I have disabled dynamic lighting on my weapon because the change in brightness of it looks a bit dodgy. I used the following code to do so:
Code: Select all
weapon1->setMaterialFlag(video::EMF_LIGHTING, false);
Code: Select all
weapon1->setMaterialFlag(video::EMF_LIGHTING, false);
Code: Select all
//AmbientColor = the color of the ambient lighting of the node
//SpecularColor = the color of the specular lighting of the node (specular effects are light reflection and such things, like shininess i think)
//DiffuseColor = the color of the diffuse lighting of the node
//EmissiveColor = the color of the light which the node emits
//Shininess = how much the node shines/reflects .. of you use a very low shininess effect it looks a little like a bloom shader, could look very cool in some scenes
//turn dyn. lighting off/on
node->setMaterialFlag(EMF_LIGHTING, false);
//set the ambient color lower than the MAX (255,255,255,255), because otherwise no specular/diffuse effects are seen (taken from the irrlicht api documentation)
node->getMaterial(0).AmbientColor.set(alpha, red, green, blue);
//set the specular color
node->getMaterial(0).SpecularColor.set(alpha, red, green, blue);
//set the diffuse color
node->getMaterial(0).DiffuseColor.set(alpha, red, green, blue);
//set the emissive color
node->getMaterial(0).EmissiveColor.set(alpha, red, green, blue);
//set the shininess value of the node (0.0f = off, > 0.0f = on)
node->getMaterial(0).Shininess = 0.0f;