[solved]Ogre3dRenderer problem
Posted: Wed Jul 23, 2008 22:29
Hi every one,
I was trying to create my own CEGUI skin. I followed the basic tutorials, and successfully created my two first good looking widgets
( it's a matter of taste I know). I tested them with CELayoutEditor and played around with properties ( the skinning system is really amazing and coupled with the layout support could save a lot of time).
Any way I decided to test my widgets in a real life application and modified the layout of the "demo_GUI" application shipped with Ogre, and I was disappointed
. The widgets looked perfect in CELayoutEditor but that wasn't the same result in Ogre. I decided to dive into the OgreRenderer code (retrieved from CVS). I analyzed the problem and these are my conclusion ( you can call me Sherlock Holms if you like
)
OgreRenderer wraps the CEGUI::Image class around an Ogre::Texture object. This is a clean approach since this use all the management features of ogre. But Ogre also make some modifications to texture files when loading the file, actually for harware requirement texture must have metrics according with powers of two (512, 256, 16 and so on). Since all the CEGUI side relies on coordinates described in the imageset files (real coordinates), and the Ogre side uses the stretched textures, all coordinates are corrupted ( the coordinate (15,16) would not necessery be the same in the loaded texture). This causes unexpected results.
I repeat again the problem is in the OgreRenderer module, neither Ogre nor CEGUI. The problem is in texture scaling, so as soon as you use normalized image sizes (512x512, 256x512, 16x16, powers of 2
) all work just fine.
I will post this in the Ogre forum also.
Hop this will help.
I was trying to create my own CEGUI skin. I followed the basic tutorials, and successfully created my two first good looking widgets

Any way I decided to test my widgets in a real life application and modified the layout of the "demo_GUI" application shipped with Ogre, and I was disappointed


OgreRenderer wraps the CEGUI::Image class around an Ogre::Texture object. This is a clean approach since this use all the management features of ogre. But Ogre also make some modifications to texture files when loading the file, actually for harware requirement texture must have metrics according with powers of two (512, 256, 16 and so on). Since all the CEGUI side relies on coordinates described in the imageset files (real coordinates), and the Ogre side uses the stretched textures, all coordinates are corrupted ( the coordinate (15,16) would not necessery be the same in the loaded texture). This causes unexpected results.
I repeat again the problem is in the OgreRenderer module, neither Ogre nor CEGUI. The problem is in texture scaling, so as soon as you use normalized image sizes (512x512, 256x512, 16x16, powers of 2

I will post this in the Ogre forum also.
Hop this will help.