Mesh loading bug (Solved)

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.

Mesh loading bug (Solved)

Postby The_Glitch » Fri Dec 02, 2016 8:39 pm

Bare with me here: I was using 3ds max 2012 and had to upgrade to 3ds max 2015 "license expired". I used the .x format I use a new exporter since pandasoft .X exporter does not work on 3ds max 2015. The new one is : http://www.cgdev.net/axe/download.php#xexporter
I've test this on the same mesh. The problem is if I load my mesh static or animated in the trunk version of irrlicht everything loads fine. But if I load these same models in ShaderPipeline which I've been using the program crashes. At first I thought it was my new .X exporter but the same models I exported work in the trunk version just fine but fail in ShaderPipeline.

The console output on shaderpipeline says the time to load the .X model is 66765ms!!

I use this character model all the time.

If I try to load a static mesh "level environment" after a few minutes of trying to load the mesh the application triggers a break point.

cpp Code: Select all
 
//! Direct access operator
    T& operator [](u32 index)
    {
        _IRR_DEBUG_BREAK_IF(index>=used) // access violation
 
        return data[index];
    }
 
Last edited by The_Glitch on Sat Dec 03, 2016 6:45 pm, edited 1 time in total.
User avatar
The_Glitch
Competition winner
 
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Mesh loading bug

Postby CuteAlien » Sat Dec 03, 2016 12:28 pm

Sorry, I'm still not familiar with the shader pipeline, so not sure if they changed anything there. Or maybe shader pipeline is still missing some fixes which are in trunk (in that case the model would also fail when loaded with Irrlicht 1.8). 2 patches that probbably matter are r5102 and r5169.
IRC: #irrlicht on irc.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8533
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Mesh loading bug

Postby The_Glitch » Sat Dec 03, 2016 4:13 pm

I figured this was a Nadro issue.

Funny thing is the Author that made the plugin for 3ds max had Irrlicht users in mind in the documentation. So I'm not sure what the problem is.
User avatar
The_Glitch
Competition winner
 
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Mesh loading bug

Postby The_Glitch » Sat Dec 03, 2016 6:45 pm

After further testing I found this on the authors website about the irrlicht bug.


Tips
•Skin or Physique modifier should be the last in modifier stack. For example, if you use Skin and TurboSmooth, MeshSmooth or ProOptimizer modifier then you should drag these modifiers under the Skin modifier.
•For keyframes, ensure you have a keyframe every 90 degrees or less of rotation.
•Bone Affect Limit is set to 20 by default in Skin modifier. You may change it if your engine supports 4 bones maximum per vertex. If you use physique modifier, on the Physique --> Reinitialize --> Vertex-Link Assignment rollout the default number of links is set to N Links, you can change it to 2, 3, or 4, depending on your choice. Choose one of these options if your game engine support of blending is limited.
•MeshNormals and MeshTextureCoords are replaced by DeclData which can hold more per-vertex information: Normal, Tangent, Binormal, VertexColor, UV sets( TexCoord0 ~ TexCoord10 ). If your loader cannot parse DeclData correctly you can uncheck the option "Vertex Elements in DeclData" then the exporter will use old templates to hold Normal, UV set etc. For further details about templates please refer to X File Templates or the DirectX File Format Specification
•Shaders will be exported in fx files and use SAS( Standard Annotations and Semantics ) which is convenient to preview in DxViewer, you can delete it or replace it with your own shader.

Load X files with 3d engines

Irrlicht is an open source cross-platform graphics engine which enable X files to be used in both DirectX and OpenGL applications. This engine provides a class CXMeshFileLoader to load X files without D3DX. It supports text and binary X file format from version 1.1, normals and texcoords in DeclData from version 1.5 but up to version 1.8.4 the loader has a bug on parsing DeclData which may cause engine failed to load a binary X file.
My solution is open CXMeshFileLoader.cpp and insert readHeadOfDataObject() at the beginning of the if block in CXMeshFileLoader::parseDataObjectMesh

if (objectName == "DeclData")
{
if (!readHeadOfDataObject()) //Add this
return false;
...
}






I saw this fixed in the latest trunk version so I copied over that code to my file in shader pipeline version and things seem okay now. "Hopefully"
User avatar
The_Glitch
Competition winner
 
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 1 guest