Exporting models from 3Dstudio Max

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.
kiel814
Posts: 37
Joined: Mon May 23, 2011 4:30 pm

Exporting models from 3Dstudio Max

Post by kiel814 »

Hi, guys, I'm trying to create simple models with 3DS Max.
Since Irrlicht does not support .max files, I'm exporting them to .obj but when I do so, the model does not look as it used to in .max.

So I wanted to ask for your help on this issue.
Do you guys use 3DS max? Or maybe you recommend another soft...
Any tips for exporting???

I have little to no experience in modelling for games, so any tips you give please try to make them as dummy proof as posible.

Here are some screenshots of the .max file:
Image
Image
Image

And here is the .obj loaded with the MeshViewer tutorial:
(I removed the skybox on purpose)
Image
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

I don't see anything wrong with your model to be honest, but to answer your question, 3ds max and blender are commonly used for modelling, with blender being free and open source, but with a much steeper learning curve

Also, .max is a scene file format, not a mesh file format
Virror
Posts: 191
Joined: Mon May 02, 2011 3:15 pm

Post by Virror »

Radikalizm wrote:I don't see anything wrong with your model to be honest, but to answer your question, 3ds max and blender are commonly used for modelling, with blender being free and open source, but with a much steeper learning curve

Also, .max is a scene file format, not a mesh file format
Well, texture looks kind of crapish on some parts, but other than thats it looks as good as it can get i guess.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Radikalizm wrote:I don't see anything wrong with your model to be honest, but to answer your question, 3ds max and blender are commonly used for modelling, with blender being free and open source, but with a much steeper learning curve

Also, .max is a scene file format, not a mesh file format
I think he's missing the bump/specular or w/e map that is.
Working on game: Marrbles (Currently stopped).
kiel814
Posts: 37
Joined: Mon May 23, 2011 4:30 pm

Post by kiel814 »

Take a look at the textures on the vertical bars on the box, they definitely look different.
Also, the 3D effect on the ground, which is generated from the texture.

Maybe the problem is not exporting the model but creating it as a scene???

Is there a way to create textured meshes in a different way other than creating a .max and then exporting it to another format?
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

The texture looking different can be because of your mipmapping and/or texture filtering settings
I don't know if irrlicht automatically loads bump or parallax maps from obj materials (I assume you're using one of those), so that could be why your ground texture isn't showing correctly
kiel814
Posts: 37
Joined: Mon May 23, 2011 4:30 pm

Post by kiel814 »

How do I change the mipmapping/texture filtering settings?

I'm using a displacement map for the floor.
If it is not loaded automatically, how do I load it?
kiel814
Posts: 37
Joined: Mon May 23, 2011 4:30 pm

Post by kiel814 »

SO it seems that when I load the .obj, Irrlicht does not automatically loads any filters, that is:
- "Tilt" for the wooden textures of the vertical bars of the box.
- "Displacement" for the floor.

Any ideas how to do this?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Please upload the .mat file. Bump map is supported for .obj files, so the floor should load correctly. Don't know what tilt could mean, maybe it's a texture matrix?!
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

Looking at the screenshot, that is not a regular bump map, bump maps do not edit geometry, they only affect normals, and in this case the geometry is clearly affected
kiel814
Posts: 37
Joined: Mon May 23, 2011 4:30 pm

Post by kiel814 »

No, it is not a bump map.
It is a displacement map.

Regarding "tilt" it was actually a typing error. It is TILE ;)

Here's the material (.mtl)

Code: Select all

# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 23.05.2011 01:39:37

newmtl Metal
	Ns 9.999999
	Ni 1.500000
	d 1.000000
	Tr 0.000000
	Tf 1.000000 1.000000 1.000000 
	illum 2
	Ka 0.588235 0.588235 0.588235
	Kd 0.588235 0.588235 0.588235
	Ks 0.000000 0.000000 0.000000
	Ke 0.000000 0.000000 0.000000
	map_Ka maps\Map__1_Composite.tga
	map_Kd maps\Map__1_Composite.tga

newmtl Material__38
	Ns 10.000000
	Ni 1.500000
	d 1.000000
	Tr 0.000000
	Tf 1.000000 1.000000 1.000000 
	illum 2
	Ka 0.588000 0.588000 0.588000
	Kd 0.588000 0.588000 0.588000
	Ks 0.000000 0.000000 0.000000
	Ke 0.000000 0.000000 0.000000
	map_Ka -s 5.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga
	map_Kd -s 5.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga

newmtl Material__0
	Ns 10.000000
	Ni 1.500000
	d 1.000000
	Tr 0.000000
	Tf 1.000000 1.000000 1.000000 
	illum 2
	Ka 0.588000 0.588000 0.588000
	Kd 0.588000 0.588000 0.588000
	Ks 0.000000 0.000000 0.000000
	Ke 0.000000 0.000000 0.000000
	map_Ka maps\Caja_lateral_Madera.tga
	map_Kd maps\Caja_lateral_Madera.tga

newmtl Material__12
	Ns 10.000000
	Ni 1.500000
	d 1.000000
	Tr 0.000000
	Tf 1.000000 1.000000 1.000000 
	illum 2
	Ka 0.588000 0.588000 0.588000
	Kd 0.588000 0.588000 0.588000
	Ks 0.000000 0.000000 0.000000
	Ke 0.000000 0.000000 0.000000
	map_Ka -s 10.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga
	map_Kd -s 10.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga

newmtl Material__25
	Ns 10.000000
	Ni 1.500000
	d 1.000000
	Tr 0.000000
	Tf 1.000000 1.000000 1.000000 
	illum 2
	Ka 0.588000 0.588000 0.588000
	Kd 0.588000 0.588000 0.588000
	Ks 0.000000 0.000000 0.000000
	Ke 0.000000 0.000000 0.000000
	map_Ka -s 10.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga
	map_Kd -s 10.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga

newmtl Material__25_dupli
	Ns 10.000000
	Ni 1.500000
	d 1.000000
	Tr 0.000000
	Tf 1.000000 1.000000 1.000000 
	illum 2
	Ka 0.588000 0.588000 0.588000
	Kd 0.588000 0.588000 0.588000
	Ks 0.000000 0.000000 0.000000
	Ke 0.000000 0.000000 0.000000
	map_Ka -s 10.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga
	map_Kd -s 10.000000 1.000000 1.000000 maps\Caja_Tirante_Madera_Madera.tga
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, displacement mapping is probably not supported by .obj files, only bump mapping. But it's not exported in any way as far as I see. The texture distortion is probably due to the texture scale (-s 10) which seems awkward. Just to make sure, which texture is applied to the box, and is it the same on all parts of the box?
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Well, the model seems to be almost correctly exported, except for some issues, which are easy to solve.

Basically, whatever you export from 3DSMAX (it may be extended to other software as well):

-It should be either an editable mesh or editable poly without modifiers. You should collapse the stack of modifiers. At most, the only modifier supported is the skin modifier, for skinned objects.

-It should be a single object, as it will be loaded as a single object by the engine. For instance, the wheels and the body of a car should be 2 diferent exported objects.

-place the object, so its pivot is on the origin of coordinates. Again, to export a wheel correctly, it should have the origin of coordinates at the center.

-Use at most 2 channels of UVW mapping coordinates, and make sure that the exporter will write both correctly. For this is good that you understand how to use the unwrap uvw modifier. And for most models, use just one channel of mapping coordinates, The usage of 2 channels is more for the stage models.

-Vertex colors are supported by irrlicht, and they help a lot, learn how to use the vertex paint utilities.

-Use square textures with power of 2 resolutions, or at least, textures whose dimensions are power of 2. (1024x1024, 512x1024, 64x256...)

-Use the least material ID's posible, those translate almost directly into meshbuffers, you want to have the least meshbuffers posible.

-Skinned objects are supported, Use Skin instead of Physique, not that physique won't work, but the Skin modifier behaves closer to what Irrlicht does. And export just a single skinned mesh.

Irrlicht only supports displacemente mapping via geometry shaders, and those are only supported in Open GL,discard the modifier or collapse the mesh, and export the high resolution object.

And that more or less, sums up all the precautions you should take when exporting models from max or other packages.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

-As it had been said, displacement mapping modifier is not handled so if you want to have the same effect in Irrlicht either use bump mapping or convert your object to editPoly/editMesh in 3dsmax.
-Another thing that is making a difference between your Irrlicht render and 3dsmax one is that 3dsmax is using a light to lit the object (by default [no light] a light is added at the camera position in 3dsmax) so you might add a simple light at the cam position in Irrlicht too.
-To get same texture render in Irrlicht use UVWUnwrap modifier.
-And I'll finish by telling you animation is not supported by obj mesh format in case you were wondering :wink:
kiel814
Posts: 37
Joined: Mon May 23, 2011 4:30 pm

Post by kiel814 »

Great advice guys! Thanks a lot.
I'll try to bear it all in mind.

So... for those of you who ARE using 3dsmax:
What format do you use to export your scenes, models and animated models?
Post Reply