WARNING: Fuwa is still a work in progress and is not ready for public use.
A software renderer written in Rust.
https://cdn.discordapp.com/attachments/118770341630705664/759036452272209920/loaded_gltf.gif
Goals:
- Full featured graphics rendering library matching functionality of something like OpenGL or Direct X, or WebGPU.
- Performance suitable for real-time usage (at least as good as software rendering can be).
- A wealth of examples and documentation to provide a solid foundation in computer graphics.
A note on safety: Fuwa uses unsafe Rust. In fact, due to the severe performance requirements of Fuwa as a renderer, it may not be possible to achieve the high performance required for real-time rendering without it. However, special attention will be given to ensure that any exposed functionality will be completely safe, and users of the crate will not need to understand the ins and outs of safe vs unsafe Rust in order to use it.
Possiblities:
- Integration as a rendering back-end for other crates like wgpu or gfx-hal.
- A software fallback for WebGPU for desktop and web platforms which don't support it.
- Support for standard shaders like GLSL or SPIR-V.
Resources:
https://github.com/ssloy/tinyrenderer/wiki
https://www.youtube.com/watch?v=uehGqieEbus&list=PLqCJpWy5Fohe8ucwhksiv9hTF5sfid8lA
https://www.gabrielgambetta.com/computer-graphics-from-scratch/introduction.html
https://fgiesen.wordpress.com/2013/02/17/optimizing-sw-occlusion-culling-index/
http://acta.uni-obuda.hu/Mileff_Nehez_Dudra_63.pdf https://www.digipen.edu/sites/default/files/public/docs/theses/salem-haykal-digipen-master-of-science-in-computer-science-thesis-an-optimized-triangle-rasterizer.pdf
TODO:
- Add geometric clipping algorithm for triangles.
- Better parallelize tasks by splitting them into bigger chunks (triangles etc)
- Fix potential crashes when moving too close to objects (draw out of bounds)
- Store/Upload data into a "device" (like WGPU) inside of Fuwa class?
- Add model loader
- Defer triangle triangulation until render stage
- Geometry Shader
- Fill out "FuwaStats" struct for data logging/analysis
- Add "Descriptors" like Vertex Descriptor, command queues, etc
- Investigate pros/cons of fixed point
- Continue SIMDifying Rasterizer
- Look into better memory allocators like (bumpalo, toolshed, typed_arena)
- Add special logic/early outs for special shaped triangle BBs
- Try (smallvec, tinyvec, arrayvec) in raster function -- smallvec gave a performance loss??
SCENES TO MAKE:
- Cube Textured
- Cube Color Blend
- Complex Scene
- Depth Tester
BENCHMARKS TO MAKE:
- Complex Scene
- Many Small Triangles
- Many Big triangles
- Depth buffer strain