Runs with 28ms on my Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
You can see more showcase images in this file: Showcase.md
A CPU Rasterizer written in Rust between Block B and C during Y2 in BUas.
This personal project served as my introduction to the Rust programming language. I looked into all of the quality-of-life improvements this language supports over C++ like easy CI/CD, formatting, and warning handling (linting).
I wrote this project as part of a masterclass held at the university. At the end of the masterclass, there was a competition for the most impressive rasterizer. My renderer was chosen and I won a little 3D-printed Ferris The Crab, Rust's mascot.
Thanks to this and previous school projects I was selected to intern at Traverse Research for their "Summer of Code" internship program.
![image](https://private-user-images.githubusercontent.com/44022509/296608442-77f7eaf2-20ef-47d9-b29d-6740cd48eda9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0MTc0NzksIm5iZiI6MTcyMDQxNzE3OSwicGF0aCI6Ii80NDAyMjUwOS8yOTY2MDg0NDItNzdmN2VhZjItMjBlZi00N2Q5LWIyOWQtNjc0MGNkNDhlZGE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDA1MzkzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQwNzllOTFhYmU1MzAwZmEwNDNlYzFiZTBhMDc1Mzg4MDJlNmUwMmI0MGQxMTJmYTliM2E2MDVlYzhmZmVkZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.J65rXMdX1C0gQlH2UUuCTKT3ttf14AqsC1rnVx8oooY)
- Basic glTF Model Loading
- Frustum Culling
- Multithreaded Fragment Shader
- Textures
- Samplers (ClampToEdge, Repeat, Mirror)
- Clipping and Backface Culling
- Normals Rendering
- Vertex Colors
(Switch render modes with M1 and M2)
- Basic Lambertian Albedo shading
- Vertex Color
- Albedo
- Albedo + Vertex Color
- Model Vertex Normal
- Model Texture Coordinates
- Barycentric View
- Depth View
- Aabb View
- Make sure you have Rust installed.
- Clone the project:
git clone https://github.com/thepaladon/rust_erizer
- Inside the project directory run:
cargo run -r
Note: Running the project in Release (-r)
is a must since the rendering code runs on the CPU.
- W/A/S/D - move around the camera
- R / F - move up/down
- Mouse - Rotate the Camera
- Note: I've written this in a terrible way which teleports your mouse around, sorry about that 🙏
- Right Click - Next View Mode
- Left Click - Previous View Mode
- Left and Right Bracket ("[" "]") - Change Scene
- B - Load Sponza
- N - Unload Sponza
- M - unlock / lock mouse