Skip to main content
GameDev.net gamedev.net
🔒 Locked

Depth values, not correct?

Started by dpadam450 Mar 8, 2007 at 7:52 PM 4 replies 600+ views
Original Post
dpadam450
dpadam450
As you can see, the helicopter and everything after it do not show up in the depth buffer. It seems to fade to white really fast. My near is .1 , far is 1,000. I've seen lots of nvidia/ati samples showing the depth buffer with objects farther away and they still show up in the depth image. Anyone else think the depth buffer image should show more?
NBA2K, Madden, Maneater, Killing Floor, Sims 
AlgorithmX2
AlgorithmX2
Actually that appears pretty correct, what ya need to keep in mind is that depth values are not Linear, they are Exponential so the farther stuff all ends up being a near 1.0, if ya want to make them more linear so you can see the more distant values you need to do some math on the original values to remap them.

I seek knowledge and to help others whom seek it
dpadam450
dpadam450
Yea I know the exponential part, but I was just looking like this:

near plane is .1, far is 1,000. The tank barrel is like 2 units from the camera, the helicopter like 15 and the mountains like 900. So it appears that everything farther than 2 gets mapped to the same depth (even though I know it doesnt because it in rendered correctly.
NBA2K, Madden, Maneater, Killing Floor, Sims 
AlgorithmX2
AlgorithmX2
Heh, I know what ya mean but after a surprisingly short distance the depth values really do just become that close that the are nearly the same value.. (.995 .9952 ....) If ya can do a fractional power and remap the curve some and you'll see that they are really just that close...

The curve is a bit sharp for my tastes, they really like to emphasize the close up stuff.

but thats pretty much what an unaltered depth map looks like.

Most samples that you see on the internet are depth maps with very small ranges, so that its easier to see the details and such.

I seek knowledge and to help others whom seek it
Kalidor
Kalidor
Quote:
Original post by dpadam450
Yea I know the exponential part, but I was just looking like this:

near plane is .1, far is 1,000. The tank barrel is like 2 units from the camera, the helicopter like 15 and the mountains like 900. So it appears that everything farther than 2 gets mapped to the same depth (even though I know it doesnt because it in rendered correctly.
I think you're underestimating just how non-linear the depth buffer is. Check out this article, especially the Z Calculator. With your near and far plane values, a distance of 1 corresponds to a depth of ~0.9, a distance of 2 is ~0.95.

Topic Locked

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

Sign in to reply to this topic.