Page 1 of 1

[fixed]Texture error in Ogre mesh loader in irrlicht 1.4.2

Posted: Thu Nov 13, 2008 8:30 am
by Zhu
When you load ogre mesh files into irrlicht 1.4.2, you will find that the textures are wrong. The reason is to confuse Index field and Source field in struct OgreVertexElement.

Fix method:
replace "if (geom.Elements.Index==geom.Buffers[j].BindIndex)" with "if (geom.Elements.Source==geom.Buffers[j].BindIndex)" in line 411, 429, 446, 481, 499 and 516 in the file "COgreMeshFileLoader.cpp".

Posted: Thu Nov 13, 2008 10:15 am
by rogerborg
Opened in the tracker.

Could you make some of your resources available, please, so that we can replicate the problem and validate the fix.

Posted: Fri Nov 14, 2008 5:05 am
by Zhu
You can test it with ninja.mesh from samples in Ogre SDK. This will replicate the bug in the function COgreMeshFileLoader::composeMeshBuffer.
Then you can find a mesh with multiple submesh. This will replicate the bug in the function COgreMeshFileLoader::composeMeshBufferLightMap.

Posted: Fri Nov 14, 2008 10:57 am
by rogerborg
I can and I could, if I had the Ogre SDK.

Can you help us to help you by just posting the meshes somewhere. Pretty please.

Posted: Fri Nov 14, 2008 11:47 am
by Kojack

Posted: Fri Nov 14, 2008 3:06 pm
by hybrid
Thanks for the ressources, that helped a lot. Current SVN/trunk (i.e. Irrlicht 1.5) has this fixed.

Problem with this fix

Posted: Tue Feb 17, 2009 2:49 pm
by z4rd0z
This fix seems a problem with some .mesh files. Please download the file "ember-media-0.5.5.tar.bz2" from http://www.worldforge.org/dev/eng/clients/ember. Unzip it in a directory.

With the 09.Meshviewer example, load the following mesh and then the associated texture:
shared/common/3d_objects/plants/trees/models/oak/oak_youngA.mesh,
shared/common/3d_objects/plants/trees/textures/oak/D.png

It works well with 1.4.2 SDK but it does not work anymore with 1.5. Texture coordinates seem to be broken.

I recompiled the 1.5 lib with the 1.4.2 COgreMeshFileLoader.cpp file, and it worked again.