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

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



On Thu, May 20, 2010 at 01:51, Chris Marrin <cmarrin@apple.com> wrote:
> I don't think specifying an RGB to Luminance conversion complicates the spec significantly.

Ok, indeed in proposed section it would just change one case in the chart.

> If the implementation happens to know that the image is greyscale, then it is free to use one of the color channels, as long as the result is the same.

This is an information that sounds impractical and expensive to get, I
can see it possible only by checking that the 3 components are equal
for every pixel of the image, or there is some other way I overlook?

> Arbitrarily choosing one of the color channels for a grayscale image seems like the wrong way to spec conversion functionality.

This is not arbitrary if you consider that the conversion table fully
mirrors the behavior of samplers in ES / GL.
Imho what is arbitrary is to define how grayscaling should be done, as
Gregg put it earlier :
"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?"

I would think that WebGL doing such conversion from an RGB that is not
already greyscale would be a little bit too implicit imo.

I argue that if the developer asks for the image to be stored in
LUMINANCE format it is his responsibility to ensure the image is
prepared for such usage (e.g normal|bump maps), if he wants instead to
present a greyscaled image on the screen this can be done easily and
dynamically in shaders with the RGB to greyscale formula of his
choosing.


Regards,
-----------------------------------------------------------
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: