R2 Core Shaders
R2DebugVisualConstant.frag
Go to the documentation of this file.
1 /// \file R2DebugVisualConstant.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 R2_vertex_data_t R2_vertex_data;
11 uniform vec4 R2_color;
12 uniform R2_view_t R2_view;
13 
14 void
15 main (void)
16 {
17  float depth_log = R2_logDepthEncodePartial(
18  R2_vertex_data.positive_eye_z,
19  R2_view.depth_coefficient);
20 
21  R2_out = R2_color;
22  gl_FragDepth = depth_log;
23 }
float R2_logDepthEncodePartial(const float z, const float depth_coefficient)
Definition: R2LogDepth.h:33
layout(location=0) in vec3 R2_vertex_world_position
World-space position.
Types relating to the view.
Types for deferred surface shading.
Interpolated vertex data that all deferred surface shaders will receive.
Logarithmic depth functions.
Matrices and parameters related to the view that all surface shaders will receive.
Definition: R2View.h:9