We render linear distance to the light in a R32 texture and store it into an octahedron projection inside a 2D texture array. This render the sampling function much more simpler and without edge artifacts.
9 lines
114 B
GLSL
9 lines
114 B
GLSL
|
|
in float linearDistance;
|
|
|
|
out vec4 FragColor;
|
|
|
|
void main() {
|
|
FragColor = vec4(linearDistance, 0.0, 0.0, 1.0);
|
|
}
|