Closed GoogleCodeExporter closed 9 years ago
I've tried that fragment shader in Shader Toy
(http://www.iquilezles.org/apps/shadertoy/) and it shows up black as expected.
Any other scalar factor also gives me the expected brightness.
Can you share a full test sample?
Original comment by nicolas....@gmail.com
on 25 Sep 2012 at 1:32
@thekend: be careful that you aren't seeing the effects of your completely
transparent canvas blending with HTML content underneath it. If you are, you
should either set alpha:false in your context creation attributes, disable
alpha writes, clear the alpha channel to 1.0 after rendering, or something
similar.
Original comment by kbr@chromium.org
on 25 Sep 2012 at 5:10
Ok, so it's obvious that the problem is not with the componentwise
multiplication in GLSL.
This behaviour of transparent canvas blending with HTML content is weird, I
will make more experiences with that.
In the shader:
gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
In javascript:
gl.colorMask(true, true, true, true);
gl.clearColor(0.0, 0.0, 0.2, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
gl.disable(gl.BLEND);
drawTriangle();
The drawn triangle is white. Is it correct with disabled blending?
If alpha mask is set to false before triangle rendering, its green as expected.
Original comment by thek...@gmail.com
on 26 Sep 2012 at 8:38
The behavior is as expected. If you have WebGL questions you should ask them on
webgl-dev-list at
https://groups.google.com/forum/?fromgroups#!forum/webgl-dev-list . Closing
this bug.
Original comment by kbr@chromium.org
on 26 Sep 2012 at 5:07
Original issue reported on code.google.com by
thek...@gmail.com
on 25 Sep 2012 at 8:54