OpenGL / GLScene 2D roadmap

I have some street raster tiles that I want to load as a 2D road map the user can zoom in/out and pan.
These tiles are quite large (tiff files) and I am worried about how to have glscene handle loading dynamically so as not to blow the memory.
I don't mind making "less accurate" images for zoomed out, etc. but need to know what basic layout I need for GLScene to achieve all of this
Any help appreciated.
I'm sure this has already been "invented" and I'm happy to use sample code, but it must be free...
LVL 17
TheRealLokiSenior DeveloperAsked:
Who is Participating?
 
TheRealLokiSenior DeveloperAuthor Commented:
I have had to make low res images for when the camera is zoomed out.
Loading 100 full res images at 3000x2000 pixels each takes gigs of memory and of course a long time to do.

What I'm doing now, is using the focal point and camera distance to determine how many tiles to load (at all), and if the camera is moved out a long way, I dump the images and load the much faster low res ones for the "edge" of the camera view

I'm sure there's a good routine for this, but perhaps not in this forum
0
 
jgordosCommented:
cut the large images into tiles... then you load (At most) 4 tiles at any one time.. each of which is much smaller than the overall image.

For instance, if you had a 100000 x 100000 bitmap...

Split the image into screenWidth by screenHeight tiles... Let's say that gives you a 10 x 10 "grid" to keep this an easier discussion.

On screen, you might start the user's position at the dead center of this tile split... 5,5.

As they pan around, you simply load and draw the individual tiles... if one tile is the same resolution as the default display, then at most you need 4 tiles loaded into memory at once.

This is a fairly common problem that is similar to all the "tiling' of images stuff you can find on the web.

http://en.wikipedia.org/wiki/Tile_engine

Hope this helps,
-john
0
 
TheRealLokiSenior DeveloperAuthor Commented:
hi,
I understand the theory.
I need help deciding on the objects to use, and if GLScene handles the memory if a tile is not needed (far to the left, etc)

I'm currently using a single TGLPlane for 1 3000x2000 tile

0
 
jgordosCommented:
what you descriped is known as "mip mapping"....

Very common.

Glad it worked for you.

-john
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.