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
x 8

Google Earth style paging

Post by Moohasha »

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.
Black holes are where God divided by 0
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

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.
User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm
x 8

Post by Moohasha »

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.
Black holes are where God divided by 0
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

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
Post Reply