Lighting Problems

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
Cyanotype
Posts: 9
Joined: Sat Feb 08, 2014 3:51 am

Lighting Problems

Post by Cyanotype »

Hello,
I'm trying to create a round light similar to this: http://i.imgur.com/cFe13.jpg or this: http://www.sc2mapster.com/media/images/ ... thanks.jpg.
Basically I want an area in a circle completely lit with a very slight soft edge. Also it should be evenly lit no matter where u stand on the map.

I have been trying around, heres my code:
smgr->setAmbientLight(SColorf(0.3f,0.3f,0.3f));
ILightSceneNode* light= smgr->addLightSceneNode();
SLight lightdata = light->getLightData();
lightdata.AmbientColor = SColorf(255,255,255);
lightdata.CastShadows = false;
lightdata.Type = ELT_POINT;
lightdata.Attenuation = vector3df(0, 50, 0);
light->setLightData(lightdata);
light->setRadius(125);
light->setPosition(core::vector3df(1200, 65, -1200));

And screens here:
http://i.imgur.com/A9HbWjy.png

As you might have guessed by now the goal is a fog of war effect.
Now the problem is the light is extremely faint and you can't even make out an edge at all. :S
And in some areas (right screen) there is no light at all! (seems it only lights areas with many triangles?)
I have set the material type to EMT_NORMAL_MAP_SOLID so I thought it should light per pixel and dont care about triangles.
As you can see I don't exactly know where I should look for the problem.
Another thing that might be associated with the problem: Weirdly if I set the Ambient light to SColorf(1.f,1.f,1.f) the map isn't completely lit and still dimmed~

Sorry if I did an obvious mistake I'm still very new to this.

Edit: Okay it seems that if I use a normal map ambient light doesnt work and the whole map seems darker so I made another try without it all:
http://i.imgur.com/LBWFFhy.png
Now colorwise it looks pretty good but the shape is ridiculous. Any way that I can make a simple round light?

Edit2: After some asking and googling it seems that I need to write shader, if anyone knows a good guide feel free to point me to it.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Lighting Problems

Post by mongoose7 »

Try searching for "opengl glsl lighthouse" or something similar.
Cyanotype
Posts: 9
Joined: Sat Feb 08, 2014 3:51 am

Re: Lighting Problems

Post by Cyanotype »

anyone knows a solution to the faint light problem?
i realized the light becomes very very faint if i set CastShadows to false, doesnt matter if its per pixel lighting or not
Post Reply