all-is-cubes
all-is-cubes copied to clipboard
Calculate light in the vertex shader
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.