Links

Lighting

How to light a game level with functional lighting strategies
Lighting design is about placing lights in the game world to create visual depth, evoke mood, and provide information to help players play.
Well-lit spaces showcase environment art and organize layouts / massing. Poorly lit spaces often feel stale, flat, unfinished, or confusing.
Since lighting is so important, we recommend a lighting pass during / soon after establishing core gameplay in blockout or scripting phase.
Because this is a level design book, we focus less on graphics and more on the design and function of lighting. Our main question: what do lights say and do?
lighting study blockout by Harley Wilson (via Artstation)
In the study above by Harley Wilson, lights tell us a lot about the game world and help us play:
  • Worldbuilding. Recessed down-lights along a wall suggest a fancy modern gallery.
  • Massing. Cooler grays wash a gallery wall, warmer lamps highlight counters, dim down-lights mark a shadowy corner. Lights divide this area into three sub-areas.
  • Circulation. The far wall is dark, maybe it leads to a backdoor or a closet. It's probably not a primary exit, which would be lit more prominently.

What is video game lighting?

In real-life, light is visible energy that interacts with surfaces. It is an elegant system; with the core physics of energy and photons, you can derive all other complex light effects.
In contrast, video game lighting is NOT elegant. It's a fake-as-hell fucking mess, secretly made of many different subsystems in a game engine:
  • Light sources: base layer of direct illumination, based on light angle and position
  • Shadows: objects occlude (block) light and project shadow maps onto other objects
  • Materials: the color, texture, opacity, and reflectivity of 3D surfaces
  • Postprocess: screenspace effects like color correction, bloom, and HDR eye adaptation
  • Reflections: true reflectivity requires re-rendering the scene; most games use approximations
  • Baking: developers pre-render lightmaps and reflection data
"What is light vs how games simulate it" slide from "Invisible Intuition: How To Light A Level" by Robert Yang for GDC 2018
Imagine making a rainbow with a prism. In real-life, you shine a ray of light through a prism and a rainbow "automatically" emerges because that's how photons and physics work.
But in a video game, a prism effect would be a mess of hacks:
  • Refracting glass material + screen space reflection for prism shape
  • Ray FX, white beam and rainbow painted separately in Photoshop
  • Glow sprites where beams intersect prism
  • Caustic projections / translucent AO for nearby surfaces
This is not an elegant universe of photons interacting with surfaces. In the list above, notice that we're not even using any light sources! It's all "fake"!
spotlight casting shadows in Unreal Engine 4, by Oskar Świerad (via UnrealArtOptimization.com)
Lighting a video game is about picking and choosing only what you need. In most game engines you can set one light to turn off shadows, or set another light to disable reflectivity. This is essential for optimization.
It's enough to make a real-life physicist vomit. "But light without shadows or reflectivity doesn't make any sense," cries the physicists. Haha, silly physicists! This is video game land!
Graphics programmers are secretly bothered as much as physicists. Tech like raytracing is about trying to make game lighting more elegant. Maybe in 10 years it will be.

A brief history of light

The sun and the moon (reflecting light from the sun) are the most common natural light sources.
There are also artificial light sources like controlled fires, gas lamps, incandescent light bulbs... and in the 21st century, there's energy-efficient fluorescent lights and LED lighting.
However, this is not just a story of technology and progress. The light bulb did not make the sun obsolete, and the LED does not make fire obsolete. We still like sunny days and romantic candle-lit dinners.
Fire has not disappeared from the world. Instead, the meaning and use of fire has changed. Lighting design is about understanding how light conveys these ideas, moods, and emotions.
various light sources throughout history: sunlight, fire, gas lamp, incandescent, fluorescent, LED

What is lighting design?

Real-life lighting design is the art / science of placing light sources to account for context and functionality, whether for an office or a moody restaurant.
Real-life professional lighting designers assess building plans and coordinate with architects. They shop in catalogs published by light fixture manufacturers, with detailed technical specifications and lab-tested light falloff charts / standardized IES profiles that they can test in 3D simulations. They must also balance local laws and building codes about minimum light levels, budget, maintenance plans, energy use, and sustainability.
light fixture catalog with distribution curves / falloff charts in standard candelas (cd) from the Daeyang Electric catalog
Because eyes adapt to nearby light levels, it is difficult to guess how bright a room actually is, so lighting designers often approximate a quick measurement with the lumen / zonal cavity method. For a more accurate reading on-site, they also use handheld light meters to measure scientific units like lux / lumens / candelas.
Some game engines are increasingly adopting this technical / scientific lighting approach. However, we must be vigilant: real-life lighting design has fundamentally different goals vs. video game lighting design.

Real-life vs. video game lighting design

REAL-LIFE LIGHTING
GAME LIGHTING
Runs on electricity
Also runs on electricity
Must obey laws of physics
Pick and choose laws; godless
Follow local regulations
No regulations, only gamer norms
Infinite light sources, infinite rendering
Optimize for fewest light sources
Long-term, you live in it
Short-term, you visit it
Glare is literally painful to look at
Glare makes your game worth $60
Comfort, safety, usability, reliability
Drama, detail, clarity, plausibility
recommended reflectance and luminance ratios for real-life classrooms, from IESNA Lighting Handbook 9th edition

Light sources

Since game lighting is so complicated, we will mostly focus on the fundamentals of lighting design for level designers: placing light sources.
  • Core light source types
  • Static vs. dynamic light sources
  • Fixture vs. light source

Core light source types

Almost every game engine uses these four core light source types:
  • Ambient light is the default minimum amount of light in the world. Not really realistic.
  • Directional light casts constant light from a direction, like sunlight downwards from the sky.
  • Point lights (omnidirectional / "omni" light) are like light bulbs, throws light in all directions.
  • Spotlights cast a cone of light in a certain direction from a certain position.
(TODO: light source diagram)
Together, these light sources form a complete domain of basic lighting tools:
Global, affects everything
Local, affects nearby things
Shines in all directions
Ambient light
Point light
Shines in one direction
Directional light
Spotlight
Other light shapes are just variations on these core types.
  • Area lights are wide flat rectangular spotlights
  • Tube lights are long point lights
  • Emissive materials / "texture lighting" use self-illuminated pixels like point lights

Static vs dynamic

A static light does not change at all, while a dynamic light can change in color, intensity, direction, or position.
Static lighting is almost always better for framerate because the engine can "bake" lighting data like lightmaps and reflections -- but rebaking constantly gets annoying, and lighting data can consume a lot of memory.
In contrast, dynamic light means the level can change and react, enabling switchable moving lights and day-night cycles -- but if there's too many light sources, then it might overload the player's machine and the framerate will suffer.
lightmap UV charts for the "New York City" map in Overwatch 2, image by Bruce Wilkie (via PlayOverwatch.com)

Fixture vs light source

A light fixture is a visible plausible source of light, like a window, a fire, or light bulb. It is an architectural feature or a decorative prop.
This is not the same as a light source, which is an invisible source of light within the game engine! A fixture may actually provide alibis for multiple invisible in-engine light sources.
In the image pictured below by Harley Wilson, there are only two visible light fixtures: an orange fireplace and a blue-gray window. But what looks like two lights is actually 11+ light sources!
medieval lighting study with light entities by Harley Wilson (via Artstation.com)

Lighting theory

Here are two ways of approaching lighting design:
  • Three point lighting: common theory for 2D media like film and photography
  • D6 lighting: more abstract but more 3D, for architects and interior designers

Three point lighting

Three point lighting is a lighting theory with three types of lights:
  • Key light: the primary light source
  • Fill light: softer secondary light source to brighten up shadows
  • Rim light: an accent to highlight objects and edges
While these core concepts are useful, it has limitations for level design. This technique comes from photography and film, so it assumes linear fixed 2D screen compositions -- not an interactive 3D space that a viewer navigates freely.
For more about this 2D lighting theory, see Three point lighting.
Three point lighting is common in studio photography and portraiture

D6 lighting

D6 lighting is a lighting theory focused on coverage and space, inspired by a six sided die. Each side represents a lighting strategy, for a total of six strategies:
  1. 1.
    Focal point ⚀
  2. 2.
    Focal frame ⚁
  3. 3.
    Path ⚂
  4. 4.
    Area ⚃
  5. 5.
    Area with focal point ⚄
  6. 6.
    Area with path ⚅
This theory has more applications for architecture and level design, however it's obscure and less known than three point theory.
For more about this 3D lighting theory, see D6 lighting.
lighting study blockout breakdown by Harley Wilson (from Artstation.com)

How to light a level

Start big

Light the biggest room / area, don't fiddle with small stuff
Start with key lights
Any global fill (ambient, global illumination)
if using indirect light in an outdoor setting, do an initial low quality light bake immediately

Natural light

various window designs and daylighting strategies, from "Architecture: Form, Space, and Order" by Francis Ching
usually directional lights and ambient lights, reflectance and reflection probes and SH very important, fog for atmospheric scattering... because it's so dependent on one light source to create contrast, ambient lights / fill lights / shadows are very important

Day for night

unless you're working in a dark moody aesthetic or the horror genre, then don't actually light your night time levels so dark
I mean, you can try, but you'll just get complaints from your playtesters that the level is too dark, and you'll be forced to walk back your too-dark lighting decisions anyway
instead, light as if it's early morning, and then use a night sky, audio cues, and fogging to make it feel like night

Artificial light

usually point lights and spotlights, pay attention to falloff and attenuation
light temperature
fixture design
IES profiles
Make reusable prefab light fixtures: make 1 floodlight, configure it, then reuse and duplicate it
work modularly and don't obsess over it too much
For key lights and accent lights, have a light source or light fixture in mind

Motivated lighting

Motivated lighting is light that has an apparent source / fixture ("motive"), and you are emphasizing / exaggerating ("motivating") its visual effect.

Wash vs grazing

If it's a fill light, it's ok for there to be no light source
it can be a point light that just floats in the middle, keep it dull and low intensity, you don't want the player to wonder why there's a random ball of light glowing in the middle of the room
Fallout 4 didn't have any baked lighting!! they handplaced all their fill lights!!
lighting designers call this "wash lighting" -- a soft smooth fill light with minimal shadow, usually for wall-washing (e.g. a gallery)
vs grazing, where you draw attention to the wall surface to highlight detail

Shadow design

Shadows create the contrast that impart depth to the 3D space. Height and depth perception is crucial for reading the topology of the level.
Shadow diagram by James Gurney, from https://gurneyjourney.blogspot.com/2010/02/light-and-form-part-1_15.html
Think about the shadow anatomy, affects the look of the game a lot.
Team Fortress 2 famously used very saturated shadow terminators on the characters
In our opinion, don't obsess so much over crafting specific dramatic shadows, you end up sacrificing everything just for one spot which is silly... think holistically about how shadows wash over the room and space, not on a specific floor or wall
Focus on big areas and gradients, think big picture
Avoid flat pitch black shadows. Use fill, bounce, reflectance to convey depth
Occlusion / contact shadows come from baked lightmaps or screenspace effects, don't stress out about them
Real-time dynamic shadows in every 3D game engine is expensive, turn off shadow casting for most lights and objects
Highlights, midtones, shadows

Texture with midtones

As a guideline, keep diffuse / albedo world textures within the midtone brightness range. Do not let the texture get too dark or too bright, or else light and shadow will have no space to do their work.
A texture that is pitch black cannot become blacker, and a texture that is full white cannot become much brighter. But if you must err on too-dark or too-bright, generally a too-bright texture is much more flexible than a too-dark texture.
"The biggest reason environments should not have dark textures is that in the physical world very few materials go below a 50% grayscale value. Materials that would go beyond that would be plastics, certain rocks, and paints. It is also the opposite, [...] super bright textures would be reserved for paint, metals, and others. [...] So I tend to stay in the 50% grayscale mark or higher [...] and the reason is that I rather have a brighter texture that causes too much bounce vs a texture that is draining the life out of my scenes." -- Rogelio Olguin, senior texture artist at Naughty Dog, from "Texturing Values for Environments"
To check your texture brightness, open the texture file in an image editing tool like Photoshop (see our full list of 2D art tools) and access your tool's histogram panel. In Photoshop, that means using either Window > Histogram or Image > Adjustments > Levels, and ensuring the image brightness is mostly in the middle 50% of the graph, between the 25% and 75% mark on the horizontal axis.
For more on environmental texturing concerns and readability, see Art Pass.
The exact "50% mid gray" midpoint may vary with the game engine's color space. Like for Unreal 3, sometimes the mid gray was actually at ~73% because of sRGB gamma to linear conversion (info). Today, most modern game engines use "linear" color space because it's more consistent and reliable.
Comparing a dark albedo texture with low histogram values (top) vs a midtone albedo texture with medium histogram (bottom), from "Epic Games Texturing Guidelines" https://docs.unrealengine.com/udk/Three/TexturingGuidelines.html
"If you create a texture that is too dark you are limiting its ability to be bright in the game. You should remember that the texture you are creating is describing how bright that surface is when lit by a 100% bright white light. Also consider that if you paint a texture too dark or include ambient occlusion that is too dark you will inhibit the surfaces ability to show shadows and lighting. Textures with too much noise and too high of contrast will also make it difficult to read a surface's shape and lighting. [...] "Below is a practical example of how dark textures affect lighting. [The left image] is trying to fix the [dark texture] by increasing light intensity [by 500%]. You can see this doesn't help GI or the dark areas at all. The final image is using the adjusted texture with a light brightness back [to normal]. These images show that if the textures are too dark they will not result in good lighting no matter how much you try to fix it with brighter lights." -- from "Epic Games Texturing Guidelines", Unreal Engine 3 developer wiki. Emphasis added.
Comparing a scene with dark albedo texture (left) vs. midtone albedo texture (right), from "Epic Games Texturing Guidelines" https://docs.unrealengine.com/udk/Three/TexturingGuidelines.html

Light pass workflow

Lighting can be very time-consuming, so don't attempt to do final lighting all at once. Instead, build flexibility into your workflow, and work iteratively. We recommend lighting in four passes: mood, navigation, gameplay, and detail. Space out each of the passes and allow enough time to settle.

Mood lighting pass

Set main key lights, figure out global settings, and add fills, think about the big takeaways and themes and player experience goals. "It should feel bright and sunny and happy"... "it should feel dark and scary and haunted"... "it should feel big and lonely..."
Light main entrances and exits of each room. To maximize the chances of a player noticing a particular place, light it. Build a hierarchy. Big important exits should have more important looking lighting, while secondary spaces should have dimmer less focused lights.
brightly lit doorways help players understand the entrances, exits, and flow of the room; from "Functional Lighting" by Magnar Jenssen http://magnarj.net/article_funclight.html

Gameplay lighting pass

Lighting to foreshadow encounters (enemy approach, battle line, possible strategies and flanks)
Lighting to highlight puzzle elements and suggest areas to explore
If you haven't playtested already, then you definitely need to playtest at this point.
the strong spotlight on the left draws attention to the enemy soldiers; from "Functional Lighting" by Magnar Jenssen http://magnarj.net/article_funclight.html

Detail lighting pass

Fine tune and tweak everything, but don't spend too long, it probably looks good enough, and if you tweak it too much you might destroy the effect from a previous pass.

Lighting examples

TODO: showcase different contexts (industrial vs residential) and moods (scary, comfy)
lighting variations diagram for level design by Simon "Sock" O'Callaghan

Lighting example: Ratchet and Clank - Rift Apart

Lighting workflow overview for Ratchet and Clank: Rift Apart, from GDC 2022: Recalibrating Our Limits: Lighting on 'Ratchet and Clank: Rift Apart' (via YouTube)

To review...

Review

Now what?

  • Try a lighting design exercise.
  • Lighting is traditionally the most performance-heavy visual aspect of a level. After a lighting pass, you'll want to do an optimization pass.

Further reading on lighting

Game lighting

General CG lighting

Real world lighting design

  • The Architecture of Natural Light, by Henry Plummer. Monacelli Press: 2009.
  • IESNA Lighting Handbook, 9th edition (2000). edited by Mark S. Rea.