Handling of duplicate textures AND MODELS in graphics memory
Posted: 26.02.2012, 04:40
On the subject of texture handling in Celestia, does anyone who is familiar with the code know if Celestia does any load optimization when the same texture file is used on multiple meshes (via the SSC "Texture" command.)
eg,
Note that Object1 and Object3 use the same texture file, so, to state it very simplistically, I would expect that if Object1 was visited first, then file1.jpg would be loaded into graphics memory at that time, then if Object3 later came into the FOV, then the texture file1.jpg would not have to be re-loaded from disk as it has already been instantiated in memory as a result of displaying object1.
My experience in this scenario suggests however that the file is re-instantiated or reloaded for each object (even though they both reference the same file on disk), as I experience what appears to be a delay as the texture is reloaded, as each successive object comes into view.
Can anyone enlighten me as to how this is handled by Celestia? My experience does seem to suggest no optimization is happening in this situation.
Cheers
CC
eg,
Code: Select all
Object1 "Sol/....etc"
{
Texture "file1.jpg"
}
Object2 "Sol/....etc"
{
Texture "file2.jpg"
}
Object3 "Sol/....etc"
{
Texture "file1.jpg"
}
Note that Object1 and Object3 use the same texture file, so, to state it very simplistically, I would expect that if Object1 was visited first, then file1.jpg would be loaded into graphics memory at that time, then if Object3 later came into the FOV, then the texture file1.jpg would not have to be re-loaded from disk as it has already been instantiated in memory as a result of displaying object1.
My experience in this scenario suggests however that the file is re-instantiated or reloaded for each object (even though they both reference the same file on disk), as I experience what appears to be a delay as the texture is reloaded, as each successive object comes into view.
Can anyone enlighten me as to how this is handled by Celestia? My experience does seem to suggest no optimization is happening in this situation.
Cheers
CC