PDA

View Full Version : Premultiplied alpha flag ignored



spattija
12-15-2009, 10:22 AM
Hi everyone,

<apologies>sorry for cross-posting, I already posted on the "OS-Browser specific questions" but that seems a bit inactive...</apologies>

After having some troubles with RGBA textures, I realized that the glTexImage2D(target, level, Image) assumes by default textures with premultiplied alpha,
so it unmultiplies source texels before sending data to the GL. The optional fourth parameter (glTexImage2D(target, level, Image, false)) seems to be ignored both in Chrome and Firefox nightly builds.
Crawling webkit and firefox source code somewhat confirmed my suspicion.
As a result I am not able to use textures with alpha channel.
Unfortunately one cannot premultiply the source RGB because it is in general a lossy procedure (whenever Alpha x Channel > 255).
Am I missing something? Has anyone faced the same problem? Is there a workaround or we just have to wait until they fix the potential bug?

Thanks,
Marco.

Coolcat
12-15-2009, 10:51 AM
I didn't try alpha textures yet, but maybe you should report this as bug. Browser developers can only fix bugs they know...