Also known as Gary from I'm a retired Halo2X Modder and Source Mapper/Coder/Overall Modder. I'm a global moderator at both and

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
RSS feed My Blogs

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.

Fake CSM

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.

So how does my Dynamic Sky Shadow system work?

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:
Old DSS System Texture and projection layout


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).

Start a group Groups
Source Developers

Source Developers

984 members Fans & Clans

For people and teams developing mods and games with Valve's Source engine.

The 99 Bolts Project

The 99 Bolts Project

3 members Developer & Publisher

The 99 Bolts Project will make several mods over time. These mods will work together to portray the rise and fall of Ava Winona, and will catalog her...

Post comment Comments
zonbie Nov 23 2011 says:

Gary, your work with projected textures and directional shadows has been one the best inspirations I have to continue working with Source.

+1 vote     reply to comment
Supahchikin Jan 8 2010 says:

Hello there Gary.

0 votes     reply to comment
Post a comment

You are not logged in, your comment will be anonymous unless you join the community. Or sign in with your social account:

Last Online
Nov 5 2015
United States United States
Become friends
Member watch
Start tracking
15,176 of 541,121
14,471 (2 today)
Time Online
19 hours
Activity Points
4 members
Site visits
Send Message
levan563 Online 1 day ago
zonbie Online 3 days ago
jangalomph Online 1 month ago
Kremator_ Online 8 months ago