This repo is just an experimental project that I have been doing, in order to learn Rust.
- 5 samples per pixel
- 6320 triangles
In main.rs
instantiate camera and a scene (in this order) and add to-be rendered objects to scene.objects
array. Then run cargo run --release
.
NOTE: As teapot model has thousands of triangles to render, the process might take a lot of time. You can simply remove this 3D model by commenting out the lines where it is added to scene.
//scene.objects.push(Box::new(obj));
TODO: The wasm integration will make usage easier.
The following program has support of:
- Diffuse and specular materials
- Lights (3 types)
- Reflections
- Shadows
- Camera and viewport control (FOV, orientation)
- Antialising (by multisampling)
- Simple .obj file reading
- AABB optimization
- Multithreading
- Builder pattern for constructing objects
- Integration with WebAssembly
- Interaction with objects
- Gamma correction
- Refraction
- Textures
It was in turn inspired by several projects listed below: