SHARE
TWEET
Untitled
a guest
Sep 15th, 2014
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- /** vec4 u_projInfo (-2.0f / (width*P[0][0]),
- 2.0f / (height*P[1][1]),
- ( 1.0f - P[0][2]) / P[0][0],
- ( -1.0f - P[1][2]) / P[1][1])
- where P is the projection matrix that maps camera space points
- to [-1, 1] x [-1, 1]. That is, GCamera::getProjectUnit(). */
- /** Reconstruct camera-space P.xyz from screen-space S = (x, y) in
- pixels and camera-space z < 0. Assumes that the upper-left pixel center
- is at (0.5, 0.5) [but that need not be the location at which the sample tap
- was placed!]
- */
- float3 reconstructCSPositionUV(float2 S, float z) {
- return float3((S.xy * u_uvProjInfo.xy + u_uvProjInfo.zw) * z, z);
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
