Lighting issues

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
Blynx
Posts: 16
Joined: Sat Apr 12, 2008 8:41 am

Lighting issues

Post by Blynx »

I tried to create lighting, it lights the whole room with a faded colour. I don't want it that strong. I wanted it to go to a small radius. It doesn't thought.

The code I use is:
ILightSceneNode* light1 = smgr->addLightSceneNode( 0, core::vector3df(0,100,-200), video::SColorf(0.1f,0.0f,0.0f), 0.2f, 0 );

I use OPENGL since DX commands crash my application.

Any help is greatly appreciated.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

It could be attenuation, but also he should consider how the polygons are structured in what he is trying to light.
TheQuestion = 2B || !2B
Blynx
Posts: 16
Joined: Sat Apr 12, 2008 8:41 am

Post by Blynx »

Halifax wrote:It could be attenuation, but also he should consider how the polygons are structured in what he is trying to light.
How do I change attenuation?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Try looking through the API documentation.
TheQuestion = 2B || !2B
Blynx
Posts: 16
Joined: Sat Apr 12, 2008 8:41 am

Post by Blynx »

Halifax wrote:Try looking through the API documentation.
I can't find it.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

lightnode->getLightData().Attenuation.set(0,1.f/radius,0);
Blynx
Posts: 16
Joined: Sat Apr 12, 2008 8:41 am

Post by Blynx »

Thanks Hybrid, that got it working.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess I'll change back to the original Irrlicht settings. Since we can now change the attenuation afterwards, there's no loss of possibilities as it was with previous versions. But the lack of radius support under OpenGL makes the initial lights setup pretty hard now.
Post Reply