Files
wc3re/shaders/object.fs

22 lines
578 B
GLSL

#version 330 core
#extension GL_ARB_explicit_uniform_location : enable
layout(location = 1) uniform sampler2D texBase;
layout(location = 2) uniform sampler2DArray texAnim;
layout(location = 3) uniform uint animFrame;
in vec2 fragTC;
flat in uint fragUseAnimTex;
out vec4 color;
void main(void) {
vec2 texDx = dFdx(fragTC);
vec2 texDy = dFdy(fragTC);
if (fragUseAnimTex > 0u)
color = textureGrad(texAnim, vec3(fragTC, animFrame), texDx, texDy);
//color = vec4(1.0, 1.0, 0.0, 1.0);
else
color = textureGrad(texBase, fragTC, texDx, texDy);
}