R2 Core Shaders

R2FilterEmission.frag
Go to the documentation of this file.
1 /// \file R2FilterEmission.frag
2 /// \brief Emission filter
3
4 in vec2 R2_uv;
5
6 uniform sampler2D R2_albedo_emission;
7 uniform sampler2D R2_glow;
8 uniform float R2_emission_intensity;
9 uniform float R2_glow_intensity;
10
11 out vec4 R2_out_rgba;
12
13 void
14 main (void)
15 {
16 vec4 map_sample =
17 texture (R2_albedo_emission, R2_uv);
18 vec3 glow_sample =
19 texture (R2_glow, R2_uv).xyz;
20
21 vec3 albedo =
22 map_sample.xyz * map_sample.w * R2_emission_intensity;
23 vec3 glow =
24 glow_sample.xyz * R2_glow_intensity;
25
26 R2_out_rgba =
27 vec4 (albedo + glow, 1.0);
28 }