Jump to content
  • Advertisement
Sign in to follow this  
Unfadable

Far plane won't go out far enough

This topic is 4435 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

I'm sure there's an easy answer to this, but no matter how far I push my far plane out in my D3DXMatrixPerspectiveFovLH() call, it doesn't seem to go past a certain point (maybe 1000 or so), things seem to clip at about the same distance. My viewport near and far is 0 and 1. My depth stencil format is D3DFMT_D24S8. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Quote:

My viewport near and far is 0 and 1.


Did you try chancing the viewport far to 1000 and viewport near to 1, 0 will result in other issues down the road. Unless you are a tick walking on a wall, you probably don't need it less than 1 for the near, and the far should be the value for the farthest object you want to render. I'm surprised you're seeing anything with the values of 0 and 1, unless you're drawing some pretty small things.

Also, if that was a typo, and your far is 1000, try at least changing near from 0 to 1

Share this post


Link to post
Share on other sites
Sorry, I shoulda been more clear

My code looks like this:

D3DVIEWPORT9 view_port;
view_port.MinZ = 0;
view_port.MaxZ = 1;

D3DXMatrixPerspectiveFovLH(&al, 60.f * (3.14f/180.f), 1024.f / 768.f, 1.f, 100000.f);

I'm using vertex/pixel shader btw.

Share this post


Link to post
Share on other sites
I assume the next line is something like:

pDevice->SetTransform( D3DTS_PROJECTION, &al);

Also

If you are using a specialized viewport, which is seems you are, then you're going to override the Perspective Z depth, and clip everything to the viewport. Have you tried changing the viewport? I might be wrong, but I think that is the root of your problems.

Share this post


Link to post
Share on other sites
I retrack my comment on focusing on the viewport. It looks like that is for the most part 2D. I need to research more, but I don't think it's related to your issue. I guess my only suggestion is to make sure you are calling:

pDevice->SetTransform( D3DTS_PROJECTION, &al);

sorry I don't have more.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!