Contents
How RED+ bakes lighting
RED+ bakes lighting with RED's own lighting commands and adds ray-traced shadows, the Sun, ambient occlusion and bounced light to them. This page explains what a bake does, which command to use, and how to follow or stop a bake.
The lighting commands
- (Shift+L) lights the lightmaps the level already has, at their current size and layout.
- (Ctrl+Shift+L) lays out every lightmap again, with its size and its place on the lightmap pages, and then lights it. The Lighting button on the top bar runs the same command.
- lights only the surfaces reached by the lights you edited. See Relight Changed Lights.
Which command to use
| You changed | Use |
|---|---|
| Existing lights you moved or edited, while you are still adjusting them | Relight Changed Lights (RF+) |
| Lights, the Sun, Emissive Light faces, light cookies or ambient light | Calculate Lighting |
| Bounce %, ambient occlusion, terrain smoothing or face-edge repair in Level Properties | Calculate Lighting |
| Brushes | Rebuild the geometry, then Calculate Maps and Light |
| Quality in Level Properties | Calculate Maps and Light |
| Lightmap detail | Restart RED+, then Calculate Maps and Light |
| Anything, before you release the level | Calculate Lighting or Calculate Maps and Light, never only a relight |
A lightmap only takes a new size and layout when lightmaps are laid out, so a change to texels per unit needs Calculate Maps and Light. See Lighting settings in Level Properties and Lightmap detail and file size.
What a RED+ bake does
- The same result every time. Baking a level twice gives the same lightmaps, on any number of processor threads.
- Several processor threads. RED+ spreads its lighting passes over all the processor's threads but two, up to 14 threads, counting the editor's own. The others run at below-normal priority.
- Ray-traced shadows. For point, spot and tube lights, RED+ traces rays from each texel towards the light to find shadows. More rays, set by Quality, give smoother shadow edges.
- The Sun. Each Sun traces its own ray from every texel that faces it.
- Portals do not block light. Portal faces cast no shadow, so light passes through them.
- Back faces are shadowed. Surfaces that face away from a light are tested for shadow like any other surface.
- Cut-out shadows. Gratings, wire glass and other see-through faces cast a shadow cut out of their own texture when the texture's alpha can be read. Otherwise they cast none.
- Placed meshes and clutter cast shadows too. See Mesh shadows and Check Mesh Shadows.
- Ambient occlusion darkens ambient light in corners and where surfaces meet. Bounce adds light reflected from lit surfaces.
- Corrections to RED's own lighting, such as blocking light through thin walls and carrying shadows across corners. See Bake accuracy.
- The result is ordinary lightmaps, saved in the level file.
While it bakes
The Computing Lighting window shows a checklist of the bake's stages:
- Prepare geometry
- Light the world
- Light groups & movers
- Gather bounce & emissive light
- Repair edges & seams
- Finalize & rebuild display
A filled triangle marks the stage that is running, a check mark a finished stage, and a dash a stage this bake skips (a level with no moving groups, or a bake with no bounce and nothing emissive). Below the checklist are the current step, a moving bar, and the number of texels lit in this stage with the time elapsed. The window does not estimate the time left. Drag it anywhere on the screen.
To stop a bake, click Cancel (Esc), or press Esc while RED+ is the active program. RED+ finishes the surface it is lighting and starts no more.
- After cancelling Calculate Lighting, surfaces not yet lit keep their previous lightmaps.
- Calculate Maps and Light lays the lightmaps out before lighting them, so after cancelling it the surfaces not yet lit are left unlit.
- The finishing passes are skipped, and so are bounce and emissive light unless they had already started. Surfaces lit while the bake stops can come out without shadows.
Run the command again for a complete bake.
When a bake ends
A complete bake can end with a message:
- "Bounce light was not applied to this bake" means the bounce stage failed or found nothing lit. The lightmaps have direct light only. Run Calculate Lighting again. See Bake accuracy.
- A message about RED's limit of 32,767 lightmap surfaces means the level needed more lightmaps than Red Faction allows, so large flat areas got fewer texels per unit in this layout. See Lightmap detail and file size.
Every complete bake is timed for the estimated bake time in Level Properties. A cancelled bake is not.
Placed meshes in the viewport
In the editor, a placed mesh takes its brightness from the baked lightmap straight below its origin, up to 200 m down. With no lit surface below, it uses the level's ambient light (or its room's own) times 2, or times New scale value when Override static mesh ambient light scale is ticked in Level Properties.
- A mesh on a wall, hanging in the air or under a table takes its brightness from the floor below it.
- This affects only the editor view. It updates when you move the mesh, open a level, rebuild geometry, finish a bake, or blend or unblend seams in Inspect Lightmap Seams.
Log lines worth knowing
The log is logs\RedPlusEditor.log in the RED+ folder.
- A line containing
[RF+ Lightmap] settings applied:lists the settings in use. It is written at the start of every bake and when you click OK in Level Properties. Quality appears as a number from 0 (Draft) to 4 (Extreme). - A line containing
[RF+ Lightmap] see-through world faces:counts the see-through faces that cast a cut-out shadow, and those that cast none because their texture has no readable alpha (paletted, 565, DXT or fully opaque). - A line containing
casts NO shadow:gives the reason a placed mesh or a clutter object casts nothing. - A warning about mesh chunks with
a render mode that says opaquemeans a see-through material was not exported see-through, so it casts a solid shadow. - A line containing
[RF+ Bake] estimateslists the estimated bake time for every Quality. It is written after a level opens and after each bake. In it, High is called Maximum. - A line containing
[RF+ Lightmap] BOUNCE NOT APPLIED:goes with the message above.
Good to know
- A mesh hidden in the editor casts no shadow.
- Sky, liquid and portal faces, and faces whose texture name contains
invisible, cast no shadow.