Light and shader issues

I have a few questions and issues I would like help with resolving…

  1. Spot lights shine through objects, they don’t cast shadows off of them, what did I do wrong?

  2. The spot lights create black lines on objects, how can I fix this?

  3. Anyway to optimize Lights?

  4. How to make a flashlight spot lamp, like with a smaller spot on the inside which looks like a flashlight?

  5. Best way to make a light flicker?

Thanks in advance!

To optimize lights, use sun and hemi lamps as much as possible, Whenever you can, bake the light, either for AO or with a full render.
To make a flashlight, the spot lamp works just fine parented to the camera. You can play around with the settings, (radius, energy distance, blend, etc.) as well as additional spot lamps. Whenever I create a flashlight, particularly for dark/horror scenes, I always use at least three spot lamps parented to the camera or flashlight object. One is at 180 degrees, one at 90, and one at 45. If you want even more detail, create one with about 25 degrees.
For flickering, use an Edit Object Actuator. With Add Object selected, set it to your light source (your light source should be in a hidden layer.) For your sensor, enable the true pulse option, and set it to whatever number you want. Also, set the number in the Actuator that will control how long the object is kept in the scene.
The Actuator number affects how long your flicker will be, while the Sensor number will affect how long the time between flicker will be.
For your spot light error, I honestly don’t know. Check your normals if you have backface culling de-selected.
The black lines around the object should be fixable by adding Anti Aliasing to your scene when in realtime. Note that AA only works in the standalone player.

I fixed the spot light issues. I can’t use area or sun for what I’m doing. I knew about making an action, but I thought there could be a different way. And last, thanks for the advice on the flashlight, I thought about doing it like that, but I thought it might cause lag.

Thank you!

First of all, make sure you are in GLSL game mode.
1.) They should cast shadows if buffer shadow is ticked.
2.) Obviously the shadows work, they create the black lines, you play with bias and bleed bias to tune them ( or use buffer shadows instead or hard ones)
3.) Bake, don’t use realtime shadows
4.) 3 spotlights for a flashtlight seems like a really long stretch … Position your spolight the way you like it, then parent it to the camera and tick slow parent with like 10 in the object tab. Then get a flashlight lighting something photo (like this http://i1245.photobucket.com/albums/gg592/Doc_Emmet/Flashlights/Beamshots/beamshot_4.png for example) and while selected the spotlight select texture tab and put it there. There you go, realistic flashlight!
5.) Animate lights color and energy settings

For flickering you can write a python script varying the intensity of the light randomly… It should create good result! You should search the forum for a “light flicker script” or something like that, since I am sure I found one here many moons ago. Can’t write one for you unfortunately at the moment.

You can always use a script, but I much prefer to simply use the logic editor.
As for the performance affected by the spot light, it really depends on how high you want the quality of the flashlight to be. More spot lamps will cause a further drop in framerate, but it’s most important to make the objects close to the camera the highest quality. And it’s called fps, not lag: lag is the time lost between connections of two or more computers. :wink:

How will that work with objects that move and obstruct the shadow when the game starts? Also It seems to mess everything up…