Talk:Compute eye space from window space

Revision as of 17:48, 23 January 2014 by Torandi (talk | contribs) (Add note about incorrect formula in "Optimized method for XYZ of gl_FragCoord")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

"Optimized method from XYZ of gl_FragCoord

I implemented this method, and I think I have found some problems with it (that can be fixed to make it work).

1. The method still uses indices from the projection matrix to calculate the eye space depth, which is confusing. This method seems to work just as well, and is less confusing: eye_z = ( camera_near / (camera_far - texture_depth * (camera_far - camera_near)) ) * camera_far [ ] 2. The method proposes that [-1, 1] should be used for the range of the coordinates when calculating eye direction. That "almost" works, but I have after some reasoning and testing found that this should probably be the corners of the near plane in eye space.

I find that the method works with these adjustments. I will test this some more, and if no one protests I'll change the article. --Torandi (talk) 13:48, 23 January 2014 (PST)