In our current application, we dynamically load a *lot* of textures into the system. The textures are taking up a great deal of memory and I am looking for a way to reduce this memory consumption. Before I get to my idea though, here is the process I think the textures are going through.
1. Texture file loaded into OSG::Image. (system memory, size of base texture) 2. OSG::Texture created that references OSG::Image. internal format is set to compressed. 3. OpenSG binds the texture, texture is uploaded to OpenGL driver which: - stores a copy of the texture on the graphics board (compressed) - (potentially) stores a copy of the texture in the driver memory to support paging The long and short of it is that I see the potential that the system is storing 3 copies of the entire texture when I really only need the single copy stored on the graphics board. If the driver stores a copy in system memory, there is nothing I can do about that, but I would like to remove the memory consumed by the OSG::Image that sits around after the image has been bound. I know that for some cases this image needs to stay around, but for our cases it doesn't so I would like to make it optional. What I propose is adding a flag to OSG::Texture that if set true: - sets the image for the texture to NullFC after the texture has been bound - thus allows reference counting to collect the OSG::Image and reclaim the memory Would this work? What would it take to add? Can anyone help me out? -Allen ------------------------------------------------------------------------------ _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
