Shadow groups

From Blood Wiki
Jump to: navigation, search
This page is not finished
You can help by editing and extending it.

Shadows group is a combination of _cs (cast shadows) and _rs (receive shadows) entity keys used to control how entity cast lightmap/vertex light shadows. Shadow groups are used to hijack the shadow casting in order to fix bugs, remove unneeded shadows or add shadow casting for bmodels.

A numbers should be used for shadows groups. BloodMap allows shadow groups from -127 to 127.

Shadows groups are applied during lightmapping of entity using this rules:

  1. Receive shadows is 0: object will not receive shadows from anything (occlusion test is skipped)
  2. Receive shadows is 1: only receive shadows from self and from objects with cast shadows 1 (the worldspawn cast shadows).
  3. Receive shadows is > 1: only receive shadows from objects with same abs(cast shadows) and worldspawn.
  4. Receive shadows is < 1: only receive shadows from objects with same abs(cast shadows).
  5. Cast shadows is 0: object will not cast any shadows (not included in raytracing tree).
  6. Cast shadows is 1: only cast shadows on objects with receive shadows 1 (the worldspawn receive shadows).
  7. Cast shadows is > 1: only cast shadows on objects with same abs(receive shadows) and worldspawn.
  8. Cast shadows is < 1: only cast shadows on objects with same abs(receive shadows).
Tip: This rules is written against BloodMap compiler, Q3map2 rules may differ

Default shadow groups

By default worldspawn and func_group have cast shadows and receive shadows 1. All other entities are mean to be moved/deleted during gameplat and so have cast shadows 0 and receive shadows 1.

Mapper can make levels to look better if entities which are known to be static (such as func_walls, trains rendered in the start position etc.) will receive explicit shadow casting.

Usage example 1: Trap made of func_train

You have two func_trains one replacing other during trap activation (Blood Omen spike traps). So you need both trains be rendered in their destinatino position, having world shadows cast upon them, but not casting shadows from each other.

Solution: set _cs 2 _cs -2 on first train, and _rs 3 _cs -3 on the second. The point is that each train should have receive shadows group that is able to receive shadows from world, and cast shadows that is not casting to world, but casing to object itself (so ambient occlusion would be correct). The usage of 2 and -3 are casual, it can be 3 or -5, 6 and -10, no matter, just it has to be different.

See also

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox