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 › openGL blend modes - A strange gift for you
Page Index Toggle Pages: 1
openGL blend modes - A strange gift for you (Read 3338 times)
openGL blend modes - A strange gift for you
Apr 8th, 2008, 6:11pm
 
To make it easier to grasp the combinations of different openGL blend modes I quickly ammended the built-in example called "SpaceJunk" with some neat functionality.

You can cycle through the blend modes for each variable in the function Code:
glBlendFunc( X1, X2 ) 

You can also toggle depth testing on and off.

The keys are:
Code:

'e': X1 = next openGL blend mode
'd': X1 = previous openGL blend mode
'r': X1 = next openGL blend mode
'f': X1 = previous openGL blend mode
'z': toggle depth testing (disabled by default)


you may notice a blank window at first. just change one of the blend variables to see something cool.

the code is too long for a post so i placed it here:
http://boxofbooze.com/processing/glblend.html

for more information on openGL blend modes see this helpful webpage:
http://pyopengl.sourceforge.net/documentation/manual/glBlendFunc.3G.html

feel free to correct anything that is wrong or missing.
--ness
Re: openGL blend modes - A strange gift for you
Reply #1 - Apr 9th, 2008, 6:55am
 
This is very helpful ness, thank you!
Re: openGL blend modes - A strange gift for you
Reply #2 - Apr 9th, 2008, 11:23pm
 
Just letting everyone know that I had found a few errors and fixed them. The link above has the corrected code.
Re: openGL blend modes - A strange gift for you
Reply #3 - Oct 29th, 2008, 4:58pm
 
I know this is an old post, but it's massively useful for a practical introduction to glBlendFunc, and really helped me get my head around it.  Thanks a lot Smiley
Re: openGL blend modes - A strange gift for you
Reply #4 - Nov 20th, 2008, 2:54am
 
This is great! it really helped me a lot to experiment with blending modes!

I added some functionalities to it you can read about it here:

http://claudiodt.blogspot.com/2008/11/opengl-blending-modes-processing-test.html

or directly check the application here:

http://de.posi.to/codici/openGLblendmodesTest/
Page Index Toggle Pages: 1