R2 Shaders
R2DepthBasic.h
Go to the documentation of this file.
1 #ifndef R2_DEPTH_BASIC_H
2 #define R2_DEPTH_BASIC_H
3 
4 /// \file R2DepthBasic.h
5 /// \brief Basic depth-only implementation that discards fragments based on the opacity of an albedo texture and a threshold value
6 
7 #include "R2DepthShaderMain.h"
8 
9 uniform sampler2D R2_texture_albedo;
10 uniform float R2_alpha_discard_threshold;
11 
12 bool
14  const R2_vertex_data_t data,
15  const R2_view_t view,
16  const R2_surface_matrices_instance_t matrices_instance)
17 {
18  vec4 surface = texture (R2_texture_albedo, data.uv);
19  return surface.w < R2_alpha_discard_threshold;
20 }
21 
22 #endif // R2_DEPTH_BASIC_H
vec2 uv
Object-space UV.
bool R2_depthShaderMain(const R2_vertex_data_t data, const R2_view_t view, const R2_surface_matrices_instance_t matrices_instance)
Definition: R2DepthBasic.h:13
The main function that all depth shaders must implement.
Interpolated vertex data that all deferred surface shaders will receive.
Matrices related to the rendered instance that all deferred surface shaders will receive.
Matrices and parameters related to the view that all surface shaders will receive.
Definition: R2View.h:9