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

Dynamic Interactions

Dynamic Interactions

Gjsdeath Blog
Start a group Groups
Source Developers

Source Developers

1,069 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...


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

Reply Good karma Bad karma+1 vote

Hello there Gary.

Reply Good karma Bad karma0 votes
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Last Online
Become friends
Member watch
20,811 of 726,695
16,478 (1 today)
Time Online
1 day
Activity Points
6 members
Site visits
Send Message
levan563 Online
Sears Online
zonbie Online
jangalomph Online
Kremator_ Online