New light leaks in 2.12: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(Initial commit (ws1 only))
(No difference)

Revision as of 18:38, 16 December 2023

There is major change in TDM 2.12 regarding how shadows are generated due to issue #5172. As the result, some we might see some major light leaks in the old missions.

Description

As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too). The shape of such light leaks does not depend on the camera position. Usually the problem is caused by using caulk on brushes: light leaks through the caulk.


New behavior (default in TDM 2.12 and after):

  • r_useLightPortalFlow = 2
  • r_useLightPortalFlowCulling = 1

The shadows are computed differently for world areas and for models:

  1. Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.
  2. A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!

As an exception, some models switch from p.2 to p.1 and cast shadows everywhere. For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".


Old behavior (default in TDM 2.11 and before):

  • r_useLightPortalFlow = 1
  • r_useLightPortalFlowCulling = 0

The behavior here is different depending on the type of light:

  • Static lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.
  • Dynamic lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.

The light is static if it has not moved since game start. That's the case when engine uses precomputed shadow volumes for world geometry.

Description

List of issues

Mission name getviewpos coordinates Links to forums Applied fixes
ws1_north -1153.92 3523.22 -955.75 29.8 -145.6 0.0

-664.04 2894.9 -635.75 10.2 9.9 0.0

1

2

svn rev 241: global workaround