Files
wc3re/shaders/object.fs

24 lines
582 B
GLSL

#version 330 core
#extension GL_ARB_explicit_uniform_location : enable
#extension GL_ARB_conservative_depth : enable
layout(location = 2) uniform sampler2D texBase;
layout(location = 3) uniform sampler2DArray texAnim;
layout(location = 4) uniform uint animFrame;
in vec2 fragTC;
flat in uint fragUseAnimTex;
layout(location = 0) out vec4 color;
layout(depth_unchanged) out float gl_FragDepth;
void main(void) {
vec4 texel = bool(fragUseAnimTex)?texture(texAnim, vec3(fragTC, animFrame)):texture(texBase, fragTC);
if (texel.a < 0.5)
discard;
color = texel;
}