Skip to main content
gamedev.net
🔒 Locked

Linearized Depth Help?

Started by Aptos Jun 9, 2010 at 12:09 PM 1 replies 800+ views
Original Post
Aptos
Aptos
Hey guys,

I'm currently working on an SSAO implementation, and therefore needed the depth buffer values. After doing some research, I found many places (most of them posts on this forum) that said to use this function:

(2.0 * Near) / (Far + Near - depth * (Far - Near))


However, I can't figure out WHY this works, and I couldn't find an explanation anywhere. I know it has something to do with how the depth is generated when transforming by the projection matrix.

Could someone enlighten me? And what's the 2.0 for?
Aptos
Aptos
Awesome, thank you, that did help!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.