// Linearization equation derived by the ROS folks at CCNY.
float linearZ = -325.616 / (point.z + -1084.61);
- // Compute the psi/theta angles of the ray through this pixel.
- vec2 angles = point.xy * halfFov;
- // Find the intersection of that ray with the plane at linearZ.
- vec2 intersection = linearZ * sin(angles);
+ vec2 unprojected = linearZ * tan(halfFov) * point.xy;
- return vec3(
+ return vec3(, linearZ);