summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/shaders/frag/face.fs
blob: 0eb5a213982a141cc1c6d6b3231a3c2a2a43ee46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#version 330 core

in VS_OUT {
    vec3 Texture;
    vec3 Color;
} fs_in;

layout (location = 0) out vec4 color;
layout (location = 1) out vec4 normal;

uniform sampler2DArray textureAtlas;

void main() {
    vec4 col = texture(textureAtlas, fs_in.Texture);
    if (col.a < 0.3)
        discard;

    color = vec4(col.rgb * fs_in.Color, 1.0f);
    normal = vec4(1.0f - color.r, 1.0f - color.b, 1.0f, 1.0f);
}