Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float _vectorToDepth(float3 vec, float n, float f)
- {
- float3 AbsVec = abs(vec);
- float LocalZcomp = max(AbsVec.x, max(AbsVec.y, AbsVec.z));
- float NormZComp = (f+n) / (f-n) - (2*f*n)/(f-n)/LocalZcomp;
- return (NormZComp + 1.0) * 0.5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement