[Public WebGL] Compositing with HTML

Chris Marrin [email protected]
Fri Jan 8 17:36:40 PST 2010

On Jan 8, 2010, at 5:20 PM, Kenneth Waters wrote:

>> What I mean by that is that color always clamps to 1.0, so if you give oversaturated colors (1.0 when alpha is 0.5, for instance), and blending results in a color greater than 1.0, the result is clamped to 1.0. I believe that is what the HTML compositor specifies and that's what WebKit does when compositing. I think Firefox is doing something different. But I'll wait for Vlad to chime in...
> Just for clarification how can you get out of range pre-multiplied
> values into HTML without WebGL?

That's a good question. The 2D Canvas API can do it using the compositing operators. There they talk about clamping to 1. SVG has similar capabilities. CSS Colors are given in non-premultiplied form and are clamped to 0-1 (or 0-255 if given in that form). So you could say that all the source elements are constrained to have legal premultiplied colors. That's not the case (currently) in WebGL, so maybe we should take measures to ensure that oversaturated values can't make it into the WebGL color buffer? 

That might be hard and non-performant. So it might be better if we just define what happens in the HTML compositor when oversaturated values are presented. This is probably more properly in the Canvas spec though.

[email protected]

You are currently subscribe to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:

More information about the public_webgl mailing list