R2 Core 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 }
R2_logDepthEncodePartial
float R2_logDepthEncodePartial(const float z, const float depth_coefficient)
Definition: R2LogDepth.h:33
layout
layout(location=0) in vec3 R2_vertex_world_position
World-space position.
R2View.h
Types relating to the view.
R2SurfaceTypes.h
Types for deferred surface shading.
R2LogDepth.h
Logarithmic depth functions.
R2_view_t
Matrices and parameters related to the view that all surface shaders will receive.
Definition: R2View.h:9