git-svn-id: svn://db.shs.com.ru/libs@671 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-12-10 18:01:17 +00:00
parent ff4f9a3b2b
commit 16146ae6fd
4 changed files with 20 additions and 14 deletions

View File

@@ -7,12 +7,16 @@ void main(void) {
// frag //
uniform sampler2D tex_0, tex_1, tex_2, tex_3, tex_4;
uniform sampler2D tex_s_0, tex_s_1, tex_t_0, tex_t_1;
void main(void) {
ivec2 tc = ivec2(gl_FragCoord.xy);
vec4 v0 = texelFetch(tex_0, tc, 0);
vec4 v1 = texelFetch(tex_1, tc, 0);
vec3 res = v0.rgb + v1.rgb;
qgl_FragColor.rgb = res;
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);
}