View Issue Details

IDProjectCategoryView StatusLast Update
0005084The Dark ModGraphicspublic09.03.2020 04:32
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.08Fixed in VersionTDM 2.08 
Summary0005084: Interaction culling and Shadowhide WIP performance
DescriptionThe purpose of this issue is to track the following forum thread:
  http://forums.thedarkmod.com/index.php?/topic/20195-performance-regression-shadowhide/

The problem is that rendering performance got worse on SVN than on 2.07, when testing on the Shadowhide WIP (Painter's Wife).
Steps To ReproduceStart the aforementioned FM and execute: setviewpos 80 -300 -125
See forum thread for more details.
TagsNo tags attached.

Relationships

related to 0005172 resolvedstgatilov Improve interaction culling: case when player-visible object is not visible from light 

Activities

stgatilov

stgatilov

29.12.2019 06:47

administrator   ~0011951

The initial results on my machine were:
    2.07 hotfix: 48-50
    svn8334: 48-50
    svn8346: 58-60
    svn8401: 35-40
    svn8401 with reverted 8380,8381 and r_useMultiDraw 0: 58-60
    svnHEAD: 38-40
    svnHEAD with reverted 8380,8381 and r_useMultiDraw 0: 58-60
So:
1) performance improved between 8334 and 8346 (most likely due to the change in VertexCache implementation)
2) performance worsened between 8346 and 8401 (due to removal of interaction culling).
stgatilov

stgatilov

29.12.2019 06:56

administrator   ~0011952

Some fixes by Duzenko to partly recap the removed culling:
  svn rev 8454 (40-45 FPS): for off-screen entities, drop interaction if entity and light are in disconnected portal areas
  svn rev 8456 (45 FPS): with loose shadow bounds, cull by viewport and by light scissor rect
  svn rev 8459 (57-60 FPS): moved both new culling checks earlier avoids instantiating dynamic models and building shadow geometry
stgatilov

stgatilov

29.12.2019 09:34

administrator   ~0011960

Next, the original interaction culling (previously removed in svn rev 8380) was restored with a few small fixes:
  svn rev 8468: fixed issue with idBounds intersection (see 0002734) --- that could ruin the case when shadow frustum does not hit the portal
  svn rev 8469: interaction culling in its original form fully restored (note: additional checks added by Duzenko also remain)
  svn rev 8473: added check for return value of ProjectionBounds inside FloodFrustumAreas (probably not important)

After that, it was discovered that FloodFrustumAreas implementation from vanilla D3 is wrong, and can erroneously remove shadows a rare cases:
  http://forums.thedarkmod.com/index.php?/topic/20195-performance-regression-shadowhide/&do=findComment&comment=442268
The repro map added to SVN as test/FloodFrustumAreas_bug.map

Aside from that, the main problem with interaction culling still remained: it could not be used in parallel from multiple threads.
Because it cached the list of portal areas found by FloodFrustumAreas in the interaction, with a use of global custom allocator.
stgatilov

stgatilov

30.12.2019 15:35

administrator   ~0011984

Finally, interaction culling was changed to make it on-the-fly and threadsafe:
  svn rev 8475: redone the whole culling code (better read svn commit message)
  svn rev 8476: two new checks added by Duzenko refactored into proper place (again, see commit message)
Also, the new algorithm is not susceptible to the bug mentioned above.

Finally, there is a note about a bit of missed opportunities:
  https://forums.thedarkmod.com/index.php?/topic/20195-performance-regression-shadowhide/&do=findComment&comment=442331
Perhaps would be done later.
stgatilov

stgatilov

03.01.2020 06:07

administrator   ~0012033

For me, performance is the same on 2.07 and current SVN, with the updated version of the map.

Issue History

Date Modified Username Field Change
29.12.2019 06:46 stgatilov New Issue
29.12.2019 06:46 stgatilov Status new => assigned
29.12.2019 06:46 stgatilov Assigned To => stgatilov
29.12.2019 06:47 stgatilov Note Added: 0011951
29.12.2019 06:56 stgatilov Note Added: 0011952
29.12.2019 09:34 stgatilov Note Added: 0011960
30.12.2019 15:35 stgatilov Note Added: 0011984
03.01.2020 06:07 stgatilov Note Added: 0012033
03.01.2020 06:08 stgatilov Status assigned => resolved
03.01.2020 06:08 stgatilov Resolution open => fixed
03.01.2020 06:08 stgatilov Fixed in Version => TDM 2.08
09.03.2020 04:32 stgatilov Relationship added related to 0005172