Question about texture/normalmap

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
stash
Posts: 47
Joined: Wed Dec 12, 2007 11:28 am
Location: Brasil, SC

Question about texture/normalmap

Post by stash »

Hi all

sorry my bad english, but isn´t my first language.

I have a model (example: a house) with many textures.. these textures have a respective normalmap (other file).

Well, in irrlicht example 11 (pixerperlighting), shows how I can set a texture to the model and the normalmap.

How can I doing the same thing with many textures and many normalmaps ?? (I cann´t view that because the model have the reference to the texture and isn´t necessary to load the texture explicitely in source code). PS: my model is a .3ds file and my textyres are all jpg.

Thanks a lot.

Stash
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Question about texture/normalmap

Post by Mel »

Irrlicht, normally, when loads a model with many textures places them on separate materials, so you can access all the materials independently and change the textures on a per material basis. You have as much materials in a single scene node, at least, as diffuse textures in your model, and you can use the ISceneNode::getMaterial() method to access any of these materials and change their properties.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
stash
Posts: 47
Joined: Wed Dec 12, 2007 11:28 am
Location: Brasil, SC

Re: Question about texture/normalmap

Post by stash »

Tks Mel.

Well.. then I need to use the getMaterial for each texture, and then, I can create/apply/set him respective normalmap, right?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Question about texture/normalmap

Post by hybrid »

Yes, but you also have to convert the whole mesh to tangent mesh (as shown in the example). But of course only once, because it affects the whole mesh. 3ds loader also supports automatic normal map loading, but you need to use the correct material settings to have the proper results.
stash
Posts: 47
Joined: Wed Dec 12, 2007 11:28 am
Location: Brasil, SC

Re: Question about texture/normalmap

Post by stash »

tks hybrid.. now is work time..
Post Reply