I try to make a realtime depth of field for Processing and for this I need to get the depthinformation into a texture to use ist in a textureShader. I'm rendering the scene in an GLGraphicsOffScreen. I can easy get the colortexture with .getTexture();, but now I need the depth information in a texture for my shader.
Like it was mentioned in another thread I made an CustomOffScreen to get the buffer ID:
class CustomOffScreen extends GLGraphicsOffScreen {
public CustomOffScreen(PApplet parent, int iwidth, int iheight, boolean multi, int level) {
super(parent, iwidth, iheight, multi, level);
}
public CustomOffScreen(PApplet parent, int iwidth, int iheight) {
super(parent, iwidth, iheight);
}
int getDepthBuffer() {
return depthStencilBuffer;
}
}
But here I am lost. How can I acces the information?