Page 1 of 1

From 3dsmax 2009 to Irrlicht/What is the best way?

Posted: Wed Mar 04, 2009 9:56 pm
by Alper_Bilgehan
Hi all,
As a team we are developing an incredibly funny 2d-3d mixed adventure game.
At this moment we are able to use 3dsmax 2009 for modeling but we have problems; the images here will be explaining:

What we have in 3dsmax:
Image
Using Panda .X exporter we get this:
Image
I've been searching through the forums for a long time.
The most popular solution to this was to use B3D exporter for Max 9, BUT that stuff doesnt support max 2009...
So we cant go B3D way... (At least for now)

Lightmapping/Dynamic Lighting/Texture Baking ... lots of confusing stuff...
What I need is a very "step-by-step how to" get your model from 3dsmax 2009 to your irrlicht game and keep it as good-looking as possible.

I've tried things like;
From 3dsmax 2009 -> Milkshape -> Irrlicht ... no satisfactory results achieved.
From 3dsmax 2009 -> IrrEdit -> Irrlicht ... no satisfactory results achieved. . . . . as far as combinations of methods i've tried

ANY HELP/SUGGESTION IS DEEPLY APPRECIATED

Posted: Wed Mar 04, 2009 10:33 pm
by hybrid
The only difference I can spot is that your model in Irrlicht isn't lit, or maybe that your normals are not properly exported.

Posted: Wed Mar 04, 2009 11:06 pm
by Steel Style
Agree with hybrid.
And you know, when you work in game it's recommended to work your model diffuse in 100% Self Illumination (see you 3ds material) then put it to 0 before export.

Posted: Thu Mar 05, 2009 12:11 am
by Acki
also it seems you're not using textures (only colors), but I think textures will make it look much better... ;)

Posted: Thu Mar 05, 2009 3:29 am
by Dorth

Posted: Thu Mar 05, 2009 9:04 am
by fmx
I use .X files through the Panda plugin to export out from Max09.

It looks to me like you are using 3DS files right now, which give messed up normals (or sometimes none at all) in irrlicht.
Has nobody actually pointed out this bug with the 3DS loader? Or is there a fix for this on the SVN or something?

IMO, the 3DS loader could also do with an upgrade to handle keyframes (another little irrlicht project on my plate I suppose, oh joy :roll:)

Posted: Thu Mar 05, 2009 10:16 am
by Alper_Bilgehan
Guess i need to clearify myself a little bit
1- I've given up exporting to .3ds files ... it's no use
2- I go file -> export selected -> export as .X file (works best)
3- Itseems that .X file has only 1 channel for the texture, which as you see doesnt include any information about light or materials.
4- I either have to shadowmap/lightmap this guy(probably via render to texture dialog) or I have to add an active light in the code and, have to set the models parameters to receive light and shadow (Like "Read only materials" checkbox does in IrrEdit)
5- Or I need to set the 3dsmax settings so that it really does a better job exporting the .X file
------------
If you ever loaded the dwarf.x to IrrEdit ... well that is what im trying to get from 3dsmax "A perfect model with perfectly aligned textures in a jpg or tga file whatever..."
------------
If anyone knows a flawless workflow please,, we are in need.

Posted: Thu Mar 05, 2009 11:41 am
by sudi
when your light is supposed to be at the same position relative to the character at all times then u probably can get good results using a shader.

Posted: Thu Mar 05, 2009 12:45 pm
by Strong99
b3d exports scene and materials but those have to match irrlicht in someway. DirectX format doesn't save those into the X file so you need to add those by hand into your application using irrlicht, could be done through a scene file like .irr or you can add it directly into the code.

For wrong texture alignment on your model use a different UVW mapping in 3dsmax

Posted: Thu Mar 05, 2009 4:54 pm
by Alper_Bilgehan
Thanks indeed; but that is the very part i'm stuck at...
You see, to get to this point as seen on the picture; all i did was to load the .x file inside the code (i.e. i didnt use the setmaterialtexture/gettexture function)

Now I know that I'm supposed to use the " Render to texture" dialog box to achieve a tga(or whatever) file and then use that file for setmaterial/gettexture function to dress up our little buddy correctly. But the problem is:
- I cant find the right configuration for "render to texture" dialog box that would give me the desired result.
There are many suggestions for max 9(previous version) but in max 2009 things are somewhat different and yet i cant figure out what exactly to do by myself.

And another weird problem is that when i load the .x file inside the code and run it, well, it works fine as seen in the picture. But when i try to load the same .x file inside IrrEdit, the model looks corrupt (it appears like the sub objects become independent and the disintagrates all over the place)
--------
So still needing suggestions...

Posted: Thu Mar 05, 2009 5:21 pm
by Strong99
no thats not what i meant.

If you asign a texture to a face or mesh you need to do a proper UV / UVW mapping.

The X file does support more textures but only one per face not per model.

Make sure you are using the newest irredit and some previous irrlicht versions had some problems with different X files

As seen on the screenshot you have some textures for the face?

Posted: Fri Mar 06, 2009 12:10 am
by Alper_Bilgehan
OK Everyone I solved the thingy..
First I had to use the Attach command in 3dsmax to attach everything to get one single object. I reset all the materials to their defaults, then i tried exporting:(you see, the problem was: i was selecting 12 individual polys and then i was trying to export via "export selected" option) By doing this, the jumbling in IrrEdit was solved and i got one nice pure gray but correct .x model.


And then coming back to 3dsmax, i textured and colored it up by adding SelectMesh modifier, and then selecting the parts of the body one at a time and adding a Material modifier again one at a time. Took some time yeah, but guess what, it correctly gave me what i exactly wanted. (so i didnt use any UVW mapper or unwrapper modifier)

Well once i got the model nicely textured and everything, the rest is to light up the scene in IrrEdit and voila!

Image

Now today's question is just because i'm a quicky:
- The one on the left comes from irr scene, the brighter one is directly imported via code and set emflighting True..
But it is a little too bright.. how do you think i make it like the one on the left??

Posted: Fri Mar 06, 2009 12:15 am
by BlindSide
Maybe the imported one is scaled? Try enabling the material flag NormalizeNormals.

Posted: Fri Mar 06, 2009 12:17 am
by hybrid
I'm not sure if the normals are automatically scaled by irrEdit. But you can definitely check which material settings in the irr file have changed from default and you can alter them on your mesh.

Posted: Fri Mar 06, 2009 12:44 am
by Alper_Bilgehan
jEES .. You guys are awesome, i did enable the normalize normals stuff and it works perfect. Thanks indeed.