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 Additive Blending. What changed
Page Index Toggle Pages: 1
OpenGL Additive Blending. What changed? (Read 2424 times)
OpenGL Additive Blending. What changed?
Apr 22nd, 2009, 2:45pm
 
some time ago i wrote the following sketch. is a circle with a circular white / alpha gradient and copied to the screen in different colours multiple times, whilst spinning. and stuff. not much to it really but it turned out nice

...

link to zip containing code and image is here
http://www.flickr.com/photos/31962137@N00/1103167546/

main loop is here. i set the colour and then draw the (white and alpha) image to the screen.

Code:

for (int i = 0 ; i < CIRCLES ; i++) {
Circle c = circles[i];
pushMatrix();
fill(colours[c.index]);
beginShape(QUADS);
texture(image);
textureMode(NORMALIZED);
vertex(c.x + -blobSize, c.y + -blobSize, c.z, 0, 0);
vertex(c.x + -blobSize, c.y + blobSize, c.z, 0, 1);
vertex(c.x + blobSize, c.y + blobSize, c.z, 1, 1);
vertex(c.x + blobSize, c.y + -blobSize, c.z, 1, 0);
endShape();
popMatrix();
}


but when i run the code (and same image) now i get only white circles, it's like the fill doesn't affect the circle like it did.

has this changed? what can i do to fix it (if anything)?
Re: OpenGL Additive Blending. What changed?
Reply #1 - Apr 22nd, 2009, 2:52pm
 
that was then, this is now

...

edit: OK, have just checked and it doesn't work in 135 either.
Re: OpenGL Additive Blending. What changed?
Reply #2 - Apr 23rd, 2009, 2:27am
 
I think fill() altering texture colours was removed quite a while back. I believe tint() is now the function you're looking for.
Re: OpenGL Additive Blending. What changed?
Reply #3 - Apr 23rd, 2009, 2:58am
 
cool, i will give it a try.

in opengl proper you'd change the ambient light colour before adding each new object, but that didn't work either.
Re: OpenGL Additive Blending. What changed?
Reply #4 - Apr 23rd, 2009, 3:01am
 
is perfect. thanks.
Page Index Toggle Pages: 1