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 › How can I do subtractive blending
Page Index Toggle Pages: 1
How can I do subtractive blending? (Read 1546 times)
How can I do subtractive blending?
Mar 15th, 2010, 2:12am
 
Hi,

I want to know how to do subtractive blending, from the very popular flight404 mini tutorial, we know that
Code:
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE); 


Is additive blending, so overlapping pixels will add together and as result you get a bright white colour.

So how can I do subtractive? I want the overlapping pixels to go black

Any help will be much appreciated
rS
Re: How can I do subtractive blending?
Reply #1 - Mar 15th, 2010, 5:25am
 
http://zanir.wz.cz/?p=60&lang=en

and click on the picture for a big version
Re: How can I do subtractive blending?
Reply #2 - Mar 15th, 2010, 5:29am
 
actually, this might be more useful

http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml

which has a GL_FUNC_SUBTRACT value.
Re: How can I do subtractive blending?
Reply #3 - Mar 18th, 2010, 9:28am
 
try it with

Code:
gl.glBlendFunc(GL.GL_MINUS_SRC_ALPHA, GL.GL_ONE); 

Page Index Toggle Pages: 1