protot/data/shaders/fs_depthbuffer.glsl

18 lines
320 B
Plaintext
Raw Normal View History

2018-02-15 09:59:38 +01:00
#version 330 core
in vec2 uv;
out vec3 color;
uniform sampler2D rendered_texture;
uniform float near;
uniform float far;
void main() {
float z = texture(rendered_texture, uv).r;
float c = (2.0 * near) / (far + near - z * (far - near));
c = 2.0 * near * far / (far + near - z * (far - near));
color = vec3(z);
}