With the impending collapse of the Citadel, two members of the Resistance are tasked with evacuating any citizens remaining. Little do they know that their mission sees them gaining critical information that puts the early fate of White Forest in their hands.

Report RSS C17 Episode One | Real Time Global Lighting in Source

It's light. It's real time, and it's in the Source Engine.

Posted by on

City 17: Episode One


Real Time Global Lighting in the Source Engine.
Yes Really.


Mod of the Year AwardsAbbreviated CSM, Cascaded Shadow Mapping is a popular technique used in many mainstream games due to it's advantages, the most notable is that it is fully dynamic. It adjusts both shadow complexity and resolution of shadows casted by objects based on distance from the player. I.e: Shadows casted by objects further away from the player have lower resolution and detail. This system makes the general appraoch to real time lighting affordable on today's hardware. Because shadows casted by objects in the distance don't need to have as much detail and resolution, quality is sacrificed for performance, though still remains real-time.

Our team member, Sam Za Nemesis intially designed it for the Alien Swarm engine, however the system is entirely backwards compatiable up to Source 2007. For a couple of days now, our smart rats at Gear Labs have been porting it back to the old Orange Box engine (2007), so far we have almost everything set up to use in our game. While City17 doesn't feature any Day to Night cycles, where this system truly shines, we'll still be heavily using it as the primiary light source in the majority of our environments due to it's advantages over the standard baked lighting technique (that's not say we're tossing out radisoity based lighting altogether!). Instead, we'll be combining the two to create a perfect balance between what real time and baked lighting can offer. It really is a nice Ying Yang kind of situation.

Sam is also trying to play with other shadow techniques, his current main goal is to give support for the more advanced PSSM (Parallel Split Shadow Maps) technique in the Source Engine, and maybe even in developing a cheap AO technique.


Real Time Global Lighting

Real Time Global Lighting

Real Time Global Lighting



The Technical Bits

Using Real time Lighting globally presents a real performance issue. Especially on the Source Engine. This implementation of CSM heavily uses all of the past improvements we've made to the stock dynamic lighting system built by Valve. For one, the system is going to use a completely custom PCF method (which, currently it does). The system is pretty basic right now, having no support for adjusting casting angles based on a time scale for instance, though we do plan to implement features like that later on into the system. Right now our main priority is making sure it runs well, and specifically for what we need it for.

In the images above we use a custom GUI panel to drive angles and light intensity, eventually we plan to release this as a standalone demo with a much nicer and cleaner interface to control the system.

From what we've measured the system currently performs at:

  • Alien Swarm 1080p, 1.5-1.7ms
  • Alien Swarm 720p, 1.2-1.4ms
  • Source 2007 1080p, 2.2-2.4ms
  • Source 2007 720p, 2.0-2.1ms

We definitely have a ways to go on Source 2007. Right now we're going to work on some pretty basic map side optimization functions we can do from Hammer. Later we'll be going deeper into the system, to see what we can internally optimize.


Right now the system is being used by the Ivan's secrets team (if you haven't seen that mod yet you should go and check it out, because it's pretty rad. Oh and Vote for them, We voted for them.). Below is a demonstration of how the system works on both 2007 and Alien Swarm.

Unfortunately we didn't have the time to a record a video in 2007, but that's also primairly because we're having some problems with the GUI for reason we can't understand. We're basically just firing outputs to the ent, and that is not as smooth or nice to see as the Alien Swarm version is, but we're working on that.


Okay now that's really all we have for today! We're serious. Follow us on Twitter for updates on what's going on in development, as well as our blog for City 17 and other development news from us. If you'd like to get in contact with us or leave us suggestions, be sure to email us at: mrtwovideocards@gmail.com.

City 17: Episode One
Post comment Comments
QuarterLife Creator
QuarterLife - - 163 comments

We're powerful wizards IRL.

Reply Good karma+3 votes
August_K
August_K - - 99 comments

Yes. Yes, you are. *bows down*

Reply Good karma Bad karma+2 votes
PeacefulPatriot
PeacefulPatriot - - 1,514 comments

Yes. YES. YES! I love my shadows. You guys and Ivan's Secrets are setting a new standard for Source modding now.

Reply Good karma Bad karma+2 votes
HmTervapuro
HmTervapuro - - 532 comments

Ooo, now that´s amazing.

Reply Good karma Bad karma+2 votes
Alex2the3gr8
Alex2the3gr8 - - 103 comments

Looks cool, but how come models aren't supplying shadows?

Reply Good karma Bad karma+1 vote
Kamikazi[Uk]
Kamikazi[Uk] - - 1,412 comments

Why havn't you guys been hired by valve :s.

Reply Good karma Bad karma+1 vote
xalener
xalener - - 1,605 comments

More importantly, why doesn't valve use their own damn tools to their potential?
We see more and more mods like this every day, but CS go is still on par graphically with battlefield 2. :/

Methinks they should start digging into their own community's tools. No shame in it.

Reply Good karma Bad karma+3 votes
samuelgames
samuelgames - - 22 comments

Cloud.steampowered.com < Vanilla CSGO
Cloud.steampowered.com < With our stuff

Reply Good karma Bad karma+4 votes
Smiley_Riley
Smiley_Riley - - 319 comments

Because Valve is smart enough not to exclude a good deal of their lower pc end gamers just to appease those with dual sli video card configs

Reply Good karma Bad karma+2 votes
MrtwovideoCards Author
MrtwovideoCards - - 660 comments

Lol, trust me. Real time lighting is pretty darn cheap these days. Dota2 currently uses global lighting and SSAO. So CS:GO really has no excuse.

Reply Good karma+1 vote
AncientT
AncientT - - 425 comments

Battlefield 2 ? you crazy its own engine is diffrent they do not look alike. i found cs go looks more realistic a 10x % than battlefield 2 even lef 4 dead 2. But ya why doesn't valve use there full potential.

Reply Good karma Bad karma-1 votes
MarkC.
MarkC. - - 22 comments

Lol, nice one!

Reply Good karma Bad karma+1 vote
Iusecomputer
Iusecomputer - - 144 comments

Looks great, lots of potential, yadda yadda.. But do viewmodels for weapons cast shadows apon themselves? I know by default ENV_projectedtextures, the only current source of shadow maps, would never cast properly on ornament props, which always bothered me. And in regards to phong shading, does the world light for phong move dynamically with the angle of the light projection, Or is phong still limited to only static world lights? I love phong.

Reply Good karma Bad karma+1 vote
MrtwovideoCards Author
MrtwovideoCards - - 660 comments

Phong moves based on the light source, yes. Also shadows cast on the viewmodel, we've fixed that.

Reply Good karma+1 vote
WS-GS8
WS-GS8 - - 154 comments

GYAHAHAH! GIMME GIMME GIMME GIMME

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: