Also known as Gary from Interlopers.net. I'm a retired Halo2X Modder and Source Mapper/Coder/Overall Modder. I'm a global moderator at both Halomods.com and Interlopers.net
Posted by Gjsdeath on Aug 24th, 2012
So, you guys remember that video posted for Ivan's Secret that featured "CSM" or dynamic sun/sky shadows? Well, I ended up discovering what I believe was the same method a while later, but posted no video, only pictures. Though my friend Ken ended up posting a video using a my code in a HL2 map on the Alien Swarm engine. Here is the video he posted:
That video does have some errors, most of them are just due to the map though. Sadly you can't just toss it in, you have to map with the system in mind.
Why do I call this fake cascaded shadow mapping? Because it's not really CSM, as CSM is supposed to have frustum view splitting and such. What I've done is hacky and inefficient. There is no way around it without coding proper CSM. Which is far beyond my abilities.
So, because I don't like the name "fake CSM" I internally refer to it as DSS(Dynamic Sky Shadows). And for now on I will refer to my implementation as that. I say "my" despsite the likely chance that Sam Za Nemesis came up with this method or a very similar one first, because I discovered this independently.
Well, it's pretty simple actually. Basically, I took the env_global_light entity that comes with AlienSwarm and modified it to use multiple orthographic "flashlight" projection instead of one. The entity already handles the system that bounds the projections to the local player.
Now that I have, let's say, four projections, I just make some textures. The way the flashlight textures work is; black is no light and white is full bright. So, if you take one, fully white texture for the center, and white textures with a black box in the center of them, you can make a "cascading" effect. Explained better in this image:
So, that's how the system works. It's really very simple. There are a few other little things I ended up doing, like projection-specific depth bias, depth slopes, and shadow filters. To cut down on shadow bleeding/ghosting, and it had to be projection-specific as you can get better values depending the size of the projection. I stopped working on the system because it was slightly after I created it, that Bio released his Deferred Mod. Which has far superior and proper CSM. Why would I continue on a my system, which is ineffecint and will always be inferior? Well, I thought that, until some people still showed some interest in my system. As the the Deferred Mod's CSM needs the deferred lighting pass to work. And that is not yet ready for mods to use and not backwards compatible with the old lighting paths. So I'm planning on working on my system again, starting from scratch. As I better understand the system now.
A awful test map with the latest(as of 12/1/2012) system(full size).