LWJGL Forum

Programming => OpenGL => Topic started by: simonhyttfors on June 17, 2013, 16:04:25

Title: Plain colored quad with glBlendFunc()
Post by: simonhyttfors on June 17, 2013, 16:04:25
I've put glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); in my OpenGL initialization code so the transparent part of my textures remains so. But I now want to add a simple colored quad, without any texture. This won't show up as long as I keep the glBlendFunc line. How do I fix it?
Title: Re: Plain colored quad with glBlendFunc()
Post by: quew8 on June 18, 2013, 07:49:39
Disable blend function, disable textures, draw quad, enable blend function, enable textures.
Title: Re: Plain colored quad with glBlendFunc()
Post by: Fool Running on June 18, 2013, 12:22:19
You should be able to keep the blend function enabled and just disable the textures. Just make sure you don't use a color with a zero alpha channel.
Title: Re: Plain colored quad with glBlendFunc()
Post by: quew8 on June 19, 2013, 10:48:53
I was thinking along the lines of performance. If it's just the one non-blended quad, don't bother disabling blend. If there are a lot of them, I think disabling blend would be a fair amount quicker.

But maybe not. If nothing else, disabling blend is less error prone.