Borderlands shadows and framerate performance

There’s been a large amount of discussion on the Gearbox forums as well as other places with regards to Borderlands (PC) having horrible framerates. Numerous people reported that disabling Dynamic Shadows in the Video configuration menu (also known as DynamicShadows=False in WillowEngine.ini) increased their framerates dramatically (by almost 2x).

People have also complained about slow mouse response, recommending all kinds of weird workarounds.

Well, I can confirm both statements on my own system which uses an nVidia GeForce 9800GT (model BFGE981024GTGE). All of the below tests were done on said card, on Windows XP SP3, the latest DirectX 9 runtimes, and nVidia driver version 195.62. Your experience may vary depending on what card you have and other whatnots.

I began by looking at WillowCompat.ini and determined that depending on what model of video card you have (based on PCI Device ID; you can look this up using GPU-Z — there are multiple revisions of the same type of card, so keep that in mind) the game chooses options for you. In my case, my card is PCI Device ID 10DE-0614 (the last 4 hexadecimal digits are what defines card model). There appear to be some oddities in WillowCompat.ini too; for example, Trilinear=True, which isn’t defined or used in any other INI file. This probably enables/disables trilinear filtering, but I’m surprised that setting isn’t defined anywhere else.

Anyway, I experimented with combinations of certain WillowEngine.ini settings, as I wanted to find out what config options — or combination of them — were causing the framerate drop. I spent a couple hours this weekend doing tests, using the entrance at Krom’s Canyon as my testing environment. The reason I chose Krom’s is that it loads very quickly, contains a good number of high-polygon models, textures which make use of reflections (think bump mapping), in addition to a large number of shadows. I actually saw some reflection/texture rendering issues while in Krom’s, which is what started me on this whole goose chase to begin with….. :-)

Finally, I should note that with regards to mouse responsiveness, I have bEnableMouseSmoothing=False set in WillowInput.ini, as well as OneFrameThreadLag=False in WillowEngine.ini (edit 2015/09/13: you should not set OneFrameThreadLag=False, as documented here). The column is meant to represent how the mouse feels both in-game as well as in the UI; players very likely know what I mean by “floaty” vs. “accurate”.

[1] [2] [3] [4] [5] Comments/Details
33 Floaty True True True
64 Accurate True True False No object or terrain shadows
38 Floaty True False True
65 Accurate True False False No object or terrain shadows
38 Floaty False True True No gun shadows
64 Accurate False True False No object or terrain shadows
38 Floaty False False True No gun shadows
65 Accurate False False False No object or terrain shadows

Table header legend:

[1] = Average FPS
[2] = Mouse responsiveness
[3] = DynamicShadows setting
[4] = LightEnvironmentShadows setting
[5] = bEnablePSSMShadows setting

Screenshots were taken for each of the above tests:

What this chart proves is that bEnablePSSMShadows is what’s responsible for the increased/decreased framerate as well as mouse responsiveness. Given that fact, there’s no real point to DynamicShadows=True when PSSM is disabled. DynamicShadows=False seemed to disable things like rendering shadows across your gun and so on; not really something I care about.

This, of course, made me ask: “What exactly is PSSM?” Thankfully there’s a significant amount of documentation on Parallel-Split Shadow Maps. Here’s a few resources I found online which visually demonstrate the concept:

The UE (Unreal Engine) has a multitude of shadow map methods which are available: PSSM, VSM (Variance Shadow Maps), and something called PCF (Percentage-Closer Filtering) or Branching PCF. Here are some more resources:

I tried a multitude of config combinations with regards to these features to see if I could keep some form of shadowing but without the performance hit. Needless to say, I wasn’t successful.

So it seems that the best way to achieve proper framerates, at least with a 9800GT, is to set bEnablePSSMShadows=False and DynamicShadows=False (for a few extra fps) and accept the results.

Other footnotes:

  • Adjusting MinShadowResolution and MaxShadowResolution had no effect on any of these tests. I mention this because I’ve seen forum users advocating decreasing these settings (from 1024 to 256) to solve framerate/mouse responsiveness issues. I adjusted these and found there to be no visual difference, nor any difference in framerate.