Depth values, not correct?

Started by
4 comments, last by Kalidor 17 years, 1 month ago
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 http://www.pawlowskipinball.com/pinballeternal

Advertisement
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
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 http://www.pawlowskipinball.com/pinballeternal

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
Quote:Original post by 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 played with the posted depth map image in GIMP, and it actually does have just enough fidelity to make out the helicopter and whatnot. If you use the levels tool, and crank the low input value almost all the way up, you can see what I saw. It's all there, just highly nonlinear. I'm assuming that this is meant to be a tank game where you drive around in the tank and shoot at things, so the tank is always the only thing right near the camera which is visible. If that's the case, try drawing everything but the tank with a further out near clip plane like 10->1000, and then the tank with clip planes from .1->2.0 or whatever after clearing the depth buffer. This will result in much less chance of polygons fighting at the far range of visibility if you run on something with a fairly low precision depth buffer. You will also be able to see much more in the depth buffer image with a near clip of something like 10.
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.

This topic is closed to new replies.

Advertisement