Files
qglengine/shaders/ds_final.glsl
2020-08-25 21:57:31 +03:00

23 lines
495 B
GLSL

// vert //
void main(void) {
gl_Position = qgl_ftransform();
}
// frag //
uniform sampler2D tex_g1, tex_s_0, tex_s_1, tex_t_0, tex_t_1;
void main(void) {
ivec2 tc = ivec2(gl_FragCoord.xy);
vec4 vs0 = texelFetch(tex_s_0, tc, 0);
vec4 vs1 = texelFetch(tex_s_1, tc, 0);
vec3 sr = vs0.rgb + vs1.rgb;
vec4 vt0 = texelFetch(tex_t_0, tc, 0);
vec4 vt1 = texelFetch(tex_t_1, tc, 0);
vec3 tr = vt0.rgb + vt1.rgb;
float alpha = (vt0.a + vt1.a) / 2;
qgl_FragColor.rgb = mix(sr, tr, alpha);
}