Sign in to follow this  

Depth values, not correct?

This topic is 3930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this