R2 Core Shaders

R2FilterLightApplicator.frag
Go to the documentation of this file.
1 /// \file R2FilterLightApplicator.frag
2 /// \brief Light application filter
3
4 in vec2 R2_uv;
5
6 uniform sampler2D R2_textures_albedo;
7 uniform sampler2D R2_textures_diffuse;
8 uniform sampler2D R2_textures_specular;
9
10 out vec4 R2_out_rgba;
11
12 void
13 main (void)
14 {
15 vec3 albedo_sample =
16 texture (R2_textures_albedo, R2_uv).xyz;
17 vec3 diffuse_sample =
18 texture (R2_textures_diffuse, R2_uv).xyz;
19 vec3 specular_sample =
20 texture (R2_textures_specular, R2_uv).xyz;
21
22 R2_out_rgba =
23 vec4 ((albedo_sample * diffuse_sample) + specular_sample, 1.0);
24 }