R2 Shaders
R2DebugColorVertices.frag
Go to the documentation of this file.
1 /// \file R2DebugColorVertices.frag
2 /// \brief Write the given color to the first fragment output.
3 
4 #include "R2LogDepth.h"
5 #include "R2SurfaceTypes.h"
6 #include "R2View.h"
7 
8 layout(location = 0) out vec4 R2_out;
9 
10 in vec4 R2_frag_color;
11 in float R2_positive_eye_z;
12 uniform R2_view_t R2_view;
13 
14 void
15 main (void)
16 {
17  float depth_log = R2_logDepthEncodePartial(
18  R2_positive_eye_z,
19  R2_view.depth_coefficient);
20 
21  R2_out = R2_frag_color;
22  gl_FragDepth = depth_log;
23 }
float R2_logDepthEncodePartial(const float z, const float depth_coefficient)
Definition: R2LogDepth.h:33
Types relating to the view.
Types for deferred surface shading.
Logarithmic depth functions.
layout(location=0) out vec4 R2_out
RGBA color.
Matrices and parameters related to the view that all surface shaders will receive.
Definition: R2View.h:9