Shadows from the sun. How to do them?

I know of only shadows possible in real time in Blender. They are buffer shadows from a Spot light.
Is it possible somehow to do or imitate shadows from a kind of direct light source like the sun?

In the latest builds from GraphicAll, yes, it’s possible. With those builds, the Harmony branch was merged into trunk - what this means is that lighting improvements for the BGE like sun shadows and light cookies are available. When you make a sun lamp, just select the Shadow button, and the shadows will appear. You can adjust the settings there to change how they appear.

cool. Do they have any performance settings for the game engine? Shadow map resolution or something?

Yep, as SolarLune said, the harmony branch gave us access to sun shadows, which is fantastic. You might have to increase the Frustum Size/Clip start/end etc… before you can see it. This depends on the scale of your scene and things.

Yep, under the quality setting, just change the size to what ever you want it to be. You have to make sure you have selected ‘Blender Game’ from the engine dropdown up the top, next to the scene selection.

Thanks Klauser,

Is there a way now to have correct shadows from a surface with alpha? I mean shadows that aware of alpha transparency of an object. Shadows from a fence or a tree foliage made from alpha planes?

Only Clip Alpha (not Alpha Blend) planes cast shadows, but:

  1. I don’t think they’ll cast shadows according to texture. I think that there was a patch to allow for this, but it hasn’t been merged as of yet.
  2. Clip Alpha planes may or may not work - they don’t work for me (there’s no transparency), but they seem to work for others.

If you model closely enough to the texture, then the shadows will be correct. Small details like fence line or tree leaf shadows can be approximated.

Thanks SolarLune, Hope it will be implemented someday.