Strange Texture Bug When Drawing Opaque Images

Started by Setlock, December 10, 2018, 22:06:33

Previous topic - Next topic

Setlock

Hello everyone, recently Ive been having an issue that youll see below. Yes I have GL_BLEND enabled, GL_ALPHA_TEST enabled, GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA),          GL11.glAlphaFunc(GL11.GL_GREATER, 0),    GL11.glEnable(GL11.GL_DEPTH_TEST);



As you can see the white appears where opaque pixels should be. Thanks in advanced for your help with this



spasi


Setlock


spasi

You multiply the RGB channels of all your RGBA textures by the ALPHA channel, then use:

glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA);

instead of

glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);