We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Disable blending in OpenGL
Page Index Toggle Pages: 1
Disable blending in OpenGL (Read 1222 times)
Disable blending in OpenGL
Apr 21st, 2009, 4:14pm
 
Hi,
I have been searching the web for an aswer to my question for days and I couldn't find any relevant threads.
I am using blending in opengl mode and I would like to disable the blending and draw other opengl shapes on top. But it seems that once I use glBlendFunc everything after that will be drawn with that effect. I added gl.glDisable(GL.GL_BLEND), gl.glClear(GL.GL_DEPTH_BUFFER_BIT),  gl.glDisable(GL.GL_COLOR_BUFFER_BIT), even tried hint(DISABLE_DEPTH_TEST) with no luck.
Please help!
Re: Disable blending in OpenGL
Reply #1 - Apr 21st, 2009, 6:59pm
 
I usually just switch the blending to the mode I'm looking for.
I draw some of my stuff with gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE); and others with gl.glBlendFunc(gl.GL_SRC_ALPHA , gl.GL_ONE_MINUS_SRC_ALPHA); depending on the view.   There is a good example that flips through the blending options at http://processing.org/discourse/yabb2/?board=OpenGL%3Baction=display%3Bnum=1207671111
Re: Disable blending in OpenGL
Reply #2 - Apr 22nd, 2009, 1:30pm
 
Hi Jeff,
Thank you so much, the setting of blending values was the key!
Page Index Toggle Pages: 1