R2 Core 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 }
R2_logDepthEncodePartial
float R2_logDepthEncodePartial(const float z, const float depth_coefficient)
Definition: R2LogDepth.h:33
R2Normals.h
Functions for transforming normal vectors.
R2View.h
Types relating to the view.
R2SurfaceTypes.h
Types for deferred surface shading.
R2_vertex_data_t::positive_eye_z
float positive_eye_z
Positive eye-space Z position.
Definition: R2SurfaceTypes.h:17
R2_vertex_data_t
Interpolated vertex data that all deferred surface shaders will receive.
Definition: R2SurfaceTypes.h:11
R2LogDepth.h
Logarithmic depth functions.
R2_view_t::depth_coefficient
float depth_coefficient
The scene&#39;s logarithmic depth coefficient.
Definition: R2View.h:11
R2_view_t
Matrices and parameters related to the view that all surface shaders will receive.
Definition: R2View.h:9