Level Editor/Workflows/Lighting and lightmaps
A TeamSpec map is lit by its sun and sky, the lights you place, and a baked lightmap: light, bounced light and shadow worked out once, ahead of time, and stored with the map. Baked light looks rich and costs players almost nothing to draw.
1. Sun and sky
Open Map Config > Environment (Map Config):
- Sun (DirectionalLight3D): its rotation is the direction the sunlight comes from; set its colour and energy.
- World Environment: the sky, the ambient light (light that reaches everywhere), fog, glow and colour adjustments.
2. Lights
Place Omni and Spot lights from the Functional menu where the sun does not reach: interiors, tunnels, lamps. Set their colour, energy and range in the inspector. See Lights.
3. Bake
Open Map Config > LightmapGI:
- Its inspector holds the lightmap's settings, such as quality and the number of light bounces.
- Bake Lightmaps bakes now, so you can see the result in the editor. The progress dialog shows each stage; the editor does not respond while it bakes (on purpose, so the level cannot change mid-bake). Hold Esc to cancel; the previous lighting is kept.
- Clear removes the bake.
- Bake lightmaps on export (on by default) bakes again every time you export, so the exported map always has up-to-date light. You only need the Bake button to preview.
A bake and a clear are each one undo step. The status line under the buttons reports the result, for example Baked 412 mesh(es) successfully.
What is baked, and what is not
- Still brushes, displacements, terrain and props are baked.
- Things that move or switch are lit by light probes instead, so they leave no baked shadow where they stood: doors, switchable groups, and props linked from an imported Source map.
- Geometry far outside the area where play happens is left out of the bake and lit by probes. The bake dialog and the status line say how many meshes lie outside the play area. A single stray object kilometres away would otherwise spread the bake thin and make it slow.
- The 3D skybox takes no lightmap; its own lights, the sun and the sky light it.
Seeing your lighting while you work
The Viewport Rendering window and the View menu change how the editor draws the map without changing it: Fullbright to see colours without light, Headlight to see the shape of a dark map, Lighting Only to see the light alone, Exposure to brighten the view.
Tips
- Keep the number of lights with real-time shadows low; baked shadows are free in the game.
- If you see a line of light along a flush join between brushes, check the brushes' Weld On Export is on, or put them in a group with Merge On Export.
- Bake once early to check the look, then rely on bake-on-export.