R2 Core Shaders

R2DebugLogDepth.frag
Go to the documentation of this file.
1 /// \file R2DebugLogDepth.frag
2 /// \brief Writes the logarithmic depth of the fragment to the first fragment output.
3
4 #include "R2LogDepth.h"
5
6 uniform vec4 data;
7
8 layout(location = 0) out vec4 R2_out;
9
10 void
11 main (void)
12 {
13 float e = R2_logDepthEncodeFull (data.x, data.y);
14 float d = R2_logDepthDecode (e, data.y);
15 R2_out = vec4 (d, 0.0, 0.0, 0.0);
16 }
R2_logDepthEncodeFull
float R2_logDepthEncodeFull(const float z, const float depth_coefficient)
Definition: R2LogDepth.h:51
layout
layout(location=0) in vec3 R2_vertex_world_position
World-space position.
R2_logDepthDecode
float R2_logDepthDecode(const float z, const float depth_coefficient)
Definition: R2LogDepth.h:72
R2LogDepth.h
Logarithmic depth functions.