Dynamic Shadows

I’ve seen a few videos that claim BGE has dynamic shadow maps – I haven’t come across any documentation that explains how I can make use of this feature, however. So, my question is, how would I use dynamic shadows in the game engine?

Only spotlights can cast shadows, and only in GLSL mode- toggle “buffer shadows” on the spotlight, rather than ray shadows, and it should work. You can tweak the size of the buffer map for higher-res or better-performing shadows, and you can tweak settings like clip distance and such for best results.

No shadows for point lights? Oy.

Turning on buffer shadows doesn’t seem to work. :frowning:

EDIT: Ah, I didn’t have GLSL materials enabled. Pardon my noobishness, I’m only getting started, after all. :slight_smile:

These shadows look kind of… Iffy, though?

http://img192.imageshack.us/img192/4021/85062389.png

Not only do they look horribly wrong, but the smaller box just stops casting shadows once it gets close enough to the edge of the light.

Try screwing with the settings a bit more…
There’s some documentation about dynamic shadows here

To get the shadows to meet objects where they touch the ground you need to tweak the bias setting- the lower it is the more accurately shadows will appear at areas of intersection, but the higher the odds are of weird stuttery shadow artifacts appearing along surfaces. The trick is to get the right balance, I suppose.

PS every single time in this post that I used the word “the” I accidentally typed “teh”. Typing fail!

http://img15.imageshack.us/img15/9148/ehgh.png

Yeah, I see what you mean by “shuttery shadow artifacts.” I’ll keep messing with the setting I suppose.

There sure seems to be a lot of supposing going on here!

Generally I don’t think many people would notice if a shadow didn’t quite meet an object if they were in the heat of a game, but those artifacts are hard to miss- so I recommend pushing the bias to the edge of whatever value causes the artifacts to start appearing, but any further than that and the visual effect of the shadows drops rapidly.