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

Re: [Public WebGL] Retrieving number of texture channels

Hi Chris,

On 24/02/2010 07:25, Chris Marrin wrote:
> On Feb 22, 2010, at 6:21 PM, Mark Callow wrote:
>> ...
>> 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.

"Query will clearly (be) need(ed)" was predicated on "automatically
determine the format". If you add a format specifier to the TexImage2D
that accepts an HTMLImage then I completely agree a query is not needed.
We had the same problem vis-a-vis one-channel luminance vs. alpha when
loading PNG files in M3G. We added a format parameter there too.

When writing the spec. for this format parameter bear in mind that OGL
ES does not support internal format conversions. Therefore perhaps you
should throw an exception if, e.g. the app. tries to load a one-channel
PNG image as RGB. In other words require that the specified format match
the HTMLImage contents.


fn:Mark Callow
org:HI Corporation;Graphics Lab, Research & Development
adr:Higashiyama 1-4-4, Meguro-ku;;Meguro Higashiyama Bldg 5F;Tokyo;;153-0043;Japan
title:Chief Architect
tel;work:+81 3 3710 9367 x228
tel;fax:+81 3 5773 8660
url:http://www.hicorp.co.jp,  http://www.mascotcapsule.com