I have some drawing code that is expected to work on "all systems" ... it's working okay on DirectX/XNA, but in OpenGL, I get graphical glitches.
Here's a screenshot:
(Top text/image in each picture is filtering on, bottom tex/image in each picture is filtering off)
Some explanation (please read before you answer that I need to offset my pixels/texels by .5 in openGL):
1. Everything you see there, including the font, are just images combined onto a texture atlas
2. The texture atlas DOES have a white, zero alpha background-- I have no idea where the darker color is blending in from.
3. There IS space around all images on the texture atlas-- they are not grabbing pixels from another, adjacent image
4. I have tried many versions of "add .5 to pixels, add .5 to texels" to try to get the OpenGL version working. I can make it look worse, but I can't make it look better.
My default render settings are these:
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE); glDisable(GL_LIGHTING); glShadeModel(GL_SMOOTH); glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glAlphaFunc(GL_GREATER,.01f);
I am suspecting the GL_ONE_MINUS_SRC_ALPHA, because I read that that's supposed to be for premultiplied alpha. I do not have premultiplied alpha in the images-- but what's the fix? I tried every blend mode that didn't sound crazy, and I get either white boxes for everything, or the images you see here.
Edited by Raptisoft, 29 March 2014 - 05:43 AM.