Page 1 of 1

Material and OgreQt

Posted: Wed Aug 21, 2013 5:11 pm
by Fabien
Hi all,

I'm using Ogre in a Qt application, based on this example http://www.ogre3d.org/tikiwiki/tiki-ind ... age=qtOgre
It works pretty well but I have some issues with the appearence of my meshes.

For instance, the "sibenik.mesh" provided in the samples, appears black. If load this mesh in a standard Ogre application (without Qt), the mesh looks fine with the good texture (see Figures)
ogre_standard.jpg
Sibenik mesh in Ogre
ogre_standard.jpg (136.34 KiB) Viewed 1116 times
ogre_qt.jpg
Sibenik mesh in Ogre Qt
ogre_qt.jpg (116.47 KiB) Viewed 1116 times
The problem seems to be related to the .material file. If I removed the line "ambient 0 0 0 1" in the file sibenik.material, some colors appears on the mesh. But it does not look as it should be.

Besides I have observed another issue with the transparency. In a Ogre application I can display a semi-transparent red cube with this material file.

Code: Select all


material Fabien/TransparencyRed
{
	technique
	{
		pass
		{
			ambient 0.4 0.1 0.1 0.3
			diffuse 1.0 0.4 0.4 0.3
			specular 1.0 1.0 1.0 1.0 64.0
			emissive 0.1 0.0 0.0 0.3
			scene_blend alpha_blend
			depth_write off
		}
	}
}
But this works with OgreQt only if I remove the line "scene_blend alpha_blend". Otherwise the cube is invisible.

I guess something is wrong in the initialization of OgreQt but I don't know why.

Re: Material and OgreQt

Posted: Wed Sep 18, 2013 10:28 pm
by fernandot
Try to set the locale before reading the .material...

setlocale(LC_ALL,"C");

Once I had a problem similar to that when my program was reading the numbers on .mateiral considering "," instead of "."