summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/basicShader.fs
blob: 24b2791d1535ab7c6f65ad5a86730225e608bf4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#version 330 core

in vec3 FragPos;
in vec2 TexCoords;
in vec3 Normal;
in vec4 Colour;

out vec4 gPosition;
out vec4 gNormal;
out vec4 gAlbedoSpec;

uniform sampler2D texture0;

void
main()
{
	vec4 textureColour = texture(texture0, TexCoords);
	float clear = round(mix(textureColour.a, 1, Colour.a));
	gPosition = vec4(FragPos, clear);
	gNormal = vec4(Normal, clear);
	gAlbedoSpec = mix(textureColour, vec4(Colour.rgb, 1), Colour.a);
}