I am trying to implement do some screen space rendering but after looking over the web I still don't find answers to some doubts.
First, I need to compute the point in view space from a value in the depth buffer.
- View-space means the camera-space or the clip-space?
I also found that, inverting the projection transformation I can get a point from the depth with a formula like
P(x,y) = [(2x/Vx-1.0)/Fx , (2y/Vy-1.0)/Fy , 1] * z(x,y)
where Vx/Vy are the dimensions of the viewport and Fx/Fy are the focal lengths
- I don't understand where does this formula comes from, if I have it correctly the perspective projection formula is different. Can someone explain me this?
- A point in view-space is a 3D-point, but why is the third coordinate 1?