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.
Lighting Problems
Re: Lighting Problems
Try searching for "opengl glsl lighthouse" or something similar.
Re: Lighting Problems
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
i realized the light becomes very very faint if i set CastShadows to false, doesnt matter if its per pixel lighting or not