[Public WebGL] Compositing with HTML

Vangelis Kokkevis [email protected]
Fri Jan 8 17:49:24 PST 2010

On Fri, Jan 8, 2010 at 5:36 PM, Chris Marrin <[email protected]> wrote:

> 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.

I'm confused.  Clamping to 1 doesn't guarantee that it's a legal
premultiplied color, does it?  Or are you saying that the 2d canvas, svg and
css take non-premultiplied colors as input, clamp all the channels to 1 and
convert them to pre-mulitplied behind the scenes?

> 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.
> -----
> ~Chris
> [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:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20100108/5318c6be/attachment.html>

More information about the public_webgl mailing list