KlassischeKeplerKriege/data/shader/multitexture.frag

21 lines
414 B
GLSL
Raw Normal View History

2016-10-05 21:26:55 +00:00
#version 120
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec3 vertex;
varying vec2 uv;
void main()
{
vec3 color = texture2D(tex0, uv).rgb;
vec3 current = texture2D(tex1, uv).rgb;
float a = length(color) - length(current);
if (a > 0.3) {
color = mix(vec3(a/3.0), current, color);
} else {
color = current;
}
gl_FragColor = vec4(texture2D(tex0, uv).xyz + texture2D(tex1, uv).xyz, 1.0);
}