The biggest culprit for divergence seems to be the
triangle packing
. If I come back to this, that’s the first thing I’ll try and tackle
Some of the thread divergence can also be clamped down with atomic adds and doing extra work to sync warp cores manually
The SAH splitting logic has a fallback to good old median splits if a degenerate split is detected, which is common for highly aligned AABB’s, maybe I ought to change that?
As usual with other GI stuff, the hardest part for me always ends up being the BRDF math
Material BRDF lobe evaluation is currently a random dice roll. 50% that it picks either specular or diffuse. Need to look into and learn a fresnel based method or maybe something better? Some code of this is already present