LR
01-12-2007 20:46:35
Hi there!
First let me thank you for this nice plugin. It already saved me a lot of trouble
A while ago I wrote a small hack for impostors to store an additional normal texture that would allow correct lighting of impostors.
This was done in Windows and everything was fine.
Now I moved to develop on Linux and strange things are going on... let me show you:
First an excerpt from Ogre.log:
As you can see, Ogre can't find the impostor texture and throws an exception which is caught and the texture is generated as intended.
Then Ogre tries to load the imostor normal texture and again throws an exception. But this time the exception is not caught and the program quits.
This is the corresponding code:
This code is, except from the filename and the texture pointer, totally similar to the original code from ImpostorTexture::renderTextures - only that the exception doesn't get caught.
Any ideas why this happens?
First let me thank you for this nice plugin. It already saved me a lot of trouble
A while ago I wrote a small hack for impostors to store an additional normal texture that would allow correct lighting of impostors.
This was done in Windows and everything was fine.
Now I moved to develop on Linux and strange things are going on... let me show you:
First an excerpt from Ogre.log:
21:23:00: Creating viewport on target 'rtt/ImpostorTexture1/407719872', rendering from camera 'ImpostorCam2', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
21:23:00: Creating resource group BinFolder
21:23:00: Added resource location '.' of type 'FileSystem' to resource group 'BinFolder'
21:23:36: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Impostor.General.industry_eco_block1.mesh.png in resource group BinFolder or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 604)
21:23:36: Texture: Impostor.General.industry_eco_block1.mesh.png: Loading 1 faces(PF_A8B8G8R8,1024x512x1) with 10 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x512x1.
21:23:36: Render Target 'rtt/ImpostorTexture1/407719872' Average FPS: 0.0278002 Best FPS: 0.0278002 Worst FPS: 0.0278002
21:24:01: Creating viewport on target 'rtt/ImpostorNormals3/407719872', rendering from camera 'ImpostorCam4', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
21:24:24: Added resource location '.' of type 'FileSystem' to resource group 'BinFolder'
21:26:03: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Impostor.Normals.General.industry_eco_block1.mesh.png in resource group BinFolder or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 604)
As you can see, Ogre can't find the impostor texture and throws an exception which is caught and the texture is generated as intended.
Then Ogre tries to load the imostor normal texture and again throws an exception. But this time the exception is not caught and the program quits.
This is the corresponding code:
String fileName = "Impostor.Normals." + entity->getMesh()->getGroup() + '.' + entity->getMesh()->getName() + ".png";
//Attempt to load the pre-render file if allowed
bool needsRegen = force;
if (!needsRegen){
try{
normals = TextureManager::getSingleton().load(fileName, "BinFolder", TEX_TYPE_2D, MIP_UNLIMITED);
}
catch (...){
needsRegen = true;
}
}
This code is, except from the filename and the texture pointer, totally similar to the original code from ImpostorTexture::renderTextures - only that the exception doesn't get caught.
Any ideas why this happens?