Reputation: 1606
Is it possible to project the camera depth onto a plane ?
Let me explain, if I simply transfer the depth buffer on a plane, it will always display the depth from the camera point of view. But how can I proceed to display the depth but from the plane point of view.
I want to apply the effect on a shader. For me it's maybe a matrix problematic but I don't get it.
Upvotes: 1
Views: 470
Reputation: 14815
The depth buffer is relative to the representation, it is possible to project it to any plane using (for example) shaders. But..
The depth buffer is not a full geometrical representation of the object, but only of the "being seen" surface from the camara POV. If you project the depth buffer, part of the object will probably not be projected (see image).
In the picture, the camara (the red eye) is looking to an object (black). The depth buffer represent the distance between the camara and the red surface. For the plane (blue line) you probably want to get the entire object projection (blue surface), but projecting the red surface on the plane, you will only get a little portion of the entire blue surface.
If you want the entire blue surface,
Upvotes: 2