protot/data/shaders/fs_depthbuffer.glsl

17 lines
241 B
Plaintext
Raw Normal View History

2018-02-15 09:59:38 +01:00
#version 330 core
in vec2 ioUV;
2018-02-15 09:59:38 +01:00
out vec3 outColor;
2018-02-15 09:59:38 +01:00
uniform sampler2D uTexture;
uniform float uNear;
uniform float uFar;
2018-02-15 09:59:38 +01:00
void main() {
float z = texture(uTexture, ioUV).r;
float c = (z - uNear) / (uFar - uNear);
outColor = vec3(c);
2018-02-15 09:59:38 +01:00
}