wynnpack-archive/assets/minecraft/shaders/core/render/text.fsh

49 lines
No EOL
1.1 KiB
GLSL

#version 150
#define FRAGMENT_SHADER
#define RENDERTYPE_TEXT
#define RENDERTYPE_TEXT_SEE_THROUGH
#moj_import <fog.glsl>
#moj_import <text.glsl>
#moj_import <version.glsl>
uniform sampler2D Sampler0;
uniform vec4 ColorModulator;
uniform float FogStart;
uniform float FogEnd;
uniform vec4 FogColor;
in float vertexDistance;
in vec4 vertexColor;
in vec2 texCoord0;
in float depth;
in float shadow;
out vec4 fragColor;
void main() {
transform.vertexColor = vertexColor;
transform.colorMod = ColorModulator;
transform.texColor = texture(Sampler0, texCoord0);
transform.color = transform.texColor * vertexColor * ColorModulator;
transform.textDepth = depth;
transform.isShadow = shadow > 0.5;
disableShadow(2200);
#if defined(MC_1_21_2)
disableShadow(1200);
disableShadow(-1000);
#if defined(RENDER_WORLD)
fragColor = transform.color * ColorModulator;
#elif defined(RENDER_SCREEN)
fragColor = linear_fog(transform.color, vertexDistance, FogStart, FogEnd, FogColor);
#endif
#else
fragColor = linear_fog(transform.color, vertexDistance, FogStart, FogEnd, FogColor);
#endif
}