Regarding GLSL shadows and lights

Hey everyone,

I’ve come to a road block figuring out GLSL shadows.

My first question: Are spot lights the only lights that can cast shadows in real-time? I’d really like to be able to find a way to make something like a sunlight casting shadows because outdoors shadows do not diverge like spot light shadows do.

My second question: How do I increase the distance a spot light will cast shadows? I would think it would be the “dist” property as that makes the spot light effect farther out, but the shadows stop casting at a certain distance no matter what i set any of the parameters to it seems. It’s true I could scale everything in my scene down but thats kind of a nuisance if your game movement speeds are already set (it would make everything appear to move in turbo speed in relation to the now smaller environment.)

Thankyou so much in advance to anyone who can help me.

Hello
yes, spotlights are the only “Lamp types” that cast “real-time” shadows!
You should use “spot/shadows” for your main character only ( near/parented to it), with “layer” activated ( only affect objects in the same layer)…
but, I’m the “unpleasant/old fashion” person here I guess?!
Bye

ah i see. What about the diverging shadows issue? Is there any way to get the shadows parallel as a sun would cast them?

Unfortunately not in the BGE at the moment, no- I really wish we could either get parallel buffer shadows or, more preferred, stencil shadow support for all lamp types (I think buffer shadow for all lamp types isn’t really doable?)
…Unfortunately work done on blender is on a volunteer basis, and I don’t know C++ to do it myself.

For sunlight shadows, what I do is create spotlights with Buffer shadows, for all of the more important objects that require shadows. Then I set them to “OnlyShadow”, which makes it o you can only see the shadows effect on the lighting.

For sunlight shadows, what I do is create spotlights with Buffer shadows, for all of the more important objects that require shadows. Then I set them to “OnlyShadow”, which makes it o you can only see the shadows effect on the lighting.
Why you don´t bake the shadows?

The Dinamic shadow system in BGE is very poor yet :frowning: I think that this is the worse failure in currenty BGE. A good dinamic shadow is essential for any Game Engine but in the BGE it seems forgotten. Maybe in future…

Try tweaking the Bias. It’s sensitive, so go to where you barely has shadows and change it a little and then step up.

Awe well that stinks about the shadows. I guess I’ll just light it like I would for a render then bake everything into the color map.

This did the trick. Lowering the bias apparently makes the shadows cast farther out. thanks sim88!!!

I solved this by putting my spot way out in BFE. I started with my sun and spot at 0x and 0y put the sun at whatever z position you like, then set the spot at 500 or higher on z axis. I parented the spot to the sun set the energy for the spot somewhere around .5, made an empty at 0x 0y 0z and parented the sun to that. I can rotate the empty and get shadows that do not converge. They aren’t truly parallel but the effect is such that when playing the game it is impossible to tell.