Mesh with Lightmap texture and normal 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
Scripter
Posts: 6
Joined: Mon Dec 17, 2007 3:20 pm

Mesh with Lightmap texture and normal texture

Post by Scripter »

Im trying to use a lightmap texture in combine with a normal texture for my project. Ive tried alot of different ways

Code: Select all

//load Mesh
scene::IAnimatedMesh* MechWarrior = smgr->getMesh("mech-01_no-vert.X");
node = smgr->addAnimatedMeshSceneNode(MechWarrior);

//load texture in different layer
node->setMaterialTexture(1, driver->getTexture("mech-1-01.jpg"));
node->setMaterialTexture(0, driver->getTexture("mech-1-illum.jpg"));
//set material flag and ive tried them all
node->setMaterialType(video::EMT_LIGHTMAP);

I want the lightmap texture and normal texture to blend and to be affected by dynamic lighting.
Anyone have a solution or know of anything i could test?

Thx
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The problem might be that you don't have a second set of texture coords. Lightmaps do require it, otherwise only fragments of the maps are shown. Since you seem to use an animated mesh it's pretty much impossible to add those coords manually. So you have to use a file format which supports lightmaps directly, such as b3d. You'll also have to export the second texture set from your 3d modeller.
However, using lightmaps with animated meshes seems to be wrong somehow...
Post Reply