Jump to content
  • Advertisement
Sign in to follow this  
jm_hewitt

Culling the earth

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

My project is dealing with a quadtree wrapped earth and I think I came up with a nice way to cull away the data. No one at the office cares about such things but I wanted to tell someone..... I have 3 generic culls already implemented in the system that do finer and finer approximations of the view volume: Sphere, Cone and then the actual planes.... When doing this, I noticed that if I had no back cullilng plane, I'd naturally see the back side of the earth. So with a geocentric universe, I realized I could quickly cull away the back side with a quick dot product of the camera position and the center of the bounding sphere of the node. This was nice and cheap. However I was still left with half the world, most still not visible when closer to the ground. I then realized that I could easily calculate the distance to the horizon because (on a perfect sphere) the camera point lies on the tangent plane at the horizon point. I could then use the pyhtagorean theorem: Distance to Horizon = SqRoot( (EarthRadius)^2 + ( Camera Altitude + EarthRadius) ^2) With some reductions: Horizon = Sqrt( Altitudue * ( 2 * Radius + Altitude ) ) In a geocentric world, this can be reduced even more since the magnitude of the camera position yields the length of C. Also it could be left squared for a cheap calculation similar to the BoundingSphere test. Close to the earth's surface this should eliminate a large area of the surface quickly. Of course there are other techniques to do it including occlusion culling and based on your camera height choosing what level of the quadtree you start on, but I was happy to try out this little trick.

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!