Sandbox Logo
28 May 2023

Area Lights

Shining a new light to the stage.
Sam Pavlovic
Graphics Programmer
Parts Unknown
Lighting is the most important element when building a scene.

In video games, lights usually are described as pinhole-sized points with no size to them, if you put a surface to them you see it converges to a single dot.

In real life lights aren't LED-sized with the power density of the sun, lights have size and volume, and through their area emit photons.

Before, we only had these lights available, it's been long requested in the community for a long while that we implement other types of lights - now we have Rectangle, Sphere and Capsule-shaped lights that are ready for you to use.

We’ve implemented a system that will help us to make new shapes moving forward. With that, all light types are now considered area lights.
They work in both Static and Dynamic lights. Static lights get some really nice soft shadowing on them.
Thanks to area lights, the physgun's beam can emit a strip of light that illuminates its entire surroundings in a seamless, continuous manner.
Valve has kindly provided us with one of the nicest volumetric fog system there is. Area Light support has been appended to them and it just works when you use them. 

It really helps when trying to build a mood to the scene.
One thing that stood out while working on this was that fog was on an SDR color system, it wasn’t giving much emphasis on the highlights of the new lights and would never glow.

Volumetric fog now renders in an HDR color space, This allows for greater emphasis on the bright lobe of the fog.
One of the main pillars that make it fun to author the new lights our new gizmos system. You can easily scale and move lights around, what you see on the editor is what you get in game.

There are some things that I want to explore with this feature to make a dessert, but we have a good main dish.

We have some work done already to support projected textures on rectangle lights. It would be really nice to see movie lobbies having their projector reflecting the light of their contents back into the world.

Right now dynamic area lights don't cast dynamic shadows, they look really off having a sharp shadow with a big light. I'm currently rewriting the shadowing system, and that should be remedied soon.