R2 Core Shaders
R2Mask.frag
Go to the documentation of this file.
1 /// \file R2Mask.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 float R2_positive_eye_z;
11 
12 uniform vec4 R2_frag_color;
13 uniform R2_view_t R2_view;
14 
15 void
16 main (void)
17 {
18  float depth_log = R2_logDepthEncodePartial(
19  R2_positive_eye_z,
20  R2_view.depth_coefficient);
21 
22  R2_out = R2_frag_color;
23  gl_FragDepth = depth_log;
24 }
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.
Logarithmic depth functions.
Matrices and parameters related to the view that all surface shaders will receive.
Definition: R2View.h:9