Sign in to follow this  
mike44

glBlendFunc

Recommended Posts

mike44    175

Hi

how to reset glBlendFunc?. I thought to reset that with push popmatrix?

Many thanks

Edited by mike44

Share this post


Link to post
Share on other sites
L. Spiro    25615

Use ::glDisable( GL_BLEND ) to disable it.
Use ::glBlendFunc( GL_ONE, GL_ZERO ) to set it back to the OpenGL default.


L. Spiro

Edited by L. Spiro

Share this post


Link to post
Share on other sites
mhagain    13430

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml

The default blend state is blending disabled and src GL_ONE, dst GL_ZERO.

However, I would recommend that you not reset the blendfunc (or indeed any other state) after drawing.  Instead you should explicitly set all of the state you want before drawing.  Add state filtering if performance bothers you.  This way your draw calls get to be more robust by not having dependencies on or assumptions about previously set state.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this