Compositor problem

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
okasugandi
Gnoblar
Posts: 15
Joined: Fri Mar 20, 2009 8:01 am

Compositor problem

Post by okasugandi »

Hi, I have a problem with compositor and resource management. The problem is: after I called ResourceGroupManager::getSingleton().unloadUnreferencedResourcesInGroup(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); then most of my compositors were no longer usable (ie crashed at void D3D9RenderSystem::bindGpuProgram(GpuProgram* prg) because the prg parameter is NULL). The unloading process is called regularly to compact the memory size of the resource loaded in the game.
Perhaps one of the solutions is by grouping the compositors in different resource group that are not going to be unloaded, but in my case that is not possible, because the compositors and others game assets are in a single archive file which is grouped by Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME. Or perhaps the solution is by preventing the compositor to not be unloaded by any means, but unfortunately I cannot achieve this way, I have tried to copy and maintain the ReourcePtr of the compositor in order to the resource unloading won't unload the resource - failed, I have tried to 'touch' the resource regularly - also failed, I have tried to move the resource to another resource group in runtime with 'changeGroupOwnership()' - worse, it crashed :p.
"Most of my compositors" stated above means there are a few compositors that are still usable after unload process being called, and unfortunately I cannot figured out what's the difference between those compositors :p.

Thanks before for any help :D!