OpenGL ES 2.0 iOS zero alpha pixel creating opaque color -
i clear framebuffer...
glclearcolor(0.0, 0.0, 0.0, 0.0); glclear(gl_color_buffer_bit); ...i enable blending such...
glenable(gl_blend); glblendfunc(gl_one, gl_one_minus_src_alpha); [self render] gldisable(gl_blend); in render code, add quad , draw it. in fragment shader have...
gl_fragcolor = vec4(0.0, 0.0, 0.0, 0.0); this yields clear quad. great. no color, no alpha, no nothing...got it. however, change fragment shader to...
gl_fragcolor = vec4(1.0, 0.0, 0.0, 0.0); i quad filled white. can explain me how filling quad transparent red yield opaque white, , not clear?
doesn't gl_one_minus_src_alpha do
(1, 1, 1, 1) - (as/ka, as/ka, as/ka, as/ka) so if 0 result in (1, 1, 1, 1)?
ed though i'm not clear why has different effect when set fragment (1, 0, 0, 0) (0, 0, 0, 0). notice used
glblendfunc(gl_src_alpha, gl_one_minus_src_alpha) what different arguments blend function?
Comments
Post a Comment