Another shadowing technique for game

i was playing portal 2,and i noticed that every light have shadows,but the game run smoothly,in blender if i add 15 or more spot lamp with shadows,it makes my game lags,so i examine the shadows in portal 2 and i noticed not all light have shadows,when i moved from light1 to light 2,the shadows moved to light2,so the shadows is not coming from the light,but,something like a lamp that cast only shadows,and it’ll place it self at the same position of a light near the player.
so,i tried to replicate this in blender,i added a spot lamp with “shadows only” option enabled,and some python so it’ll place it self at the same position of a light source near the player,and the spot lamp is tracking the player.

here’s a .blend: shadows.blend (687 KB)

Note: there are 2 spot lamp and i added integer property to both of the lamp, first spot lamp have an integer with a value set to “0” and the second spot lamp with a value set to “1” so both of the spot lamp souldn’t be placed at the same place,but, somehow it doesn’t work in blender 2.70,and shadows are overlaping.

Yeah, some Unreal games like lost planet 2 or the batman series uses the same technique. Looks great in blender but not working in the external player however.

Maybe you could scale the intensity of the shadow light so that when it warps it’s less noticable.

That said, I love this trick, and will definitely be using it!

Curious technique. Thanks!

this technique I used in my game Dead Cyborg, but not only shadows but all of the lamps

That’s a pretty cool technique. Definitely faster than a couple hundred spots. It looks somewhat distorted, but I’m sure with the right amount of tweaking it would be flawless!

I really wish you would post your incredible ideas in the resources forums, rather than waiting for people to pick at your source code :stuck_out_tongue:

Is that a bug with the standalone player or is it from the script? This is a great trick.

Hello
nice and sophisticated lighting.
Thank you for sharing!
Bye