WebGL composited incorrectly with Night Light |
||||||
Issue descriptionChrome Version: 72.0.3623.3 (Dev) OS: Chrome OS What steps will reproduce the problem? (1) Go to http://khronos.org/registry/webgl/sdk/tests/conformance/textures/misc/texture-npot-video.html (2) Turn on Night Light What happens instead? formerly "white" canvas at the top of the window (might be partly transparent) "pops" through the Night Light filter I suspect what could be happening here is that the WebGL canvas has alpha:true,premultipliedAlpha:true but the test case is outputting invalid colors (e.g. [255, 255, 255, 0]). I'm not sure about that - not sure why this particular test would be doing that. I can try to pin it down it further if needed, let me know.
,
Dec 12
,
Dec 14
,
Dec 19
I can repro the issue easily. This happens when we use CTM matrix + HW overlays. Kai is probably right about pointing out that the colors in the buffers are invalid, since they should be premultiplied, but the three channel are more than the alpha channel. Why do we produce buffers with invalid values to begin with? ccing Kristian in case he has any idea how the display controller should behave in these cases.
,
Dec 19
Here's a super-simple repro case that verifies that the issue is with premultiplied alpha:
<canvas id="canvas"></canvas>
<script>
const gl = canvas.getContext('webgl');
gl.clearColor(1, 1, 1, 0.5);
gl.clear(gl.COLOR_BUFFER_BIT);
</script>
,
Dec 19
(Use this test case in case we change the original one to not trigger this. I don't think it's supposed to.)
,
Dec 19
Adding Blink>WebGL because this can only happen with WebGL canvases.
,
Dec 19
Fundementally, WebGL apps can produce invalid color values when the "premultipliedAlpha" context creation parameter is set to true. The only practical way we could work around this would be to always do a full-canvas blit at the end of the user's rendering when premultipliedAlpha is true, in order to clamp the color values to be less than or equal to the alpha value, which would be prohibitively expensive.
,
Jan 10
I don't suspect this is worth fixing. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by kainino@chromium.org
, Dec 12