Two textures

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
bdpdonp
Posts: 68
Joined: Sat Oct 10, 2009 6:35 am

Two textures

Post by bdpdonp »

I read the forums on this and I honestly did ot understand. Guess I am still a beginner after a few months.

I have two bitmaps to a 3ds file. The code I use loads the model fine, but only seems to work with one texture and I have 2 of them. So far, cannot figure out how.

Code: Select all

        playerModel = smgr->getMesh("Models\\warbird.ms3d");
        node = smgr->addMeshSceneNode(playerModel);
        if (node) {
                node->setMaterialFlag(video::EMF_LIGHTING, false);
                node->setMaterialTexture(0, driver->getTexture("Models\\warbird.bmp"));
        } 
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Re: Two textures

Post by Iyad »

set texture layer to 1 for the second texture.
or merge both textures in 1 image and recalculate UV for the model.
#include <Iyad.h>
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Two textures

Post by hybrid »

No, don't give too much on these tipps. For two textures you should have two materials in the mesh (or more). You have to get the materials and set the first texture of each to the proper textures. If your model does not have these textures, though, you might find only one meshbuffer. In that case you could use the second approach from Iyad. But since you'd have to rework your model anyway, it would be much better to assign two different materials in the mesh editor, and then use my first approach.
Post Reply