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

Re: [Public WebGL] Retrieving number of texture channels

On Feb 22, 2010, at 1:45 PM, Kenneth Russell wrote:

> ...As far as I can tell from looking at the DOM Level 1 and HTML 5 specs,
> as well as the Canvas spec, the answer is no, it isn't possible to
> query an HTML image for this level of information.
> Given the ambiguity between luminance and alpha textures, and the
> utility of both, I am dubious that X3D try to auto-detect what kind of
> texture environment mode should be used based simply on the number of
> channels in the texture. It seems to me that the scene graph should
> provide control over this parameter.
> It may be technically feasible for WebGL to return the internal format
> for textures loaded from HTMLImageElements, and to choose the best one
> for the incoming image, but it will be quite a bit of work. WebKit's
> internal image decoder class does not currently provide the number of
> channels in the original image; it always decodes to RGBA format, so
> recovering the information that the incoming PNG was for example
> grayscale + alpha will take a fair amount of plumbing. If you would
> like to see this information exposed then please file an RFE against
> WebGL on http://www.khronos.org/bugzilla/ so we can track it in the
> spec and all implementations.

I don't think there is a need to tell the author what kind of image they have loaded. They should know that a priori. What we do need is for the author to know what kind of image has been loaded on all implementations. We can't have a one channel image get loaded as LUMINANCE on one platform and as RGB on another. Since HTML is so oriented to RGB(A) images, perhaps we should simply add a format param back into the forms of texImage2D taking HTMLImageElement, HTMLCanvasElement and HTMLVideoElement?


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: