View Issue Details

IDProjectCategoryView StatusLast Update
0003970The Dark ModCodingpublic12.12.2014 08:14
ReporterSteveL Assigned ToSteveL  
PrioritynormalSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionTDM 2.03 
Summary0003970: Rain and lightgem performance optimization
DescriptionRain gets re-calculated from scratch and re-uploaded to the gpu twice during the lightgem rendering passes. I got 10 extra FPS by stopping that from happening in the street spot in The Accountant that was being discussed in the forum today.
Additional InformationThe biggest issue with heavy rain is 1000s of vertices being calculated and uploaded to the GPU each frame. That's an issue for a room full of AI too, but the lightgem doesn't make the situation any worse where AI are concerned. An AI can use the same mesh and vertices no matter what angle it's seen from, so it only needs its verts doing once each frame, but particles (that turn to face the viewpoint) have to be recalculated and reuploaded for every viewpoint in a frame.

I got 10 extra FPS (48 from 38) in several tests when looking up the rainy street in The Accountant, the spot that was under discussion in the forum today. I took the readings with the 2 street AI behind me.

I don't think that could have been fixed back when the lightgem was first being worked on. You can't use the "suppressInViewID" property of render entities to stop worldspawn weather patches being drawn, but we can do it now that the engine is open source.
TagsNo tags attached.

Relationships

related to 0000047 resolvedSteveL Lightgem Level Affected By Particles 

Activities

SteveL

SteveL

12.12.2014 00:35

reporter   ~0007242

A few more tests in a test map with no other stuff going on, just a series of weather patches sized 880x912 with texture textures/darkmod/weather/rain_downpour

# patches / FPS standard / FPS with lightgem tweak
6 patches / 49fps / 60+ fps
9 patches / 35fps / 60+
12 patches / 26 / 53
18 patches / 18 / 41
24 patches / 14 / 33
nbohr1more

nbohr1more

12.12.2014 02:13

developer   ~0007246

This fix should also fix tracker 47
SteveL

SteveL

12.12.2014 07:56

reporter   ~0007247

Committed at 0006392

/trunk/renderer/draw_common.cpp
/trunk/renderer/tr_light.cpp
/trunk/renderer/tr_local.h

Includes an new defined constant in tr_local.h so that the rule makes sense in the engine (which doesn't know about the game logic or the lightgem), and I've used the new constant in draw_common.cpp where soft particles previously had a hard-coded value to do the same thing.

Issue History

Date Modified Username Field Change
11.12.2014 00:31 SteveL New Issue
11.12.2014 00:31 SteveL Status new => assigned
11.12.2014 00:31 SteveL Assigned To => SteveL
12.12.2014 00:35 SteveL Note Added: 0007242
12.12.2014 02:13 nbohr1more Note Added: 0007246
12.12.2014 07:09 SteveL Relationship added related to 0000047
12.12.2014 07:56 SteveL Note Added: 0007247
12.12.2014 08:14 SteveL Status assigned => resolved
12.12.2014 08:14 SteveL Resolution open => fixed