fast-nuclear-sim/assets/shader/light.fsh

14 lines
164 B
GLSL

#version 460 core
in vec3 frag_pos;
uniform float far_plane;
void main()
{
float distance = length(frag_pos);
gl_FragDepth = distance / far_plane + 1e-4f;
}