Texture files

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
Guest

Texture files

Post by Guest »

I have re-assembled in MilkShape 30 imported meshes to re-create a character.
Each mesh has its own texture file, so I have 30 tga files.
This is ok with MilkShape, where I can declare 30 materials and assign each one to the corresponding part of the body of my character : The result is perfect.
Now I try to import my character (ms3d file) in IrrLicht, and if I understand well, I can only use 1 tga file
[with setMaterialTexture(0, driver->getTexture("xxx.tga"));] and not 30 tga files.
How do I get rid of this problem :?:
(I would like to avoid retexturing everything manually)
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Unfortunately you can't. Irrlicht currently only supports 1 texture/mesh. To get around this you have to put all textures in one file, and use UV mapping to map them onto your mesh.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

But this is only true with .ms3d files.
.3Ds, .bsp, or in next version .x files support multiple textures, if this helps you. :)
Guest

Post by Guest »

Thank very much you for your two clear answers.
I try both solutions (ms3d with all textures in one file, and 3ds with my 30
original textures files) : Both solutions are ok.
However, I saw in both cases that the quality of rendering in IrrLicht is slightly below the quality of rendering in MilkShape : See pictures below.

Image

(I used DT_DIRECTX8 and setAmbientLight() at 1, 1, 1)

Did I miss something ?

Despite that,IrrLicht is a wonderfull product :D
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

seems that milkshape uses a light which comes from your direction. Add this into your scene in irrlicht, switch lighting on for the model, and it will look the same.
tstuefe
Posts: 40
Joined: Wed Jan 07, 2004 12:53 pm
Location: Heidelberg, Germany
Contact:

Post by tstuefe »

I don't really understand where the white lines come from in the irrlicht rendering of yuor model. Is it possible that the texture is not cleanly defined - i.e. does it show, when wrapped around the model, white borders?

I cannot imagine that the white lines are gaps inbetween the meshes, or are they?
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

actually the white lines seem to be in both, but the shading covers it up better in MS3d..

seems like your tris arent all sharing the same verts?
a screen cap is worth 0x100000 DWORDS
Guest

Post by Guest »

niko wrote:...Add this into your scene in irrlicht, switch lighting on for the model, and it will look the same.
You are right Nico, its much better now.
Here is the best that I could get.
Image
It stays a little bit dark, but if I keep some setAmbientLight, the details vanish, so I had to kill this AmbientLight completly and keep only addLightSceneNode().

Now the new problem I have to face is that if I add or remove a SceneNode (i.e. the floor below my character) that completly jeopardize the lighting of my character and I need new parameters for my function addLightSceneNode() to get a nice lighting again.
But those are probably standard problems for newbies :?

Yes Tstuefe, the white lines are sometime gaps inbetween the meshes (for the knees, for instance), while sometime it is due to my poor positionning of the texture (for the breast, for instance). I did not invest enough time to re-assemble my character and it is far from perfect. :)
Anyway, I believe that Keless is right : The shading covers up those imperfections in a better way in the MilkShake picture. :roll:
Post Reply