Saxum/Shader/depth.fsh
2015-02-04 22:54:40 +01:00

12 lines
153 B
GLSL

#version 150
in vec4 fragPosition;
uniform float farPlane;
out float gl_FragDepth;
void main() {
gl_FragDepth = length(fragPosition)/farPlane;
}