R2 Shaders
R2LogDepthOnlySingle.frag
Go to the documentation of this file.
1 /// \file R2LogDepthOnlySingle.frag
2 /// \brief Single-instance logarithmic depth only fragment shader.
3 
4 #include "R2LogDepth.h"
5 #include "R2Normals.h"
6 #include "R2SurfaceTypes.h"
7 #include "R2View.h"
8 
9 in R2_vertex_data_t R2_vertex_data;
10 uniform R2_view_t R2_view;
11 
12 void
13 main (void)
14 {
15  float depth_log = R2_logDepthEncodePartial (
16  R2_vertex_data.positive_eye_z,
17  R2_view.depth_coefficient);
18 
19  gl_FragDepth = depth_log;
20 }
float R2_logDepthEncodePartial(const float z, const float depth_coefficient)
Definition: R2LogDepth.h:33
Functions for transforming normal vectors.
Types relating to the view.
Types for deferred surface shading.
float positive_eye_z
Positive eye-space Z position.
Interpolated vertex data that all deferred surface shaders will receive.
Logarithmic depth functions.
float depth_coefficient
The scene's logarithmic depth coefficient.
Definition: R2View.h:11
Matrices and parameters related to the view that all surface shaders will receive.
Definition: R2View.h:9