As far back as I can remember I have always been fascinated by 3D graphics. And building a Ray Tracer and Renderer seems like a fantastic project to sharpen my skills with Rust.
So I have embarked to build one from the ground up and share my experience over a series of posts.
I have decided to name it
Ruxel, which is a portmanteau of Rust + pixel.
My objective is to try to update this series at least on a weekly basis, so here you can expect to find the GitHub and crates.io repositories:
- 3D graphics processing is intensive on machine resources and greatly benefits from low-level control.
- Rust is fast and its speed has been benchmarked against
Gowith outstanding results.
- Rust promises zero cost abstractions
- Rust is free of undefined behavior so no dangling pointers, data races, null dereferences or other nasty stuff at runtime.
- Rust compiler is incredibly clear and verbose.
Be able to render and ray trace the following:
- OBJ files
- With these attributes:
- Idiomatic and ergonomic code:
- Semantic typing
- Semver and features
- Adherence to Rust’s API guidelines
- Thorough documentation (
- Test driven
- Benchmarking and performance testing
- Graceful error handling
- Single threaded (multithreading for future versions)
Here are some of the best books1 on these topics that I’ve come across, and think that can help me with this personal project:
- Rendering and 3D graphics:
- Rust programming:
And here are some links with useful insights and information:
- One Hundred Thousand Lines of Rust by Aleksey Kladov (mtklad)
- Rust Design Patterns found on rust-unofficial/patterns
- Rust API Guidelines found on rust-lang/api-guidelines
Well, without further ado let’s start coding!
References and disclaimers:
Disclaimer: I am not affiliated, associated, endorsed or sponsored by any these authors or publishers. I own physical copies of these books and use them for personal education purposes. ↩
Buck, Jamis. (2019). The ray tracer challenge: A test-driven guide to your first 3D renderer. The Pragmatic Programmers. ↩
Pharr, M., Jakob, W., Humphreys, G. (2017). Physically based rendering: From theory to implementation (3rd ed.). Morgan Kaufmann ↩
Akenine-Möller, T., Haines, E., Hoffman, N., Pesce, A., Iwanicki, M., Hillaire, S. (2018). Real-time rendering (4th ed.). CRC Press, Tailor & Francis Group. ↩
Blandy, J., Orendorff, J, F.S Tindall, L. (2021). Programming Rust: Fast, safe systems development (2nd ed.). O’Reilly ↩
Gjengset, J. (2022). Rust for rustaceans: idiomatic programming for experienced developers. No Starch Press ↩