• API
• FAQ
• Tools
• Archive
SHARE
TWEET # Untitled a guest Jan 11th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. n = near
2. f = far
3. _ZBufferParams =[(1-f/n),f/n,x/f,y/f]
4. z = depth buffer Z-value (f+n)/(f-n)+2*f*n/(EZ*(f-n))
5. EZ  = eye Z value
6. LZ  = depth buffer Z-value remapped to a linear [0..1] range (near plane to far plane)
7. LZ2 = depth buffer Z-value remapped to a linear [0..1] range (eye to far plane)
8.
9. GL:
10. EZ  = (2*n*f)/(f+n - z * (f-n))
11.     = (2*n*f)/(f+n - (f+n)+2*f*n/EZ)
12.     = (2*n*f)/(2*f*n/EZ)
13.     = 1/(1/EZ)
14.     = EZ
15.
16. LZ  = (EZ-n)/(f - n)
17.     = n * (z + 1.0) / (f + n - z * (f - n))
18.
19. LZ2 = EZ/f
20.     = (2n) / (f + n - z * (f - n))
21.
22. LZ2 in two instructions:
23. LZ2 = 1.0 / (_ZBufferParams.x * z + _ZBufferParams.y)
24.     = 1.0/ b
25. b = (1-f/n)*((f+n)/(f-n)+2*f*n/(EZ*(f-n))) + f/n
26.
27. 好吧，我还是没推出来
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.

Top