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

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Zhu
Posts: 3
Joined: Thu Nov 13, 2008 8:21 am

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

Post 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".
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Zhu
Posts: 3
Joined: Thu Nov 13, 2008 8:21 am

Post 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.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Thanks for the ressources, that helped a lot. Current SVN/trunk (i.e. Irrlicht 1.5) has this fixed.
z4rd0z
Posts: 11
Joined: Sat Jan 12, 2008 9:11 am

Problem with this fix

Post 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.
Post Reply