A really quick demo I slammed together in about 3 hours.
I was doing a lot of reading on shadows and the methods used, and I decided the best way for me to learn was to just try it by myself.
So, I started simple and make a copy of all the geometry in a shape that was facing the light. I then translate each vertex in a direction based on the lights current position, untill it hits the floor plane.
Very simple, yet very effective. I used the stencil buffer to only draw onto the floor. There is a problem with the poly pipe; there is lots of Z-fighting going on, because two different sets of polygons are being translated back ot the plane, on top of each other. I either need to create some sort of sillhuete detection, and create an entirely new shape from that, or, get the objects to cast self shadows to stop the overlapping.
Either way, I am pretty happy with the results in such a short space of time. I'm now going to look into how the pros do it, and start using another buffer to store the lights depth buffer, and use that to create a shadow texture.
@retropixlstudios Hey dude, cheers for the comment. Oddly enough, the method I use here is sort of similar to shadow volumes, which is a very high tech method of creating shadows. I use shadow mapping at the moment, it's fast, it's easy and the overall effect can be tweaked very nicely. (also, the silhouette method is probably using the adjacency buffer in D3D! Have a look for it, it's an interesting method :) )
CallumBGood 10 months ago
To do that sillhuete thing you could do this: take the normals or the faces, take the normal (direction from the face) of the light and if it is back facing remove it. I read a slideshow I found somewhere on how to do this and optimize it, it could probably explain it better than I can, let me try to find it.
retropixlstudios 10 months ago