the best way of loading a model and its texture

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
yuko
Posts: 6
Joined: Mon Apr 03, 2006 4:54 pm

the best way of loading a model and its texture

Post by yuko »

Hi

I have one problem about meshes and its textures.
What is in your opinion the best way to load a model in irrlicht??
I have tried several options but, each of them have its limitations:

1) Design the mesh in Milkshape, load .ms3d in irrlicht and apply the texture. Then the limitation is that if the model is complex is very difficult to apply the texture from irrlicht (how texture a multitextured model...??).

2) Design the model with a 3D modeling tool and apply the texture with a tool like UV Mapper, which simplifies this problem. Then I export the textured model to .3ds to load that file from Irrlicht. Then I can load the textured model, but this texture has not lightining properties!!! The result is poor.

My question is "is there a way to texture a model with a external application, load the textured model into irrlicht and its textured is affected by light?

I would appreciate any advice!
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

Code: Select all

Then I can load the textured model, but this texture has not lightining properties!!! The result is poor
if u find this insuficient then there is AFAIK unfortunately nothing to do
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
hybrid

Post by hybrid »

I think you should just enable lighting for your models. Then most of the models supported by Irrlicht will use their own texture settings and have lighting effects on them. Check out the tutorials/examples.
luckymutt
Posts: 453
Joined: Sun Mar 06, 2005 11:56 pm
Location: C-Ville

Post by luckymutt »

It is not difficult.
Do a search for lightmapping or texture baking. That will allow you to keep your lighting information on textures.
Join us in the Irrlicht chatroom:
[url]irc://irc.freenode.net/irrlicht[/url]

I love deadlines. I like the whooshing sound they make as they fly by. -D.Adams
yuko
Posts: 6
Joined: Mon Apr 03, 2006 4:54 pm

Post by yuko »

Thanks for the answers.
I have tried to enble lighting of 3ds model and It doesn´t work.

I have searched in forum and I haven't find a free alternative with good results. Maybe the best way is model with Wings3D, export to .obj and applying the texture from Irrlicht...?

Another question: lightmaps are so important?

If someone could recommend me a free solution I would be very grateful.

Apologies for my poor English.
hybrid

Post by hybrid »

Ok, so you really want to simply have dynamic lights with effect on 3ds textures? This is working out of the box with Irrlicht. You have to do a 'getMesh' for the 3ds file which provides you with the mesh as well as with the textures (if there are textures defined and properly mapped). Then enable lighting and add a dynamic light (or disable lighting to see the textures even without a light) and it will work -- in most of the cases. Could you send the console output and a screenshot of your current situation?
I am currently fixing the 3ds loader so your file could help to improve Irrlicht if it really does not work.
hybrid

Post by hybrid »

So I have found at least one 3ds model which does not display correctly, although it should do. It is pretextured with all textures correctly set up. The textures are loaded (after some more fixes I will post shortly) but they simply don't show up. The car is just black (only the interior is colored after applying my patches, because the use vertex colors). Adding lights does not change anything, also exchanging the textures does not help. I'm lost.
If someone else wants to try the link is http://www.marlinstudios.com/files/traf ... icfree.zip (I'm not affiliated with this company, I just found it on 3dcafe). I have tested the model with 3ds viewers and they show the model correctly textured, so tex-coords are good. Any hints? Can it be my gfx card (although there are no special effects, and I also tried to scale the textures to 512x512)
Note that with plain Irrlicht and also after applying my current patches the textures are misnamed (due to simply overwriting the texture names while loading the model) so you might have to rename them.
Post Reply