[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Adding internalformat param to all texImage2d variants

On May 18, 2010, at 12:06 PM, Gregg Tavares wrote:

> The suggested conversions all seem to have issues which opens up another can of worms,
> ALPHA                                                   Convert to grayscale                    Use alpha, ignore RGB
> What does it mean to convert to gray scale?  Is this a gamma biased conversion? One that multiplies R G and B as appropriate for their overall contribution to luminance? Take max of R, G, B? What if my app needs it one way and yours another?

There is a pretty standard formula for converting RGB to Luminance:

	Y = 0.3*R + 0.59*G + 0.11*B

As it turns out this does have to do with their overall contribution. I don't see a reason to use any other conversion. And remember if you need some other luminance curve you can always import the image as RGB and use the shader to convert it to luminance.

> LUMINANCE                                               Convert to grayscale                    Convert RGB to grayscale, ignore alpha
> LUMINANCE_ALPHA                         Convert to grayscale, alpha=1           Convert RGB to grayscale, use alpha
> RGB                                                             Use RGB                                         Use RGB, ignore alpha
> This RGB pre-multiplied by the alpha or not? Which is appropriate for my app?

Premultiplied is a separate parameter.

> RGBA                                                    Use RGB, alpha=1                                Use RGBA


You are currently subscribe to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: