the Twarchive

This is a record of a twitter thread, originally posted in 2020

Thew
@AmazingThew

heey this is getting somewhere

Thew
@AmazingThew

Converted the raymarcher over to a URP Custom Pass so it works in the scene view, and finally figured out how to bind/sample the spherical harmonics that unity generates for ambient lighting, so it actually responds to the lighting environment similarly to opaque surfaces

Thew
@AmazingThew

Only doing attenuation rn, so no in-scattering or other multipath effects. Also only sampling the SH at the initial intersection, rather than every step, so ambient light is a bit harsh/shiny

Cool to see brighter light reaching further inside due to exponential attenuation tho

Thew
@AmazingThew

step-count heatmaps are always cool looking

the core idea I'm playing with here is a 2-channel field that stores both density and distance to the bounding surface. Can sphere-trace empty space to move fast, then switch to fixed-step density accumulation inside the bounds