Texture in OpenGL ES 2 looks pixelated
(Aug 26, 2011 11:51 AM)ThemsAllTook Wrote: Aha, you've hit another classic problem. Short version: Your texture appears to be using premultiplied alpha; use glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) and the black halo should disappear.
Thanks! That solved it.
(Aug 26, 2011 11:51 AM)ThemsAllTook Wrote: As for why your pixels are premultiplied, I presume you're loading the texture with UIImage or some other Apple API? Apple's image loading functions will typically premultiply your data for you, though in some cases you can disable it. If you want to load the image without premultiplying, you can (maybe? haven't done it in a while) change the options you use to load the image, or use libpng directly.
Yeah, I'm using UIImage CGBitmapContext. (Everything is copied and pasted from here)
Should I bother with it? Why do I care if my images are premultiplied if they are shown correctly? What are the benefits?
One last question which is probably more related to my previous thread-
If I manually sort my objects/sprites by depth, and then call glDrawWhatever in that order, can I ditch depth test and the depth buffer?
|Messages In This Thread|
RE: Texture in OpenGL ES 2 looks pixelated - vunterslaush - Aug 26, 2011 12:15 PM
Possibly Related Threads...
|OpenGL ES Texture Compression||ajrs84||9||2,505||
May 7, 2013 03:36 PM
Last Post: ajrs84
|OpenGL ES Texture Masking||airfire||5||12,818||
Nov 14, 2012 09:36 AM
Last Post: toanNguyen
|OpenGL ES Texture Masking||dalasjoe sin||0||3,494||
Apr 13, 2012 12:17 AM
Last Post: dalasjoe sin
|Lighting and changing texture colors in OpenGL||agreendev||2||6,912||
Aug 13, 2010 03:47 PM
Last Post: agreendev
|OpenGL ES Texture Problems||jhbau1000||1||4,831||
Jul 12, 2010 05:57 AM
Last Post: Kezhaya