This project is my attempt to learn rendering technique by crafting a 3d rasterizer from scratch.
The program is an interactive GUI application capable of rendering model files exported in Wavefront format (.obj
). You can explore the various rasterizer options by interacting with the GUI.
The rasterizer runs purely on CPU, and no parallelism is added so far. Although I’ve employed various techniques to improve performance, the rendering is still too slow for any practical purpose.
You may also be interested in my other computer graphics project - a ray-tracer written from scratch: ray.
Please note that not all features can be explored via the GUI.
- Lamp (color and position)
- Multiple lamp support
- Mesh
- Single/double-faced
- World transformation
- Optionally cast shadow
- Shader
- Preset shaders:
PureColor
,DiffuseShader
,SpecularShader
,SimpleMaterial
- Custom shader via
trait Shader
- Preset shaders:
- Basic shadow support
- Texture
- Bi-linear filter
- Nearest-pixel filter
- Rasterizer
- Rasterization and shading pass separation
- Multiple render modes
- Shaded (normal)
- Wireframe
- Clipped triangles visualization
- Shadow volume visualization
- Wavefront model (
.obj
) loading- Material support (
.mtl
) - Color texture support
- Bump map support
- Multi object/multi material in a single
obj
file
- Material support (
See the screenshot.
Camera controls:
- Rotation: dragging (left mouse button)
- Pan: dragging (middle mouse button)
- Zoom: scroll wheel
- transparency support
- build executable binaries from CI
- write a doc on guided exploration of various graphics glitches
- Clone this repository
- Run
cargo run --release
The UI is based on egui_glium. Make sure you have all its dependencies installed.
Since I didn’t intentionally collect articles helpful to me until some point, please be aware that the list here is incomplete.
- Computer Graphics from Scratch by Gabriel Gambetta
- Shadow volume - Wikipedia
- 8.3 - Perspective Projections — LearnWebGL
- Graphics Compendium | Graphics Pipeline Review
GPL-2.0