per polygon lighting?

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
ryoma

per polygon lighting?

Post by ryoma »

My mesh model has no shade.
It looks like no lighting(all polygon's blightness is equal)

code is below.
IAnimatedMeshSceneNode* node;
node = g_sceneMng->addAnimatedMeshSceneNode(
g_sceneMng->getMesh(meshname.c_str()), NULL, id, pos);
node->setMaterialTexture(0, g_driver->getTexture(texname.c_str()));

g_sceneMng->addLightSceneNode(
0, core::vector3df(0,500,0), video::SColorf(0.8f, 0.75f, 0.65f), 600.0f);

Help me!
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

You need to add a shadow to the model or it won't show it. Look in the API under IAnimatedMeshSceneNode for the way to go.
Unarekin
Posts: 60
Joined: Thu Apr 22, 2004 11:02 pm

Post by Unarekin »

Add this somewhere in there:
node->setMaterialFlag(EMF_LIGHTING, true);
Post Reply