We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › straight alpha/no premultiply HELP!
Page Index Toggle Pages: 1
straight alpha/no premultiply HELP! (Read 369 times)
straight alpha/no premultiply HELP!
Sep 7th, 2008, 5:57pm
 
Hi
I've been using PNGs of simple sprites textured onto quads, but they are appearing with white halos around them, as if premultiplied - I need to apply them with straight alpha.

I searched through the forums and found similar problems, but couldn't figure out the opengl code.  Any help or work arounds appreciated, thanks,
Glenn.
Re: straight alpha/no premultiply HELP!
Reply #1 - Sep 8th, 2008, 11:23am
 
okay, managed to narrow down the specific problem,

the white fringing only occurs when you see the sprite at a distance, but when viewed up close to around its orginal size, it's absolutely fine.  So something to do with the scaling in opengl is affecting the accuracy of the alpha channel at small sizes.
so now i have to sort this out somehow, any advice welcome as usual.
Re: straight alpha/no premultiply HELP!
Reply #2 - Sep 8th, 2008, 12:43pm
 
Well I think i've figured it out, I've just made sure that when I'm making the sprites in Photoshop, I'm doing it against a black background, and saving out as a TGA with alpha channel, so that it is premultiplied to black, the same as my sketch background.  Not %100 technically sure what's going with everything, but at least i've found a solution.
Page Index Toggle Pages: 1