vange-rs
vange-rs copied to clipboard
[meta] Voxel ray tracing plan
- [x] land the implementation - #218
- [ ] create tools to measure GPU time, to start optimization
- [ ] use Morton codes for the terrain buffer. This will improve data locality access patterns. Possibly, use a 2x2 texel tile as the basis (instead of the 2x1 that we have today). Probably need to update it in a compute shader.
- [ ] alternatively, switch the terrain buffer to an R32Uint texture (storing 2 texels)
- [x] store voxel data into a buffer as well. Use Morton codes for addressing. Pack bits into 32bit words.
- [x] optimize voxel construction. It takes too long to load a level.
- [x] address the portability issues, e.g. #222
- [ ] environment map for the sky
- [x] describe the rendering approach in the blog.
- [x] voxelized shadow rendering
Baseline on my Mac - the default camera of the Level binary on Fostral. Window size 2280x1524. 40ms for RT. Texture units are busy 98.7% of the time.
WIth #223 I'm seeing the time for RT raising to 48ms (about 20% hike). Still worth it given the reduced VRAM, and now we are mostly ALU bound, which scales better with GPUs.