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 & HelpSyntax Questions › Zbuffer depth test in P3D vs OPENGL
Page Index Toggle Pages: 1
Zbuffer depth test in P3D vs OPENGL (Read 1027 times)
Zbuffer depth test in P3D vs OPENGL
Feb 4th, 2008, 2:37am
 
I'm having some issues with depth testing in P3D.  The following code does some rendering after using the DISABLE_DEPTH_TEST hint. In the OPENGL case, the lines render over the geometry (what I was expecting), but they are occluded in the P3D case.

Does the depth buffer hint apply in P3D mode, or am I missing something?

Quote:


import processing.opengl.*;

boolean useOPENGL = true;

void setup(){
 if (useOPENGL)  size(500,500,OPENGL);
 else size(500,500,P3D);
}

void draw(){

 unhint(DISABLE_DEPTH_TEST);
 background(0);
 noStroke();
 fill(64);
 pushMatrix();
 translate(250,250);
 sphere(50);
 popMatrix();

 hint(DISABLE_DEPTH_TEST);
 stroke(255);
 line(0,0,width,height);

 beginShape();
 vertex(width,0);
 vertex(0,height);
 endShape();

}


Re: Zbuffer depth test in P3D vs OPENGL
Reply #1 - Feb 4th, 2008, 4:56am
 
You're right it doesn't work. But...

I've been using OCD to have 2 camera feeds. One for the scene and one for the GUI. The GUI is done with controlP5. I do the same disable z-test that you are doing and then call controlP5.draw() at the end of draw(). Works fine in P3D and OPENGL. But any processing shapes don't work.

I'm pretty certain that controlP5 works because it is drawing after draw(). So my thinking would be to make a class and register it to draw before or after the frame then it "should" work.

Page Index Toggle Pages: 1