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

35 lines
805 B
Text
Raw Normal View History

2024-08-25 12:42:26 +00:00
#version 150
#define FRAGMENT_SHADER
#define POSITION_TEX
2024-10-22 10:50:40 +00:00
#define POSITION_TEX_COLOR
2024-08-25 12:42:26 +00:00
#moj_import <util.glsl>
#moj_import <texture.glsl>
2024-08-25 12:43:53 +00:00
#moj_import <version.glsl>
2024-08-25 12:42:26 +00:00
uniform sampler2D Sampler0;
uniform vec4 ColorModulator;
in vec2 texCoord0;
2024-10-22 10:50:40 +00:00
in vec4 vertexColor;
2024-08-25 12:42:26 +00:00
out vec4 fragColor;
void main() {
transform.textureUV = texCoord0;
transform.colorMod = ColorModulator;
2024-10-22 10:50:40 +00:00
#if defined(MC_1_21_2)
transform.color = texture(Sampler0, texCoord0) * vertexColor;
#else
transform.color = texture(Sampler0, texCoord0);
#endif
2024-08-25 12:42:26 +00:00
2024-08-25 12:45:24 +00:00
removePixel(Sampler0, ivec2(0, 0), ivec4(255, 0, 0, 255));
removePixel(Sampler0, ivec2(0, 1), ivec4(255, 0, 0, 255));
2024-08-25 12:42:26 +00:00
2024-08-25 12:45:24 +00:00
if(transform.color.a == 0.0 || transform.color.a == 1.0 / 255.0)
2024-08-25 12:42:26 +00:00
discard;
fragColor = transform.color * transform.colorMod;
}