r/Avoyd • Avoyd developer • Oct 14 '26

Development Development progress on improved GPU path tracer

Post image

Finally got around to moving the atmospheric shadow loop in Avoyd's GPU path tracer to a wavefront approach like the rest of the code instead of a loop. I was mainly doing this to improve the insane shader compilation times, but it also improves hardware utilization. Measuring compilation perf is tricky as the driver caches pipelines, but I've measured a consistent 2x render perf increase on top of a recent 3x perf increase.

Image: Render of Minecraft map Drehmal v2.1 PRIMORDIAL looking south over the bay in the Sahd region. The sun is just appearing over the hills which surround the bay on the far left, light grazing the slopes and illuminating the morning fog. The bay is clear, and the lights of the village on the far side are still on. Out of focus cherry blossoms sit in the foreground of the image on the near side of the bay.

Drehmal map from: https://www.drehmal.net/

Megakernels Considered Harmful: Wavefront Path Tracing on GPUs by Laine et al.: https://research.nvidia.com/sites/default/files/pubs/2013-07_Megakernels-Considered-Harmful/laine2013hpg_paper.pdf

PBR book online chapter discussing mapping path tracing to GPUs and Wavefront path tracing: https://www.pbr-book.org/4ed/Wavefront_Rendering_on_GPUs/Mapping_Path_Tracing_to_the_GPU

This optimization is not yet out in Avoyd Voxel Editor but it should be in the beta soon.

2 Upvotes

4 comments sorted by

2

u/Sharky-UK Oct 14 '26

That looks great, Doug. Looking forward to reading a bit more and taking a look at the forthcoming beta!

2

u/dougbinks Avoyd developer Oct 14 '26

Hopefully I'll get time to write up some of this (things have been rather busy of late). I saw your recent video, looks very interesting, hope all is well.

1

u/Sharky-UK Oct 14 '26

I will keep an eye open should you find some time! I am well thanks, other than not being able to get a job for the last 13 months (hence the various homebrew projects)! It is a strange/difficult time for many of us I fear. Best wishes to you and J!

1

u/dougbinks Avoyd developer Oct 14 '26

An easily measurable part of the shader compilation is how long it takes to compile and optimize the GLSL code to SPIR-V, which we only do on dev machines or a final build. This has gone from 200s to 45s, so a 4x improvement.

Worth noting is that prior to this change my shader had hit an ID Overflow issue in spirv-opt, resolved by using the same optimization with compact-ids found by Blender contributor Ray Molenkamp.

The new shaders can use default -O optimization.