2017-10-31 19:27:10 +01:00
|
|
|
uniform sampler2D baseTexture;
|
|
|
|
uniform sampler2D normalTexture;
|
|
|
|
uniform sampler2D textureFlags;
|
|
|
|
|
|
|
|
#define leftImage baseTexture
|
|
|
|
#define rightImage normalTexture
|
|
|
|
#define maskImage textureFlags
|
|
|
|
|
2020-10-25 18:01:03 +01:00
|
|
|
varying mediump vec2 varTexCoord;
|
|
|
|
|
2017-10-31 19:27:10 +01:00
|
|
|
void main(void)
|
|
|
|
{
|
2020-10-25 18:01:03 +01:00
|
|
|
vec2 uv = varTexCoord.st;
|
2017-10-31 19:27:10 +01:00
|
|
|
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;
|
|
|
|
}
|