Jump to content
  • Advertisement
Sign in to follow this  

Disabling far plane

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

Is it somehow possible to disable the far plane? I didn't discovered it yet. I want to render every frame first very far WITHOUT depth test and then between far plane (which is quite close to the camera for optimal z-testing) and near plane WITH depth test. I'm searching for some optimal solution. Thank you, typek

Share this post

Link to post
Share on other sites
Original post by typek
Is it somehow possible to disable the far plane?

No. You can push it very far away at the cost of z-buffer resolution or you can use some wierd custom projection.
If you tell us what you are trying to do someone might know alternative way.

Share this post

Link to post
Share on other sites
NV_DEPTH_CLAMP extension allows you to disable clipping against the near and far planes. Instead of clipping geometry, the depth values are just clamped to the depth range. Unfortunately, it works only for NVidia.

Also, read here(Under the "View Frustum Clipping – The Ultimate Evil" paragraph) for a way to project the far plane into infinity.

Now, for your case IMO the best way is to:

1)Push the far plane just very far away,as far as your most distant object is. Since you don't want to use depth testing, depth precision doesn't matter.
2)Disable depth testing&writing
3)Render whatever you want
4)Setup the perspective normally now
5)Enable depth operations
6)Render the normal geometry

Share this post

Link to post
Share on other sites
Infinite Far Plane Perspective matrix calculation:
Note, source language is Java.

float fovy = 45f;
float aspect = ((float) AppContext.WIDTH)/((float)AppContext.HEIGHT);
float n = 1f; //Near Clip Value
float[] entries = new float[16];
float left, right, top, bottom;
float nudge=0.999f; //prevent artifacts with infinite far plane

//convert fov from degrees to radians




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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!