Realtime Shadows

Realtime shadows are a new feature in the BGE. The now famous bathroom demo has them, but how do I make some of my own? How do I get them to be in the game engine? I make a spotlight, and I have a cube on a plane, and I press P and no shadows appear. What do I have to do?

What version of Blender do you have, and do you have it in textured mode?

I use the official 2.48 release, and yes, it is in textured mode.

Add materials and make sure glsl is enabled, also make sure you have a graphics card that supports glsl, and It appears real time shadows don’t work on imacs with an intel card. Have fun.

how do we “enable” GLSL!

goto the menu strip at the top of Blender and select

Game–>Blender GLSL Materials

Also, the spotlight must use the buffer shadow method, rather than raytracing.

yeah, raytracing doesn’t seem to work for it, make sure you set the samples a bit higher than 1 cause the solid black shadow just doesn’t look right.


I have a Widnows Vista with an AMD Althon Dual Core 2.6 GHz CPU, and shadows do work on my computer, because they worked in the bathroom demo. I just can’t get shadows into my own project.

Delete the lamp and add a new one?!

Hello YellowLambo i had the same problem but i found a trick to make shadows.

First, you must set your light spot on Buff Shadow and active the GLSL, that’s true. But notice that if your object is too huge, the light will be too far. Try to reduce your objets, or move closer your light. Personnaly, it works.
Second, don’t forget to set a material on your objets (and the ground !) It doesn’t work without them.

Apparently the light doesn’t like spaces too wide. I wonder if i can change this, but actually i didn’t find where it is.

I realised that I had to do things in a ceratin order. I forgot the order, but it was pretty easy.

no special order needed, probably your impression is this one because some of the changes in materials/lights do update GLSL view immediately, and some of them not (but you can force it to update by moving a lamp or whatever).

not-that-obvious tips:

  • Only Spot lamps support realtime shadows, and only in Buffer Shadows mode, not Raytracing (by default is the second one).
  • The object receiving the shadows must have a material in order to work (actually is recommended that all the objects you want to lit, have materials)

pretty-obvious tips:

  • make sure you’re in textured mode, enabled GLSL from the Game menu, and that your gfx card can handle it (specifications about that in the 2.48 release logs page).

Yeah, I noticed that I don’t need an order a while ago. I just did it in a different order than I had been trying, and that time it worked. I just realized that the only problem was that my spotlight was too far away, the whole time! LOL

you can/should tweak the clipstart and clipend points to tweak the ranges of the area that casts shadows… that way you can have the spotlight far away and not need a massive buffer…

Is there a way to keep the shadows from disappearing when the object is touching the ground? Currently that’s the problem I’m having.

It’s a bug that I think will have to be fixed in 2.49.

@ TheSambassador, could you explain that a little bit more? or a screenie from your scene and light settings.

@YellowLambo, of course all bugs need to be fixed, but i think he’s having exactly the same thing that Michael W describes up there. And there is no 2.49.

Of course there’s no 2.49 (yet). I mean it is a bug to fix for the next bug-fix release, which is likley 2.49.

I have blender 2.49b now, and that bug has not been fixed. It really does make it look a LOT worse.