Skip to content
RED+
Contents

Lighting

The Sun

The Sun (RF+) is a light from infinitely far away, like sunlight or moonlight. RED+ bakes it into the lightmaps, so every face of the level shows it in any Red Faction client. A level can hold up to eight Suns, and the bake adds their light.

Place a Sun

  1. In Object mode, pick Sun in the object list and place it as you place any other object. RED+ puts it where the active view's camera is, pointing down and slightly to one side, and selects it.
  2. Aim it: with the Sun selected, rotate it (hold R).
  3. Set its colour, brightness and softness in Sun Properties.
  4. Choose Level, Calculate Lighting.

Placing a Sun turns sunlight on for the level. Only the direction of the Sun counts: where the object stands makes no difference to the lighting, and it may stand outside the level.

In the viewports a Sun shows as an icon with one arrow in the Sun's colour, pointing the way the light travels. A selected Sun's icon takes the selection colour.

Sun Properties

Select a Sun and choose Edit, Properties... (Ctrl+P).

ControlValuesNew SunWhat it sets
Pointingread onlyWhere the light comes from: a compass direction and the height above the horizon in degrees. It also says when the Sun is nearly overhead (very short shadows) or low (very long shadows).
Presetsix presets(custom)Sets Color and Brightness together.
ColorR, G, B, each 0 to 255255, 247, 224The colour of the light. Pick... opens the colour picker.
Brightness0 to 40.75How strong the light is. 0 turns this Sun off.
Edge softness1 to 6411 gives a sharp shadow edge. A higher number traces that many rays per texel across a small disc, which smooths the shadow edge and makes the bake slower.

The presets:

PresetColorBrightness
Midday - white, harsh255, 252, 2451.00
Afternoon - warm255, 244, 2140.75
Golden hour - deep warm255, 206, 1400.60
Sunset - orange255, 168, 940.45
Overcast - flat, cool214, 222, 2320.35
Moonlight - dim, blue150, 176, 2200.20
  • Preset shows (custom) when the Sun matches no preset in both colour and brightness.
  • A Brightness outside 0 to 4 is ignored, and the Sun keeps its previous brightness. An Edge softness outside 1 to 64 is set to the nearest limit. A colour value above 255 counts as 255.
  • With several Suns selected, the dialog shows the first. OK gives the others the same colour, brightness and edge softness. Each keeps its own direction.
  • Pointing is worked out when the dialog opens. To change the direction, close the dialog and rotate the Sun.

Several Suns

A level holds up to eight Suns: a sun and a moon, a key light and a fill. Place each one from the object list.

  • Each Sun has its own direction, colour, brightness and edge softness, and the bake adds their light.
  • RED+ names them Sun, Sun 2 and so on, in the order they were placed. After you delete one, the others are numbered again.
  • Every Sun traces a ray for every lightmap texel of the level, times its Edge softness, so each Sun adds bake time.
  • Placing a ninth shows "A level holds eight Suns at most." and selects the last Sun instead.
  • A Sun cannot be copied and pasted. Place a new one from the object list.

How the bake lights with the Sun

  • For each texel that faces a Sun, RED+ traces a ray towards it across the whole level. If nothing blocks the ray, the texel takes the Sun's colour times its brightness, scaled by how squarely the face turns towards the Sun. Texels facing away from a Sun get nothing from it.
  • The level's geometry and placed meshes block the Sun and cast its shadows.
  • Ambient occlusion never darkens sunlight. When bounce is on (Good and above), sunlit surfaces pass their light on as bounce like any other lit surface.
  • A Sun hidden in the editor still lights the bake.
  • Relight Changed Lights does not track changes to a Sun. After changing one, use Calculate Lighting.

The Sun in the game: the "RF+ Sun" lights

The lightmaps light the level's faces. Placed meshes, enemies and the player are not lightmapped, so for them RED+ writes one ordinary spot light per Sun into the level each time you save it: RF+ Sun for the first Sun, RF+ Sun 2 for the second, and so on. Each sits far outside the level, aims the way its Sun points and has its Sun's colour.

  • Alpine Faction 1.4 with its Direct3D 11 renderer lights meshes and characters from these lights. Stock Red Faction and Dash Faction do not use them.
  • RED+ sets each light's position, aim, colour and strength from its Sun at every save. Change the Sun, not the light.
  • A Sun with Brightness 0 gets no light, and bakes nothing either. The light of a Sun you delete or set to 0 is removed at the next save.
  • The lights appear in the editor as lights far outside the level. RED+ keeps them out of the bake and out of the viewport's lighting.
  • Leave the lights where they are and do not rename them. RED+ recognises them by their names.
  • Is Enabled in Light Properties is yours to set. Clear it to keep that Sun off meshes and players until an event turns it on.
  • The level needs built geometry. If it has none when you save, RED+ leaves the lights as they are and the log has a line containing the level has no compiled geometry.

Light on placed meshes

For a level lit by the Sun, open Edit, Level Properties..., tick Override static mesh ambient light scale in Advanced Options and set New scale value to 1.

  • Otherwise the game multiplies a placed mesh's light, ambient included, by 2 in single player and 3.2 in multiplayer, and sunlit meshes come out brighter than the ground under them.
  • RED+ also uses this value to set the strength of the "RF+ Sun" lights. When the override is not ticked, every save writes a warning to the log.
  • The "RF+ Sun" lights cast no shadows. A mesh standing in a baked shadow is lit as if it stood in the sun, because the game cannot shadow a placed mesh with the level's geometry. A prop that must sit in shadow can be converted to brushes, which bake like the rest of the level. See Convert to Brushes.
  • Every other enabled light in the level also lights meshes and players in the game, so switching the Sun off shows on a mesh only where no other light reaches it.

Switch a Sun during the game

Link a Light_State event, or a Set_Light_Color event set to black, to the Sun itself.

  • When you save, RED+ points every event link to a Sun at that Sun's "RF+ Sun" light, and when the level opens it points them back at the Sun. In RED the link goes to the Sun, and the game finds the light.
  • A link drawn to the "RF+ Sun" light itself works too. After the level is opened again, it shows as a link to the Sun.
  • Link an event, not a trigger: in the game a trigger linked straight to a light does nothing.
  • The event changes the light on meshes and players only. The level's baked lighting stays as it was baked.

Levels from other editors and older builds

  • RED+ keeps the Suns in its own section of the level file, which other editors skip. To them the "RF+ Sun" lights are ordinary lights: RED, Alpine Faction's editor and Glacier bake them like any other light. Delete them there before baking in that editor.
  • If a level was last saved by an editor that kept the "RF+ Sun" lights but not RED+'s section, RED+ rebuilds a Sun from each light when it opens the level: its direction, colour and brightness. Edge softness starts at 1, and the rebuilt Suns stand at the centre of the level, 3 m apart. The log has a line containing [RF+ Sun] rebuilt the Sun from the for each one.
  • A level with several Suns that was saved again by a RED+ build that holds only one Sun comes back with all of them: RED+ rebuilds the extra Suns from their "RF+ Sun 2" and later lights in the same way. Check their Edge softness afterwards.
  • A level saved by a newer Alpine Faction editor (RFL version 306) can carry that editor's own Sun. RED+ does not read it, and it is not kept when you save the level in RED+. The log window says so when the level opens.