texture memory management question

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
blueberry
Posts: 11
Joined: 19.03.2006
With us: 18 years 8 months
Location: z??rich, switzerland

texture memory management question

Post #1by blueberry » 26.03.2006, 14:58

hi everybody who's deep into coding!

i'm working on a quite complex presentation with celestia, where alot of objects and different textures are used.

hence management of texture memory is a perfomance issue.

so my question is: if a (perhaps preloaded) texture becomes unnecessary because an object has stoped existing (in time), are the object's textures erased from the graphic processor's texture memory?

and a second one: are only textures loaded (without preloading) if objects are close (larger than a few pixels)?

thanks alot, very best -blueberry

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 26.03.2006, 15:26

Celestia does no management of graphics memory. It never deletes textures. Apparently some management is done by the graphics drivers. My impression (which could be wrong) is that graphics data can be swapped out to buffers in the computer's main memory when there isn't enough room on the graphics card. In other words, lots of RAM may be needed. Even so, I know that things will stop being drawn properly when too much is needed. The Billow Maidens addon has this problem if you visit every object in it.

However, you should consider making your Addon with low resolution textures, too, so that it works well on systems with limited resources.

I'm not sure when the textures are loaded. I'd suggest experimenting. Watch the memory usage shown by the Task Manager when an object moves into the field of view. Textures have to be loaded into main memory before they're loaded into the graphics card, so you'll see Celestia's memory usage increase when the textures are loaded.

If you aren't already, consider using DDS texture images. They use a lot less main memory than JPEG or PNG images.
Selden


Return to “Development”