I wrote this code:
" vec3 col1 = texture2D(uDiffuseTexture, vec2(vTextureCoord.x, vTextureCoord.y + time)).rgb;\n" +
" float a1=1.0;\n"+
" vec3 col2 = texture2D(uNormalTexture, vec2(vTextureCoord.x + time, vTextureCoord.y)).rgb;\n" +
" float a2=uAlpha;\n"+
by the way:
with: gl_FragColor = vec4(col1+col2, a1+a2);
alpha not working…why? always the same, why?
my uAlpha variable is an uniform, that changes from 0.1 to 1.0
Currently, you’re mixing your two images with additive blending (col1+col2) without considering the
uAlphauniform to mix the two images.I suppose that what you’re trying to achieve is blend image2 over image1, using uAlpha as opacity.