New light leaks in 2.12: Difference between revisions
WS2 added |
No edit summary |
||
Line 59: | Line 59: | ||
|- | |- | ||
| ws2_homeagain | | ws2_homeagain | ||
| 4385 420 -410 -30 -110 0 | | | ||
4178.12 391.47 -94.56 -28.8 43.6 0.0 | 4385 420 -410 -30 -110 0 | ||
4347.92 -271.22 57.53 -0.8 18.4 0.0 | 4178.12 391.47 -94.56 -28.8 43.6 0.0 | ||
4347.92 -271.22 57.53 -0.8 18.4 0.0 | |||
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1] | | [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1] | ||
| (not yet) | | (not yet) |
Revision as of 22:29, 22 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:
- Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.
- 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.
Validation
Before adding an issue here, please make sure to check the following steps:
- Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.
- Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.
The light leak can be caused by this issue only if both points are true.
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 | svn rev 241: global workaround |
ws2_homeagain |
4385 420 -410 -30 -110 0 4178.12 391.47 -94.56 -28.8 43.6 0.0 4347.92 -271.22 57.53 -0.8 18.4 0.0 |
1 | (not yet) |
cos3_sacricide | -1283.53 -380.68 83.25 15.2 -38.6 0.0 | 1 | (not yet) |