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.

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

Postby KevinLuo » Fri Nov 10, 2017 9:55 am

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

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

Postby CuteAlien » Fri Nov 10, 2017 11:04 am

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.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: 8363
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

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

Postby Arclamp » Fri Nov 10, 2017 10:53 pm

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...
Arclamp
 
Posts: 46
Joined: Thu Oct 10, 2013 7:45 pm

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

Postby KevinLuo » Sat Nov 11, 2017 7:38 am

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: 18
Joined: Sat Apr 15, 2017 6:08 am

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

Postby KevinLuo » Sat Nov 11, 2017 7:59 am

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

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

Postby CuteAlien » Sat Nov 11, 2017 11:32 am

About .mtl file - yes - the .obj loader does handle that automatically.
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: 8363
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

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

Postby Arclamp » Sun Nov 12, 2017 10:11 pm

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.
Arclamp
 
Posts: 46
Joined: Thu Oct 10, 2013 7:45 pm

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

Postby KevinLuo » Mon Nov 13, 2017 3:11 am

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

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

Postby Mel » Mon Nov 13, 2017 2:54 pm

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

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

Postby KevinLuo » Thu Nov 16, 2017 2:59 am

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

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

Postby mant » Thu Dec 07, 2017 9:17 am

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

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

Postby Mel » Thu Dec 07, 2017 11:49 pm

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

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

Postby mant » Sat Dec 09, 2017 5:52 pm

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: 55
Joined: Sun Jan 27, 2013 3:38 pm

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

Postby mant » Thu Dec 14, 2017 8:32 am

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


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest