Directional Lights problem?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
cfoks
Posts: 6
Joined: Fri Jul 27, 2007 7:49 pm

Directional Lights problem?

Post by cfoks »

How can I use directioal lights on irrlicht or are there directional lights?
I look at the forums but I can't get any good solution....
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Code: Select all

scene::ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(0,0,0), video::SColorf(255, 255, 255, 255), 1000.0f);
video::SLight ldata = light->getLightData();
ldata.Type = video::ELT_DIRECTIONAL;
ldata.Position = core::vector3df(-10,5,-5);
light->setLightData(ldata);
cfoks
Posts: 6
Joined: Fri Jul 27, 2007 7:49 pm

Post by cfoks »

I try but I cannot see anything. hmmmmm. thinking......
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

is lighting material flag of your scene nodes turned to true?
cfoks
Posts: 6
Joined: Fri Jul 27, 2007 7:49 pm

Post by cfoks »

hmmm...I enabled it to true but I got debug error....I disabled it to false and I closed the all lights and I got different result but it is not directional light because it lights all the face of objects in current scene...I think irrlicht does not have directional light like cone ...

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

Post by hybrid »

You mean spot light, not directional light. Directional light is like sunlight from a light source infinitely far away. And no, no spot lights yet.
cfoks
Posts: 6
Joined: Fri Jul 27, 2007 7:49 pm

Post by cfoks »

hmmm....OK. Then,I will try to find different solution to get spot light... continue to thinking.......
Post Reply