feat(rendering): add fog-distance darkness to chunk shaders
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
#version 330 core
|
||||
in vec2 vUv;
|
||||
in float vShade;
|
||||
in float vWorldY;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform sampler2D atlas;
|
||||
uniform float u_caveDarkStartY;
|
||||
uniform float u_caveDarkEndY;
|
||||
uniform float u_caveMinBrightness;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 texel = texture(atlas, vUv);
|
||||
FragColor = vec4(texel.rgb * vShade, 1.0);
|
||||
float t = clamp((u_caveDarkStartY - vWorldY) /
|
||||
(u_caveDarkStartY - u_caveDarkEndY), 0.0, 1.0);
|
||||
float brightness = mix(1.0, u_caveMinBrightness, t);
|
||||
FragColor = vec4(texel.rgb * vShade * brightness, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user