Sign in to follow this  
Stellar Developer

remove farZ clipping?

Recommended Posts

I doubt it. The min Z and far Z are used for the ZBuffer. MinZ = 0.0 and FarZ = 1.0. The greater the distance between min and far Z, the less the precision of the ZBuffer.

Share this post


Link to post
Share on other sites
The far plane can be removed. I only know how to do it in opengl though. It just involves making a custom perspective matrix (I'll dig up the opengl matrix someone here should be able to convert it, or will know a built in d3d command). It will cost you some z-buffer accuracy, and The best way to help deal with that is to push the z-near plane as far back as possible (the near planes possition has far greater affect than the far planes).

Share this post


Link to post
Share on other sites
Ok I'm taking this from "Practical and Robust Shadow Volumes" here

Your project matrix should be


2*Near/(Right-Left), 0 , (Right+Left)/(Right-Left), 0
0 ,2*Near/(Top-Bottom), (Top+Bottom)/(Top-Bottom), 0
0 , 0 , -1 , 2*Near
0 , 0 , -1 , 0



Just be aware that the z-buffer is really inaccurate for very distant objects, so your far away objects might get some z fighting artifacts.

I'm not sure if there's something special you need to do to use this in d3d though.

I'm not sure what your doing and there maybe a cleaner way to do what you want. If there's only a few distant objects, backgrounds you can disable the z-buffer, and just draw those very distant objects, in back to front order. Then draw the rest of the scene normally.

Share this post


Link to post
Share on other sites
Quote:
Original post by CadeF
D3DX matrix, I think he is working with DirectX :)


D3D and Opengl generally have the same capabilities (Opengl extensions sometimes open up features D3D doesn't yet have) So I'm almost certain theres a straight foward way to do the same on D3D. Probably just some custom matrix call.

Note: The above matrix may need to have it's handedness switched though. Someone around here should know.

Share this post


Link to post
Share on other sites

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