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, this transparency thing...
Page Index Toggle Pages: 1
openGL, this transparency thing... (Read 2213 times)
openGL, this transparency thing...
Jan 11th, 2010, 8:40pm
 
hello dear Processing forum,

i'm wondering if there is a fix for this issue where supposedly transparent planes are only properly transparent from one side, i.e. from certain angles they are opaque towards other objects except the background...

Nico loves banana.

Banana in front of Nico = all dandy.
Nico in front of banana = no proper transparency.
Re: openGL, this transparency thing...
Reply #1 - Jan 12th, 2010, 6:10am
 
It was moving around so much I couldn't tell from the sketch link, but here were my first thoughts when reading the post.

Possibly lighting...?
try:
ambientLight(255, 255, 255, 0,0,0);

Blending...?
Maybe try cycling through blending options
http://74.125.47.132/search?q=cache:0QPN0etLW4MJ:boxofbooze.com/processing/glblend.html+space+junk+blend+example&cd=1&hl=en&ct=clnk&gl=us
Re: openGL, this transparency thing...
Reply #2 - Jan 13th, 2010, 10:46am
 
yep, the link you posted is perfect. thanks!
Re: openGL, this transparency thing...
Reply #3 - Mar 15th, 2010, 2:22pm
 
All I get from that link is a google cache of a domain squatter page. I'm having the same issue. Is there an up to date link?
Re: openGL, this transparency thing...
Reply #4 - Mar 15th, 2010, 2:41pm
 
Using hint(ENABLE_DEPTH_SORT); gets transparency working correctly, but at the cost of performance. Also, for me at least, it introduced some funny little rendering errors. They look like regions that aren't shaded correctly that appear and disappear depending on the camera angle.
Re: openGL, this transparency thing...
Reply #5 - Mar 21st, 2010, 4:14am
 
here's the code from above: http://de.posi.to/codici/openGLblendmodesTest/openGLBlendModeTest2.pde

my personal favorite for most applications is this setting:
Code:
pgl = (PGraphicsOpenGL) g;
gl = pgl.beginGL();
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
gl.setSwapInterval(1);
pgl.endGL();


gives a nice "holographic" look by simply adding colors.

gl.setSwapInterval(1) is v-sync.
Page Index Toggle Pages: 1