2021-01-04 23:37:44 +01:00
|
|
|
#version 440 core
|
2021-01-07 11:06:40 +01:00
|
|
|
|
2021-01-04 23:37:44 +01:00
|
|
|
in vec2 TexCoords;
|
|
|
|
in vec2 Light;
|
2021-01-08 23:53:22 +01:00
|
|
|
in float Diffuse;
|
2021-01-04 23:37:44 +01:00
|
|
|
|
|
|
|
out vec4 fragColor;
|
|
|
|
|
|
|
|
layout(binding=0) uniform sampler2D BlockAtlas;
|
|
|
|
layout(binding=1) uniform sampler2D LightMap;
|
|
|
|
|
2021-01-08 03:31:46 +01:00
|
|
|
vec4 light() {
|
|
|
|
vec2 lm = Light * 0.9375 + 0.03125;
|
|
|
|
return texture2D(LightMap, lm);
|
|
|
|
}
|
|
|
|
|
2021-01-07 11:06:40 +01:00
|
|
|
void main() {
|
2021-01-04 23:37:44 +01:00
|
|
|
vec4 tex = texture2D(BlockAtlas, TexCoords);
|
|
|
|
|
2021-01-10 01:34:22 +01:00
|
|
|
fragColor = vec4(tex.rgb * light().rgb * Diffuse, tex.a);
|
2021-01-04 23:37:44 +01:00
|
|
|
}
|