Page 1 of 2

Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Fri Nov 10, 2017 9:55 am
by KevinLuo
The memory size of my .x model is only 6 Mbyte, but smgr->getMesh("1.x") almost costs 100 seconds.
Is this kind of ridiculous? Many games load mesh models that are above 20 Mbyte.

By the way, how to set textures to a tree model in the ".obj" format? I have a texture of the leaf and
a texture of the branch. When the tree mesh loaded, the count of its materials is one. It seems that I
load this tree as a whole object.

Do you have any tutorials on textures and models? According to the samples, all textures are just like
automatically loaded with the mesh.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Fri Nov 10, 2017 11:04 am
by CuteAlien
Yeah, 100 seconds is indeed strange. Maybe some crazy amount of animations in that 6MB or something? Just guessing - if you can send me the model I can run it through profiler here.

And obj format usually has it's textures defined in an .mtl file. If you only have one material I'd rather blame the exporter, it should split different materials into groups.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Fri Nov 10, 2017 10:53 pm
by Arclamp
I've tested with 70mb files without issue.

One thing I can say is, not all Direct X exporters are written equal! (e.g. Blender, 2.7 exports static ok-ish, but need 2.49 for .x anims)

Second, what export options have you got selected, you don't want all the instances, modifiers, custom, etc... but do select triangulate faces!

Did you make / export this file or get it from somewhere? There's a txt version of the format, so who knows what might be in there...

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Sat Nov 11, 2017 7:38 am
by KevinLuo
CuteAlien wrote:Yeah, 100 seconds is indeed strange. Maybe some crazy amount of animations in that 6MB or something? Just guessing - if you can send me the model I can run it through profiler here.

And obj format usually has it's textures defined in an .mtl file. If you only have one material I'd rather blame the exporter, it should split different materials into groups.
The original format of my model is .max, and I translated it into the .x format by C4D. The C4D may not support the .x format well.
By the way, I don't find any API to load the .mtl file, is the .mtl file loaded automatically with the .obj file?

Thanks for your reply and patience!

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Sat Nov 11, 2017 7:59 am
by KevinLuo
Arclamp wrote:I've tested with 70mb files without issue.

One thing I can say is, not all Direct X exporters are written equal! (e.g. Blender, 2.7 exports static ok-ish, but need 2.49 for .x anims)

Second, what export options have you got selected, you don't want all the instances, modifiers, custom, etc... but do select triangulate faces!

Did you make / export this file or get it from somewhere? There's a txt version of the format, so who knows what might be in there...
Thanks for your reply! While I was loading a 27mb model file, I was warned that the total vertices count is above 65535. After nearly 25 minutes,
the model was successfully loaded but only some parts of the model showed up.
First of all, I transformed the .max file into a .obj file in 3dmax. Secondly, I imported the .obj file in C4D and created the materials for its branches
and leaves. Lastly, I exported the whole model as a .x file. I was not quite familiar with the C4D, so I selected all the options when exported the file,
like export texture, save the normal vectors, generate the mesh and so on. May I ask what's the DirectX exporter u used?

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Sat Nov 11, 2017 11:32 am
by CuteAlien
About .mtl file - yes - the .obj loader does handle that automatically.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Sun Nov 12, 2017 10:11 pm
by Arclamp
I've been using the b3d exporter addon for Blender instead of struggling with x files nowadays.

Also made use of MakeHuman and found some motion capture animations, its these which have gotten large.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Mon Nov 13, 2017 3:11 am
by KevinLuo
Arclamp wrote:I've been using the b3d exporter addon for Blender instead of struggling with x files nowadays.

Also made use of MakeHuman and found some motion capture animations, its these which have gotten large.
Thanks for your share!

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Mon Nov 13, 2017 2:54 pm
by Mel
Definitely look for a good X exporter for 3DSMAX, there are some very good, The best is KWExport, i hope there is still version for it, but messes the timing with Irrlicht, and saves the time in 3DSMAX tick format: 1 second of animation is composed of 4000 ticks, so the frames are expressed in ticks, which translates into 4000fps. Anyway, 6mb file is something big, unless you're saving it in text format.

Also, Irrlicht should handle the skinning in the COLLADA loader, so there is a format that supports skinning and it's not completely outdated like B3D or X. Too bad the FBX is proprietary,

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Thu Nov 16, 2017 2:59 am
by KevinLuo
Mel wrote:Definitely look for a good X exporter for 3DSMAX, there are some very good, The best is KWExport, i hope there is still version for it, but messes the timing with Irrlicht, and saves the time in 3DSMAX tick format: 1 second of animation is composed of 4000 ticks, so the frames are expressed in ticks, which translates into 4000fps. Anyway, 6mb file is something big, unless you're saving it in text format.

Also, Irrlicht should handle the skinning in the COLLADA loader, so there is a format that supports skinning and it's not completely outdated like B3D or X. Too bad the FBX is proprietary,
Thanks for your generous share!

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Thu Dec 07, 2017 9:17 am
by mant
Blender export .X files in text format. Any solution for converting it to binary so loading will be faster?
Irrlicht supports loading .X in binary.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Thu Dec 07, 2017 11:49 pm
by Mel
As far as Irrlicht is concerned, create your own binary format, and convert that X file into your own. Other than that, ask the programmer of the blender exporter to write binary DirectX files.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Sat Dec 09, 2017 5:52 pm
by mant
I'm finding tools to convert .x files from text format to binary, they have meshconvert and dxops in DXSDK. I will report some results here.
Update: MeshConvert.exe from DirectX SDK Utilities (June 2010 version) works. By using binary mesh format, a scene of in my engine cut off 50% loading time and size on disk reduced from 69Mb to 29Mb.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Thu Dec 14, 2017 8:32 am
by mant
Warning: MeshConvert.exe discards either the armature/animations/skin weights or all of those. My guess is that it only convert the mesh.
Animation is not working with binary .x files converted from text my DX SDK's MeshConvert.

Re: Loading a 6 Mbyte ".x" model costs 100 seconds?

Posted: Wed Jan 31, 2018 6:12 pm
by devsh
Mel wrote:As far as Irrlicht is concerned, create your own binary format, and convert that X file into your own. Other than that, ask the programmer of the blender exporter to write binary DirectX files.
Exactly what I'm getting done now :D