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.
Page Index Toggle Pages: 1
glowing ray effect (Read 1008 times)
glowing ray effect
May 11th, 2008, 5:08am
 
hi guys,

im making a glowing ray effect, so far the way ive approached this was to create a number of cylinders which fan out from the center of a sphere.

http://www.julapy.com/processing/rays.mp4

the left side of the sphere blends correctly while the right doesn't seem to blend at all.  tried using a quad instead of a cylinder and got the same result.
also tried disabling depth test, gl.glDisable( GL.GL_DEPTH_TEST ), but no change.

does anyone have an idea of how to fix this?

also, if anyone has any other ways of creating this effect, be great to hear ur approach.
Re: glowing ray effect
Reply #1 - May 11th, 2008, 10:59am
 
Hi julapy

You surely have seen this:

http://codeanticode.wordpress.com/2008/05/04/gltexture-renamed-to-glgraphics/

There you can combine the Offscreen example with the BloomEffect example and everything you draw is nicely bloomed

Test your Blendmodes:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=OpenGL;action=display;num=1207671111

greetings ascorbin
Re: glowing ray effect
Reply #2 - May 11th, 2008, 11:17am
 
Your problem is your draw order.

There is one easy way to work around it, as well as disabling the depth test, disable writing depth information with gl.glDepthMask(0); (or possibly 1.. can't remember which is "on" and which is "off") for your cylinders.
Re: glowing ray effect
Reply #3 - May 11th, 2008, 4:10pm
 
thx guys, disabling the depth mask did the trick.
gl.glDepthMask( false );

JohnG, i had a quick google and ur absolutely right, when drawing transparent or opaque objects its best to draw them back to front. im guessing this would involve some kind of z-sorting. wonder if opengl can do this before rendering to screen...

ascorbin, yeh been following that thread and GLSL is very high on the todo list... just have to get the fundamentals down first.

thx again guys.
Page Index Toggle Pages: 1