Sign in to follow this  

Frustrum Problems in a huge gameworld

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

Hello Everyone, I am making a little space simulation but i am having trouble with the Projection matix since the objects are kind of big. the problem occurs when i set the far plane of the projection matrix to a real high number. but if i dont do this the objects just disapear at one point since they are not in the camera frustrum anymore i thought about useing alpha blending at the edge of the frustrum so i wouldnt see the planets pop but then a huge planet would just apear out of nothing does anyone have any ideas on how to deal with these kinds of problems in huge game worlds? thank you for any suggestions or links to read for me in advance

Share this post


Link to post
Share on other sites
Keep planets at the same distance (at the edge of the far plane) and change their size when they are on the horizon. That way it goes from a tiny spec to a huge planet with no popping. Not the best answer but it should work, you just have to figure out the rate at which you need to change the size.

Share this post


Link to post
Share on other sites
Actually I made such an engine, but I abandoned it some years ago. My solution was this:
Put all of the objects in (not visible, theoretical) bubbles. If two bubbles intersects each other, then you have to unite them. When you render a bubble, at first, you have to clear the z-buffer in it, and then draw every object of the bubble in receding order (when all objects are opaque). The bubbles are sortable objects. So you can draw them in oncoming order. In the next frame you can reuse the old bubbles with small modifications. And the bubblesort is very effective on recycled bubbles! :)
As far as I remember the bubble-handling routine was rather complicated, but it worked.

There is another solution too: If you simulate spaceships in the near, then the far planets doesn't move at all, or moving very slowly. You can made impostors from them, or you can draw them on the background, and change when the difference is bigger than a threshold.

Share this post


Link to post
Share on other sites
What problems do you have when you set the far plane to a very large number? It is possible (and sometimes desireable) to set the far plane at infinity. The near plane has much more influence on depth buffer resolution, so if that is the problem, then move the near plane out.

If you have problems with objects popping into view (BTW, this is not likely to be related to the far clip plane being too close), here are two possible solutions:
  1. Use imposters.
  2. Use black fog.


Off topic: One of the problems that frequently occur in space games is lack of precision in floating point numbers. For example, if the Sun is the origin of the world, then the resolution of a float at the Earth is about 100 miles. That could be a problem.

Share this post


Link to post
Share on other sites

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