summaryrefslogtreecommitdiff
path: root/advanced_lighting/8.deferred_shading/shaders/gbuffer.frag
blob: 5f82c0b2d91e58d693119faf2b15b10cb0059de8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#version 330 core

in vert_t {
    vec3 position;
    vec3 normal;
    vec2 tex_coords;
} vert;

layout (location = 0) out vec3 position;
layout (location = 1) out vec3 normal;
layout (location = 2) out vec4 color_specular;

uniform sampler2D texture_diffuse;

void main()
{
    position = vert.position;
    normal = vert.normal;
    color_specular.rgb = texture(texture_diffuse, vert.tex_coords).rgb;
    // TODO(pryazha): add specular texture
    // color_specular.a = texture(texture_specular, vert.tex_coords).r;
    color_specular.a = 1;
}