minecraftjava/assets/shaders/Chunk_FS.glsl
2023-04-17 12:12:01 -04:00

22 lines
No EOL
614 B
GLSL
Executable file

#version 130
#extension GL_EXT_texture_array : enable
in vec2 pass_textureCoordinates;
in float visibility;
in float pass_layer;
in float pass_baseLightingValue;
out vec4 out_Color;
uniform sampler2DArray modelTexture;
uniform vec3 tint;
uniform vec3 skyColor;
void main(void){
vec4 textureColour = texture2DArray(modelTexture,vec3(pass_textureCoordinates, pass_layer));
if(textureColour.a<0.5) discard;
out_Color = textureColour;
out_Color.rgb += tint.xyz;
out_Color.rgb *= pass_baseLightingValue;
out_Color = mix(vec4(skyColor.x,skyColor.y,skyColor.z,1.0),out_Color, visibility);
}