Skip to main content
GameDev.net gamedev.net
🔒 Locked

Large image display

Started by cragwolf Jan 20, 2007 at 11:10 PM 0 replies 650+ views
Original Post
cragwolf
cragwolf
I want to learn about some strategies for displaying very large images. Let's say my video card doesn't let me create textures bigger than 2048x2048, and it has 128 MB of video memory. If I want to display a very large image, say 8192x8192 (no zooming, so the user will have to scroll the image to see all of it, orthographic mode), then the first problem I have is that I can't create a texture that large. To deal with this problem, I split up the image into 16 textures of size 2048x2048. But then my problem would be that not all of these textures can fit into video memory. I have some questions at this point: what happens if you try to create more textures than can fit in your video memory? Do they just go into your system memory? If so, does this mean that if the user is scrolling my image, and I have to display an image tile which is not in video memory, then there might be some slowness noticed by the user as data is copied from system memory to video memory? I would be grateful for any answers, or any information relevant to my task.
GuentherKrass
GuentherKrass
Hi cragwolf,

Splitting up the image into several textures is the right way to do it. To do this efficently, check which of the tiles need to be updated and render to an offscreen buffer, preferably a fbo (or pbuffer) and copy the buffer to the corresponding texture.

Quote:

But then my problem would be that not all of these textures can fit into video memory.


With 2048x2084 pixels and 4 bytes per pixel (if you're not rendering with floating point values) you have 16 MB per tile. You said, that there will be no zooming, so the user will never be able to see the whole 8192x8192 image. On a normal diplay he will see a maximum of 4 tiles = 64 MB. Just update the right textures and you'll be fine. You can even create 4 fbos and bind them as textures directly.

Quote:

what happens if you try to create more textures than can fit in your video memory? Do they just go into your system memory? If so, does this mean that if the user is scrolling my image, and I have to display an image tile which is not in video memory, then there might be some slowness noticed by the user as data is copied from system memory to video memory?


Those textures first go to AGP / PCI-Express connected memory. If they don't fit in there, then they will be stored in system memory. You want to avoid either case, since this can be very slow, especially when using very big textures.

Cheers,

GuentherKrass

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.