GL Blending Question - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: GL Blending Question (/thread-10031.html)
GL Blending Question - SethWillits - May 2, 2012 10:45 PM
See the faint glow/fuzz around the one the right? What's going on? The one on the left is the original png layered on top of the screenshot in Photoshop.
I'm using GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA.
RE: GL Blending Question - arekkusu - May 4, 2012 09:39 AM
Looks like somewhere between Photoshop and your image loader, you got pre-multiplied pixels. So all pixels with alpha are "too dark" with that blend equation.
This can happen if you use CoreGraphics to load images.
RE: GL Blending Question - Charybdis - Jun 28, 2012 03:25 PM
It looks like the pixels in your texture with low opacity have RGB of 255,255,255. This is done to improve compression but I thought this was only done only for pixels with 0 opacity (still a problem when using linear sampling), but in the image it looks like it is happening for all those with 'low' opacity.
Yes, you need to look into "pre-multiplied alpha". It is a perfect solution and not too dfficult to understand.
All you need to do is multiply all rgb values by the alpha when loading the image, and use this blend function instead:
It 'should' magically solve your problem.