diff --git a/pack/assets/minecraft/shaders/core/rendertype_text.fsh b/pack/assets/minecraft/shaders/core/rendertype_text.fsh new file mode 100644 index 0000000..0ad137a --- /dev/null +++ b/pack/assets/minecraft/shaders/core/rendertype_text.fsh @@ -0,0 +1,40 @@ +#version 150 + +#moj_import + +uniform sampler2D Sampler0; + +uniform vec4 ColorModulator; +uniform float FogStart; +uniform float FogEnd; +uniform vec4 FogColor; + +in float vertexDistance; +in vec4 vertexColor; +in vec2 texCoord0; + +out vec4 fragColor; + +void main() { + vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator; + if (color.a < 0.1) { + discard; + } + + /** + * I hate Planet Minecraft but this is actually pretty useful + * https://www.planetminecraft.com/blog/changing-hardcoded-colours-1-18-1-17-core-shaders/ + */ + + /* XP text */ + if(color.r <= 126.50/255.0 && color.r > 126.49/255.0 && color.g == 252/255.0 && color.b <= 31.63/255.0 && color.b > 31.62/255.0){ + color = vec4(0.9569, 0.7216, 0.8588, color.a); + } + + /* XP text shadow */ + if(color.r <= 31.7/255.0 && color.r > 31.6/255.0 && color.g <= 62.3/255.0 && color.g > 62.25/255.0 && color.b <= 8.0/255.0 && color.b > 7.9/255.0){ + color = vec4(0.898, 0.5412, 0.749, color.a); + } + + fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); +}