Google Earth style paging

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm

Google Earth style paging

Post by Moohasha » Wed Dec 03, 2008 6:48 pm

My manager nearly gave me a heart attack last week when he said "Just look at how Google Earth is done and do that." Yeah, okay.
So is there a plugin or something out there to do Google Earth-like paging? I need to model the entire world, but as the user zooms in on a section it becomes more detailed (if the imagery is available). I'm using Google Earth images (well, Virtual Earth, but same thing) which are divided up in the Mercator format, meaning higher detail levels just subdivide the lower levels. I figure as the user zooms in on an area it should just subdivide and load the next higher level of imagery (again, if available) for each new subdivision.
One obvious issue is resource management. I rendered the entire world using level 5 imagery (32x32 images = 1024 images total) and it used 302 MB of RAM. So obviously, when I zoom in and out and change resolutions (ie, load/reload new images), I don't want to keep textures that aren't used anymore in memory. I'm willing to suffer the performance hit of constantly loading/reloading images to reduce how much RAM is used.
Another issue is floating point precession. It's one thing to render the world and move around from orbit, but as the use gets down to the surface and is moving the camera around, the camera probably shouldn't be 0.000001 units away from the geometry. So there's the issue of seamlessly scaling and offsetting the geometry as the user moves around.
If someone has done something like this already, or knows a better solution, I'm all ears! I don't think my manager realizes that GOOGLE EARTH isn't exactly an easy funtionality to duplicate.
0 x
Black holes are where God divided by 0

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Thu Dec 04, 2008 3:54 pm

Really this just means you want to use the ResourceBackgroundQueue and manually control when you load your textures, then swap over the materials being used in those sections to use the different resolution textures based on proximity. It's not as hard as it sounds, it's just a distance test, some load queuing via ResourceBackgroundQueue, and some material creation / destruction / changing.
0 x

User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm

Post by Moohasha » Thu Dec 04, 2008 11:44 pm

But that still leaves the meshes. Whenever a higher resolution texture is loaded, the mesh also needs to be subdivided to provided more detail for that area, just like the TerrainSceneManager. (Hm, maybe I'll look at the code for that.) At higher "elevations" a simple quad is fine, but at lower "altitudes" I'm actually going to load elevation data in which case each hi-res quad around the camera will be subdivided much more...just like Google Earth.
Thanks for the info though. I'll look into the ResourceBackgroundQueue for loading/unloading the materials and textures.
0 x
Black holes are where God divided by 0

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Fri Dec 05, 2008 6:28 pm

There are been several threads on planet rendering plugins on this forum already, use the search. E.g. http://www.ogre3d.org/phpBB2/viewtopic. ... +rendering
0 x

Post Reply