R2 Core Shaders

R2FilterOcclusionApplicator.frag
Go to the documentation of this file.
1 /// \file R2FilterOcclusionApplicator.frag
2 /// \brief Occlusion application filter
3
4 in vec2 R2_uv;
5
6 uniform sampler2D R2_texture;
7 uniform float R2_intensity;
8
9 layout (location = 0) out vec4 R2_out_diffuse;
10
11 void
12 main (void)
13 {
14 vec3 occlusion_sample =
15 texture (R2_texture, R2_uv).xxx;
16 vec3 occlusion =
17 (1.0 - occlusion_sample) * R2_intensity;
18 R2_out_diffuse =
19 vec4 (occlusion, 1.0);
20 }
layout
layout(location=0) in vec3 R2_vertex_world_position
World-space position.