Help with 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
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

Help with lighting

Post by Chet »

The model on my terrain is much darker than the terrain and the smaller details don't cast shadows so it looks flat, what am I missing here in settings?

Code: Select all

smgr->setAmbientLight(video::SColorf(.3f,.3f,.4f,1.0f)); 
scene::ILightSceneNode* nodeLight = smgr->addLightSceneNode(0, core::vector3df(100, 100, 100),
      video::SColorf(1.0f,1.0f,1.0f,1.0f),
      20000.0f);
video::SLight light;   
light.Direction = core::vector3df(1000,100,1000);
light.Type = video::ELT_DIRECTIONAL;
light.AmbientColor = video::SColorf(0.3f,0.3f,0.4f,1);
light.SpecularColor= video::SColorf(0.4f,0.4f,0.5f,1);
light.DiffuseColor = video::SColorf(1.0f,1.0f,1.0f,1);
light.CastShadows = true;

scene::ISceneNode * temple = smgr->addMeshSceneNode(smgr->getMesh("E:/ALLNEW/Epothy/temple/000_mesh.x"));
             temple->setPosition(core::vector3df(512,26.5,512));
          //   temple->setScale(core::vector3df(20,20,20));
             temple->setMaterialFlag(video::EMF_LIGHTING, false);
             temple->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);        
Xarshi
Posts: 27
Joined: Sat Feb 28, 2009 6:15 pm

Post by Xarshi »

Well, for starts, you are disabling light on the temple scene node. The line temple->setMaterialFlag(video::EMF_LIGHTING, false); turns off all light. Perhaps your terrain has lighting enabled? Just a thought.
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

Post by Chet »

oh geeze, facepalm :P
Post Reply