Create/src/main/resources/assets/create/shader/contraption.frag
JozsefA a56d08b78e a bunch of refactoring to make things easier later
it's not any more stable but belts render on contraptions
rotating things almost do
actually fix a bunch of memory leaks
2021-01-11 00:29:02 -08:00

23 lines
504 B
GLSL

#version 440 core
in vec2 TexCoords;
in vec4 Color;
in float Diffuse;
in vec3 BoxCoord;
out vec4 fragColor;
layout(binding=0) uniform sampler2D BlockAtlas;
layout(binding=1) uniform sampler2D LightMap;
layout(binding=4) uniform sampler3D LightVolume;
vec4 light() {
vec2 lm = texture(LightVolume, BoxCoord).rg * 0.9375 + 0.03125;
return texture2D(LightMap, lm);
}
void main() {
vec4 tex = texture2D(BlockAtlas, TexCoords);
fragColor = vec4(tex.rgb * light().rgb * Diffuse, tex.a);
}