Skip to content
RED+
Contents

Lighting

Light Cookies

A light cookie, or gobo, is a greyscale pattern that a light projects. White passes light, black blocks it and grey dims it. The pattern is baked into the lightmap, so it costs nothing in game and the game shows it with no special support. See Which game plays what RED+ saves.

Use a cookie for a pattern with no geometry behind it: blinds you never modelled, a grate, leaves outside a window. Brushes and meshes already cast real shadows in the bake.

Where to find it

The Light Cookie (RED+) group at the bottom of Light Properties.

How to use it

  1. Select a light and open Light Properties.
  2. In Light Cookie (RED+), click Library..., pick a pattern and click Use This. You can also type a texture name in Texture.
  3. Set Sharpness. Start at 100 and come down for softer edges.
  4. Click OK.
  5. Aim the light at the surface the pattern should fall on.
  6. Choose Level, Calculate Lighting (Shift+L).

Settings

  • Texture: the file name of the cookie image. Leave it blank for no cookie.
  • Sharpness: 0 to 100 %. At 100 the image is projected as it is, with crisp edges. Lower values use a blurred version of it, and 0 is the softest. A blank field means 100. At 80 or more, RED+ leaves the surfaces the light reaches out of the smoothing and edge blending it applies to lightmaps after the bake, so crisp edges stay crisp.

Library... opens the Light Cookie Library. It lists the cookies, each with a thumbnail if it is a TGA file and a grey box if not, and shows a large preview and a one-line description of the selected one.

  • It lists the images in user_maps\textures\Gobos in your Red Faction folder and in the gobos folder of RED+. If both have a file of the same name, it lists the one in user_maps\textures\Gobos.
  • Use This, or a double-click, copies the image into user_maps\textures\Gobos and puts its name in Texture. A file of that name already there is kept, not overwritten.
  • If the copy fails, RED+ says so and chooses nothing.
  • Browse Files... picks an image from anywhere. RED+ stores only its file name and does not copy it, so keep the image in a texture folder that existed when RED+ started, such as user_maps\textures\Gobos.
  • Only TGA files get a preview. Other formats show no preview for this format.

RED+ copies into the folder RF_DIR in redplus.ini names or, without RF_DIR, the Red Faction folder RED+ sits in. If it cannot find Red Faction, Use This shows a message and chooses nothing. Set RF_DIR and try again.

The starter set

FilePattern
gobo_blinds.tgaVenetian blinds, horizontal slats
gobo_window4.tgaFour-pane window with frame and mullions
gobo_grate.tgaCeiling grate or vent, square mesh
gobo_bars.tgaVertical bars: prison window, railings
gobo_foliage.tgaDappled light through leaves
gobo_softspot.tgaSoft round pool that takes the hard edge off a spotlight

Each is a 256 x 256 TGA.

How the pattern maps to the light

  • The image is projected from the light along the direction it points. Its centre lies on the light's aim.
  • On point lights and on spot lights with an FOV of 180 degrees or less, the image covers 90 degrees around the aim, 45 degrees to each side. A spot light's FOV does not change that.
  • On a spot light with an FOV over 180 degrees, the image covers 360 degrees minus the FOV around the aim: 90 degrees at an FOV of 270, less above it and more below it. See Spot lights.
  • Outside the image, and behind the light, the light is left alone.
  • Colour in the image is ignored: RED+ uses its brightness.
  • Turning a light around its own aim does not turn the pattern. Rotate the image instead.

Making your own

  • Use a greyscale image. Save it as a 24- or 32-bit image. You can pick TGA, PNG, JPG, VBM and DDS files.
  • 256 x 256 is plenty: the bake blurs the image for you as Sharpness comes down.
  • A paletted or DXT-compressed image does not load. The bake log then says is in a format this cannot read (paletted or DXT); convert it to TGA or PNG.
  • RED+ reads each cookie image once per session. After you edit an image, restart RED+ before you bake again. A cookie that fails to load is not tried again until you restart RED+.

Good to know

  • A cookie is not a shadow. Anything you build already casts one, so if you modelled the blinds you do not need a cookie.
  • The cookie is saved with the level so RED+ remembers it. The game never needs the image, because the pattern is in the lightmap.
  • The cookie is applied where the bake works out the light's shadows, so a light with Shadow Casting cleared projects no cookie.
  • If the bake log says a cookie assigned but NONE reached the bake, no cookie was applied in that bake. Look above it for did not load or is in a format this cannot read. If neither is there, check that the light is not Editor only and that it lights something.
  • When RED+ starts, the log says how many cookies it found in its gobos folder. A line containing no light cookies in means that folder is missing or holds no TGA files.