Help with setMaterialTexture

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
lobo-tuerto
Posts: 8
Joined: Sat Apr 12, 2008 4:14 pm

Help with setMaterialTexture

Post by lobo-tuerto »

Hello guys,


I would like some pointers about how setMaterialTexture works. I'm trying to assign two textures to a model.

The first texture is the naked body in layer 0, and the second texture are the clothes in layer 1 (same size as body but with alpha channel so some parts of the body can be seen through).

Code: Select all

    node->setMaterialTexture(0, driver->getTexture("body.tga"));
    node->setMaterialTexture(1, driver->getTexture("clothes.tga"));
But it isn't working, what's the correct way to do it?
Blog: Lobo tuerto
En tierrra de ciegos, el tuerto es rey.
piiichan
Posts: 59
Joined: Thu May 01, 2008 1:20 am
Location: New Caledonia (France - Pacific)
Contact:

Post by piiichan »

Have a look at the setMaterialType method here
=>http://irrlicht.sourceforge.net/docu/cl ... e.html#a41

You have a list of all types of materials available to you here
=> http://irrlicht.sourceforge.net/docu/na ... .html#a157

It looks like none of them can suit your needs, but I'm a noob, so play around with it....
lobo-tuerto
Posts: 8
Joined: Sat Apr 12, 2008 4:14 pm

Post by lobo-tuerto »

Yeah I have looked at those, that's why I'm asking about it in this beginner's forum. :)
Blog: Lobo tuerto
En tierrra de ciegos, el tuerto es rey.
piiichan
Posts: 59
Joined: Thu May 01, 2008 1:20 am
Location: New Caledonia (France - Pacific)
Contact:

Post by piiichan »

I tried all different material types, putting the textures into different texture layers and also into different materials .... without success :(

If somebody comes with a solution, I would also be interested to learn how to put a texture onto another
lobo-tuerto
Posts: 8
Joined: Sat Apr 12, 2008 4:14 pm

Post by lobo-tuerto »

Hmmm.... reading about other topics I heard about a render to texture feature, but I would like to know if that's the only method to achieve this.

So basically everytime your char changes clothes or "armor" you would have to render to texture then apply that texture to your model, right?
Blog: Lobo tuerto
En tierrra de ciegos, el tuerto es rey.
Post Reply