• FEATURED

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

## glBlendFunc

4 replies to this topic

### #1mike44  Members

Posted 26 February 2017 - 03:09 AM

Hi

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

Many thanks

Edited by mike44, 26 February 2017 - 11:38 AM.

### #2TheChubu  Members

Posted 26 February 2017 - 01:39 PM

You call glBlendFunc again with whatever value you want it to be the "default" one.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

### #3L. Spiro  Members

Posted 26 February 2017 - 05:48 PM

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, 26 February 2017 - 05:48 PM.

### #4WiredCat  Members

Posted 27 February 2017 - 01:33 PM

you dont do glpushmatrix you do glpushattrib, although you should use what l spiritual wrote

eL Spirito

### #5mhagain  Members

Posted 27 February 2017 - 01:43 PM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.