Material and OgreQt

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
Fabien
Gnoblar
Posts: 1
Joined: Wed Aug 21, 2013 4:51 pm

Material and OgreQt

Post by Fabien » Wed Aug 21, 2013 5:11 pm

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 1089 times
ogre_qt.jpg
Sibenik mesh in Ogre Qt
ogre_qt.jpg (116.47 KiB) Viewed 1089 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.
0 x

fernandot
Kobold
Posts: 29
Joined: Thu Jun 07, 2012 7:22 pm
Location: Brazil
Contact:

Re: Material and OgreQt

Post by fernandot » Wed Sep 18, 2013 10:28 pm

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 "."
0 x

Post Reply