1
0
Fork 0
mirror of https://github.com/dragonfireclient/dragonfireclient.git synced 2024-11-23 11:14:01 -05:00
dragonfireclient/client/shaders/3d_interlaced_merge/opengl_fragment.glsl
Muhammad Rifqi Priyo Susanto 1abb83b1ab
Use vec4 for varTexCoord in interlaced shader (#11004)
Somewhen in the past, inTexCoord0 was a vec2. Now, it is a vec4.
2021-03-01 13:37:32 +01:00

23 lines
502 B
GLSL

uniform sampler2D baseTexture;
uniform sampler2D normalTexture;
uniform sampler2D textureFlags;
#define leftImage baseTexture
#define rightImage normalTexture
#define maskImage textureFlags
varying mediump vec4 varTexCoord;
void main(void)
{
vec2 uv = varTexCoord.st;
vec4 left = texture2D(leftImage, uv).rgba;
vec4 right = texture2D(rightImage, uv).rgba;
vec4 mask = texture2D(maskImage, uv).rgba;
vec4 color;
if (mask.r > 0.5)
color = right;
else
color = left;
gl_FragColor = color;
}