minetest/client/shaders/3d_interlaced_merge/opengl_fragment.glsl
Vitaliy 707c8c1e95
Shaders for Android (GLES 2) (#10506)
Shader support for OpenGL ES 2 devices (Android)

Co-authored-by: sfan5 <sfan5@live.de>
2020-10-25 18:01:03 +01:00

24 lines
502 B
GLSL

uniform sampler2D baseTexture;
uniform sampler2D normalTexture;
uniform sampler2D textureFlags;
#define leftImage baseTexture
#define rightImage normalTexture
#define maskImage textureFlags
varying mediump vec2 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;
}