Help needed about exporting from 3DS max to Irrlicht

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.
Post Reply
craigyuyu
Posts: 5
Joined: Thu Mar 21, 2013 5:56 pm

Help needed about exporting from 3DS max to Irrlicht

Post by craigyuyu »

Hi, I just started to use Irrlicht. Everything is good except for export/importing 3D models. I really appreciate if anyone can provide some hints.

I am using 3Ds max 2013 for modeling my models. I save them in .3ds format and they can be loaded into Irrlicht successfully. However, there's a problem with .3ds file loaded in Irrlicht, in that gouraud shading is not working. It will only use flat shading even I set Gouraudshading to ON. So I will end up having some bad, faceted rendering like this:
http://irrlicht.sourceforge.net/forum/v ... =1&t=39767 (this guy reported similar problem)

My model pic (no gouraud shading):
https://www.dropbox.com/s/kpt0oub6tymae ... arison.png


As suggested, I switch to exporting .obj format from 3ds max instead. Now the Gouraudshading is working. However, irrlicht can only load in the mesh, but not the textures. So the loaded model is grey (though i see it's shaded smoothly).

The strange thing is:
1) I export my model in 3ds max to .obj file,
2) I import the exported .obj file into 3ds max again, everything works fine. Texture is correctly mapped.
3) However, if I import the same .obj file in Irrlicht, texture is missing

Here's the file 3ds max file (very simple, with just 1 texture) with the exported .obj (and .mtl) I am testing with. I'd be very thankful if someone could help with a simple test.
https://www.dropbox.com/s/pj6eqk704yzpp ... upload.zip


Does anyone here use 3ds max for modeling, and successfully get the models exported and properly imported to irrlicht? (this sounds quite a standard production pipeline to me :) ) If so, could you share with me how you do it?
It seems to me the 3Ds max .obj exporter cannot export properly for Irrlicht. I tried .dae also, no luck too :(

I'm testing the import using Example 9: meshviewer, so I think the problem is not with my code.

My ultimate goal is to export model from 3ds max to any format possible, s.t. it can be loaded in Irrlicht with nice rendering. It's even ok to stick with .3ds format, if I can enable Gouraudshading properly s.t. there's no faceted rendering.

Any help greatly appreciated. Thanks a lot.
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Help needed about exporting from 3DS max to Irrlicht

Post by Mel »

The output console of the example 9 should tell you of the textures it can't load. Also, use only standard materials to make sure they get correctly exported. I use 3DSMAX, and it works very well for me.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
craigyuyu
Posts: 5
Joined: Thu Mar 21, 2013 5:56 pm

Re: Help needed about exporting from 3DS max to Irrlicht

Post by craigyuyu »

Thanks a lot, Mel. You hint is a very good way to debug. I find that, for some reason, the texture (absolte) paths messed up and irrlicht cannot load the textures. Now I change to use relative path and the texture loading works!

Hey, as you're also using 3Ds Max for modeling, may I know what OBJ Export options you usually use for the .obj exporter?

Now I just use the default parameters with "Preset = <NONE>". However, I see that I can change the preset to "Maya" / "Blender" and many others...etc.. Do you have a general preference over these when you're exporting .obj for Irrlicht to import?

Thanks again for your kind sharing.

As I was searching around, I remember once you made a reply with a "list of reminders" for exporting from 3Ds Max... too bad that I forgot where the post is... :( Anyway, great thanks!
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Help needed about exporting from 3DS max to Irrlicht

Post by Mel »

Normally i use a preset that swaps the Y and Z axes, like the Lightwave one, it works very well. Something you may have noticed is that MAX uses as the Up axis the Z vector, while Irrlicht, and most of the 3D programs use as the Up axis the Y vector, hence the need to swap those vectors in the export process.

The OBJ is very flexible, although it only allows for 1 channel of texture coordinates.

While exporting and in general, while working for real time rendering, the rule of thumb uses to be the least the better, the least materials posible, the least triangles posible, the least textures posible, the least resolution posible for textures. But with the current hardware, on PC, anyway, it is posible to have thousands of triangles, and huge textures, and no body complains, but it is still preferable to have as few materials as posible (those translate later into diferent draw calls, and we want these to a minimum) and as few textures as posible per material, as the texture reads stall the rendering pipeline a bit each time a texture is read, hence the need. Ok?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
craigyuyu
Posts: 5
Joined: Thu Mar 21, 2013 5:56 pm

Re: Help needed about exporting from 3DS max to Irrlicht

Post by craigyuyu »

Thanks a lot for sharing your experience, Mel. This all makes good sense to me.
Post Reply