Skip to content
RED+
Contents

Meshes

Mesh shadows and Check Mesh Shadows

Placed meshes and clutter objects cast shadows into the baked lightmaps. You can switch the shadow off for any of them. Check Mesh Shadows lists every one in the level and repairs mesh files whose stored spheres are too small.

What casts a shadow

  • Placed static meshes (.v3m) and character meshes (.v3c) cast shadows when you calculate lighting. Effects (.vfx) do not.
  • RED's clutter objects cast shadows too, without being converted to mesh objects.
  • A character mesh casts its rest pose: the shape RED shows with no State Anim. An animated .v3c casts that pose, not a frame of its animation, and a swaying plant casts its resting shape.
  • Every part of a mesh made of several parts casts, where RED draws it.
  • The shadow uses the most detailed version (LOD 0) of each part.
  • Meshes hidden in the editor do not cast shadows.
  • A placed mesh the editor has not loaded yet is loaded for the bake.
  • Meshes also block ambient occlusion, cut-outs included.

Switching a shadow off

  • One mesh: in Mesh Properties, clear Casts shadow. It is ticked for every mesh until you clear it. With several meshes selected and a mix of settings, the box shows a grey tick and is left as it is unless you click it.
  • A selection: select placed meshes, clutter or both, then choose RED+, Casts Shadow Off for Selection (RF+). RED+, Casts Shadow On for Selection (RF+) turns the shadows back on. Other selected objects are skipped. A message says how many meshes and clutter objects changed. Clutter has no Casts shadow checkbox, so these commands are the only switch for it.

The next bake applies the change. The setting is saved with the level, and only the lighting bake uses it.

See-through materials

Palm fronds, gratings and fences get their shape from their texture's alpha channel rather than from their polygons. RED+ cuts the shadow of such a mesh out of its texture, so it casts its own silhouette instead of a solid rectangle. This needs all of the following:

  • The material was exported see-through: its render mode uses alpha blending or alpha testing.
  • The texture has transparent texels, in a format RED+ can cut out.
  • The mesh has texture coordinates.

Texels at least half opaque block light. Texels below half let it through. The texture repeats across the mesh as it does when drawn. Only 32-bit textures and 16-bit 4444 textures can be cut out. Any other format, such as paletted, 16-bit 565 or 1555, 24-bit or DXT compressed, keeps a solid shadow.

If a material's texture has transparent texels but the material was not exported see-through, the mesh still casts a solid shadow. The bake log counts such parts with this line:

mesh chunk(s) carry a texture WITH transparency but a render mode that says opaque

Export that material see-through to fix it. The log also has a line containing alpha mask for every mesh texture the bake reads, saying how many of its texels are transparent, which helps you find the texture.

Messages in the bake log

The log is logs\RedPlusEditor.log in the RED+ folder.

Log textMeaning
mesh occluders:How many placed meshes and clutter objects cast shadows in this bake.
casts NO shadowThe mesh or clutter object gave no geometry to the bake, for example an effect. The line says why.
rejected, its geometry could not be readThe geometry could not be read. The mesh casts no shadow.
with Casts shadow off, so not castingHow many meshes and clutter objects have their shadow switched off.
hidden in the editor, so not castingHow many are hidden in the editor.
reaching past their own sphereThe mesh casts its shadow, but a part reaches past its stored sphere. See below.

Check Mesh Shadows

RED+, Check Mesh Shadows (RF+)

This command is only in the RED+ menu. It opens the Mesh Shadow Check window, which lists every mesh file placed in the level and every clutter object, one row per file. A clutter row shows the clutter class and its mesh file. A file placed more than once shows how many times, for example x3.

Each row gives the file name, its status, the radius of RED's sphere for the mesh, how far the drawn geometry reaches from the sphere's centre, the ratio of the two, and the number of parts.

StatusMeaning
okEvery part lies inside its own stored sphere.
undersizedA part reaches past its own stored sphere. The mesh still casts its full shadow.
Other textThe object casts no shadow, and the text says why, for example that its shadow is switched off, that its geometry could not be read, or that it is an effect.

RED culls a mesh with a sphere it works out from the spheres of the mesh's parts. When a part reaches past its own sphere, the mesh can disappear while some of it is still in view. That is what undersized warns about. It does not affect the shadow.

The summary above the list counts the files and placements, the rows that cast no shadow, and those with a part past its sphere. The line below the list gives the selected mesh's sphere centre and radius, how far its geometry reaches, its vertex and part counts, and how many parts reach past their own sphere. It ends with Fix Selected grows those radii. or Nothing to repair.

Fix Selected

  1. Select an undersized mesh.
  2. Click Fix Selected. RED+ looks for the file by name in user_maps\meshes, red\meshes and the folders inside them, in your Red Faction folder.
  3. Confirm. The question says how many parts reach past their spheres and how many copies of the file were found. RED+ grows the stored radius of each of those parts to 1.05 times its reach, in every copy. Part positions are left as they are.
  4. Restart the editor, reopen the level, then click Re-check. RED keeps the geometry it has loaded until it exits, so until you restart, the list still shows the old spheres.

Before it changes a file, RED+ copies it to a backup beside it with .bak-redplus added to the name, for example lamp.v3m.bak-redplus. If that backup already exists, the next one is lamp.v3m.bak-redplus1, then lamp.v3m.bak-redplus2, so every fix keeps its own backup. The changed file is written in full before it replaces the original, so a failed write leaves the original untouched.

Fix Selected refuses:

  • A character mesh (.v3c). Its spheres cover its animation, so there is nothing to repair.
  • A clutter object. Its mesh belongs to the game's own files.
  • A mesh whose parts all lie inside their spheres (status ok).
  • A mesh whose geometry could not be read.
  • A copy of the file in which a part's stored sphere cannot be found exactly once. That copy is skipped and the log names it. The result message says how many files could not be changed.

If RED+ cannot tell where Red Faction is installed, it asks you to set RF_DIR in redplus.ini. Restart the editor after you set it. See redplus.ini.

Re-check and Copy Report

  • Re-check measures the placed meshes and clutter again, as the editor has them loaded. It is not run when you open another level, so click Re-check then.
  • Copy Report copies the rows of the list to the clipboard as text, without the summary and the placement counts.
  • The window stays open while you work in the editor. Choosing the command again brings it to the front.

Good to know

  • Check Mesh Shadows measures the meshes the same way the bake does.
  • Fix Selected changes the mesh file itself, so every level that uses that mesh gets the fix.
  • For cut-out textures that hide what is behind them in game, see Fix Texture Alpha.
  • For a prop that must be shadowed by the level in game, see Convert to Brushes.