Here is a link to an example I put together today demonstrating real time lighting/shadows with animated meshes.
http://home.swiftdsl.com.au/~gezeder/lloyd/Shadows.zip
A few points to note:
1. I just realised - you will probably need to change the screen resolution as I set it to 1280x800 which is my laptop's resolution, easy enough it's in the first few lines.
2. There are glitches - I have not tweaked this fully but hopefully you will be able to see how it works.
To run it:
open the file Sci Fi Engine.bb (remembering to change the graphics resolution) and simply run it. Cursor keys to move/turn the player around. There are about 20 little green men running around who will cast shadows as well as a set of doors which also cast shadows and the walls of the level which while themselves not seen do cast shadows as well.
The core stuff that does the shadows:
ShadowMap.bb - contains a few functions, one which basically initialises the system, another which sets up spot lights, another to remove lights when necessary and the main one which updates the level shadows every frame.
Don't worry about all the rubbish that is in the Sci Fi Engine.bb code - I basically spent the last little while modifying my gauntlet code to run this and so it is not in the best of shape however it should not give you any errors.
http://home.swiftdsl.com.au/~gezeder/lloyd/Shadows.zip
A few points to note:
1. I just realised - you will probably need to change the screen resolution as I set it to 1280x800 which is my laptop's resolution, easy enough it's in the first few lines.
2. There are glitches - I have not tweaked this fully but hopefully you will be able to see how it works.
To run it:
open the file Sci Fi Engine.bb (remembering to change the graphics resolution) and simply run it. Cursor keys to move/turn the player around. There are about 20 little green men running around who will cast shadows as well as a set of doors which also cast shadows and the walls of the level which while themselves not seen do cast shadows as well.
The core stuff that does the shadows:
ShadowMap.bb - contains a few functions, one which basically initialises the system, another which sets up spot lights, another to remove lights when necessary and the main one which updates the level shadows every frame.
Don't worry about all the rubbish that is in the Sci Fi Engine.bb code - I basically spent the last little while modifying my gauntlet code to run this and so it is not in the best of shape however it should not give you any errors.