Dynamic Shadows in Stage3D

On 3.3.2013 by Antti Lepistö


This is a 20 minute game jam on “shadow” that got out of hand. Thanks to being so OCD about it I also got a sneak peak into drawing primitives using Stage3D and Starling. The technique is quite simple and illustrated in image below. Shoot rays from the source through each vertex into the edges of the area and then draw new polygons using points from the raycast. There’s still some issues with filling the shadow shape if light source is really close to objects.

Next I will look into texturing the polygons properly and building a simple game prototype around this technique. Stay tuned.

Click to view live


Click to view debug version with raycast

Leave a Reply

Your email address will not be published. Required fields are marked *