R2 Core Shaders
R2DepthBasicStippled.h
Go to the documentation of this file.
1 #ifndef R2_DEPTH_BASIC_STIPPLED_H
2 #define R2_DEPTH_BASIC_STIPPLED_H
3 
4 /// \file R2DepthBasicStippled.h
5 /// \brief Basic depth-only implementation that discards fragments based on the opacity of an albedo texture, a threshold value, and stippling
6 
7 #include "R2DepthShaderMain.h"
8 #include "R2Viewport.h"
9 #include "R2Stipple.h"
10 
11 uniform sampler2D R2_texture_albedo;
12 uniform float R2_alpha_discard_threshold;
13 
14 uniform R2_stipple_t R2_stipple;
15 uniform R2_viewport_t R2_viewport;
16 
17 bool
19  const R2_vertex_data_t data,
20  const R2_view_t view,
21  const R2_surface_matrices_instance_t matrices_instance)
22 {
23  vec4 surface = texture (R2_texture_albedo, data.uv);
24 
25  return R2_stippleRun(R2_stipple, R2_viewport, gl_FragCoord.xy)
26  || surface.w < R2_alpha_discard_threshold;
27 }
28 
29 #endif // R2_DEPTH_BASIC_STIPPLED_H
vec2 uv
Object-space UV.
Stippling types and functions.
Viewport types and functions.
The type of viewports.
Definition: R2Viewport.h:9
The main function that all depth shaders must implement.
bool R2_depthShaderMain(const R2_vertex_data_t data, const R2_view_t view, const R2_surface_matrices_instance_t matrices_instance)
Interpolated vertex data that all deferred surface shaders will receive.
The type of stippling parameters.
Definition: R2Stipple.h:11
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