@hamoid yes but not in the shader and by default it is double sided. Anything that can be done in OpenGL can be done in processing so :
import peasy.*;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.opengl.GL;
PeasyCam cam;
boolean b[] = new boolean[3];
PShape shp1, shp2;
PGL pgl;
GL2ES2 gl;
void setup() {
size(800, 600, P3D);
cam = new PeasyCam(this, 400);
hint(DISABLE_DEPTH_TEST);
hint(DISABLE_DEPTH_SORT);
hint(DISABLE_DEPTH_MASK);
shp1 = createShape(SPHERE, 90);
shp1.setStroke(false);
shp1.setFill(color(100));
shp2 = createShape(BOX, 180);
shp2.setStroke(false);
shp2.setFill(color(255, 40, 20, 100));
}
void draw() {
background(255);
cam.beginHUD();
fill(0);
text("DEPTH_TEST " + b[0], 20, 20);
text("DEPTH_SORT " + b[1], 20, 40);
text("DEPTH_MASK " + b[2], 20, 60);
text("<- use the mouse to toggle settings", 200, 40);
cam.endHUD();
pgl = beginPGL();
gl = ((PJOGL)pgl).gl.getGL2ES2();
// OpenGL Code
gl.glEnable(GL.GL_CULL_FACE);
gl.glCullFace(GL.GL_FRONT); // GL_BACK, GL_FRONT_AND_BACK
for(int i=0; i<2; i++) {
for (int x = -200; x<=200; x+=200) {
for (int y = -200; y<=200; y+=200) {
pushMatrix();
translate(x, i*300, y);
// hint((x+y)/200 % 2 == 0 ? ENABLE_DEPTH_MASK : DISABLE_DEPTH_MASK);
shape((x+y)/200 % 2 == 0 ? shp1 : shp2);
popMatrix();
}
}
}
endPGL();
}
void mousePressed() {
int id = mouseY / 20;
if (id < b.length) {
b[id] ^= true; // same as b[id] = !b[id]
}
hint(b[0] ? ENABLE_DEPTH_TEST : DISABLE_DEPTH_TEST);
hint(b[1] ? ENABLE_DEPTH_SORT : DISABLE_DEPTH_SORT);
hint(b[2] ? ENABLE_DEPTH_MASK : DISABLE_DEPTH_MASK);
}
@neilcsmith could you make a quick exemple, i tried to do that but I failed.