[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 6:21 PM, Mark Callow wrote:

> Hi,
> The reason  glGetTexLevelParameter was dropped is that internal format
> conversions were dropped. In GL ES, the format and internalformat
> parameters of TexImage2D must match. Therefore the application knows the
> format it specified.
> The WebGL implementation must know what format it is specifying when
> loading HTMLImages. Chris mentioned that they are loaded as either RGB
> or RGBA format depending on presence of an alpha channel. So it doesn't
> seem like it would be hard to add a query to WebGL. On the other hand,
> since they are never loaded as 1 or 2 channel textures, the X3D
> implementation doesn't need to know the difference. It can always use
> the texture color as the diffuse color.
> I agree with Ken that adding support to WebGL for deciphering HTMLImages
> that are PNG files to automatically determine the format to use for
> TexImage2D is an enhancement. A query will clearly need to be part of
> this enhancement.

We don't need queries for this. We simply need to know what the resultant internal format is for each type of image loaded. As I mentioned in other responses, adding a format param would provide this.


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: