Dynamic lightsystem with shadows!

Blitz3D Forums/Blitz3D Programming/Dynamic lightsystem with shadows!

Craig:

Using the systme is really simple.

You have one function to cast a regular shadow,
one to cast a static shadow,
one to receive a shadow,
and one to set up a light source.

Then all you do is call updateshadows each frame.

That's all there is to it. All the other stuff in my code is just there to allow you to turn on additional lights and such. And there's some global variables which you can modify if you desire soft shadows, or need to change the amount the shadows are offset from a surface.



"does it do shadows on top of existing light maps?"

Yes. The system generates new geometry seperate from your level geometry for the shadows each frame, and these are blended on top of whatever was already there.