I’d like to make a post processing effet that detects depth contrast to make a kind of cartoon effect.
My idea was to use an Fbo, take its depth layer and make a contour detection with a shader.
OF warns me that I should use ofFbo::Setting, the problem is that there is no documention in the OF web site. An other thing I was wondering, a depth buffer has only one layer (grey scales) so I was wondering who it should be dealt in my fragment shader.
Has any one any help or documentation about this ?
Although when I used the depth texture I didnt have access for some unknown reason, and had to paint it first on a new fbo in the color buffer, and then use this depthFbo.getTexture() to access the depth information:
@Hennio Thank you very much for this very clear and precise answer! I didn’t that the fbo could be allocated this way. Using depth buffers is a bit more tricky than I expected indeed.
I’ll try your methode during the week and I’ll give you feedback.
also to be get anything in the depth texture you need to enable depth testing using ofEnableDepthTest() of glEnable(GL_DEPTH_TEST) otherwise the graphics card won’t write to the depth butffer
It’s okay with this, the main problem was how to get the depth buffer to make post processing effect.
Juste a question, before writing the post, I tried to do