We Are The Lambda Generation. LambdaGeneration is a website dedicated to the video game Half-Life. ( We're basically really passionate about crowbars, headcrabs and anyone who has goatee with a PhD in theoretical physics… )

Deferred Lighting… On The Source Engine?!

News & Rumors Other

Many people see the Source engine as an antiquated relic. They compare it to other contemporary game engines, and they try to prove that, according to some subjective standards, it is somehow “uglier“. That’s an argument that will most likely never end (at least not until Valve reveals Source 2, or something).

I suppose the reason for this perceived outdatedness - in both graphical quality and technical features – is that, at the end of the day, it’s best to make sure that your game is able to impress as many people as possible, rather than trying to impress a scant few with unoptimized eye candy. Those scant few will eventually journey to other games in search of their next graphical fix anyway, so what’s the point?

So Valve’s approach makes a lot of sense, when you look at it from a strictly objective point of view. Besides, the Source engine has got a lot of horsepower in it yet, although much of it remains untapped. Some of this horsepower isn’t all about… well, speed. It’s also about achieving better… handling, so to speak. Just like the sort of horsepower I am about to introduce you to!

Deferred Lighting… On The Source Engine?!

Meet Biohazard. You might recall he created the fan-made Source Shader Editor, as well as a unique dynamic day-night/weather climate system, also for Source. But what he’s recently cooked up is far more impressive than either of those – a unique deferred lighting solution for the Alien Swarm branch of the Source engine. It’s brand new, and it seems to be independent from any past attempts at realizing this kind of lighting on Source. And on top of all that, it also includes a terrific built-in in-game lighting/shadowing editor, that’s leagues beyond anything of the sort that Valve has ever created. Let’s take a look:

Easy to set up and easy to edit. On top of that, it looks to be incredibly versatile and extremely robust. Not to mention all the awesome designs and effects that can be accomplished with such an implementation. This is Bio’s description of the system itself:

This is a deferred lighting implementation that I’ve created on the Alien Swarm SDK. It’s currently offering shadow mapping for directional/point/spot lights, blinn phong and volumetric scattering via light volumes.

The in-game editor allows you to load from/save to VMF files directly, however parented or named lights (with I/O) will not be editable in-game.

Hundreds of small lights can be rendered with great performance (on a GTX 260), however as soon as they cover a lot of screenspace or are even drawn fullscreen (intersecting light geometry) they become much more expensive.

The renderer firstly draws the skybox/scene to the gbuffer (normals+lighting params and depth), performs light rendering via low poly spheres/cones and does a second pass on the skybox/scene that produces the final result. Due to this, all shadows and lights from the world are directly projectable on the skybox, however geometry in the skybox does not yet cast shadows nor can you place lights in the skybox.

There’s currently no hardware filtering support for AMD because I do not own any AMD cards, so I can hardly add that myself. Running this on AMD will either require you to recompile everything with a color based shadow mapping filter (as easy as changing one line of code) or adding fetch4 code – you’ve been warned.

Source code and demo build can be obtained here:
http://code.google.com/p/swarm-deferred/

Hopefully this’ll get more folks interested in Alien Swarm modding, which seems to be far more open, versatile, and… well, pleasant than modding on almost all other branches of the Source engine. Besides, it’s free!

Advertisement

About this Article

18 Comments

  1. VALVEHIRETHISMANPL0X

  2. I hope they update it in the newest valve games like they added CS:GO Dynamic Shadow.Is the CS:GO Dynamic Shadow added in portal 2 from the DLC update??

  3. Now how about fixing the hit boxes and networking?

  4. wow. Now I understand why alienswarm had source2 in its comments. It clearly was built to *do* these things. It it totally bio-hazards code? because I know he stated the CSM was native to alien-swarm and he just re-activated it. So was the deferred renderer also a part of that. Deferred rendering can even be put into your average flash 3d package, so it’s not totally impossible for one man to do all of this. I’ve always suspected Valve’s R&D team to be years ahead of where the current version of the engine is today. And it’s been mightily apparent they have been holding back on a ‘few’ things. Did valve have plan for a deferred renderer, was there code left over? either way Now can someone give him the trainstation map to do a tech demo with ;)

    • You may have confused Bio with the City 17: Episode One crew, who did post recently on ‘Lopers regarding similar tech that they were working on. As far as I know, Bio’s work is independent from the City 17 team’s endeavors (which, if I recall correctly, was based on past work from the Ivan’s Secrets devteam) – but I am unsure if this is, in fact, all native to ASW.
      But you do make some good points. Alien Swarm has always struck me as a sort of… sore thumb within the Source branch library. It just doesn’t seem to fit, if you know what I mean. And that “source 2″ reference always struck me as rather odd.

      • I think I may just hang my spurs up as source defender ;) I’ve always felt a little jaded that they didn’t have “enough hours in the day”. But I’ve always justified that they worked on R&D that grounded the future base of the engine with improved textures, instance tessellation of models, and then toss on a lighting lighting system deferred or otherwise ontop. But after Biohazard just put ‘that
        together in what 6-12 months, by him/her-self. I’ve lost that conviction in defending valve’s decisions to not aggressively upgrade the engine all the same for the mid to upper echelon of the community and giving similar tools to modders.

        • I can’t blame you for that. Valve’s been making a lot of mistakes lately – and it goes beyond moddability or engine versatility. But I have high hopes that in some time, they’ll make up for it, in a way that’s going to satisfy a lot of people.

  5. I have seen videos of this guy work, he is great at what he does, Im unsure if valve hired him but I hope so bad they did, Valve needs some fresh air in tools, shaders and lighting. Don’t get me wrong Source is great, I havent seen yet such a complex animation sytem and scene manager in other games, but in terms of lighting and other FX they where falling behind, I wish we will see even better games with this.

    • Also the projected particle system he implemented, I tip my hat at him, so much potential…

    • He was offered a job, but said that he would like to finish his education before he accepted.

      • I’d take that offer in a flash. Oh, Valve employment fiat – how do you strike so silently? It’s interesting, though – perhaps we will see this deferred lighting solution turning into an actual, legitimate Source implementation.

  6. Color me impressed.

  7. I get the general shape of the idea, but how will this actually affect how Source looks?

    • It allows for more varied, complex, and aesthetically diverse lighting. Especially on the modding front, I suppose.

Leave a reply


Sign in via Steam to skip spam and contact fields.

Advertisement