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

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

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

Post 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.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

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

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

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

Post 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...
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

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

Post 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!
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

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

Post 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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

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

Post by CuteAlien »

About .mtl file - yes - the .obj loader does handle that automatically.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

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

Post 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.
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

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

Post 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!
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

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

Post 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,
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

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

Post 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!
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

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

Post 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.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

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

Post 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.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

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

Post 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.
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

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

Post 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.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

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

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