Jump to content

View more

Image of the Day

Working on Johnny Bonasera Chapter 2 Intro. #screenshotsaturday #adventuregame https://t.co/QWEx05T09z
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

glBlendFunc

2: Adsense
  • You cannot reply to this topic
4 replies to this topic

#1 mike44   Members   

150
Like
0Likes
Like

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.


#2 TheChubu   Members   

9307
Like
1Likes
Like

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


#3 L. Spiro   Members   

25243
Like
3Likes
Like

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.


#4 WiredCat   Members   

1415
Like
0Likes
Like

Posted 27 February 2017 - 01:33 PM

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

 

eL Spirito



#5 mhagain   Members   

13022
Like
1Likes
Like

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.