all-is-cubes icon indicating copy to clipboard operation
all-is-cubes copied to clipboard

Calculate light in the vertex shader

Open kpreid opened this issue 10 months ago • 0 comments

To improve the performance/quality of GPU volumetric rendering, we need to be able to efficiently obtain light samples while raymarching. Calling the current lighting function in the fragment shader is too expensive already. Instead, fetch data from the light texture in the vertex shader, precompute the validity and scaling, and pass a 3×3×3 array to the fragment shader (but is that too much data?) so it can do simple linear interpolation.

kpreid avatar Feb 24 '25 03:02 kpreid