Performance Tweaks: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
 
(835 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article relates to performance issues ''for players''. For performance information ''for mappers'', see [[Performance: Essential Must-Knows]]
{{important|headline=For Players|text=This article relates to performance issues ''for players''. For performance information ''for mappers'', see [[Performance: Essential Must-Knows]] }}
 
 


== '''Minimum Specifications''' ==
== '''Minimum Specifications''' ==


* CPU: 1.5Ghz with x64 instructions (64-bit) and SSE2 SIMD support
<br>
* GPU: OpenGL 3.2 compatible with at least 512MB of VRAM ( roughly the performance of a Geforce GT 8800 )
* '''CPU''': 1.5Ghz with x64 instructions (64-bit) and SSE2 SIMD support
* RAM: 2GB
* '''GPU''': OpenGL 3.2 compatible with at least 512MB of VRAM ( roughly the performance of a Geforce GT 8800 )
* Storage: 30GB free space ( depending amount of missions you download )
* '''RAM''': 2GB+
* '''Storage''': 30GB free space ( depending amount of missions you download )
* '''Display''': We recommend a display that can render '''at least 640x480''' for legible menus and hud. <br>(''Some analog NTSC televisions with 480i have high quality sub-pixels that can render an image that looks approximately like 1024x480 or 800x480''.<br>''If you PC has analog TV out, try configuring 800x600 or 1024x768 '''[[Resolutions|resolutions]]''' for improved fidelity.'')


You may be able to play on weaker hardware using config tips in this wiki but you will likely encounter many missions that are too taxing.
<br>You may be able to play on weaker hardware using config tips in this wiki but you will likely encounter many missions that are '''[[#Mission_Updates|too taxing]]'''.
<br><br>The Dark Mod 1.0 was originally released in 2009. The average mission designer and player of that time had a Geforce 6600GT and AMD Athlon 64 X2 2GHZ.
<br><br>The Dark Mod 1.0 was originally released in 2009. The average mission designer and player of that time had a Geforce 6600GT and AMD Athlon 64 X2 2GHZ.
<br>While some missions were playable all the way down to a Pentium 4 2.8GHZ with an Geforce FX 5200, this is well below the expected audience for this project.
<br>While some missions were playable all the way down to a Pentium 4 2.8GHZ with a Geforce FX 5200, this is well below the expected audience for this project.
<br>Current Intel integrated GPU's have better performance than the Geforce 8800 that was a very high-end card in 2009.
<br>Current Intel integrated GPU's have better performance than the Geforce 8800 (which was a very high-end card in 2009).
<br>See [[Performance_Tweaks#Hardware_Considerations|Hardware Considerations]] for additional details.
<br>''( Low-power mobile chips are known to throttle under heavy load, especially when using integrated graphics. )''
<br><br>Note: Low-power mobile chips are known to throttle under heavy load, especially when using integrated graphics.
<br><br>'''See [[#Hardware_Considerations|Hardware Considerations]] for additional details.'''
<br><br>
<br>


{{clear}}
{{clear}}
<br>
<font size="4">


== '''Show FPS''' ==
== '''Conventions''' ==
</font>


Most of the changes demonstrated in this article are via "Console variables" '''[[Cvars_in_The_Dark_Mod|CVARS]]'''.


First, you can check how many {{abbr|FPS|frames per second}} are achieved by opening the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde, {{key|^}} on German keyboards) and type:
The "seta" prefix is intended to save these settings permanently so that they are retained on restart and that
is what is used by Darkmod.cfg.


com_showFPS 1
Note: With the exception of '''[[#Reduce_your_resolution!|Screen Resolution]]''' and '''[[#Image_downsizing|Image Downsize]]''', most settings can be changed in realtime in the console or via a '''[[Bindings_and_User_Settings|key bind]]''' in DarkmodKeybinds.cfg.
<br> (Also, '''[[Performance_Tweaks#Lower_your_Render_Scale_(New_2.07)|"Render Scale"]]''' can be changed in realtime and is preferred to Screen Resolution anyway)


=='''Show Position'''==
<pre>


To identify the locations where problems are found, use these two cvars to render the positions as an overlay display while playing.
seta something "value"


Open the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde, {{key|^}} on German keyboards) and type:
</pre>


<pre>
=== OBSOLETE Suggestions ===


g_showviewpos 1
Some configuration suggestions in this wiki are no longer applicable in the latest TDM versions and are only
<br>preserved for players running '''[[#Legacy_Versions|<u>old versions</u>]]'''. Where applicable these are labelled '''OBSOLETE''' so you can ignore them.


con_noPrint 0
=== Temporary Testing ===


</pre>
To temporarily test any settings, you can drop the "seta" and simply invoke the cvar and it's value (without double quotes) in
the console.


===TDM Show Viewpos ( New 2.12 )===
Example:


To accomplish the basically the same thing ( a little more refined ) the new tdm_show_viewpos cvar is now available
Open the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde, {{key|^}} on German keyboards) and type:


<pre>
<pre>


tdm_show_viewpos 1
r_softShadowsRadius 2


</pre>
</pre>


== '''Stop Time''' ==
{{clear}}


Moving and Thinking can impact performance in unexpected ways.
=== Toggle settings in realtime ===
<br>When comparing graphical settings it might be best to "Stop Time" so that the entire scene is frozen
 
<br>and the FPS changes due to '''graphics options''' can be more easily compared.
For example, you could '''[[Bindings_and_User_Settings|bind]]''' both shadow maps and soft shadows to the Z key to enable and disable them both by pressing that key
<br>Open the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde is {{key|^}} on German keyboards) and type:


<pre>
<pre>


g_stopTime 1
bind "z" "toggle r_shadows 1 2; toggle r_softShadowsQuality 0 15; shadowimplchanged"


</pre>
</pre>


in DarkmodKeybinds.cfg
<br><br>( shadowimplchanged is needed when changing '''[[#Change_Shadow_Mode_(New_2.07)|shadow modes]]''' )


<font size="5">
{{clear}}


== '''Optimizing the OS performance'''==
=== Mission.cfg (New in 2.12) ===
</font>


Historically, TDM had significantly better performance on Windows because Doom 3 had no SIMD optimizations under Linux.
When TDM was a Doom 3 mod, you could add a DoomConfig.cfg file to specific missions under doom3/darkmod/fms/mission_name
<br>As of 2.06 and newer Linux TDM has both SSE SIMD and AVX optimizations so it can run faster under Linux due to less OS overhead.
<br>This allowed you customize settings on a per mission basis
<br>Unfortunately, the default "capped FPS mode" has never worked well under Linux so out-of-box Linux still performs worse.
<br>In TDM 2.12 a new config file called mission.cfg was created that allows mission authors to make fleeting setting changes to dynamic cvars
<br>'''Hence we advise switching to [[Performance_Tweaks#Uncap_FPS_(New_in_v2.06) | uncapped mode]] under Linux.'''
<br>You can use this file to replicate the old per mission concept
<br>If you have a weaker CPU and can install Linux ( dual boot, etc ) you may see 5 to 10% performance uplift when configured properly


* Make a mission.cfg file and place it under your darkmod folder. This is your global setting file.
* Make another mission.cfg file and place it under darkmod/fms/<mission_name>. This is your per mission setting file
* Add cvars to the per mission file in the format of seta r_something "0"
* For each cvar added to the per mission file, add the preferred default version to the global setting file


=== All OS Variants: File Permissions ===
To ensure the global setting gets re-applied, uninstall the current mission before installing a new one


Make sure your darkmod folder is located in a non-protected location.
=== Launch Options ===


On Windows, "Program Files" is protected and will cause problems saving any settings or installing Fan Missions.
You can also add the value as part of your target in your shortcut:


On Linux, you should consider creating your darkmod directory under your /home/<username>/ folder to avoid permission issues.
Example with two cvars:


=== Linux UEFI Secure Boot ===
*  {{RMB}} Right click your Desktop shortcut to TheDarkMod and select Properties
*  On the Shortcut Tab enter the following into the "Target:" field


With Secure Boot enabled in the BIOS, some Linux distros will fallback to (slow) open drivers and wont have access to most hardware features.
<pre>
<br>If your Linux distro doesn't offer "Signed Kernels" and "Signed Drivers" disabling UEFI may be the only way to have acceptable performance
<br>We recommend that you consider using a Linux distro that offers Signed Kernels such as the latest Ubuntu, OpenSUSE, Debian, Linux Mint versions


=== Stop running programs in the background ===
"C:\darkmod\TheDarkModx64.exe" +set r_softShadowsRadius 2 +r_useEntityCulling 1


Programs running in the background might either eat up memory that is needed for <s>Doom 3</s> The Dark Mod, and thus cause swapping to the hard disk, or they might consume CPU time or other resources.
</pre>


This can cause either general slowdowns or ''hickups'' during game play.
(Assuming you installed into C:\darkmod)


{{clear}}
* Then {{LMB}} click the Change Icon button and browse for the Darkmod.ico icon in your darkmod install path
* {{LMB}} Click Apply


=== Ensure that Programs are the main priority in the OS ===
See also '''[[#Set_TheDarkMod_to_High_Priority|Set TheDarkMod to High Priority]]'''


To begin the process, type sysdm.cpl in Run box ({{key|Windows}} + {{key|R}}) and hit {{key|Enter}} to open the System Properties.
{{Clear}}
<br>


Select the Advanced tab and under Performance, {{LMB}} click on Settings.
<font size="4">


In the Performance Options box, select the Advanced Tab again.
== '''Evaluation and Diagnostics''' ==
</font>


You will see a section Processor Scheduling
The following options offer basic quick tools to examine performance.
<br>See '''[[Profiling|Profiling]]''' and '''[[Tracy:_timeline_profiler|Tracy Profiler]]''' for advanced (developer level) performance evaluation


Choose "Programs" then {{LMB}} click Apply.
=== Show FPS ===


{{clear}}


<font size="3">
First, you can check how many {{abbr|FPS|frames per second}} are achieved by opening the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde, {{key|^}} on German keyboards) and type:
=== White-list TheDarkMod.exe in Security Software ===
</font>


Make sure that Windows Defender or Anti-Virus, Anti-Spyware, etc aren't constantly scanning or interacting
com_showFPS 1


with TheDarkMod.exe. Add it to your security white-list.
=== Show Position ===


==== Windows 10 Granular Security Options ====
To identify the locations where problems are found, use these two cvars to render the positions as an overlay display while playing.


With new attacks like Meltdown and Spectre, Windows 10 has added CPU architecture specific security fixes.
Open the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde, {{key|^}} on German keyboards) and type:
<br>Many of these have performance impacts. The impact is mostly on Storage access so loading times would
<br>normally be the only casualty of these changes. Still, it's possible that these protections might interfere
<br>with The Dark Mod in other ways.


Please review:
<pre>


https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/exploit-protection-reference?view=o365-worldwide
g_showviewpos 1


and disable the security options you feel are excessive.
con_noPrint 0


<font size="5">
</pre>


=== '''Priority and Affinity''' ===
====TDM Show Viewpos ( New 2.12 )====
</font>


<font size="4">
To accomplish the basically the same thing ( a little more refined ) the new tdm_show_viewpos cvar is now available
==== Windows Priority and Affinity ====
</font>


Note: As of The Dark Mod 2.08 Frontend Acceleration, defaults to 2 threads. When configuring affinity you should
<pre>
<br>ensure that at least 2 cores ( preferably 3 ) are allocated to TDM. If you increase the jobs_numThreads value
<br>you should correspondingly increase the number of cores available in process affinity.


===== Set TheDarkMod to High Priority =====
tdm_show_viewpos 1


* Launch TheDarkMod
</pre>


''(Note: Do not start a mission or test map yet. If the 3D render is initialized it will take a long time to exit fullscreen and return to it.)''
=== Stop Time ===


* {{key|Alt}} + {{key|Enter}} to exit fullscreen
Moving and Thinking can impact performance in unexpected ways.
* {{key|Ctrl}} + {{key|Alt}} + {{key|Del}} to open your Task Manager
<br>When comparing graphical settings it might be best to "Stop Time" so that the entire scene is frozen
* {{RMB}} Right-click on TheDarkMod.exe the choose "Go to Details"
<br>and the FPS changes due to '''graphics options''' can be more easily compared.
* (On the details\processes pane) {{RMB}} Right-click on TheDarkMod.exe and mouse-over Set Priority and choose High
<br>Open the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde is {{key|^}} on German keyboards) and type:
* {{key|Alt}} + {{key|Enter}} to return to fullscreen


You can also edit your Desktop shortcut to start in High priority:
<pre>


* {{RMB}} Right-click your Desktop shortcut to TheDarkMod and select Properties
g_stopTime 1
* On the Shortcut Tab enter the following into the "Target:" field
 
<pre>
 
cmd.exe /c start "TheDarkMod" /High "C:\darkmod\TheDarkMod.exe"


</pre>
</pre>


(Assuming you installed into C:\darkmod)
=== Killmonsters ===


* Then {{LMB}} click the Change Icon button and browse for the Darkmod.ico icon in your darkmod install path
<br>You can roughly estimate the impact of AI by navigating to an area or room where no AI are visible, then invoking "killmonsters" in the console
* {{LMB}} Click Apply
<br>If the FPS jumps up dramatically, your performance issues may be mostly related to AI think cycles on the CPU
<br><br>If so, try TDM config changes that can '''<u>reduce CPU usage</u>''' such as '''[[#Change_Shadow_Mode_(New_2.07)|"Shadow maps mode"]]''', '''[[#Lightgem_Calculation_Optimizations|"Lightgem interleave"]]''', '''[[#Lower_Sound_Quality|"Disable EFX"]]''', '''[[#Revert_to_2.03_AI_Search_behavior|"2.03 Search Behavior"]]''',
<br>'''[[#Disable_Lip_Sync|"Disable Lip Sync"]]''', and '''[[#Particle_Tweaks|"Skip Particles"]]'''
<br><br>( Make sure '''[[#Enable_Multi-Core_(new_in_v2.06)|Multi-core]]''' , '''[[#Frontend_Acceleration_(new_in_v2.09+)|Frontend acceleration]]''' and '''[[#Uncap_FPS_(New_in_v2.06)|Uncapped FPS]]''' are enabled and ensure your '''[[#Optimizing_the_OS_performance|OS is optimized]]''' too )


===== Set TheDarkMod Affinity =====
=== No Shadows ===


If you have a limited number of cores or heavy background tasks are always consuming the
<br>If you disable shadows and there is no performance change (especially if you also '''[[#Killmonsters|killmonsters]]''' ), this can indicate something more complex is impacting performance.
default cores, you can set The Dark Mod to run on a specific core via "affinity"
<br>While shadows are off, try lowering and raising individual quality settings and see whether any have dramatically different performance impact.
<br>If not, raise the issue with mission author in the original '''[https://forums.thedarkmod.com/index.php?/forum/57-fan-missions/ mission thread]''' ( unless the mission is already '''[[#Known_Taxing_Missions|known to be taxing]]''' )


* Launch TheDarkMod
<pre>
* {{key|Alt}} + {{key|Enter}} to exit fullscreen


''(Note: Do not start a mission or test map yet. If the 3D render is initialized it will take a long time to exit fullscreen and return to it.)''
r_shadows 0


* {{key|Ctrl}} + {{key|Alt}} + {{key|Del}} to open your Task Manager
</pre>
* Click the Performance Tab and look at the CPU display to see which cores are the least busy
* (On Windows 10, click the "Open Resource Monitor" link and then click the CPU tab and expand the right pane)
* Close the Resource Monitor and click the Processes Tab in Task Manager
* {{RMB}} Right-click on TheDarkMod.exe the choose "Go to Details"
* (On the details\processes pane) {{RMB}} Right-click on TheDarkMod.exe
* Mouse-over then click "Set Affinity" and uncheck cores you want to prevent TDM from using
* {{key|Alt}} + {{key|Enter}} to return to fullscreen


As with Priority you can set Affinity in your shortcut.
{{clear}}
<br>


Example Target:
<font size="4">


<pre>
== '''Delete Darkmod.cfg after upgrade''' ==
</font>


cmd.exe /c start "TheDarkMod" /affinity 1 "C:\darkmod\TheDarkMod.exe"
If you run tdm_installer to upgrade TDM, it offers you the option to Restore Darkmod.cfg.
 
<br>When you do this, you may be reverting newer '''[[#The_game_is_very_slow!|configuration defaults]]''' that have been changed in the latest release.
</pre>
<br><br>While it may be inconvenient to reconfigure all your preferred settings from scratch, it may be best to start with this step ( deleting Darkmod.cfg )
<br>before tinkering with any other setting changes. ( Especially if you haven't done this for a few upgrade cycles. )
<br><br>Newer TDM versions keep your keybindings and controller settings in a separate file ( DarkmodKeybinds.cfg ) so you will just need to change
<br>resolution, brightness \ gamma, and other graphic quality settings in addition to game-play difficulty settings.
{{clear}}
<br>
<font size="4">


The affinity number is not matched to the number in your performance screen.
== '''Mission Updates''' ==
For example "Core 0" in Task Manager is affinity 1. The values are in Hex but
</font>
are converted from binary where 1 represents an active core and 0 is disabled
in a descending order.


For example: Binary 1110 means Core 3, 2, and 1 are enabled while Core 0 is disabled.
Mission authors often discover performance problems after they release their missions.
Converting from Binary to Hex gives you /affinty E. This is a useful config if the majority
<br>They will occasionally issue new mission versions that have improved performance.
of your processes are running on Core 0. FE for an 8 core chip would accomplish the same result.
<br>Also, the TDM team will sometimes apply fixes to missions that can improve performance and stability in new release versions.
<br>We recommend checking the Mission Downloader for updates to your existing missions ( denoted with an asterisk )
<br>Note: '''Savegames''' do not work between different mission versions.
<br><br>TDM performance can vary wildly depending on what any specific mission author has done to design their mission.
<br>Before deciding that TDM is unplayable on your hardware, please try '''[[#Known_Low_Requirement_Missions|less demanding missions]]'''


Another useful option is 0101 /affinity 5 which will select core 0 and 2 which are "real"
=== Known Taxing Missions ===
cores in a Hyperthreading environment.


* Core 0 is 1
The following are a few missions that are known to challenge low-end hardware configurations
* Core 1 is 2
<br><br>
* Core 2 is 4
* Core 3 is 8
* Core 4 is 10
* Core 5 is 20
* Core 6 is 40
* Core 7 is 80
* Core 8 is 100
* Core 9 is 200
* Core 10 is 400
* Core 11 is 800


Again, the core number does not exclude hyperthread cores so if you have an 8 Core \ 16 thread CPU
* Scroll of Remembrance
you must count all real and hyperthread virtual cores when setting affinity.
* Briarwood Manor
* The Rats Triumphant
* Rightful Property
* A Bridge Too Far
<br>


===== Windows Combined Example =====
=== Known Low Requirement Missions ===
Conversely, here are a few missions that should run well on low-end hardware ( in addition to the included "official" missions )
<br><br>
 
* Closemouthed Shadows
* The Outpost
* The Parcel
* Special Delivery
* The Thieves
* Thief's Den 1
* The Golden Skull
* Langhorne Lodge
* Coercion
* The Bakery Job
* Deadeye
* A Night Of Loot: One Man's Treasure
* Down and Out on Newford Road
* A Matter of Hours
* Sir Talbot's Collatoral
<br>


You can include both priority and affinity switches in your shortcut
=== Missions that require 64-bit ===


<pre>
Some very large missions will not load when running 32-bit TDM versions on Windows ( or may have anomalies on 32-bit Linux )
<br>They simply cause TDM to exceed the Windows "2GB allocation limit" for 32-bit during loading.
<br><br>


C:\Windows\System32\cmd.exe /c start "TheDarkMod" /High /affinity 5 "C:\darkmod\TheDarkMod.exe" +set r_softShadowsRadius 2.5 +r_useEntityCulling 1
* The Painter's Wife
* Penny Dreadful 3: Erasing the Trail
* Shadows of Northdale ACT 1


</pre>
<br>( Note: You may be able to use '''[[#Image_downsizing|image_downSize cvars]]''' to lower resources to load these missions on 32-bit Windows. )
<br>( Note: 32-bit TDM is <u>unsupported</u> as of '''[[What's_new_in_TDM_2.10|TDM 2.10]]'''. We still provide binaries but no assurance that they will work with all missions and OS versions. )


Start TheDarkMod with high priority on Cores 0 and 2 (real cores) and add two '''launch cvars''' ( See [[#Conventions|Conventions]]).
<br><br>


As you can see, you can make a huge launch string but once you go past 2 or 3 cvars it's best to
<font size="5">


use Darkmod.cfg unless you wish to make multiple launchers for testing (etc).
== '''Optimizing the OS performance'''==
</font>
<font size="3">
'''Windows or Linux ?'''
</font>
<br><br>'''[[#Legacy_Versions|Historically]]''', TDM had significantly better performance on Windows because Doom 3 had no SIMD optimizations under Linux.
<br>As of 2.06 (and newer) TDM has both SSE SIMD and AVX optimizations under both Windows and Linux
<br>so '''TDM can now run <u>faster under Linux</u>''' due to less OS overhead.
<br><br>Unfortunately, the default "capped FPS mode" has never worked well under Linux (even in vanilla Doom 3) so <u>out-of-box</u> Linux still performs worse.
<font size="3">
<br>'''Hence we advise switching to the new [[Performance_Tweaks#Uncap_FPS_(New_in_v2.06) | uncapped mode]] under Linux.'''
</font>
<br><br>If you have a weaker CPU and can install Linux ( or dual boot, etc ) you may see 5 to 10% performance uplift when configured properly


===== Process Management Note =====


''You can also either "End Task" on processes that you know you don't need or set them to "below normal" or "low" priority.''
=== Drivers ===


''Moving these low priority processes to a different core via affinity is also an option.''
Ensure that all hardware drivers are installed and up-to-date. See '''[[#Hardware_Considerations|"Hardware considerations"]]''' and '''[[#Linux_UEFI_Secure_Boot|"Linux Secure Boot"]]''' for further details.


''Some processes, such as OneDrive.exe (which is integrated into the OS) will keep restarting so it's best to set these to "low priority"''
=== All OS Variants: File Permissions ===


''If you are unsure what a process does, do not change it until you've researched the process.''
Make sure your darkmod folder is located in a non-protected location.


<font size="4">
On Windows, "Program Files" is protected and will cause problems saving any settings or installing Fan Missions.
==== Linux Priority and Affinity ====
</font>


Note: Linux generally does a good job of ensuring that other applications or processes are not impacting
On Linux, you should consider creating your darkmod directory under your /home/<username>/ folder to avoid permission issues.
<br>game performance ( or really any foreground application performance ).
<br>Managing affinity and\or priority usually has little to no effect in Linux unless you knowingly have lots of other heavy applications running.


===== Linux Priority =====
=== Stop running programs in the background ===


NOTE: Some modern Linux distros that use pipewire audio will not render audio if
Programs running in the background might either eat up memory that is needed for <s>Doom 3</s> The Dark Mod,
<br>the initial command that invokes the application is run as root or sudo. I am currently investigating a workaround.
<br>and thus cause swapping to the hard disk, or they might consume CPU time or other resources.  


You can launch TDM with a very high priority via the "nice" command:
This can cause either general slowdowns or ''hickups'' during game play.


<pre>
{{clear}}
sudo nice --18 su -c /home/user/darkmod/thedarkmod.x64 username
</pre>


There are two dashes in the above command. The first dash just tells the command that we are passing a parameter,
=== Ensure that Programs are the main priority in the OS ===
<br>the second dash indicates a "negative priority number". Confusingly, the larger the negative number the higher
<br>the priority with a maximum value of -20. Conversely the higher the positive integer, the lower the program priority!
<br>For the sake of responsiveness, it is probably best to avoid the top or bottom if the priority range.
<br>Also, note that the command must run as sudo to use negative priority and it's best to use "su -c program username"
<br>so that it is run as "you" (replace username with your username) rather than root so you don't end up with root owned files.
<br>See the visudo change in [[Performance_Tweaks#Linux_Combined_Example|Linux Combined Example]] for details on how to run as sudo without a password
 
Example to launch with lower priority ( lowest possible value 19 ):


<pre>
To begin the process, type sysdm.cpl in Run box ({{key|Windows}} + {{key|R}}) and hit {{key|Enter}} to open the System Properties.  
nice -10 /home/user/darkmod/thedarkmod.x64
</pre>


You can also change the priority of TDM while it is running via "renice" and "pidof"
Select the Advanced tab and under Performance, {{LMB}} click on Settings.


<pre>
In the Performance Options box, select the Advanced Tab again.
renice -n --18 -p $(pidof thedarkmod.x64)
</pre>


===== Linux Affinity =====
You will see a section Processor Scheduling


Modern Linux operating systems will list cores with a list starting with 0, so ( for example ) the top core number in an 8 core CPU will be 7.
Choose "Programs" then {{LMB}} click Apply.


You can identify cores and whether the cores are hyperthread ( HT ) cores via:
{{clear}}


lscpu -e
<font size="3">


Example:
=== Disable Desktop Effects ===
</font>


    CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ    MINMHZ
(If you are willing to sacrifice you desktop visual behavior and effects for better TDM performance. Note: This can be reverted.)
    0  0    0      0    0:0:0:0      yes    4100.0000 400.0000
    1  0    0      1    1:1:1:0      yes    4100.0000 400.0000
    2  0    0      2    2:2:2:0      yes    4100.0000 400.0000
    3  0    0      3    3:3:3:0      yes    4100.0000 400.0000
    4  0    0      0    0:0:0:0      yes    4100.0000 400.0000
    5  0    0      1    1:1:1:0      yes    4100.0000 400.0000
    6  0    0      2    2:2:2:0      yes    4100.0000 400.0000
    7  0    0      3    3:3:3:0      yes    4100.0000 400.0000


The CPU number above is what the OS recognizes when using affinity commands, the core number is actual core number.
To begin the process, type sysdm.cpl in Run box ({{key|Windows}} + {{key|R}}) and hit {{key|Enter}} to open the System Properties.  
So in the above results, CPU's 4 to 7 are hyperthreading cores whereas cores 0 to 3 are real cores.


To pin TDM to specific cores, you can change the launch options to:
Select the Advanced tab and under Performance, {{LMB}} click on Settings.


<pre>
In the Performance Options box, select the Visual Effects tab.
taskset -c 1,2,3 /path/to/thedarkmod.x64
</pre>


The above example forces TDM to run on real cores 1, 2, and 3. You may use a dash to specify a range of cores (1-3) or even
Check "Adjust for Best Performance" then click Apply.
mix both syntax forms ( 1-3,6 ).


You can also change the core of a running TDM instance by using pidof to auto-locate the PID of the running process:
{{clear}}


<pre>
<font size="4">
taskset -cp 1,2,3 $(pidof thedarkmod.x64)
</pre>


More advanced users may wish to "cpuset" to create a new logical group of cores and caches (etc) then assign TDM to run under
=== '''White-list TheDarkMod.exe in Security Software''' ===
<br>the new CPU Set
</font>


And (of course) you can instead use taskset to move other non-critical processes to other cores or HT cores.
Make sure that Windows Defender or Anti-Virus, Anti-Spyware, etc aren't constantly scanning or interacting


===== Linux Combined Example =====
with TheDarkModx64.exe. Add it to your security white-list.


NOTE: Some modern Linux distros that use pipewire audio will not render audio if
==== Windows 10 Granular Security Options ====
the initial command that invokes the application is run as root or sudo. I am currently investigating a workaround.


In Linux nice and taskset cannot be invoked at the same time to launch an application.  
With new attacks like Meltdown and Spectre, Windows 10 has added CPU architecture specific security fixes.
<br>You can launch TDM and use taskset to change the running process and likewise use renice to change priority
<br>Many of these have performance impacts. The impact is mostly on Storage access so loading times would
<br>To launch with both priority and affinity at once, you can use "schedtool"
<br>normally be the only casualty of these changes. Still, it's possible that these protections might interfere
<br>You will first need to use visudo to allow schedtool to run in sudo without a password
<br>with The Dark Mod in other ways.
<br>visudo will open an editor where you may add the following to the bottom of the file


<pre>
Please review:


%sudo ALL = ( ALL ) NOPASSWD: /usr/bin/schedtool,/usr/bin/nice
'''https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/exploit-protection-reference?view=o365-worldwide'''


</pre>
and disable the security options you feel are excessive.
<br><br>
 
==== BIOS Mitigations ====
 
The Core Isolation vulnerability configuration ( see '''[[#Windows_10_Granular_Security_Options|above]]''' ) is known to cause at least 10% FPS loss
<br>Rather than safelisting TDM, if you do not use virtualization features you can disable virtualization in BIOS
<br><br>Likewise, if you have 4 or more physical CPU cores, you can disable Hyperthreading in BIOS to avoid performance loss
<br>due to many Spectre \ Meltdown mitigations
<br><br>Disabling features in BIOS is the safest way to improve performance issues related to known CPU hardware exploits
<br>Also, some vulnerabilities can be patched via a '''[[#Upgrade_your_BIOS|BIOS Upgrade]]'''
<br><br>
 
==== Disable TDM Connectivity ====


Then simply edit the "command field" for the properties page of your Darkmod launcher icon as follows:
If you decide to bypass / safelist TDM in security software, you can mitigate risks posed by TDM's network connection by setting:


<pre>
<pre>


sudo schedtool -R -p 50 -a 1,2,3,5,6,7 -e nice --17 su -c "/home/user/darkmod/thedarkmod.x64 +set r_shadows 1 +r_ssao 0" username
seta tdm_allow_http_access "0"


</pre>
</pre>


In the above example, priority (-p ) is set to -50 ( highest is -99 aka realtime ) and affinity ( -a ) is set to use real cores 2 to 4 and corresponding HT cores ).
in Darkmod.cfg to block connectivity.
<br>Setting any application to -99 ( realtime ) priority is unsafe because it may be hard to exit or may lockup the OS trying to request resources.
 
<br>schedtool has a "-n" flag for the nice value but it only supports positive nice values so we added the nice invoke after the "-e" ( execute flag ) and
This comes with the caveat that the in-game mission downloader won't work, you'll need to download missions from '''https://www.thedarkmod.com/missions'''
<br>made sure to su ( switch user ) to run thedarkmod.x64 as "username" ( eg whatever your username is ).  
<br>and copying them to your darkmod/fms folder. Unless you know that your TDM executable was at risk for being replaced by a malicious version,
<br>Finally, for good measure we have set shadows to stencil ( 1 ) and SSAO off ( 0 ) using standard Doom 3 style launch options for example syntax
<br>leaving connectivity open on it "while safelisted" is very low risk. You can further mitigate the risk by '''[[#Compile_Darkmod_for_your_own_Hardware|compiling your own executable]]'''.


{{clear}}
{{clear}}
<br>


<font size="4">
<font size="5">


=== '''Disable Desktop Effects''' ===
=== '''Priority and Affinity (Advanced)''' ===
</font>
</font>
----


(If you are willing to sacrifice you desktop visual behavior and effects for better TDM performance. Note: This can be reverted.)
<br>The following sub-section is a deep dive into forcing your Operating System to treat TDM as the '''most important application'''.
<br><br>A well behaved and maintained OS generally will not need to be configured like this so please consider these options
<br>to be an extreme last resort to ensure that no OS performance factors are slowing down TDM
<br>Before applying any of these changes, ensure that you have tuned other '''[[#Killmonsters|CPU related settings]]''' in TDM
<br><br>


To begin the process, type sysdm.cpl in Run box ({{key|Windows}} + {{key|R}}) and hit {{key|Enter}} to open the System Properties.  
<font size="4">
==== Windows Priority and Affinity ====
</font>
----
Note: As of The Dark Mod 2.08 Frontend Acceleration, defaults to 2 threads. When configuring affinity you should
<br>ensure that at least 2 cores ( preferably 3 ) are allocated to TDM. If you increase the jobs_numThreads value
<br>you should correspondingly increase the number of cores available in process affinity.


Select the Advanced tab and under Performance, {{LMB}} click on Settings.
===== Set TheDarkMod to High Priority =====


In the Performance Options box, select the Visual Effects tab.
* Launch TheDarkMod


Check "Adjust for Best Performance" then click Apply.
''(Note: Do not start a mission or test map yet. If the 3D render is initialized it will take a long time to exit fullscreen and return to it.)''


{{clear}}
* {{key|Alt}} + {{key|Enter}} to exit fullscreen
* {{key|Ctrl}} + {{key|Alt}} + {{key|Del}} to open your Task Manager
* {{RMB}} Right-click on TheDarkMod.exe the choose "Go to Details"
* (On the details\processes pane) {{RMB}} Right-click on TheDarkMod.exe and mouse-over Set Priority and choose High
* {{key|Alt}} + {{key|Enter}} to return to fullscreen


<font size="4">
You can also edit your Desktop shortcut to start in High priority:


=== '''Driver Considerations''' ===
* {{RMB}} Right-click your Desktop shortcut to TheDarkMod and select Properties
</font>
* On the Shortcut Tab enter the following into the "Target:" field


''(IdTech4) The Dark Mod was originally based on OpenGL 2.0. (the same as Doom 3)''
<pre>


''GPU manufacturers have largely ignored issues with this older specification so a number of workarounds have been''
cmd.exe /c start "TheDarkMod" /High "C:\darkmod\TheDarkModx64.exe"


''compiled by the community to attend to erroneous behaviors or poor performance.''
</pre>


''As of TDM 2.06 and newer The Dark Mod uses OpenGL 3.x so many of these suggestions are no longer applicable.''
(Assuming you installed into C:\darkmod)


''That said, even OpenGL 3.2 (current requirement) is an old standard so some newer workarounds may be needed.''
* Then {{LMB}} click the Change Icon button and browse for the Darkmod.ico icon in your darkmod install path
* {{LMB}} Click Apply


===== Set TheDarkMod Affinity =====


{{clear}}
If you have a limited number of cores or heavy background tasks are always consuming the default cores,
<br>you can set The Dark Mod to run on a specific core via "affinity"


==== Intel ( new 2.09 ) ====
* Launch TheDarkMod
* {{key|Alt}} + {{key|Enter}} to exit fullscreen


Some Intel drivers do not perform well with persistent mapping enabled.
''(Note: Do not start a mission or test map yet. If the 3D render is initialized it will take a long time to exit fullscreen and return to it.)''
<br>In 2.09 there is a special persistent mapping mode that works better for this hardware.
<br>You must disable standard persistent mapping to use this mode.


<pre>
* {{key|Ctrl}} + {{key|Alt}} + {{key|Del}} to open your Task Manager
* Click the Performance Tab and look at the CPU display to see which cores are the least busy
* (On Windows 10, click the "Open Resource Monitor" link and then click the CPU tab and expand the right pane)
* Close the Resource Monitor and click the Processes Tab in Task Manager
* {{RMB}} Right-click on TheDarkMod.exe the choose "Go to Details"
* (On the details\processes pane) {{RMB}} Right-click on TheDarkMod.exe
* Mouse-over then click "Set Affinity" and uncheck cores you want to prevent TDM from using
* {{key|Alt}} + {{key|Enter}} to return to fullscreen


r_gpuBufferNonpersistentUpdateMode "1"
As with Priority you can set Affinity in your shortcut.


r_usePersistentMapping 0
Example Target:


</pre>
<pre>


cmd.exe /c start "TheDarkMod" /affinity 1 "C:\darkmod\TheDarkModx64.exe"


==== (AMD\ATI) Disable Catalyst AI ====
</pre>


2018: The latest Radeon Crimson and Adrenalin Drivers:
The affinity number is not matched to the number in your performance screen.
<br>For example "Core 0" in Task Manager is affinity 1.
<br>The values are in Hex but are converted from binary where 1 represents an active core and 0 is disabled.
<br>They are in a descending order.


Surface Format Optimization = OFF
For example: Binary 1110 means Core 3, 2, and 1 are enabled while Core 0 is disabled.
<br>Converting from Binary to Hex gives you /affinty E. This is a useful config if the majority
<br>of your processes are running on Core 0. FE for an 8 core chip would accomplish the same result.


[[FAQ#Disable_Catalyst_AI_in_recent_AMD_ATI_drivers|Disable Catalyst AI in recent AMD Drivers]]
Another useful option is 0101 /affinity 5 which will select core 0 and 2 which are "real" cores
<br>in a Hyperthreading environment.


==== (AMD\ATI) Rename the executable ====
* Core 0 is 1
 
* Core 1 is 2
Most modern drivers have built-in profiles for the executable names of commercial games.
* Core 2 is 4
* Core 3 is 8
* Core 4 is 10
* Core 5 is 20
* Core 6 is 40
* Core 7 is 80
* Core 8 is 100
* Core 9 is 200
* Core 10 is 400
* Core 11 is 800


Renaming TheDarkMod.exe to the name of a commercial OpenGL game may gain you some optimizations
Again, the core number does not exclude hyperthread cores so if you have an 8 Core \ 16 thread CPU
<br>you must count all real and hyperthread virtual cores when setting affinity.


or even a Crossfire profile (I believe DarkAthena.exe had one.)
===== Windows Combined Example =====


Known working renames:
You can include both priority and affinity switches in your shortcut


DarkAthena.exe (thus far the most consistent improvement)
<pre>


Doom3BFG.exe
C:\Windows\System32\cmd.exe /c start "TheDarkMod" /High /affinity 5 "C:\darkmod\TheDarkModx64.exe" +set r_softShadowsRadius 2.5 +r_useEntityCulling 1


Wolf2MP.exe
</pre>


Amnesia.exe
Start TheDarkMod with high priority on Cores 0 and 2 (real cores) and add two '''launch cvars''' ( See '''[[#Conventions|Conventions]]''' ).


Brink.exe
As you can see, you can make a huge launch string but once you go past 2 or 3 cvars it's best to


Prey.exe
use Darkmod.cfg unless you wish to make multiple launchers for testing (etc).


==== (Nvidia) Optimus Laptop wont use your Nvidia GPU ====
===== Process Management Note =====


See also: [https://nvidia.custhelp.com/app/answers/detail/a_id/2615/~/how-do-i-customize-optimus-profiles-and-settings%3F]
''You can also either "End Task" on processes that you know you don't need or set them to "below normal" or "low" priority.''


Many Laptops now have the ability to use the GPU that is built into the CPU when not "gaming".
''Moving these low priority processes to a different core via affinity is also an option.''
<br>Unfortunately, sometimes the drivers for these Laptops don't detect TDM as a "game".


The easiest solution is to create a Driver Profile for TheDarkMod.exe or TheDarkModx64.exe in your driver settings.
''Some processes, such as OneDrive.exe (which is integrated into the OS) will keep restarting so it's best to set these to "low priority"''


* Right click {{RMB}} anywhere on your desktop where no icon is shown
''If you are unsure what a process does, do not change it until you've researched the process.''
* Left Click {{LMB}} Nvidia Control Panel
* Then Click on the Programs Tab
* Click "Add" and browse for TheDarkMod.exe or TheDarkModx64.exe
* Then scroll down the settings list and find "OpenGL Rendering GPU"
* Then select your Nvidia GPU from the list of options


[[Image:Nvidia_Profiles.jpg|600px]]
<font size="4">
<br><br><br><br>


{{clear}}
==== Linux Priority and Affinity ====
</font>
----


==== (Nvidia) Disable the Streamer Service ====
Note: Linux generally does a good job of ensuring that other applications or processes are not impacting
<br>game performance ( or really any foreground application performance ).
<br>Managing affinity and\or priority usually has little to no effect in Linux unless you knowingly have lots of other heavy applications running.
<br>Finally, some Linux distros are starting to ship with an enhancement package "Game Mode" that automatically prioritizes gaming


Open your run dialog ({{key|Windows}} + {{key|R}}) or command prompt and type services.msc
===== Linux Priority =====


On the Extended Tab locate "Nvidia Streamer Network Service"
NOTE: Some modern Linux distros that use pipewire audio will not render audio if
<br>the initial command that invokes the application is run as root or sudo. I am currently investigating a workaround.


{{RMB}} Right-click it and choose "Stop"
You can launch TDM with a very high priority via the "nice" command:


Once the service is stopped, {{RMB}} right click it again and choose Properties
<pre>
sudo nice --18 su -c /home/user/darkmod/thedarkmod.x64 username
</pre>


On the General Tab set Startup Type = Disabled then {{LMB}} click Apply.
There are two dashes in the above command. The first dash just tells the command that we are passing a parameter,
<br>the second dash indicates a "negative priority number". Confusingly, the larger the negative number the higher
<br>the priority with a maximum value of -20. Conversely the higher the positive integer, the lower the program priority!
<br>For the sake of responsiveness, it is probably best to avoid the top or bottom if the priority range.
<br>Also, note that the command must run as sudo to use negative priority and it's best to use "su -c program username"
<br>so that it is run as "you" (replace username with your username) rather than root so you don't end up with root owned files.
<br>See the visudo change in '''[[Performance_Tweaks#Linux_Combined_Example|Linux Combined Example]]''' for details on how to run as sudo without a password
 
Example to launch with lower priority ( lowest possible value 19 ):


Do the same for "Nvidia Streamer Service"
<pre>
nice -10 /home/user/darkmod/thedarkmod.x64
</pre>


Do the same for "Nvidia Telemetry" service(s).
You can also change the priority of TDM while it is running via "renice" and "pidof"  


Note: There is a GUI option to disable streaming in the newest Geforce Experience settings page.
<pre>
renice -n --18 -p $(pidof thedarkmod.x64)
</pre>


You would still be advised to disable the Telemetry service for extra performance.
===== Linux Affinity =====


Modern Linux operating systems will list cores with a list starting with 0, so ( for example ) the top core number in an 8 core CPU will be 7.


You can identify cores and whether the cores are hyperthread ( HT ) cores via:


''You can also perform these steps for any services that you know can be manually started
lscpu -e


''or are not needed for your daily usage. (Obviously) Do not disable any service that you don't
Example:


''recognize or know is safe to disable.''
    CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ    MINMHZ
    0  0    0      0    0:0:0:0      yes    4100.0000 400.0000
    1  0    0      1    1:1:1:0      yes    4100.0000 400.0000
    2  0    0      2    2:2:2:0      yes    4100.0000 400.0000
    3  0    0      3    3:3:3:0      yes    4100.0000 400.0000
    4  0    0      0    0:0:0:0      yes    4100.0000 400.0000
    5  0    0      1    1:1:1:0      yes    4100.0000 400.0000
    6  0    0      2    2:2:2:0      yes    4100.0000 400.0000
    7  0    0      3    3:3:3:0      yes    4100.0000 400.0000


The CPU number above is what the OS recognizes when using affinity commands, the core number is actual core number.
<br>So in the above results, CPU's 4 to 7 are hyperthreading cores whereas cores 0 to 3 are real cores.


To pin TDM to specific cores, you can change the launch options to:


'''NEW INFO:'''
<pre>
taskset -c 1,2,3 /path/to/thedarkmod.x64
</pre>


The Nvidia Streamer Service is now tied to the "Geforce Experience" "In-Game Overlay" setting.<br>Disabling that feature in Geforce Experience should accomplish the same as the above.
The above example forces TDM to run on real cores 1, 2, and 3. You may use a dash to specify a range of cores (1-3)
<br>or even mix both syntax forms ( 1-3,6 ).


{{clear}}
You can also change the core of a running TDM instance by using pidof to auto-locate the PID of the running process:


<pre>
taskset -cp 1,2,3 $(pidof thedarkmod.x64)
</pre>


More advanced users may wish to "cpuset" to create a new logical group of cores and caches (etc) then assign TDM
<br>to run under the new CPU Set


And (of course) you can instead use taskset to move other non-critical processes to other cores or HT cores.


{{clear}}
===== Linux Combined Example =====


==== (Nvidia) Disable Threaded Optimizations ====
NOTE: Some modern Linux distros that use pipewire audio will not render audio if
the initial command that invokes the application is run as root or sudo. I am currently investigating a workaround.


Open Nvidia Control Panel ->
In Linux nice and taskset cannot be invoked at the same time to launch an application.
<br>You can launch TDM and use taskset to change the running process and likewise use renice to change priority
<br>To launch with both priority and affinity at once, you can use "schedtool"
<br>You will first need to use visudo to allow schedtool to run in sudo without a password
<br>visudo will open an editor where you may add the following to the bottom of the file


Manage 3D Settings ->
<pre>


Bottom half of list locate "Threaded Optimization" <-- Set to NO / Off
%sudo ALL = ( ALL ) NOPASSWD: /usr/bin/schedtool,/usr/bin/nice


Also set "Multi-display/Mixed GPU acceleration" to "Single display performance mode"
</pre>


This can also reduce or eliminate driver crashes or rendering anomalies.
Then simply edit the "command field" for the properties page of your Darkmod launcher icon as follows:


<font size="3">
<pre>
* Note: '''<u>This might be obsolete information.</u>'''<br>With the latest Nvidia drivers, some users have reported that '''disabling''' Threaded Optimizations<br>has significantly '''<u>reduced performance</u>'''. (Down from 60 to 25FPS in one case.)</font><br><br><br>


==== Lower in-driver quality settings ====
sudo schedtool -R -p 50 -a 1,2,3,5,6,7 -e nice --17 su -c "/home/user/darkmod/thedarkmod.x64 +set r_shadows 1 +r_ssao 0" username


AMD, Nvidia, and Intel all give users the option to lower texture quality and
</pre>


also have various quality "optimization" levels for texture LOD Bias and Anisotropy (Filtering).
In the above example, priority (-p ) is set to -50 ( highest is -99 aka realtime ) and affinity ( -a ) is set to use real cores 2 to 4 and corresponding HT cores ).
<br>Setting any application to -99 ( realtime ) priority is unsafe because it may be hard to exit or may lockup the OS trying to request resources.
<br>schedtool has a "-n" flag for the nice value but it only supports positive nice values so we added the nice invoke after the "-e" ( execute flag ) and  
<br>made sure to su ( switch user ) to run thedarkmod.x64 as "username" ( eg whatever your username is ).  
<br>Finally, for good measure we have set shadows to stencil ( 1 ) and SSAO off ( 0 ) using standard Doom 3 style launch options for example syntax


==== Try different driver versions ====
{{clear}}


Sometimes updating to the latest driver version or reverting to an older version
<font size="5">


will improve performance. Try a few revisions or ask about known good driver versions.
== '''Optimizing Dark Mod settings''' ==
</font>


This applies to both GPU drivers and "Motherboard Chipset Drivers".  
''The settings changes below generally can be changed independently of one another.''


See also [[#Upgrade_your_BIOS|Upgrade your BIOS]]
''This means that if your want better settings in one aspect (such as AA) you can''


''try reducing quality or disabling another aspect (such as soft-shadows, ambient occlusion, v-sync, etc)''


{{clear}}


<font size="5">
<font size="4">


== '''Optimizing Dark Mod settings''' ==
=== '''Reduce your resolution!''' ===
</font>
----
<br>
<font size="2">
{{important|headline=Important!|text=<br><br>'''While the [[#Screen_Resolution|Screen Resolution]] section mostly applies to legacy displays (CRT's),'''
<br><br>'''if TDM doesn't properly detect the [[Resolutions|Native Resolution]] of your modern display'''
<br>'''you should still configure it before adjusting the [[Performance_Tweaks#Lower_your_Render_Scale_(New_2.07)|Render Scale]]'''}}
</font>
</font>
{{clear}}
<br>
<font size="3">


<font size="3">
==== Lower your Render Scale (New 2.07) ====
=== '''Delete Darkmod.cfg after upgrade''' ===
</font>
</font>


If you run tdm_installer to upgrade TDM, it offers you the option to Restore Darkmod.cfg.
The new '''"Render Scale"''' slider in 2.07 allows you to reduce the internal resolution that TDM will render to.  
<br>When you do this, you may be reverting newer configuration defaults that have been changed in the latest release.
<br>Lowering this has a similar performance impact as lowering your '''[[#Screen_Resolution|Screen Resolution]]''' and is the '''preferred way to improve performance via resolution change'''
<br>While it may be inconvenient to reconfigure all your preferred settings from scratch, it may be best to start with this step
<br>One additional benefit is that lowering Render Scale '''does not impact Menu and HUD / GUI resolution''' so you can set it much lower than screen resolution
<br>before tinkering with any other setting changes. ( Especially if you haven't done this for a few upgrade cycles. )
<br><br>Newer TDM versions keep your keybindings and controller settings in a separate file
<br>so you will just need to change resolution, brightness \ gamma, and other graphic quality settings
<br>in addition to game-play difficulty settings.


<font size="3">
<pre>
=== '''Mission Updates''' ===
</font>


Mission authors often discover performance problems after they release their missions.
seta r_fboResolution "0.85"
<br>They will occasionally issue new mission versions that have improved performance.
<br>Also, the TDM team will sometimes apply fixes to missions that can improve performance and stability in new release versions.
<br>We recommend checking the Mission Downloader for updates to your existing missions ( denoted with an asterisk )
<br>Note: '''Savegames''' do not work between different mission versions.


<br><br>
</pre>
 
Note: With the r_fboResolution CVAR, you can also do the '''opposite'''...
<br>You can also render to a '''higher than native resolution''' and the down-scaled output will look '''[[#Lower_Anti-aliasing|sorta like SSAA]]'''.
<br>This is '''VERY''' expensive so we recommend going no higher than '''r_fboResolution 1.5'''.


――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
===== Image Sharpening (New 2.09) =====


''The settings changes below generally can be changed independently of one another.''
In 2.09 a new "Contrast Adaptive Sharpening" shader has been added and is enabled by default.
<br>At the default Render Scale this simply improves the quality of textures (makes lower resolution textures less blurry).
<br>When paired with a lower Render Scale values it can substantially reduce the blur and '''make the screen look almost like full resolution!'''


''This means that if your want better settings in one aspect (such as AA) you can''
<pre>


''try reducing quality or disabling another aspect (such as post-processing, image_downsize, v-sync, etc)''
seta r_postprocess_sharpen "1"
seta r_postprocess_sharpness "0.7"


</pre>


<font size="4">
<font size="3">


=== '''Conventions''' ===
==== Screen Resolution ====
</font>
</font>


Most of the changes demonstrated in this article are via "Console variables" [[Cvars_in_The_Dark_Mod|CVARS]].
On modern LCD, OLED, or MicroLED displays we advise against changing native resolution unless you know that your monitor
 
<br>has an excellent internal resolution scaler. You should instead change your '''[[Performance_Tweaks#Lower_your_Render_Scale_(New_2.07)|Render Scale]]''' as described in the previous sub-section.
The "seta" prefix is intended to save these settings permanently so that they are retained on restart and that
<br>This section is more applicable to players using CRT or Plasma displays which naturally support a wide range of resolutions.
is what is used by Darkmod.cfg.
<br>Even if you have a CRT or other legacy display tech, it may be better to change Render Scale to avoid legibility issues in Menus and HUD / GUI.
<br><br>On older cards (or integrated graphics), <s>Doom 3's</s> TDM's render engine is very expensive for every per pixel drawn, and reducing the resolution will help the most.  
<br>For instance, at 1600x1200 the game needs to draw '''four times''' as many pixels as when running 800x600.
<br>The result with 800x600 will not look as bad as one might think &ndash; but the frame rate improvements might make it much more playable.
<br><br>
<font size="3">
If you cannot set the resolution you want in the '''Video Settings Menu''' then enter it in Darkmod.cfg. (As shown below)<br>
</font>
<br>Example cvars for a Native 1080p HD display:


<pre>
<pre>


seta r_softShadowsRadius "2"
seta r_mode "-1"
seta r_customwidth "1920"
seta r_customheight "1080"
seta r_aspectratio "1"


</pre>
</pre>


==== OBSOLETE SUGGESTIONS ====
<br>For the lowest possible resolutions, search down for these cvars first and replace them with the values shown:


Some configuration suggestions in this wiki are no longer applicable in the latest TDM versions and are only
<pre>
<br>preserved for players running old versions. Where applicable these are labelled OBSOLETE so you can ignore them.


==== Temporary Testing ====
seta r_mode "-1"
seta r_customHeight "640"
seta r_customWidth "480"


To temporarily test any settings, you can drop the "seta" and simply invoke the cvar and it's value (without double quotes) in
</pre>
the console.


Example:
alternate for low resolution on wide screen monitors:


Open the console with {{key|Ctrl}}+{{key|Alt}}+{{key|~}} (tilde, {{key|^}} on German keyboards) and type:
16:9 ratio


<pre>
<pre>
seta r_mode "-1"
seta r_customwidth "1280"
seta r_customheight "720"
seta r_aspectratio "1"
</pre>


r_softShadowsRadius 2
<font size="3">
'''See also: "[[Resolutions]]" (for a list of known configurations)'''
</font>


</pre>


<s>Note: Some CVAR changes in the console, such as vid_mode (resolution), r_multisamples (AA), r_swapInterval (V-Synch), image_anisotropy (AF)
<font size="3">
cannot be changed without also invoking vid_restart.</s>


NEW: As of TDM 2.07, almost all conventional settings can be altered without restarting the engine!
==== Lower Anti-aliasing ====
</font>


See also: [[#Toggle_settings_in_realtime|Toggle settings in realtime]]
The Dark Mod ships with standard '''[https://en.wikipedia.org/wiki/Multisample_anti-aliasing "Multi-Sample Anti-Aliasing" ( MSAA )]'''. This can reduce or eliminate jagged pixelization on geometry edges
<br>by sampling sub-pixels near those edges and blending based on the average color. In practice this means that every visible geometry edge will get rendered
<br>at a multiple of it's native resolution ( depending on your setting; eg. 2x, 4x, 8x, 16x ).
<br>While this is still lower than increasing your overall screen resolution by the same factor, it can still increase the render workload by 50% or more in dense scenes.
<br>MSAA is particularly heavy for '''[[#Change_Shadow_Mode_(New_2.07)|Stencil Shadows]]''' but 2.11+ have some '''[[#Soft_Shadows_Mipmaps_(_New_in_2.11_)|dedicated optimizations]]''' to improve that.
<br><br>Unfotunately, if you needs the extra performance, you may need accept some aliasing ( jaggies ) unless your GPU vendor offers '''[[#Driver_Anti-Aliasing_Settings|better in-driver AA options]]'''.
<br><br>Since AA approximates a higher resolution, you may prefer disabling it in favor of choosing a higher resolution ( eg 1080p with 8xAA verses 1440p with no AA )
<br>( Depending on your graphics performance, it may be better to use a lower '''[[Performance_Tweaks#Lower_your_Render_Scale_(New_2.07)|Render Scale]]''' and then use a higher AA value to retain clean edges. )


{{clear}}
<br>In the standard video settings, set AA to a lower value or 0


==== Launch Options ====
<pre>


You can also add the value as part of your target in your shortcut:
seta r_multiSamples "0"


Example with two cvars:
</pre>
in Darkmod.cfg
{{clear}}
<br>


*  {{RMB}} Right click your Desktop shortcut to TheDarkMod and select Properties
<font size="4">
*  On the Shortcut Tab enter the following into the "Target:" field


<pre>
=== '''Screen Refresh and FPS''' ===


"C:\darkmod\TheDarkMod.exe" +set r_softShadowsRadius 2 1 +r_useEntityCulling 1
</font>
----


</pre>
In theory, screen refresh and FPS should be independent of engine and driver performance.
<br>Unfortunately, the OS, Drivers, and OpenGL API often cause slowdown and performance issues if refresh settings are misconfigured
<br>
<font size="4">


(Assuming you installed into C:\darkmod)
==== Uncap FPS (New in v2.06) ====
</font>
Run one game tick per graphics frame, rather than fixed 60 ticks per second.


* Then {{LMB}} click the Change Icon button and browse for the Darkmod.ico icon in your darkmod install path
In 2.06 this is now a GUI option "Uncap FPS" in the Advanced Video settings GUI menu.
* {{LMB}} Click Apply
<br><br>This not only makes the player camera move more smoothly but can also improve performance
<br>since some drivers do not work well with the capped FPS design.


See also [[#Set_TheDarkMod_to_High_Priority|Set TheDarkMod to High Priority]]
<pre>


――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
seta com_fixedTic "1"


{{Clear}}
</pre>
<br>


<font size="4">
in Darkmod.cfg
=== '''Reduce your resolution!''' ===
<br><br>
<font size="3">
'''Note: Uncapping FPS is <u>crucial</u> to a smooth performance in most <u>Linux</u> environments!'''.
</font>
</font>


On older cards (or integrated graphics), <s>Doom 3's</s> TDM's render engine is very expensive for every per pixel drawn, and reducing the resolution will help the most.
<br>The default capped design appears to have some flaw for frame timing against the native Linux timer
<br>For instance, at 1600x1200 the game needs to draw '''four times''' as many pixels as when running 800x600.  
<br>Uncapping FPS or running TDM capped under Wine will resolve this.
<br>The result with 800x600 will not look as bad as one might think &ndash; but the frame rate improvements might make it much more playable.
<br>Native Doom 3 builds are also impacted by this problem so it predates The Dark Mod.
<br><br>
<br>The Dark Mod cannot use com_preciseTic 0 as a workaround ( some users have used this to improve Linux Doom 3 frame timing )
 
<br>Uncapped mode has the additional benefit of making '''[https://bugs.thedarkmod.com/view.php?id=5575 video playback properly sync to audio]'''.
<br>The Dark Mod team has worked hard to ensure that the uncapped mode is bug free at high FPS values but if you wish to
<br>reduce the risk of high-FPS related bugs, set your Max FPS ( com_maxFPS, see below section ) to 75 or less.
<br>'''NEW''': At least 3 Windows 10 low-end users have reported similar performance benefits from uncapped mode. In the future, 2.13 will set this as default.
{{clear}}
<br>
<font size="3">
<font size="3">
 
===== Max FPS (New in 2.08 ) =====
==== Screen Resolution ====
</font>
</font>


On modern LCD, OLED, or MicroLED displays we advise against changing native resolution unless you know that your monitor
In 2.08 you can define the max FPS via the Max FPS setting in the Advanced Video settings GUI menu.
<br>has an excellent internal resolution scaler. You should instead change your [[Performance_Tweaks#Lower_your_Render_Scale_(New_2.07)|Render Scale]] as described in the next sub-section.
<br>(This is setting is meant to be paired with th '''Uncapped FPS''' mode above.)
<br>This section is more applicable to players using CRT or Plasma displays which naturally support a wide range of resolutions.
<br>
<br>Even if you have a CRT or other legacy display tech, it may be better to change Render Scale to avoid legibility issues in Menus and HUD / GUI.
<br><br>'''Note: While this section is mostly applicable to legacy displays, if TDM doesn't properly detect the native resolution of your modern display'''  
<br>'''you will still need configure it ( as shown below ) before adjusting Render Scale'''
 
<br>If you cannot set the resolution you want in the video settings menu then enter it in Darkmod.cfg.<br>
<br>For the lowest possible resolutions, search down for these cvars first and replace them with the values shown:
 
<pre>
<pre>


seta r_mode "-1"
seta com_maxFPS "90"
seta r_customHeight "640"
seta r_customWidth "480"


</pre>
</pre>


alternate for wide screen monitors:
in Darkmod.cfg
{{clear}}
<br>


16:9 ratio
<font size="3">


<pre>
==== Run The Dark Mod in fullscreen ====
seta r_mode "-1"
seta r_customwidth "1280"
seta r_customheight "720"
seta r_aspectratio "1"
</pre>
 
<font size="3">
'''See also: "[[Resolutions]]" (for a list of known configurations)'''
</font>
</font>


Running Darkmod in windowed mode might be quite a bit slower than fullscreen mode.


<font size="3">
One reason for this is that windowed mode is sometimes forced to V-sync. ( See '''[[#Disable V-sync | Disable V-sync]]''' )


==== Lower your Render Scale (New 2.07) ====
</font>
The new "Render Scale" slider in 2.07 allows you to reduce the internal resolution that TDM will render to.
<br>Lowering this has a similar performance impact as lowering your resolution and is the '''preferred way to improve performance via resolution change'''
<br>One additional benefit is that lowering Render Scale does not impact Menu and HUD / GUI resolution


<pre>
<pre>
 
seta r_fullscreen "1"
seta r_fboResolution "0.85"
 
</pre>
</pre>


Note: With the r_fboResolution CVAR, you can also do the '''opposite'''...
in Darkmod.cfg
<br>You can also render to a '''HIGHER THAN NATIVE''' resolution and the down-scaled output will look '''sorta like SSAA'''.
<br>This is '''VERY''' expensive so we recommend going no higher than '''r_fboResolution 1.5'''.


===== Image Sharpening (New 2.09) =====


In 2.09 a new "Contrast Adaptive Sharpening" shader has been added and is enabled by default.
In 2.08 you can choose between Windowed, Fullscreen, and Borderless Windowed.
<br>At the default Render Scale this simply improves the quality of textures.
Fullscreen is the lowest latency option.
<br>When paired with lower Render Scale values it can substantially reduce the blur and make the screen look almost like full resolution!


<pre>
===== Fullscreen Windowed in Modern Windows Versions =====


seta r_postprocess_sharpen "1"
It has become widely recognized that v-sync is a source of input delay and forcing it for both Windowed and Fullscreen Windowed modes
seta r_postprocess_sharpness "0.7"
<br>is not optimal. The latest Windows versions no longer force v-sync on Fullscreen Windowed applications but if you encounter any issues
<br>or have an older Windows release you should be able to force it off via your driver application profile settings:


</pre>
If you have a Nvidia card


* Open Windows start menu and type: Nvidia control panel
* Click Manage 3D settings, on the left pan
* Under "I would like to use the following 3D settings" scroll down until you see "Vertical sync."
* Select Vertical sync choose "Force off" or " disable" ... from the drop down.


<font size="3">
For AMD


==== Lower Anti-aliasing ====
* Click the Start button or Windows icon.
</font>
* Type "Catalyst control center" in the search bar.
* Press Enter on your keyboard.
* Click Gaming.
* Under "3D Application Settings" scroll down to "Wait for vertical refresh."
* Move the slider down to the side that says "Performance" so the text beneath it says Always Off.


The Dark Mod ships with standard "Multi-Sample Anti-Aliasing" ( MSAA ). This can reduce or eliminate jagged pixelization on geometry edges
The above won't be necessary for users with variable refresh displays and video cards with variable refresh support such as G-Sync or Freesync.
<br>by sampling sub-pixels near those edges and blending based on the average color. In practice this means that every visible geometry edge will get rendered
<br>at a multiple of it's native resolution ( depending on your setting; eg. 2x, 4x, 8x, 16x ).
<br>While this is still lower than increasing your screen resolution by the same factor, it can still increase the render workload by 50% or more in dense scenes.
<br>If you needs the extra performance, you may need accept some aliasing ( jaggies ).
<br>Since AA approximates a higher resolution, you may prefer disabling it in favor of choosing a higher resolution ( eg 1080p with 8xAA verses 1440p with no AA )
<br>Incidentally, if you have GPU power to spare you can either use your GPU driver settings to force even higher quality modes such as SSAA that performs sub-sampling to every pixel
<br>or configure TDM [[Performance_Tweaks#Lower_your_Render_Scale_(New_2.07)|Render Scale]] ( r_fboResolution ) above native resolution for a similar effect (see previous sub-section ).


<br>In the standard video settings, set AA to a lower value or 0


<pre>
{{clear}}


seta r_multiSamples "0"  
<font size="3">
==== Force Refresh Timing ====
</font>


</pre>
(Related to vsync)
in Darkmod.cfg
 
Some newer video cards may not properly report the refresh rate to this engine (typically digital output like DVI, HDMI, or DisplayPort)
<br>This can cause lag, stutter, and uneven frame pacing.


Create an autoexec.cfg in your darkmod directory and set:


Note: Nvidia's in driver FXAA anti-aliasing setting is substantially faster than the multi-samples settings
<pre>
in game.


Doom 3 is far less susceptible to AA artifacts so this may be an acceptable alternative especially
seta r_displayRefresh "60"
if you are are running the game at native resolution (or nearly native).


AMD has MLAA which may also work well in the same way.
</pre>


Depending on your graphics performance, it may be better to use a lower Render Scale and then use a higher AA value to retain clean edges.
(Obviously increase to match your available mode.)
<br>
{{clear}}
<br>


<font size="4">
<font size="3">


=== '''Enable Multi-Core (new in v2.06)''' ===
==== Disable V-sync ====
</font>
</font>


In 2.06 the engine splits the Frontend and Backend into separate threads if you
Depending on your drivers and driver settings, Vsync will cap FPS to the closest available standard refresh rate.  
enable the Experimental "Multi-Core" setting in the Advanced Video settings GUI menu.
<br>This means that if your FPS go below 60, TDM may be capped at the next standard value of 30FPS rather than rendering at 40FPS or higher which would feel smoother.
<br>Further, sometimes capping FPS will prevent TDM from recovering from a lower FPS in a timely manner.
<br><br>Unless you are extremely sensitive to screen-tearing, we advise that you disable vsync
<br><br>In the standard video settings, disable vsync


<pre>
<pre>
 
seta r_swapInterval "0"  
seta com_smp "1"
 
</pre>
</pre>


in Darkmod.cfg
in Darkmod.cfg


'''In 2.09 this is enabled by default. The setting is no longer in the GUI.'''


==== Frontend Acceleration (new in v2.09+) ====
'''NEW INFO''' TDM 2.10 has an '''Adaptive Vsync''' option in the Video Settings GUI which only performs the sync action when you are at or above refresh rate. Thus avoiding performance loss.
 
In 2.09 the engine frontend can submit models to the render backend via parallel jobs on multiple CPU cores.
<br>This is similar to how Doom 3 BFG handles this.
<br> Enable "Frontend Accelleration" in the Advanced Video settings GUI menu.


<pre>
<pre>
 
seta r_swapInterval "-1"
seta r_useParallelAddModels "1"
 
</pre>
</pre>


'''In TDM 2.11 this is enabled by default.'''
in Darkmod.cfg


Also, you can increase the number of assigned cores:
<font size="3">
 
<br>If your GPU driver supports superior Vsync options such as Fast Sync, Freesync, or G-sync '''[[#Driver_Vsync_Settings|it may be preferable to force that feature via a Driver Profile]]'''
<pre>
</font>
 
seta jobs_numThreads "3"
 
</pre>
 
'''( See the [[Performance_Tweaks#Priority_and_Affinity|Affinity section]] above regarding cpu core management in relation to these options. )'''
{{clear}}
{{clear}}
<br>
<br>
<font size="4">


<font size="4">
=== '''Multi-Core Options''' ===


=== '''Uncap FPS (New in v2.06)'''===
</font>
</font>
Run one game tick per graphics frame, rather than fixed 60 ticks per second.
----
 
Starting with TDM 2.06, there has been an ongoing effort to improve the TDM Engine to take advantage of Multi-Core CPU's
<br>If your CPU has more than 1 core (or offers Hyperthreading), the following settings can dramatically improve performance
<br><br>
 
==== Enable Multi-Core (new in v2.06) ====


In 2.06 this is now a GUI option "Uncap FPS" in the Advanced Video settings GUI menu.
In 2.06 the engine splits the Frontend and Backend into separate threads if you enable the Experimental "Multi-Core" setting
<br><br>This not only makes the player camera move more smoothly but can also improve performance
<br>in the Advanced Video settings GUI menu.
<br>since some drivers do not work well with the capped FPS design.


<pre>
<pre>


seta com_fixedTic "1"
seta com_smp "1"


</pre>
</pre>
Line 837: Line 951:
in Darkmod.cfg
in Darkmod.cfg


Note: '''Uncapping FPS is crucial to a smooth performance in most Linux environments'''.  
'''In 2.09 this is enabled by default. The setting is no longer in the GUI.'''
<br>The default capped design appears to have some flaw for frame timing against the native Linux timer
<br><br>
<br>Uncapping FPS or running TDM capped under Wine will resolve this.
<br>Native Doom 3 builds are also impacted by this problem so it predates The Dark Mod.  
<br>The Dark Mod cannot use com_preciseTic 0 as a workaround ( some users have used this to improve Linux Doom 3 frame timing )
<br>This mode has the additional benefit of making video playback properly sync to audio.
<br>The Dark Mod team has worked hard to ensure that the uncapped mode is bug free at high FPS values but if you wish to
<br>reduce the risk of high-FPS related bugs, set your Max FPS ( com_maxFPS, see below section ) to 75 or less.


{{clear}}
==== Frontend Acceleration (new in v2.09+) ====
<br>
==== Max FPS (New in 2.08 ) ====


In 2.08 you can define the max FPS via the Max FPS setting in the Advanced Video settings GUI menu.
In 2.09 the engine frontend can submit models to the render backend via parallel jobs on multiple CPU cores.
<br>This is similar to how Doom 3 BFG handles rendering.
<br> Enable "Frontend Accelleration" in the Advanced Video settings GUI menu.


<pre>
<pre>


seta com_maxFPS "90"
seta r_useParallelAddModels "1"


</pre>
</pre>


in Darkmod.cfg
'''In TDM 2.11 this is enabled by default.'''
 
===== Jobs Settings =====
 
Also, you can increase the number of assigned cores:
 
<pre>
 
seta jobs_numThreads "3"
 
</pre>


'''( See the [[Performance_Tweaks#Priority_and_Affinity|Affinity section]] regarding OS CPU Core management in relation to these options. )'''
{{clear}}
<br>
<font size="4">
<font size="4">


=== '''Shadow Settings''' ===
=== '''Shadow Settings''' ===
 
----
</font>
</font>


<font size="3">
<font size="3">


==== '''Change Shadow Mode (New 2.07)''' ====
==== Change Shadow Mode (New 2.07) ====
</font>
</font>


<br>In TDM 2.07 we offer two different "Shadow Implementation" options in the GUI.
<br>In TDM 2.07+ we offer two different "Shadow Implementation" options in the Advanced Video Settings GUI.
<br>


* Maps (Shadow Maps)
* '''Maps''' (Shadow Maps)


* Stencil (Stencil Shadow Volumes)
* '''Stencil''' (Stencil Shadow Volumes)


<br>Shadow Maps can perform better in scenes with fewer but larger light sources and less small shadow casters.
<br>( There is a 3rd mode '''[[#No_Shadows|"No Shadows"]]''' It's available via the console and can be used for troubleshooting.
<br>Some missions might be playable in this mode but will probably be very difficult with no shadows to hide in.
<br>Darkness can still exist in areas outside the light radius or falloff though. )
 
<br>'''Shadow Maps''' can perform better in scenes with fewer but larger light sources and less small shadow casters.
<br>Shadow Map performance depends on the amount and speed of VRAM on you GPU
<br>Shadow Map performance depends on the amount and speed of VRAM on you GPU
<br>Most of the calculations are done on the GPU in this mode so if you have a weak CPU and mid-range GPU ( usually old desktops ) this mode is preferred
<br>Most of the calculations are done on the GPU in this mode so if you have a '''<u>weak CPU</u>''' and mid-range GPU ( usually old desktops )  
<br>Stationary Lights + Big areas + Big Lights = Higher FPS with Maps  
<br>'''this mode is preferred'''
<br><br>Stencil can perform faster for systems with powerful CPU's and weak GPU's ( usually laptops ) because it mostly relies on fillrate.
Stationary Lights + Big areas + Big Lights = Higher FPS with Maps  
<br>Stencil soft shadows sometimes run faster because they don't do calculations for "distance to blocker" ( contact hardening )
<br>'''Stencil''' can perform faster for systems with powerful CPU's and '''<u>weak GPU's</u>''' ( usually laptops ) because it mostly relies on fillrate.
<br>Lots of small moving lights + confined spaces = Higher FPS with Stencil
<br>Stencil '''[[#Lower_or_Disable_Soft_Shadows_(New_in_v2.06)|soft shadows]]''' sometimes run faster because they don't do calculations for '''[[What's_new_in_TDM_2.07#Graphics|"distance to blocker"]]''' ( contact hardening )
Lots of small moving lights + confined spaces = Higher FPS with Stencil


Maps mode:
<br>'''Maps mode:'''
<pre>
<pre>


Line 892: Line 1,019:
</pre>
</pre>


Stencil mode:
'''Stencil mode:'''


<pre>
<pre>
Line 901: Line 1,028:


in Darkmod.cfg
in Darkmod.cfg
<br><br>(If you change this via the console, also invoke shadowimplchanged or you may be missing some shadows)
<br><br>
<font size="3">


<font size="3">
==== Lower or Disable Soft Shadows (New in v2.06) ====
==== '''Lower or Disable Soft Shadows (New in v2.06)''' ====
</font>
</font>
Shadow Quality determines how many gradients ( color bands) that soft shadows use.
Shadow Quality determines how many gradients ( color bands) that soft shadows use.
Line 916: Line 1,045:
in Darkmod.cfg
in Darkmod.cfg


===== Softening Radius =====


In the advanced videos settings menu set the Shadow Softness slider to make shadows softer
In the advanced videos settings menu set the Shadow Softness slider to make shadows softer
Line 929: Line 1,059:


You can experiment with values between 1.5 and 3.5 or more.
You can experiment with values between 1.5 and 3.5 or more.
<br>Another way to get blurrier shadows without "cranking the quality" is to use '''Shadow Maps''' and set a very low '''[[#Shadow_Map_Size|Shadow Map Size]]'''


===== Single Pass Shadow Maps =====
===== Soft Shadows Mipmaps ( New in 2.11 ) =====


Rather than calculating all shadows one-at-a-time, all shadow casting is calculated in one pass for every light.
To reduce the impact of sampling shadows for soft shadow effects and '''[[#Lower_Anti-aliasing|MSAA]]''' ( in '''Stencil''' mode ), 2.11 introduced a new mipmap optimization
'''THIS CAN OFFER SUBSTANTIAL PERFORMANCE IMPROVEMENT'''


<pre>
<pre>


seta "r_shadowMapSinglePass "1"
    seta r_softShadowsMipmaps "1"


</pre>
</pre>


in Darkmod.cfg
in Darkmod.cfg ( default setting, no change should be needed )


2.10 Issues:
<br><br>


* The old backend does not work with this mode ( r_useNewBackend 0 )
<font size="4">
* For some users, screenshots will be missing shadows for func_static geometry if this is enabled
* The screen-shot issue is resolved in 2.11+
'''NEW - This is enabled by default in 2.12'''


===== Shadow Map Size =====
==== '''Shadow Map Settings''' ====
</font>
----
Shadow Maps require more complex designs to optimize texture usage and reduce \ avoid artifacts.
<br>Correspondingly, TDM has many settings specific to this mode


The larger the Shadow Map texture, the more detail and less artifacts you have further away from the light center or for small objects.  
<font size="3">
<br>Conversely, smaller Shadow Map textures perform much better (use less resources).
===== Single Pass Shadow Maps =====
</font>
 
Rather than calculating all shadows one-at-a-time, all shadow casting is calculated in one pass for every light in the scene.
<br>'''THIS CAN OFFER SUBSTANTIAL PERFORMANCE IMPROVEMENT'''
 
<pre>
 
seta "r_shadowMapSinglePass "1"
 
</pre>
 
in Darkmod.cfg
 
'''NEW - All known issues for this mode are fixed. This is enabled by default in 2.12'''
<br><br>
 
<font size="3">
 
===== Shadow Map Size =====
</font>
 
The larger the Shadow Map texture, the more detail and less artifacts you have further away from the light center or for small objects.  
<br>Conversely, smaller Shadow Map textures perform much better (use less resources).
<br>Since stretching a low resolution shadow texture over a large area naturally causes bi-linear blurring,  
<br>Since stretching a low resolution shadow texture over a large area naturally causes bi-linear blurring,  
<br>some players prefer lower resolution maps instead of increasing the quality and softening radius which produces less blur  
<br>some players prefer lower resolution maps instead of increasing the quality and softening radius which produces less blur  
<br>due to realistic contact hardening simulation in the light shaders.
<br>(due to realistic contact hardening simulation in the light shaders).


<pre>
<pre>
Line 964: Line 1,118:
</pre>
</pre>


You can also increase this to reduce light leaks from the r_shadowMapCullFront optimization.
You can also increase this to reduce light leaks from the experimental '''[[#Shadow_Map_Cull_Front|Front Culling Optimization]]'''.
<br>On balance enabling that optimization may offset the pitfalls of a bigger shadow map.  
<br>On balance enabling Front Culling may offset the performance pitfalls of a bigger shadow map.  
<br>You can experiment with shadow map sizes that are slightly larger than 1024 such as 1280 or 1440.
<br>You can experiment with shadow map sizes that are slightly larger than 1024 such as 1280 or 1440.
<br>This setting can also be used to reduce the impact of '''Volumetric Lights''' because they always use Shadow Maps regardless of Shadow Mode
<br><br>This setting can also be used to reduce the performance impact of '''[[#Disable_Volumetric_Lights_(New_in_v2.11)|Volumetric Lights]]''' because they  
<br>always use Shadow Maps regardless of '''[[#Change_Shadow_Mode_(New_2.07)|Shadow Mode]]'''
<br>If your GPU runs missions without Volumetric Lights well in Stencil Mode but struggles with missions that contain them,
<br>try setting the map size to 256 or lower.
<br><br>
 
<font size="3">


===== Max Light Size =====
===== Max Light Size =====
</font>


The larger the light, the more Shadow Map resolution you need (see Shadow Map Size).
The larger the light, the more Shadow Map resolution you need (see '''[[#Shadow_Map_Size|Shadow Map Size]]''' ).
<br>There are some lights so large that Shadows will never look good without insane texture sizes.
<br>There are some lights so large that Shadow Maps will never look good without insane texture sizes.
You can set a threshold to say if lights are bigger than X, use Stencil Shadows.
<br>You can set a threshold to say if lights are bigger than X, use Stencil Shadows.


<pre>
<pre>
Line 980: Line 1,141:


</pre>
</pre>
 
<br>
<font size="4">
<font size="3">
=== '''Lower or Disable Ambient Occlusion (New in 2.08)''' ===
===== (Shadow Maps) See also: =====
* '''[[#Shadow_Map_Cull_Front|Front Culling Optimization]]'''
* '''[[#Disable_Volumetric_Shadows|Disable Volumetric Shadows]]'''
</font>
<br>
----
<br>
<font size="4">
 
=== '''Lower or Disable Ambient Occlusion (New in 2.08)''' ===
</font>
</font>


Line 1,019: Line 1,189:


In TDM 2.08 the default Frame Buffer was upgraded to use 64-bit color to reduce color banding.  
In TDM 2.08 the default Frame Buffer was upgraded to use 64-bit color to reduce color banding.  
<br>Some GPU's have poor support for this format or render much slower. Consider revert to 32-bit.
<br>Some GPU's have poor support for this format or render much slower. Consider reverting to 32-bit.
<br>Change Color to 32-bit under the Advanced Video settings menu or:
<br>Change Color to 32-bit under the Advanced Video settings menu or:


Line 1,057: Line 1,227:


in Darkmod.cfg
in Darkmod.cfg


<font size="4">
<font size="4">
=== '''Run The Dark Mod in fullscreen''' ===
 
=== '''Set Object Detail to Low''' ===
</font>
</font>


Running Darkmod in windowed mode might be quite a bit slower than fullscreen mode.
In the advanced video settings menu lower the Object detail slider below normal
 
One reason for this is that windowed mode is sometimes forced to V-sync. ( See [[#Disable V-sync | Disable V-sync]] )
 


<pre>
<pre>
seta r_fullscreen "1"
seta tdm_lod_bias "0.5"
</pre>
</pre>


in Darkmod.cfg
in Darkmod.cfg (see also '''[[Object_detail|Object Detail]]''' )




In 2.08 you can choose between Windowed, Fullscreen, and Borderless Windowed.
<font size="4">
Fullscreen is the lowest latency option.


==== Fullscreen Windowed in Modern Windows Versions ====
==='''Field of View Decrease'''===


It has become widely recognized that v-sync is a source of input delay and forcing it for both Windowed and Fullscreen Windowed modes
</font>
<br>is not optimal. The latest Windows versions no longer force v-sync on Fullscreen Windowed applications but if you encounter any issues
<br>or have an older Windows release you should be able to force it off via your driver application profile settings:


If you have a Nvidia card
<br>{{important|headline=Motion Sickness Warning|text=<br><br>FOV adjustment is mostly for player comfort and to reduce motion sickness.
<br><br>Lower FOV values are more inclined to cause motion sickness.
<br>16:9 players can lower to FOV 75 to eliminate '''[https://forums.thedarkmod.com/index.php?/topic/19539-conformal-perspective-as-an-option-in-tdm/ foveal edge distortion]''' but doing so increases the risk of experiencing discomfort<br>(The default FOV ( 90 ) for TDM was design for 4:3 ratio screens.)}}


* Open de Windows start menu and type: Nvidia control panel
<br>You can get a performance improvement if you decrease the field of view. By default this is 90 degrees but you might try entering in the console:
* Click Manage 3D settings, on the left pan
* Under "I would like to use the following 3D settings" scroll down until you see "Vertical sync."
* Select Vertical sync choose "Force off" or " disable" ... from the drop down.


For AMD
g_fov 85


* Click the Start button or Windows icon.
or
* Type "Catalyst control center" in the search bar.
* Press Enter on your keyboard.
* Click Gaming.
* Under "3D Application Settings" scroll down to "Wait for vertical refresh."
* Move the slider down to the side that says "Performance" so the text beneath it says Always Off.


The above won't be necessary for users with variable refresh displays and video cards with variable refresh support such as G-Sync or Freesync. 
<pre>
seta g_fov "85"
</pre>


in Darkmod.cfg


{{clear}}
In addition, if you are playing a mission that is too good to miss and reach a very low performance area which is almost unplayable on your machine,
<br>you might consider setting the field of view extremely low temporarily to get you through then restore to 90 later...


<font size="4">
g_fov 50


=== '''Disable V-sync''' ===
or '''[[Bindings_and_User_Settings|bind]]''' a toggle
</font>
 
<br>In the standard video settings, disable vsync


<pre>
<pre>
seta r_swapInterval "0"  
bind "z" "toggle g_fov 50 90";
</pre>
</pre>


in Darkmod.cfg<br><br><br>
in DarkmodKeybinds.cfg so you can tap a key to go between FOV ranges.


<font size="3">'''NEW INFO!!!!'''
See '''[[#Toggle_settings_in_realtime|Toggle Settings in Realtime]]'''


Setting '''r_swapInterval "-1"''' enables "Adaptive Vsync" which only performs the sync action when you are at or above refresh rate.
'''Note from Fidcal''': I have played comfortably on g_fov 75 and even think perhaps it makes nearby objects more realistically close so you can get right up to a table, etc.  
<br>This has much less performance impact.<br><br>
<br>Not noticed any problem with restricted view.
'''NEWER''' TDM 2.10 has an Adaptive Vsync option in the Video Settings GUI
</font><br><br><br>
The Dark Mod has extremely variable FPS compared to modern titles due to it's substantial
CPU heavy renderer.  


We strongly recommend disabling V-Sync altogether or forcing variable V-sync tech such as  
'''Note:''' On older TDM releases some players reported that changing this setting might occasionally produce odd effects such as a grabbed object seems to move a little on release.
G-Sync, Freesync, Fast-Sync or Enhanced Sync (new) in your driver settings.<br><br>
<br><br>


==== Force Refresh Timing ====
<font size="4">


(Related to vsync)
=== '''Lower Anisotropic Filtering ( Not recommended )''' ===
</font>


Some newer video cards may not properly report the refresh rate to this engine (typically digital output like DVI, HDMI, or DisplayPort)
In the standard video settings, lower or disable Anisotropic Filtering ( AF )
This can cause lag, stutter, and uneven frame pacing.
 
create an autoexec.cfg in your darkmod directory and set:


<pre>
<pre>


seta r_displayRefresh "60"
seta image_anisotropy "0"  


</pre>
</pre>


(Obviously increase to match your available mode.)
in Darkmod.cfg<br>


<font size="4">
'''Note: This has very little performance benefit for most GPU hardware'''. The mipmaps needed to perform AF are already loaded into
=== '''Set Object Detail to Low''' ===
<br>VRAM so the only savings are very inexpensive sampling operations that are normally handled by dedicated filtering hardware.
</font>
<br><br>
<s>In 2.09 if you change Anisotropic Filtering and have "r_useBindlessTextures 1" set (default) the game may stutter
<br>when you return from the menu because it must rebuild all the textures.
<br>To avoid this, set "r_useBindlessTextures 0" then restart the game and test your preferred AF mode then once you have found your
<br>performace-to-image quality sweet spot set "r_useBindlessTextures 1" and restart TDM</s>
<br><br>
'''NEW''': In 2.11+, bindless texture support was removed due to multiple issues with AMD drivers.
<br>You should be able to change anisotropic filtering settings in the GUI without encountering stutters.
<br><br>


In the advanced video settings menu lower the Object detail slider below normal
=== '''OBSOLETE''' Set the ambient shading to "Faster" ===


Inside the settings, change the ambient rendering method to "Faster".
<s>
<pre>
<pre>
seta tdm_lod_bias "0.5"
seta tdm_ambient_method "1"
</pre>
</pre>
</s>
in Darkmod.cfg


in Darkmod.cfg (see also [[Object_detail]] )
(Note: Some preliminary tests in v2.05 show that the Enhanced Ambient is now faster than the "fast" texture based Ambient.)
<br>(Note: This setting has been removed in 2.09+ )


=== '''OBSOLETE''' Set the interaction.vfp to "Standard" ===


<font size="4">
In the video settings menu, change the interaction shader to Standard.  Lighting will not look as good, but you may gain a few frames per second.


==='''Field of View Decrease'''===
<s>
<pre>


</font>
seta tdm_interaction_vfp_type "0"
 
'''Note''' that this setting might occasionally produce odd effects such as a grabbed object seems to move a little on release.
 
You can get a performance improvement if you decrease the field of view. By default this is 90 degrees but you might try entering in the console:
 
g_fov 85
 
or


<pre>
seta g_fov "85"
</pre>
</pre>
</s>


in Darkmod.cfg
in Darkmod.cfg


In addition, if you are playing a mission that is too good to miss and reach a very low performance area which is almost unplayable on your machine,
'''In 2.08 this setting is'''
<br>you might consider setting the field of view extremely low temporarily to get you through then restore to 90 later...


g_fov 50
<pre>


or bind a toggle
seta r_interactionProgram "0"


<pre>
bind "z" "toggle g_fov 50 90";
</pre>
</pre>


in Darkmod.cfg so you can tap a key to go between FOV ranges.
This setting doesn't work in 2.09+ It is a stub cvar that does nothing.
<br>If you wish to test interaction shaders, create a glprogs folder in your mission folder with new shaders having the same name as the default ones.
<br>You can keep the default shaders in the same folder in renamed form then swap filenames and execute reloadGLSLprograms to compare changes.
<br>For a more clean comparison also set g_stopTime to prevent dynamic light changes
{{clear}}


See [[#Toggle_settings_in_realtime|Toggle Settings in Realtime]]
<font size="5">


Note from Fidcal: I have played comfortably on g_fov 75 and even think perhaps it makes nearby objects more realistically close so you can get right up to a table, etc.
== '''Slow loading times''' ==
<br>Not noticed any problem with restricted view.
 
<font size="4">
=== '''Lower Anisotropic Filtering''' ===
</font>
</font>


In the standard video settings, lower or disable AF
'''OBSOLETE! TDM 2.10 has very fast loading times!'''
<br>The only setting that might improve loading times is "seta image_preload 0"
<s>
<br><br>
If you find an FM is very slow to load it may be an ATI graphics card problem.
<br>One report says this was cured by turning off Catalyst AI. Also cures [[FAQ#HDR-Lite_Post-Processing_problems|HDR-Lite Post-Processing Problems]].


<pre>
Changing the following settings to 0 will also reduce loading time, but be warned:
<br>if you have a lower-end system, poor graphics card, or low ram,
<br>you will likely notice a performance hit in-game since you will now be using uncompressed textures.


seta image_anisotropy "0"  
<pre style="max-width:35em">
seta image_useNormalCompression "0"
seta image_useCompression "0"
seta image_preload "0"
</pre>
</s>
<br>
New 2.10+ cvars ( defaults ) for fast loading times:


<pre style="max-width:35em">
seta image_levelLoadParallel "1"
seta image_useTexStorage "1"
seta image_mipmapMode "0"
</pre>
</pre>


in Darkmod.cfg<br>
In 2.10 the RXGB normal map compression format has been replaced the higher quality RGTC format.


Note: This has '''very little''' performance benefit for most GPU hardware.  
Note: Disabling compression is not recommended and may lead to Malloc errors due to heavy memory consumption.  


<br>This is also one of the few graphic settings that can be adjusted without requiring a vid_restart or restarting the engine.
If you want to disable compression, you may be able to compensate by setting '''[[#Image downsizing|Image Downsizing]]''' settings.


'''NEW''': In 2.09 if you change Anisotropic Filtering and have "r_useBindlessTextures 1" set (default) the game may stutter
See also '''[[FAQ#Getting "Malloc Failure for #######" crash-to-desktop|Malloc Failure Errors]]'''
<br>when you return from the menu because it must rebuild all the textures.
{{clear}}
<br>To avoid this, set "r_useBindlessTextures 0" then restart the game and test your preferred AF mode then once you have found your
<br>
<br>performace-to-image quality sweet spot set "r_useBindlessTextures 1" and restart TDM


'''NEW 2''': In 2.11, bindless texture support was removed due to multiple issues with AMD drivers.
<font size="5">
<br>You should be able to change anisotropic filtering settings in the GUI without encountering stutters.


== '''The game is very slow!''' ==
</font>


=== Set the ambient shading to "Faster" '''( OBSOLETE in 2.09+)''' ===
{{important|headline=Important!|text='''<br><br>If you do not have properly installed hardware drivers, TDM may be rendering graphic features using your CPU'''
<br>'''or may be performing CPU tasks in legacy modes. THESE ARE INCREDIBLY SLOW. See [[#Hardware_Considerations|Hardware Considerations]]'''
<br><br>'''Likewise, Linux players will need to either have a <u>Signed</u> Kernel ( and Drivers ) or disable [[#Linux_UEFI_Secure_Boot|Secure Boot]] since unsigned hardware lacks acceleration'''
<br>'''Linux players will also need to ensure that TDM is in [[#Uncap_FPS_(New_in_v2.06)|"Uncapped FPS mode"]] or they will have performance problems regardless of their hardware capabilities.'''
'''Finally, if you have a laptop with [[#(Nvidia)_Optimus_Laptop_wont_use_your_Nvidia_GPU|2 GPU options]] it can also behave as if you don't have hardware acceleration when using the weaker GPU.'''}}
{{important|headline=Defaults|text='''<br><br>The advised performance defaults below should mostly already be set by default on upgrade.'''
'''Please consider [[Performance_Tweaks#Delete_Darkmod.cfg_after_upgrade|deleting darkmod.cfg]] after upgrading to restore these defaults.'''}}
<br>
If you get less than 10 FPS, or the game even stutters, please try this:


Inside the settings, change the ambient rendering method to "Faster".
Look into your '''Darkmod.cfg''' inside your darkmod folder and check that the following settings are like shown below:
<s>
<pre>
seta tdm_ambient_method "1"
</pre>
</s>
in Darkmod.cfg


(Note: Some preliminary tests in v2.05 show that the Enhanced Ambient is now faster than the "fast" texture based Ambient.)
<pre style="max-width:35em">
(Note: This setting has been removed in 2.09 )
seta image_usePrecompressedTextures "1"
seta image_useNormalCompression "1"
seta image_useAllFormats "1"
seta image_useCompression "1"
seta image_preload "1"
seta r_useCachedDynamicModels "1"
seta r_useShadowVertexProgram "1"
seta r_useEntityCulling "1"
</pre>


=== Set the interaction.vfp to "Standard" '''(OBSOLETE in 2.09+)''' ===
Note: r_useShadowVertexProgram no longer exists in TDM. All shadow modes use GPU vertex operations.<br><br>


In the video settings menu, change the interaction shader to StandardLighting will not look as good, but you may gain a few frames per second.
'''OBSOLETE 2.09''' performance defaults
   
<pre style="max-width:35em">
seta r_useMultiDrawIndirect "1"
seta r_useBindlessTextures "1"
</pre>


<s>
'''2.11''' new performance defaults ( in addition to the standard performance defaults above )
<pre>
 
seta tdm_interaction_vfp_type "0"


<pre style="max-width:35em">
seta r_useNewBackend "1"
seta r_modelBvhBuild "1"
seta com_smp "1"
seta r_useParallelAddModels "1"
seta r_usePersistentMapping "1"
seta com_useMinorTics "1"
seta com_fixedTic "1"
seta com_maxFPS "166"
</pre>
</pre>
</s>


in Darkmod.cfg
'''2.12''' new performance defaults ( in addition to the standard performance defaults above )


'''In 2.08 this setting is'''
<pre style="max-width:35em">
seta r_useLightPortalFlow "2"
seta r_useLightPortalFlowCulling "1"
seta r_softShadowsMipmaps "1"
seta r_useEntityScissors "1"
seta r_animationBounds "1"
seta r_useNewRenderPasses "1"
seta r_shadowMapSinglePass "1"
</pre>


<pre>
Note: 2.12 r_useNewRenderPasses replaces r_useNewBackend


seta r_interactionProgram "0"


</pre>
<font size="4">


This setting doesn't work in 2.09+ It is a stub cvar that does nothing.
=== '''Frame Memory''' ===
<br>If you wish to test interaction shaders, create a glprogs folder in your mission folder with new shaders having the same name as the default ones.
</font>
<br>You can keep the default shaders in the same folder in renamed form then swap filenames and execute reloadGLSLprograms to compare changes.
<br>For a more clean comparison also set g_stopTime to prevent dynamic light changes
{{clear}}


<font size="5">
'''New in TDM 2.08'''


== '''Slow loading times''' ==
<pre>
</font>
r_frameIndexMemory
</pre>


'''OBSOLETE! TDM 2.10 has very fast loading times!'''
and
<br>The only setting that might improve loading times is "seta image_preload 0"


<s>
<pre>
r_frameVertexMemory
</pre>


If you find an FM is very slow to load it may be an ATI graphics card problem.  
Increasing frame memory may help avoid crashing or slow-down when a scene suddenly requires more resources.
One report says this was cured by turning off Catalyst AI. Also cures [[FAQ#HDR-Lite_Post-Processing_problems|HDR-Lite Post-Processing Problems]].
<br>If you are VRAM limited, consider lowering texture quality ( '''[[#Image_downsizing|Image Downsize]]''' ) or '''[[#Lower_your_Render_Scale_.28New_2.07.29|Render Scale]]'''
before increasing these.
{{clear}}
<br>


Changing the following settings to 0 will also reduce loading time, but be warned:
<font size="5">
if you have a lower-end system, poor graphics card, or low ram, you will likely notice a performance hit in-game since you will now be using uncompressed textures.


<pre style="max-width:35em">
=== '''Disabling standard graphics features''' ===
seta image_useNormalCompression "0"
</font>
seta image_useCompression "0"
----
seta image_preload "0"
At the cost of some pretty severe scene quality, you can disable a number of independent graphic features
</pre>
</s>
New 2.10+ cvars ( defaults ) for fast loading times:


<pre style="max-width:35em">
that are non-essential to play.
seta image_levelLoadParallel "1"
seta image_useTexStorage "1"
seta image_mipmapMode "0"
</pre>


In 2.10 the RXGB normal map compression format has been replaced the higher quality RGTC format.
<font size="4">
==== Texture Based Tweaks ====
</font>
----
These changes reduce or remove texture data to improve performance on GPU's with low VRAM or low memory bandwidth


Note: Disabling compression may lead to Malloc errors due to memory consumption.
===== Image downsizing =====


You may be able to compensate by setting image_downsize options or use image_downsize instead of disabling compression. [[#Image downsizing|Image Downsizing]]
TDM can automatically reduce texture resolution for all 3 supported texture types; diffuse,
<br>normal (bump), and specular. Systems with very low quantities of VRAM or low memory bandwidth benefit from this change.
<br>'''Note: You must restart TDM or invoke reloadImages for image_downsize settings to take effect'''
<br><br>


See [[FAQ#Getting "Malloc Failure for #######" crash-to-desktop|Malloc Failure Errors]]
In Darkmod.cfg, set '''image_downSize''' to '''1''' and then set a limit with '''image_downSizeLimit''',
e.g., '''"image_downSizeLimit" "256"'''. 


<pre>


<font size="5">
seta image_downSize "1"
seta image_downSizeLimit "256"


== The game is '''very''' slow! ==
</pre>
</font>


Note: The advised performance defaults below should mostly already be set by default on upgrade.
This reduces texture memory requirements and may completely alleviate hard drive thrashing for dynamic image loading.  
<br>Please consider [[Performance_Tweaks#Delete_Darkmod.cfg_after_upgrade|deleting darkmod.cfg]] after upgrading to restore these defaults.
<br>Try lowering to 512 and if you still need more VRAM or need lower RAM usage during mission load ( see '''[[#Missions_that_require_64-bit|64-bit missions]]''' ) then move down to 256, 128, or 64
<br><br>
<br><br>There are similar cvars for bump and specular maps as well.
If you get less than 10 FPS, or the game even stutters, please try this:


Look into your '''Darkmod.cfg''' inside your darkmod folder and check that the following settings are like shown below:
Example: Downsize Normal Maps


<pre style="max-width:35em">
<pre>
seta image_usePrecompressedTextures "1"
seta image_useNormalCompression "1"
seta image_useAllFormats "1"
seta image_useCompression "1"
seta image_preload "1"
seta r_useCachedDynamicModels "1"
seta r_useShadowVertexProgram "1"
seta r_useEntityCulling "1"
</pre>


Note: r_useShadowVertexProgram no longer exists in TDM. All shadow modes use GPU vertex operations.<br><br>
seta image_downSizeBump "1"
seta image_downSizeBumpLimit "256"


'''OBSOLETE''' 2.09 performance defaults
<pre style="max-width:35em">
seta r_useMultiDrawIndirect "1"
seta r_useBindlessTextures "1"
</pre>
</pre>


2.11 new performance defaults ( in addition to the standard performance defaults above )
Example: Downsize Specular maps
 
<pre>
 
seta image_downSizeSpecular "1"
seta image_downSizeSpecularLimit "64"


<pre style="max-width:35em">
seta r_useNewBackend "1"
seta r_modelBvhBuild "1"
seta com_smp "1"
seta r_useParallelAddModels "1"
seta r_usePersistentMapping "1"
seta com_useMinorTics "1"
seta com_fixedTic "1"
seta com_maxFPS "166"
</pre>
</pre>


2.12 new performance defaults ( in addition to the standard performance defaults above )
Many players have found that they prefer lower resolution normal maps rather than low resolution textures


<pre style="max-width:35em">
====== Image Downsizing verses Lower Resolution ======
seta r_useLightPortalFlow "2"
seta r_useLightPortalFlowCulling "1"
seta r_softShadowsMipmaps "1"
seta r_useEntityScissors "1"
seta r_animationBounds "1"
seta r_useNewRenderPasses "1"
seta r_shadowMapSinglePass "1"
</pre>


<br>Higher resolutions require larger frame buffers thus more VRAM, likewise higher resolution textures also consume VRAM
<br>This leads to the an interesting decision on visual tradeoffs.
<br><br>When you lower the resolution substantially, the overall visuals of the scene are roughly preserved in general way
<br>but the scene becomes sort of impressionistic, filled with artifacts, and somewhat hard to read
<br><br>When you instead lower texture resolution <u>to the extreme</u> (lower than 128), the scene remains sharp but takes on a more stylized \ cartoon aspect
<br>because all these high fidelity 3D objects are coated in blurry images. It makes TDM look like a beefed-up Nintendo 64 game.
<br>If you set image filtering to Nearest mode, TDM instead looks like a strange offset of Minecraft
<br><br>In this case, there is no objective winner.
<br><br>Some people actually prefer the low-texture options to the native presentation due to the interesting style or nostalgic appearance.
<br>Whereas others will consider the extreme style variance to violate the immersion of the scene and would prefer to suffer with less
<br>scene fidelity for the sake of cohesion.


Note: 2.12 r_useNewRenderPasses replaces r_useNewBackend
<br>Thread:
<br>In 2.10 and newer you can control both the standard resolution and the "renderscale" whereas
<br>2.09 required you to change renderscale for lower the resolution. It is still preferable to lower renderscale unless you have a CRT monitor


<font size="4">
'''https://forums.thedarkmod.com/index.php?/topic/19498-image_downsize-in-206/'''
{{clear}}
<br><br>


==='''Lightgem Calculation Optimizations'''===
===== Disable Specular Maps =====
</font>


<font size="3">
Specular gives materials their shine. This option will make all surfaces shine-free.
====Lightgem interleaved calculation====
</font>


By default lightgem calculation occurs every frame. You can set lightgem calculation to happen only once
Note: This may not work with the Enhanced Ambient
<br> per several frames by setting tdm_lg_interleave console parameter to values higher than 1.
<br> For example, typing:


tdm_lg_interleave 3
<pre>


in console tells TDM to recalculate lightgem value every third frame.
seta r_skipSpecular "1"


In recent TDM versions, this tweak is more beneficial to single-core CPU's.
</pre>
<br>Perhaps it's only current advantage is to assist with maintaining high FPS for 120+ hz monitors.


This tweak can increase average FPS, but it often produces noticeable stuttering, especially on slow machines
in Darkmod.cfg
when your FPS is below 25 to 30FPS.
<br>


{{clear}}
===== Disable Normal Maps =====


=====Lightgem interleave minimum FPS=====
The main detail attribute for textures in Doom 3 \ Darkmod is the Normal Map.


In TDM 2.05 there is a new tdm_lg_interleave_min cvar that allows you to set a cutoff point
If you disable this your game will become really ugly.
for FPS below which the Lightgem Interleave optimization takes effect.
<br>It is set to 40 by default. If your FPS goes below 40 then tdm_lg_interleave returns to the default value of 1 internally to prevent stutter.
<br>Depending on your sensitivity you may wish to increase this to 50 or more.


<pre>
<pre>


tdm_lg_interleave_min 40
seta r_skipBump "1"


</pre>
</pre>


<br> As the cost of lightgem calculation is (also) substantially lower in v2.05 and newer, you may be able to set this to 1 for most missions.
in Darkmod.cfg
<br>
<br> In testing, the only mission I found that suffered from "tdm_lg_interleave ( > 1) stuttering" was "Penny Dreadful 3: Erasing the Trail".
<br> For that mission, I set tdm_lg_interleave_min to 50 to cure the stutter.
<br> This setting can also be used to boost already high FPS values for the new unbounded FPS options ( [[Performance_Tweaks#Disable_FPS_Lock | com_FixeTic 1]] ).
<br> (eg. If you have 90FPS set tdm_lg_interleave to 7 and tdm_lg_interleave_min to 75 to attempt a push towards 120FPS)


In 2.06 with the lightgem calculated on a different thread, this can likely stay at 1 regardless of how low the FPS gets.
===== Disable all Ambient Surfaces =====


<font size="3">
Related to skipping particles, r_skipAmbient will get rid of any non-lit* particles
 
<br>(*most particles are additive blends and don't react to light)
==== Weak Lightgem (Not Recommended)====
<br>along with any other surfaces that don't change based on illumination (most decals, additive glowing windows, etc.).
</font>
 
Setting:


<pre>
<pre>


seta tdm_lg_weak "1"  
seta r_skipAmbient "1"


</pre>
</pre>


in Darkmod.cfg will disable the renderer based lightgem and use a simpler math-based solution.
in Darkmod.cfg
<br>It's a far less accurate lightgem but may allow weaker systems to play the game as a '''last resort'''.<br><br>
 
(Note: The cost of lightgem calculation has been substantially lowered in TDM v2.05 and newer.
<br>This may be an obsolete option in future releases.)
 
 


<font size="4">
<font size="4">


=== '''Disabling standard graphics features''' ===
==== Light and Fog tweaks ====
</font>
</font>
----
These tweaks reduce or eliminate the impact of fogs and volumetric light effects which are often heavier than normal lights.


At the cost of some pretty severe scene quality, you can disable a number of independent graphic features
<font size="3">


that are non-essential to play.
===== Disable Volumetric Lights (New in v2.11) =====
 
<font size="4">
==== Texture Based Tweaks ====
</font>
</font>


These changes reduce or remove texture data to improve performance on GPU's with low VRAM or memory low bandwidth
Volumetric lights force shadow map rendering for their light radius ( per light ).
<br>If you have a GPU with low VRAM or poor VRAM bandwidth ( less than 128-bit bus, integrated graphics, etc),
<br>it may be worthwhile to disable them or reduce your default '''[[Performance_Tweaks#Shadow_Map_Size |shadow map resolution]]''' ( r_shadowMapSize ).


===== Image downsizing =====
To disable volumetrics entirely, set:
 
TDM can automatically reduce texture resolution for all 3 supported texture types; diffuse,
<br>normal (bump), and specular. Systems with very low quantities of VRAM or low memory bandwidth benefit from this change.
 
In Darkmod.cfg, set '''image_downSize''' to '''1''' and then set a limit with '''image_downSizeLimit''',
e.g., '''"image_downSizeLimit" "256"'''. 


<pre>
<pre>


seta image_downSize "1"
seta r_volumetricEnable "0"
seta image_downSizeLimit "256"


</pre>
</pre>


This reduces texture memory requirements and may completely alleviate hard drive thrashing.
in Darkmod.cfg
There are similar cvars for bump and specular maps as well.
 
====== Disable Volumetric Shadows ======


Example: Downsize Normal Maps
Volumetric Lights force expensive Shadow Maps in Stencil Mode. You can disable that via


<pre>
<pre>


seta image_downSizeBump "1"
seta r_volumetricForceShadowMaps "0"
seta image_downSizeBumpLimit "256"


</pre>
</pre>


Example: Downsize Specular maps
in Darkmod.cfg
 
====== Lower Volumetric Samples ======
 
The more samples the smoother the volumetric lights at the cost of lots of performance.
<br>Try lowering the samples. Also try changing the r_volumetricBlur and r_volumetricDither values.


<pre>
<pre>


seta image_downSizeSpecular "1"
seta r_volumetricSamples "16"
seta image_downSizeSpecularLimit "64"


</pre>
</pre>


===== Disable Specular Maps =====
in Darkmod.cfg


Specular gives materials their shine. This option will make all surfaces shine-free.
<font size="3">


Note: This may not work with the Enhanced Ambient
===== Disable BlendLights =====
</font>


<pre>
<pre>


seta r_skipSpecular "1"
seta r_skipBlendLights "1"  


</pre>
</pre>
Line 1,500: Line 1,666:
in Darkmod.cfg
in Darkmod.cfg


===== Disable Normal Maps =====
<font size="3">


The main detail attribute for textures in Doom 3 \ Darkmod is the Normal Map.
===== Disable Fog =====
 
</font>
If you disable this your game will become really ugly.


<pre>
<pre>


seta r_skipBump "1"
seta r_skipFogLights "2"  


</pre>
</pre>
Line 1,514: Line 1,679:
in Darkmod.cfg
in Darkmod.cfg


===== Disable all Ambient Surfaces =====
As of 2.08 and newer there are several modes of fog disable behavior. Mode 1 only disables it for opaque objects (etc)


Related to skipping particles, r_skipAmbient will get rid of any non-lit* particles
<font size="4">
<br>(*most particles are additive blends and don't react to light)
<br>along with any other surfaces that don't change based on illumination (most decals, additive glowing windows, etc.).


<pre>
==== Particle Tweaks ====
</font>
----
Particles mostly impact CPU performance but can impact the GPU due to lots of alpha operations and overdraw


seta r_skipAmbient "1"
===== Disable Soft Particles ( New in 2.03 )=====


</pre>
The new Soft Particle effects in v2.03+ use a little more GPU than the previous particles.


in Darkmod.cfg
This is offset by the fact that v2.03+ doesn't render particles during the '''[[#Lightgem_Calculation_Optimizations|lightgem calculation.]]'''


<font size="4">
Still, if you want an extra boost then set:
 
==== Light and Fog tweaks ====
</font>
 
<font size="3">
 
===== Disable Volumetric Lights (New in v2.11) =====
</font>
 
Volumetric lights force shadow map rendering for their light radius ( per light ).
<br>If you have a GPU with low VRAM or poor VRAM bandwidth ( less than 128-bit bus, integrated graphics, etc),
<br>it may be worthwhile to disable them or reduce your default [[Performance_Tweaks#Shadow_Map_Size |shadow map resolution]] ( r_shadowMapSize ).
 
To disable volumetrics entirely, set:


<pre>
<pre>


seta r_volumetricEnable "0"
seta r_useSoftParticles "0"


</pre>
</pre>
Line 1,552: Line 1,704:
in Darkmod.cfg
in Darkmod.cfg


====== Disable Volumetric Shadows ======
===== Disable Particles ( '''Not recommended''' ) =====


Volumetric Lights force expensive Shadow Maps in Stencil Mode. You can disable that via
This will '''<u>seriously mar your image quality</u>'''. Flames, glares, rain, snow, and smoke will all be gone.


<pre>
<pre>


seta r_volumetricForceShadowMaps "0"
seta r_skipParticles "1"


</pre>
</pre>


in Darkmod.cfg
in Darkmod.cfg
.
<font size="4">


====== Lower Volumetric Samples ======
==== Entity Shadow Tweaks ====
</font>
----
===== Disable Player Shadow=====


The more samples the smoother the volumetric lights at the cost of lots of performance.
The player shadow slightly reduces performance. It has no game effect at all (not seen by AI for instance) apart from atmospheric effect so if you want to disable it enter in the console:
<br>Try lowering the samples. Also try changing the r_volumetricBlur and r_volumetricDither values.
 
g_showplayershadow 0
 
Or, in Darkmod.cfg (see above) change the following line from "1" to "0":


<pre>
seta g_showplayershadow "0"


seta r_volumetricSamples "16"
This is the <u>default setting</u> as of TDM 1.02 and newer.


</pre>
===== Disable Player Lantern Shadow=====


in Darkmod.cfg
You may notice a drop in performance while using the player lantern.


<font size="3">
Add "noshadows" "1" to entitydef light_lantern_moving in tdm_playertools_lantern.def and this stops the player lantern casting shadows.<br>This helps improve performance slightly when using the lantern.<br><br>
----
<font size="4">


===== Disable BlendLights =====
==== Disable Sky ====
</font>
</font>


(New in v2.05) Pitch black sky with no clouds, Moon, or stars
<pre>
<pre>


seta r_skipBlendLights "1"  
seta g_enablePortalSky "0"


</pre>
</pre>
Line 1,590: Line 1,753:
in Darkmod.cfg
in Darkmod.cfg


<font size="3">
<font size="4">


===== Disable Fog =====
==== Disable Lip Sync ====
</font>
</font>


AI will not play lipsync animations
<pre>
<pre>


seta r_skipFogLights "2"  
seta tdm_ai_opt_nolipsync "1"


</pre>
</pre>
Line 1,603: Line 1,767:
in Darkmod.cfg
in Darkmod.cfg


As of 2.08 and newer there are several modes of fog disable behavior. Mode 1 only disables it for opaque objects (etc)
<font size="3">


<font size="4">
==='''OBSOLETE''' Drop in Frame Rates when Viewing Water===
 
==== Particle Tweaks ====
</font>
</font>


===== Disable Soft Particles ( New in 2.03 )=====
Some players have reported a drastic drop in performance when an agitated water surface is in view. (This on a Radeon card.)
<br>Try entering this in the console. It disables the water visible surface effects but at least it might let you play normally...


The new Soft Particle effects in v2.03 and newer use a little more GPU than the previous particles.
<pre>


This is offset by the fact that v2.03 and higher don't render particles during the lightgem calculation.
seta r_skipPostProcess "1"


Still, if you want an extra boost then set:
</pre>
 
or


<s>
<pre>
<pre>


seta r_useSoftParticles "0"
seta r_postprocess "0"


</pre>
</pre>
</s>
<pre>


in Darkmod.cfg
seta r_bloom "0"


===== Disable Particles =====
</pre>


This will '''<u>seriously mar your image quality</u>'''. Flames, glares, and smoke will all be gone.
You can also set a key-bind to toggle this instead:


<pre>
<pre>


seta r_skipParticles "1"
bind "z" "toggle r_bloom 0 1"


</pre>
</pre>


in Darkmod.cfg
See '''[[#Toggle_settings_in_realtime|Toggle Settings in Realtime]]'''
.
<font size="4">


==== Entity Shadow Tweaks ====
See also '''[[FAQ#(OBSOLETE_in_2.12)_Underwater_performance_poor|Underwater performance poor]]'''
</font>


===== Disable Player Shadow=====
TDM 2.12 has improved underwater performance. It no longer uses the postprocess pipeline.


The player shadow slightly reduces performance. It has no game effect at all (not seen by AI for instance) apart from atmospheric effect so if you want to disable it enter in the console:
{{clear}}
<br>


g_showplayershadow 0
<font size="5">


Or, in Darkmod.cfg (see above) change the following line from "1" to "0":
=='''Gameplay Performance Tips'''==
</font>


seta g_showplayershadow "0"
If you have done everything else you can and performance is still poor then one or two things you might do in game to help:
* Close all doors after you have passed through. Generally the game has to process both areas until you close the door if the doorway is still in sight.
* Kill or KO every AI you can. You might not like to play that way but generally, AI still hog resources even out of sight (depending on how set up in the game.)
* Avoid alerts. A dozen guards searching for you will really slow things down on a low-end machine.
* Try to look down at the ground when moving along. Gazing up at a grand vista will slow you down. Best to do your gazing while standing still.


===== Disable Player Lantern Shadow=====
<font size="4">


You may notice a drop in performance while using the player lantern.
==='''Revert to 2.03 AI Search behavior'''===
</font>
The new AI "hiding spot" routines in 2.04 (and newer) are more CPU intensive than 2.03's search method. Try the old 2.03 mode.


Add "noshadows" "1" to entitydef light_lantern_moving in tdm_playertools_lantern.def and this stops the player lantern casting shadows.<br>This helps improve performance slightly when using the lantern.<br><br>
<pre>
seta tdm_ai_search_type "1"
</pre>


==== Disable Sky ====
in Darkmod.cfg


(New in v2.05) Pitch black sky with no clouds, Moon, or stars
<font size="4">
<pre>


seta g_enablePortalSky "0"
==='''Lightgem Calculation Optimizations'''===
</font>
----


</pre>
<br>The Lightgem used to be a very taxing calculation because it required the entire scene to be rendered to an off-screen
<br>image that was then slowly passed to parser code to comb all pixels for the brightest value.
<br><br>As of '''TDM 2.05''' and newer, only shadow casting geometry is rendered during the Lightgem calculation and the
<br>pixels are read directly from an "OpenGL Buffer Object" at high speed.
<br><br>Further optimizations after 2.05 include:
* Moving the calculation to it's own Thread and utilizing SMP
* Making the calculation part of the native Doom 3 sub-view system
* Excluding Lightgem calculations from many phases of the render system that are not applicable
* Inheriting optimizations from the overall renderer ( Improving TDM render speeds, improves the Lightgem render speed )


in Darkmod.cfg
<br>This means that the old configurations to reduce the impact of Lightgem calculation are mostly irrelevant
<br>except for niche scenarios (such as 120FPS+ gaming), very old hardware ( Single Core CPU's ), or very old TDM versions ( older than 2.07).
<br><br>


==== Disable Lip Sync ====
<font size="3">
====Lightgem interleaved calculation====
</font>


AI will not play lipsync animations
By default lightgem calculation occurs every frame. You can set lightgem calculation to happen only once
<pre>
<br> per several frames by setting tdm_lg_interleave console parameter to values higher than 1.
<br> For example, typing:


seta tdm_ai_opt_nolipsync "1"
tdm_lg_interleave 3


</pre>
in console tells TDM to recalculate lightgem value every third frame.


in Darkmod.cfg
This tweak can increase average FPS, but it often produces noticeable stuttering, especially on slow machines
when your FPS is below 25 to 30FPS.


<font size="4">
<br>


=== '''Frame Memory''' ===
{{clear}}
</font>


'''New in TDM 2.08'''
=====Lightgem interleave minimum FPS ( New in 2.05)=====


<pre>
In TDM 2.05 there is a new tdm_lg_interleave_min cvar that allows you to set a cutoff point
r_frameIndexMemory
for FPS below which the Lightgem Interleave optimization takes effect.
</pre>
<br>It is set to 40 by default. If your FPS goes below 40 then tdm_lg_interleave returns to the default value of 1 internally to prevent stutter.
<br>Depending on your sensitivity you may wish to increase this to 50 or more.
 
<pre>


and
tdm_lg_interleave_min 40


<pre>
r_frameVertexMemory
</pre>
</pre>


Increasing frame memory may help avoid crashing or slow-down when a scene suddenly requires more resources.
<br> As the cost of lightgem calculation is (also) substantially lower in v2.05 and newer, you may be able to set this to 1 for most missions.
<br>If you are VRAM limited, consider lowering texture quality ( [[#Image_downsizing|image_downsize]] ) or [[#Lower_your_Render_Scale_.28New_2.07.29|resolution scale]]
<br>
before increasing these.
<br> In testing, the only mission I found that suffered from "tdm_lg_interleave ( > 1) stuttering" was "Penny Dreadful 3: Erasing the Trail".
<br> For that mission, I set tdm_lg_interleave_min to 50 to cure the stutter.
<br> This setting can also be used to boost already high FPS values for the new '''[[#Uncap_FPS_(New_in_v2.06)|unbounded FPS]]''' option.
<br> (eg. If you have 90FPS set tdm_lg_interleave to 7 and tdm_lg_interleave_min to 75 to attempt a push towards 120FPS)
 
In 2.06 with the lightgem calculated on a different thread, this can likely stay at double your interleave value regardless of how low the FPS gets.


<font size="3">
<font size="3">


===OBSOLETE Drop in Frame Rates when Viewing Water===
==== Weak Lightgem '''(Not Recommended)'''====
</font>
</font>


Some players have reported a drastic drop in performance when an agitated water surface is in view. (This on a Radeon card.)
Setting:
<br>Try entering this in the console. It disables the water visible surface effects but at least it might let you play normally...


<pre>
<pre>


seta r_skipPostProcess "1"
seta tdm_lg_weak "1"  


</pre>
</pre>


or
in Darkmod.cfg will disable the renderer based lightgem and use a simpler math-based solution.
<br>It's a far less accurate lightgem but may allow weaker systems to play the game as a '''last resort'''.
<br>This can also be used as a workaround for graphic drivers that don't support features needed by the lightgem FBO / PBO
<br>Android users on the unofficial Android fork have confirmed this workaround
<br><br>


<s>
<font size="3">
<pre>


seta r_postprocess "0"
==== '''OBSOLETE''' Lightgem Split ====
</font>


</pre>
During the initial development of TDM, it was found that you would get better frame pacing and a smoother experience
</s>
<br>if you split the Lightgem calculation into half a run per cycle.
<br>This was even better than interleave but could also be "used with interleave" to offer even more performance.
<br>Unfortunately, the "split mode" caused some unwanted flicker in particle effects so it was disabled by default.
<br>The flickering was cured in TDM 2.03 when SteveL prevented particles from rendering during the Lightgem phase
<br>The flickering was rarely experienced even prior to 2.03 so if you are running a Doom 3 mod version
<br>you would likely be able to enable the optimization without any issue.
<br>In TDM 2.06, the feature was hard-coded to enabled, there is no configuration to enable \ disable it now.
<br><br>For 2.05 and older set:


<pre>
<pre>


seta r_bloom "0"
seta tdm_lg_split "1"


</pre>
</pre>


You can also set a key-bind to toggle this instead:
in Darkmod.cfg


<pre>
{{clear}}
<br>


bind "z" "toggle r_bloom 0 1"
<font size="5">


</pre>
== '''Lower Sound Quality''' ==
</font>


See [[#Toggle_settings_in_realtime|Toggle Settings in Realtime]]
=== Disable EFX reverb (new 2.06) ===


See also [[FAQ#Underwater_performance_poor|Underwater performance poor]]
The new EFX audio option (equivalent to EAX) has some impact on mission performance, due to additional reverb calculation by the CPU.
<br>Disable this option for extra performance. Especially if you get big stutter or lockup events opening doors from indoor
to outdoor areas.
<br>This option, disabled by default, is toggled with the main menu's "Audio/OpenAL EFX".


TDM 2.12 has improved underwater performance. It no longer uses the postprocess pipeline.
Turning on this option makes no performance or audio difference if the mapper didn't include an EFX file. For more about that, see [[Setting Reverb Data of Rooms (EAX)]].


<font size="5">
=== Force 22khz ===


== '''Experimental Features''' ==
'''<s>2.06: Do not use this optimization. It is known to cause issues with loading missions on some OpenAL hardware:<br>
</font>
http://bugs.thedarkmod.com/view.php?id=4814</s>
'''
 
'''(This is fixed in 2.07)'''
 
You can force 22khz audio processing to reduce the CPU overhead of audio processing.
 
Obviously, EAX effects will increase CPU load for audio so you should consider disabling
 
those before lowering audio quality. If normal audio plays fine but EAX causes performace,
 
this change might give you a boost while EAX is enabled.
 
<pre>
 
seta s_force22kHz "1"
 
</pre>
 
{{clear}}
<br>
 
<font size="5">
 
== '''Experimental Features''' ==
</font>


These settings may offer some performance benefits with caveats \ bugs.
These settings may offer some performance benefits with caveats \ bugs.
Line 1,757: Line 1,994:
The default shadow map mode calculates shadows for both polygons that are on the side facing
The default shadow map mode calculates shadows for both polygons that are on the side facing
<br>the light (front) and the side facing away from the light (back).
<br>the light (front) and the side facing away from the light (back).
<br>This mode improves performance by only calculating the back side shadows.
<br>Cull Front mode improves performance by only calculating the back side shadows.
<br>This mode is almost production ready. It actually fixes or improves some visuals that the default mode produces
<br>This mode is almost production ready. It actually fixes or improves some visuals that the default mode produces
<br>but it has some glaring artifacts such as light leaks where surfaces meet in corner areas.
<br>but it has some glaring artifacts such as light leaks where surfaces meet in corner areas.
<br>In most missions, you will not be able to tell the difference other than the '''improved performance'''
<br>'''In most missions, you will not be able to tell the difference other than the <u>improved performance</u>'''


<pre>
<pre>
Line 1,784: Line 2,021:
<br>
<br>


=== OBSOLETE Single Pass Light Rendering ( 2.09 ) ===
=== Use BFG style Portal Culling (new in v2.06) ===
<br>
 
If you have a system that works well with Multi-Core ( com_smp 1) then you may
consider enabling r_useAnonReclaimer to reduce cache thrashing.
 
2.07 and newer
 
<pre>
 
seta r_useAnonReclaimer "1"
 
</pre>
 
2.06
 
<pre>
 
seta r_useBfgPortalCulling "1"
 
</pre>
 
in Darkmod.cfg
 
=== '''OBSOLETE''' Single Pass Light Rendering ( 2.09 ) ===
<br>
'''THIS OPTION DOES NOT WORK IN 2.11'''
'''THIS OPTION DOES NOT WORK IN 2.11'''
<br><br>
<br><br>
Line 1,805: Line 2,065:
<br>This is probably because of the Nvidia's tiling (deferred rendering) hardware optimizations.
<br>This is probably because of the Nvidia's tiling (deferred rendering) hardware optimizations.


=== Use BFG style Portal Culling (new in v2.06) ===
=== '''OBSOLETE''' Skip Dynamic Shadows ===


If you have a system that works well with Multi-Core ( com_smp 1) then you may
<br>'''This setting is no longer available as of TDM 2.12'''
consider enabling r_useAnonReclaimer to reduce cache thrashing.


2.07 and newer
<br>Only render shadows from Stationary lights. This will break missions where players might need to hide in a moving shadow.


<pre>
<pre>


seta r_useAnonReclaimer "1"  
seta r_skipDynamicShadows "1"


</pre>
</pre>


2.06


<pre>
<font size="5">


seta r_useBfgPortalCulling "1"
== '''Hardware Considerations''' ==
</font>


</pre>
If you can correct hardware deficiencies you may not need to perform as many tweaks or setting changes.
<br>Sometimes it is as simple as a Driver or BIOS update. Other times, you may need to consider updating hardware.


in Darkmod.cfg
<font size="4">


=== '''Driver Considerations''' ===
</font>
----
''(IdTech4) The Dark Mod was originally based on OpenGL 2.0. (the same as Doom 3)''


''GPU manufacturers have largely ignored issues with this older specification so a number of workarounds have been''


''compiled by the community to attend to erroneous behaviors or poor performance.''


=== Skip Dynamic Shadows ===
''As of TDM 2.06 and newer The Dark Mod uses OpenGL 3.x so many of these suggestions are no longer applicable.''


Only render shadows from Stationary lights.
''That said, even OpenGL 3.2 (current requirement) is an old standard so some newer workarounds may be needed.''
This will break missions where players might need to hide in a moving shadow.


<pre>


seta r_skipDynamicShadows "1"
{{clear}}
 
==== Linux UEFI Secure Boot ====


</pre>
With Secure Boot enabled in the BIOS, some Linux distros will fallback to (slow) open drivers and wont have access to most hardware features.
<br>If your Linux distro doesn't offer "Signed Kernels" and "Signed Drivers" disabling UEFI may be the only way to have acceptable performance
<br>We recommend that you consider using a Linux distro that offers Signed Kernels such as the latest Ubuntu, OpenSUSE, Debian, Linux Mint versions


<font size="5">
==== Linux Kernel Version ====


== '''Lower Sound Quality''' ==
For AMD and Intel hardware, the drivers come with the Linux Kernel. Some Linux distros ship with older Kernels that do not support the latest hardware.
</font>
<br>Many of these distros offer options to upgrade to newer Kernel versions with better hardware support.
<br>Ubuntu and Linux Mint offer "OEM Signed Kernels" that offer newer hardware support and are signed so they can be used with Secure Boot.


=== Force 22khz ===
==== Try different driver versions ====


'''<s>2.06: Do not use this optimization. It is known to cause issues with loading missions on some OpenAL hardware:<br>
Sometimes updating to the latest driver version or reverting to an older version
http://bugs.thedarkmod.com/view.php?id=4814</s>
'''


'''(This is fixed in 2.07)'''
will improve performance. Try a few revisions or ask about known good driver versions.


You can force 22khz audio processing to reduce the CPU overhead of audio processing.
This applies to both GPU drivers and "Motherboard Chipset Drivers".  
{{clear}}
<br>


Obviously, EAX effects will increase CPU load for audio so you should consider disabling
<font size="3">


those before lowering audio quality. If normal audio plays fine but EAX causes performace,
==== '''Lower in-driver quality settings''' ====
</font>
----
AMD, Nvidia, and Intel all give users the option to lower texture quality and


this change might give you a boost while EAX is enabled.
also have various quality "optimization" levels for texture LOD Bias and Anisotropy (Filtering).


<pre>
===== Driver Anti-Aliasing Settings =====


seta s_force22kHz "1"
TDM ships with standard Multi-Sampling Anti-Aliasing ( MSAA ) which is more taxing on performance than some newer Anti-Aliasing technologies.
<br>It may be better to disable AA in-game and use your in-driver AA settings instead.
<br><br>For example, Nvidia's in-driver '''[https://en.wikipedia.org/wiki/Fast_approximate_anti-aliasing FXAA]''' anti-aliasing setting is substantially faster than the multi-samples settings
in game.
<br>AMD has MLAA which works in a similar way.
<br>( Warning: FXAA can make '''[[#Related_FXAA_and_Blurry_Fonts|text and GUI's a little blurrier]]''' )
<br><br>Both AMD and Nvidia also offer AA enhancements to smooth transparent texture edges.
<br><br>Doom 3 is far less susceptible to AA artifacts so FXAA may be an acceptable alternative especially if you are are running the game at native resolution (or nearly native).
<br><br>Incidentally, if you have GPU power to spare you can either use your GPU driver settings to force even higher quality modes such as '''[https://en.wikipedia.org/wiki/Supersampling SSAA]'''
<br>( that performs sub-sampling to every pixel ) or configure TDM '''[[Performance_Tweaks#Lower_your_Render_Scale_(New_2.07)|Render Scale]]''' ( r_fboResolution ) above native resolution for an SSAA effect.
<br>
===== Driver Vsync Settings =====


</pre>
As with AA, AMD, Intel and Nvidia have multiple options to tailor Vsync performance including Enhanced Sync, Fast Sync, Speed Sync
<br>and Variable Frame Rate options like G-Sync and Freesync.
<br>Disabling in-game Vsync and forcing one of these new sync modes in your driver settings will probably be a better Vsync solution
{{clear}}
<br>
<font size="3">


=== Disable EFX reverb (new 2.06) ===
==== '''Vendor Specific Issues''' ====
</font>
----
Over the years, users have discovered quirks in Intel, Nvidia, or AMD drivers that can be mitigated.
===== Intel ( new 2.09 ) =====


The new EFX audio option (equivalent to EAX) has some impact on mission performance, due to additional reverb calculation by the CPU.
Some Intel drivers do not perform well with persistent mapping enabled.
<br>Disable this option for extra performance. Especially if you get big stutter or lockup events opening doors from indoor
<br>In 2.09 there is a special persistent mapping mode that works better for this hardware.
to outdoor areas.  
<br>You must disable standard persistent mapping to use this mode.
<br>This option, disabled by default, is toggled with the main menu's "Audio/OpenAL EFX".


Turning on this option makes no performance or audio difference if the mapper didn't include an EFX file. For more about that, see [[Setting Reverb Data of Rooms (EAX)]].
<pre>


<font size="5">
r_gpuBufferNonpersistentUpdateMode "1"


=='''Gameplay Performance Tips'''==
r_usePersistentMapping 0
</font>


If you have done everything else you can and performance is still poor then one or two things you might do in game to help:<br><br>
</pre>


* '''Revert to 2.03 Search behavior'''<br>


<pre>
===== (AMD\ATI) Disable Catalyst AI =====
seta tdm_ai_search_type "1"
</pre>
'''The new AI "hiding spot" routines in 2.04 (and newer) are more CPU intensive that 2.03's search method'''<br><br>


* Close all doors after you have passed through. Generally the game has to process both areas until you close the door if the doorway is still in sight.
2018: The latest Radeon Crimson and Adrenalin Drivers:
* Kill or KO every AI you can. You might not like to play that way but generally, AI still hog resources even out of sight (depending on how set up in the game.)
* Avoid alerts. A dozen guards searching for you will really slow things down on a low-end machine.
* Try to look down at the ground when moving along. Gazing up at a grand vista will slow you down. Best to do your gazing while standing still.


{{clear}}
Surface Format Optimization = OFF


== '''Compile Darkmod for your own Hardware''' ==
[[FAQ#Disable_Catalyst_AI_in_recent_AMD_ATI_drivers|Disable Catalyst AI in recent AMD Drivers]]


The Dark Mod already contains many hardware specific optimizations and can detect when your system has the needed hardware so that it can accelerate parts of the engine.
===== (AMD\ATI) Rename the executable =====
<br>Though unlikely, it is possible that MSVC++ or GCC compilers can improve the performance of the executable further when told what hardware you have.
<br>You can try compiling The Dark Mod yourself and add any compiler configurations that are specific to your hardware.<br><br>
[[The_Dark_Mod_-_Compilation_Guide|Darkmod Compiling Guide]]
<br><br>For Windows \ MSVC++ you may wish to add an AVX flag:
  https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170
<br><br>For Linux you can add -DCMAKE_CXX_FLAGS=-march=native to your cmake string.
<br><br>Example:
  cmake -DCMAKE_BUILD_TYPE="Release" .. -DGAME_DIR=/home/user/darkmod -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_CXX_FLAGS=-march=native


{{clear}}
Most modern drivers have built-in profiles for the executable names of commercial games.


<font size="5">
Renaming TheDarkMod.exe to the name of a commercial OpenGL game may gain you some optimizations


== '''Hardware Considerations''' ==
or even a Crossfire profile (I believe DarkAthena.exe had one.)
</font>


=== OBSOLETE Configure Video RAM ===
Known working renames:


Change:
DarkAthena.exe (thus far the most consistent improvement)


<pre>
Doom3BFG.exe


seta com_videoRam "128"
Wolf2MP.exe


</pre>
Amnesia.exe


to the appropriate value (in MB) for your GPU in Darkmod.cfg
Brink.exe


Eg. A 2GB video card would have 2048 there.
Prey.exe


<pre>
<font size="4">
===== (Nvidia) Optimus Laptop wont use your Nvidia GPU =====
</font>


seta com_videoRam "2048"
See also: [https://nvidia.custhelp.com/app/answers/detail/a_id/2615/~/how-do-i-customize-optimus-profiles-and-settings%3F]


</pre>
Many Laptops now have the ability to use the GPU that is built into the CPU when not "gaming".
<br>Unfortunately, sometimes the drivers for these Laptops don't detect TDM as a "game".
 
The easiest solution is to create a Driver Profile for TheDarkMod.exe or TheDarkModx64.exe in your driver settings.
 
* Right click {{RMB}} anywhere on your desktop where no icon is shown
* Left Click {{LMB}} Nvidia Control Panel
* Then Click on the Programs Tab
* Click "Add" and browse for TheDarkMod.exe or TheDarkModx64.exe
* Then scroll down the settings list and find "OpenGL Rendering GPU"
* Then select your Nvidia GPU from the list of options
 
[[Image:Nvidia_Profiles.jpg|600px]]
<br><br><br><br>


{{clear}}
{{clear}}


=== Upgrade your BIOS ===
===== (Nvidia) Disable the Streamer Service =====
 
 
Sometimes bugs or unintended specification limits in the BIOS on an older motherboard will prevent it from
Open your run dialog ({{key|Windows}} + {{key|R}}) or command prompt and type services.msc
allowing the CPU or GPU to meet their potential.  
 
 
On the Extended Tab locate "Nvidia Streamer Network Service"
If your manufacturer has an updated motherboard BIOS available, consider applying it.
 
 
{{RMB}} Right-click it and choose "Stop"
=== Last resort: Upgrade your hardware ===
 
 
Once the service is stopped, {{RMB}} right click it again and choose Properties
Modern games need a lot of computing power, and while you don't need the absolutely newest hardware to play them, upgrading single components of your machine can help tremendously:
 
On the General Tab set Startup Type = Disabled then {{LMB}} click Apply.
 
Do the same for "Nvidia Streamer Service"
 
Do the same for "Nvidia Telemetry" service(s).
 
Note: There is a GUI option to disable streaming in the newest Geforce Experience settings page.
 
You would still be advised to disable the Telemetry service for extra performance.
 
 
 
''You can also perform these steps for any services that you know can be manually started
 
''or are not needed for your daily usage. (Obviously) Do not disable any service that you don't
 
''recognize or know is safe to disable.''
 
'''NEW INFO:'''
 
The Nvidia Streamer Service is now tied to the "Geforce Experience" "In-Game Overlay" setting.<br>Disabling that feature in Geforce Experience should accomplish the same as the above.
 
{{clear}}
 
 
{{clear}}
 
===== (Nvidia) Disable Threaded Optimizations =====
 
Open Nvidia Control Panel ->
 
Manage 3D Settings ->
 
Bottom half of list locate "Threaded Optimization" <-- Set to NO / Off
 
Also set "Multi-display/Mixed GPU acceleration" to "Single display performance mode"
 
This can also reduce or eliminate driver crashes or rendering anomalies.
 
<font size="3">
* Note: '''<u>This might be obsolete information.</u>'''<br>With the latest Nvidia drivers, some users have reported that '''disabling''' Threaded Optimizations<br>has significantly '''<u>reduced performance</u>'''. (Down from 60 to 25FPS in one case.)</font><br><br><br>
 
{{clear}}
----
<br>
 
<font size="3">
 
=== Upgrade your BIOS ===
</font>
<br>
Sometimes bugs or old specification limits in the BIOS on an older motherboard will prevent it from
allowing the CPU or GPU to meet their potential.
 
Also, some vulnerabilities can be patched via BIOS update so that you wont lose performance due to '''[[#White-list_TheDarkMod.exe_in_Security_Software|mitigations]]'''.
 
If your manufacturer has an updated motherboard BIOS available, consider applying it.
<br><br>
 
=== Compile Darkmod for your own Hardware ===
 
The Dark Mod already contains many hardware specific optimizations and can detect when your system has the needed hardware so that it can accelerate parts of the engine.
<br>Though unlikely, it is possible that MSVC++ or GCC compilers can improve the performance of the executable further when told what hardware you have.
<br>You can try compiling The Dark Mod yourself and add any compiler configurations that are specific to your hardware.<br><br>
'''[[The_Dark_Mod_-_Compilation_Guide|Darkmod Compiling Guide]]'''
<br><br>For Windows \ MSVC++ you may wish to add an AVX flag:
  '''https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170'''
<br><br>For Linux you can add -DCMAKE_CXX_FLAGS=-march=native to your cmake string.
<br><br>Example:
  cmake -DCMAKE_BUILD_TYPE="Release" .. -DGAME_DIR=/home/user/darkmod -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_CXX_FLAGS=-march=native
 
{{clear}}
<br>
 
<font size="3">
=== '''Legacy Versions''' ===
</font>
----
If your Graphics Card ( GPU ) does not support OpenGL 3.2+ you can still play older TDM missions using Legacy TDM Versions
<br>Some of the '''[[#OBSOLETE_Suggestions|OBSOLETE]]''' settings referred to in this wiki can also improve performance in these versions
<br><br>Here is a handy list of version details:
* '''[[#Legacy_Doom_3_Mod_Versions|Doom 3 Mod]]''' versions: '''[[Thief's_Den|Thief's Den Demo]]''', '''[[Saint_Lucia|Tears of St. Lucia Demo]]''', and Releases '''1.0''' to '''[[What's_new_in_TDM_1.07|1.07]]''' ( Same OpenGL support as Doom 3 )
* '''Doom 3 Mod''' Executable compiled from '''Doom 3 Source Code: [[What's_new_in_TDM_1.08|1.08]]''' ( no OpenGL 1.x support, only OpenGL 2.0 )
* '''[[#Legacy_OpenGL_2.0_Versions|Legacy OpenGL 2.0]]''' "Standalone" versions: '''2.0''' to '''[[What's_new_in_TDM_2.05|2.05]]'''
* '''Hybrid''' OpenGL 2.0 \ 3.x versions with (both ARB and GLSL): '''2.06''' and '''[[What's_new_in_TDM_2.07|2.07]]'''
* '''Modern''' OpenGL 3.2 versions ( GLSL only ): '''2.08''' to '''[[What's_new_in_TDM_2.12|2.12]]'''
<br>''(Mod versions 1.0 to 1.08 ( and both Demo releases ) require the original ( vanilla ) Doom 3 with the latest 1.3.1 patch game to play)''
<br><br>
==== Legacy OpenGL 2.0 Versions ====
Older TDM versions ( 2.07 and older ) are able to run on OpenGL 2.0 or earlier hardware. If you cannot run the latest TDM versions, try an older release.
<br>( Your hardware will still need to be able to run Doom 3 regardless of which TDM version you try. )
<br><br>'''OpenGL 2.0 mode''' in 2.06 and 2.07 :
<pre>
    seta r_nvidiaOverride "0"
    seta r_softShadowsQuality "0"
    seta r_useFBO "0"
    seta r_useGLSL "0"
</pre>
''( TDM 2.05 and older <u>only</u> support OpenGL 2.0 mode. No special configuration is required for these older releases. )''
<br>
<br>The easiest takeaway here is that if your Graphics Card supports OpenGL versions between 2.0 and 3.1,
<br>this means that '''[[What's_new_in_TDM_2.07|TDM 2.07 is your best option]]''' as it has the most optimizations (and features) yet supports
<br>the older OpenGL versions.
 
==== Legacy Doom 3 Mod Versions ====
 
As a '''[https://en.wikipedia.org/wiki/Doom_3 Doom 3]''' mod, TDM could render using any OpenGL standard that Doom 3 could ( between GL 1.1 and 2.0 / DX7 to DX9 hardware )
<br>but most TDM versions use ARB assembly (GL 2.0) for water and glass effects so running TDM on DX8 (or lower) hardware
<br>may result in some visual anomalies.
<br><br>If Doom 3 doesn't detection your OpenGL support, you may need to force it via the r_renderer '''[[Cvars_in_The_Dark_Mod|CVAR]]'''
<pre>
    seta r_renderer "arb"
</pre>
There are several backends other than the "arb" backend ( arb is for the oldest hardware ):
* arb (basic)
* nv10 (Nvidia GF1, GF2, GF4MX)
* nv20 (Nvidia GF3, GF4)
* R200 (Radeon 8500)
* ARB2 (NV30, R300 and above) ( same as "best" ) ( OpenGL 2.0 )
<br>Also the "Enhanced" '''[[#OBSOLETE_Set_the_interaction.vfp_to_%22Standard%22|interaction]]''' and '''[[#OBSOLETE_Set_the_ambient_shading_to_"Faster"|ambient]]''' video settings require OpenGL 2.0 ( ARB assembly shaders )
<br>(TDM 1.08 and newer have no legacy ( pre-DX9 hardware \ pre-OpenGL 2.0 ) support)
<br><br>Finally, even in mod form TDM has higher specification requirements than Doom 3 due to higher poly characters and assets.
<br>Further, since Doom 3 does not have some of the culling and multi-core optimizations that TDM 2.06 and newer have,
<br>old missions can be even more taxing even when run on old OpenGL modes (without shaders, etc).
<br>For example the mission "Rightful Property" on TDM 1.07 ( mod version ) has many areas that are below 20FPS
<br>whereas TDM 2.07 (and newer) can render the same areas over 150FPS on the same hardware.
 
{{clear}}
<br>
 
=== '''OBSOLETE''' Configure Video RAM ===
 
Change:
 
<pre>
 
seta com_videoRam "128"
 
</pre>
 
to the appropriate value (in MB) for your GPU in Darkmod.cfg
 
Eg. A 2GB video card would have 2048 there.
 
<pre>
 
seta com_videoRam "2048"
 
</pre>
{{clear}}
<br>
<font size="5">
 
=== '''Last resort: Upgrade your hardware''' ===
</font>
----
 
<br>This whole wiki article is meant to assist players with '''making TDM run as best as possible''' on their '''current hardware'''.
<br><br>That said, you may find that the needed compromises are too harsh or that some missions still do not perform
<br>well enough even with an optimized configuration. As such, it may be time to consider hardware upgrades.
<br><br>'''Before upgrading hardware it may still be advised to:'''
* Ensure you have the latest '''[[#Driver_Considerations|Drivers]]''' for your hardware ( GPU, Chipset \ Motherboard, Audio )
* Ensure your laptop is '''[[#(Nvidia)_Optimus_Laptop_wont_use_your_Nvidia_GPU|using the correct GPU]]'''
* Ensure you are running in '''[[#Uncap_FPS_(New_in_v2.06)|Uncapped FPS Mode]]''' and have proper '''[[#Linux_UEFI_Secure_Boot|Secure Boot Settings]]''' if you are using Linux
* Ensure you have the latest OS updates installed
* Ensure you have the correct '''[[#Lower_in-driver_quality_settings|Driver Settings]]''' applied
* Ensure your '''[[#Upgrade_your_BIOS|Firmware]]''' is up-to-date ( Motherboard BIOS \ UEFI, GPU firmware, etc)
* Open a support thread in the forums, especially if your hardware is above the '''[[#Minimum_Specifications|minimum specifications]]'''
 
<br>Modern games need a lot of computing power, and while you don't need the absolutely newest hardware to play them,  
<br>upgrading single components of your machine can help tremendously:
 
* If you got '''less than 2 GByte''' main memory, consider upgrading your memory. This really helps to reduce swapping, which introduces quite noticeable slowdowns.
* If you got a graphic card older than the Nvidia Geforce GT 8x00 series or ATI/AMD HD 4x00 series, consider upgrading it.
* Upgrading the (spinning) hard disk to SSD / NVME "Solid State" storage should improved loading times, especially on 2.10 and newer.
* For comparison, see '''[[Known_System_Configurations|Known System Configurations]]''' to see the weakest hardware known to run current TDM versions.
 
<br>Upgrading your CPU is possible in most cases but can be quite complicated and the cost might be so high that upgrading your whole PC might be a better value.
{{clear}}
<br>
 
<font size="5">


* If you got '''less than 2 GByte''' main memory, consider upgrading your memory. This really helps to reduce swapping, which introduces quite noticeable slowdowns.
== '''Configuration Based Issues''' ==
* If you got a graphic card from NVidia older than the Geforce 8x00 series, consider upgrading it.
* For comparison, see '''[[Known_System_Configurations|Known System Configurations]]''' to see the weakest hardware known to run current TDM versions.


Upgrading your CPU is possible in most cases but can be quite complicated
and the cost might be so high that upgrading your whole PC might be a better value.
Upgrading the hard disk will usually not help much with gaming, unless you are running out of free space.
SSD / NVME storage have improved loading times, especially on 2.10 and newer
<font size="5">
== '''Toggle settings in realtime''' ==
</font>
</font>


With the exception of Resolution, AA, and AF settings; most of the above settings can be changed in realtime
A few configuration changes that players apply for performance benefit can cause unexpected problems.
in the console or via a bind in Darkmod.cfg.


For example, you could bind both post-processing and enhanced interaction to the Z key to enable and disable them both by pressing that key
=== A Warning about cm_backFaceCull ===
 
<pre>
 
bind "z" "toggle r_postprocess 0 1; toggle tdm_interaction_vfp_type 0 1"
 
</pre>
 
in Darkmod.cfg
 
<font size="5">
 
== '''A Warning about cm_backFaceCull''' ==
</font>


Some users have reported AI pathfinding and tread-milling issues with this enabled.
Some users have reported AI pathfinding and tread-milling issues with this enabled.
While this can be the fault of poor map design or monsterclip placement,  
While this can be the fault of poor map design or monsterclip placement,  
<br>'''one thing that <u>can cause this</u> is the performance cvar:'''
<br>'''<u>one thing that can cause this</u> is the performance cvar:'''


<pre>
<pre>
Line 1,999: Line 2,443:
<br>We recommend disabling it (cm_backFaceCull "0" ) unless you know the mission you're playing has been tested with it enabled.
<br>We recommend disabling it (cm_backFaceCull "0" ) unless you know the mission you're playing has been tested with it enabled.


<font size="5">
=== '''OBSOLETE''' Blurry Briefing and Menu Screens===
 
=='''Blurry Briefing and Menu Screens'''==
</font>
 
* Obsolete info. This is fixed in TDM 2.05 (and later.)


<s>If you get blurry briefing and menu screens then in Darkmod.cfg make sure you do NOT have image_downSize 0.  
If you get blurry briefing and menu screens then in Darkmod.cfg make sure you do NOT have '''[[#Image downsizing|image_downSize]]''' set to 1.  


Instead set it to 1. But see also [[#Image downsizing|Image Downsizing]] as there is a patch available to allow
Instead set it to 0.


image_downsize without making menus blurry.</s>
* '''This is fixed in TDM 2.05 (and later.)'''


=== Related FXAA ===
==== Related FXAA and Blurry Fonts ====


( 2.07+ )
( 2.07+ )
Line 2,019: Line 2,458:
This is a known problem with FXAA in general.
This is a known problem with FXAA in general.


== See also ==
== '''See also''' ==


[http://www.tweakguides.com/Doom3_8.html | Tweakguides Doom 3]
'''[https://web.archive.org/web/20160420002142/http://www.tweakguides.com/Doom3_8.html Tweakguides Doom 3]'''


See also the [[FAQ]].
See also the '''[[FAQ]]'''.


{{installation}}
{{installation}}

Latest revision as of 13:32, 16 October 2024

For Players

This article relates to performance issues for players. For performance information for mappers, see Performance: Essential Must-Knows


Minimum Specifications


  • CPU: 1.5Ghz with x64 instructions (64-bit) and SSE2 SIMD support
  • GPU: OpenGL 3.2 compatible with at least 512MB of VRAM ( roughly the performance of a Geforce GT 8800 )
  • RAM: 2GB+
  • Storage: 30GB free space ( depending amount of missions you download )
  • Display: We recommend a display that can render at least 640x480 for legible menus and hud.
    (Some analog NTSC televisions with 480i have high quality sub-pixels that can render an image that looks approximately like 1024x480 or 800x480.
    If you PC has analog TV out, try configuring 800x600 or 1024x768 resolutions for improved fidelity.)


You may be able to play on weaker hardware using config tips in this wiki but you will likely encounter many missions that are too taxing.

The Dark Mod 1.0 was originally released in 2009. The average mission designer and player of that time had a Geforce 6600GT and AMD Athlon 64 X2 2GHZ.
While some missions were playable all the way down to a Pentium 4 2.8GHZ with a Geforce FX 5200, this is well below the expected audience for this project.
Current Intel integrated GPU's have better performance than the Geforce 8800 (which was a very high-end card in 2009).
( Low-power mobile chips are known to throttle under heavy load, especially when using integrated graphics. )

See Hardware Considerations for additional details.


Conventions

Most of the changes demonstrated in this article are via "Console variables" CVARS.

The "seta" prefix is intended to save these settings permanently so that they are retained on restart and that is what is used by Darkmod.cfg.

Note: With the exception of Screen Resolution and Image Downsize, most settings can be changed in realtime in the console or via a key bind in DarkmodKeybinds.cfg.
(Also, "Render Scale" can be changed in realtime and is preferred to Screen Resolution anyway)


seta something "value"

OBSOLETE Suggestions

Some configuration suggestions in this wiki are no longer applicable in the latest TDM versions and are only
preserved for players running old versions. Where applicable these are labelled OBSOLETE so you can ignore them.

Temporary Testing

To temporarily test any settings, you can drop the "seta" and simply invoke the cvar and it's value (without double quotes) in the console.

Example:

Open the console with Ctrl+Alt+~ (tilde, ^ on German keyboards) and type:


r_softShadowsRadius 2

Toggle settings in realtime

For example, you could bind both shadow maps and soft shadows to the Z key to enable and disable them both by pressing that key


bind "z" "toggle r_shadows 1 2; toggle r_softShadowsQuality 0 15; shadowimplchanged"

in DarkmodKeybinds.cfg

( shadowimplchanged is needed when changing shadow modes )

Mission.cfg (New in 2.12)

When TDM was a Doom 3 mod, you could add a DoomConfig.cfg file to specific missions under doom3/darkmod/fms/mission_name
This allowed you customize settings on a per mission basis
In TDM 2.12 a new config file called mission.cfg was created that allows mission authors to make fleeting setting changes to dynamic cvars
You can use this file to replicate the old per mission concept

  • Make a mission.cfg file and place it under your darkmod folder. This is your global setting file.
  • Make another mission.cfg file and place it under darkmod/fms/<mission_name>. This is your per mission setting file
  • Add cvars to the per mission file in the format of seta r_something "0"
  • For each cvar added to the per mission file, add the preferred default version to the global setting file

To ensure the global setting gets re-applied, uninstall the current mission before installing a new one

Launch Options

You can also add the value as part of your target in your shortcut:

Example with two cvars:

  • Click the right mouse button Right click your Desktop shortcut to TheDarkMod and select Properties
  • On the Shortcut Tab enter the following into the "Target:" field

"C:\darkmod\TheDarkModx64.exe" +set r_softShadowsRadius 2 +r_useEntityCulling 1

(Assuming you installed into C:\darkmod)

  • Then Click the left mouse button click the Change Icon button and browse for the Darkmod.ico icon in your darkmod install path
  • Click the left mouse button Click Apply

See also Set TheDarkMod to High Priority


Evaluation and Diagnostics

The following options offer basic quick tools to examine performance.
See Profiling and Tracy Profiler for advanced (developer level) performance evaluation

Show FPS

First, you can check how many FPS are achieved by opening the console with Ctrl+Alt+~ (tilde, ^ on German keyboards) and type:

com_showFPS 1

Show Position

To identify the locations where problems are found, use these two cvars to render the positions as an overlay display while playing.

Open the console with Ctrl+Alt+~ (tilde, ^ on German keyboards) and type:


g_showviewpos 1

con_noPrint 0

TDM Show Viewpos ( New 2.12 )

To accomplish the basically the same thing ( a little more refined ) the new tdm_show_viewpos cvar is now available


tdm_show_viewpos 1

Stop Time

Moving and Thinking can impact performance in unexpected ways.
When comparing graphical settings it might be best to "Stop Time" so that the entire scene is frozen
and the FPS changes due to graphics options can be more easily compared.
Open the console with Ctrl+Alt+~ (tilde is ^ on German keyboards) and type:


g_stopTime 1

Killmonsters


You can roughly estimate the impact of AI by navigating to an area or room where no AI are visible, then invoking "killmonsters" in the console
If the FPS jumps up dramatically, your performance issues may be mostly related to AI think cycles on the CPU

If so, try TDM config changes that can reduce CPU usage such as "Shadow maps mode", "Lightgem interleave", "Disable EFX", "2.03 Search Behavior",
"Disable Lip Sync", and "Skip Particles"

( Make sure Multi-core , Frontend acceleration and Uncapped FPS are enabled and ensure your OS is optimized too )

No Shadows


If you disable shadows and there is no performance change (especially if you also killmonsters ), this can indicate something more complex is impacting performance.
While shadows are off, try lowering and raising individual quality settings and see whether any have dramatically different performance impact.
If not, raise the issue with mission author in the original mission thread ( unless the mission is already known to be taxing )


r_shadows 0


Delete Darkmod.cfg after upgrade

If you run tdm_installer to upgrade TDM, it offers you the option to Restore Darkmod.cfg.
When you do this, you may be reverting newer configuration defaults that have been changed in the latest release.

While it may be inconvenient to reconfigure all your preferred settings from scratch, it may be best to start with this step ( deleting Darkmod.cfg )
before tinkering with any other setting changes. ( Especially if you haven't done this for a few upgrade cycles. )

Newer TDM versions keep your keybindings and controller settings in a separate file ( DarkmodKeybinds.cfg ) so you will just need to change
resolution, brightness \ gamma, and other graphic quality settings in addition to game-play difficulty settings.


Mission Updates

Mission authors often discover performance problems after they release their missions.
They will occasionally issue new mission versions that have improved performance.
Also, the TDM team will sometimes apply fixes to missions that can improve performance and stability in new release versions.
We recommend checking the Mission Downloader for updates to your existing missions ( denoted with an asterisk )
Note: Savegames do not work between different mission versions.

TDM performance can vary wildly depending on what any specific mission author has done to design their mission.
Before deciding that TDM is unplayable on your hardware, please try less demanding missions

Known Taxing Missions

The following are a few missions that are known to challenge low-end hardware configurations

  • Scroll of Remembrance
  • Briarwood Manor
  • The Rats Triumphant
  • Rightful Property
  • A Bridge Too Far


Known Low Requirement Missions

Conversely, here are a few missions that should run well on low-end hardware ( in addition to the included "official" missions )

  • Closemouthed Shadows
  • The Outpost
  • The Parcel
  • Special Delivery
  • The Thieves
  • Thief's Den 1
  • The Golden Skull
  • Langhorne Lodge
  • Coercion
  • The Bakery Job
  • Deadeye
  • A Night Of Loot: One Man's Treasure
  • Down and Out on Newford Road
  • A Matter of Hours
  • Sir Talbot's Collatoral


Missions that require 64-bit

Some very large missions will not load when running 32-bit TDM versions on Windows ( or may have anomalies on 32-bit Linux )
They simply cause TDM to exceed the Windows "2GB allocation limit" for 32-bit during loading.

  • The Painter's Wife
  • Penny Dreadful 3: Erasing the Trail
  • Shadows of Northdale ACT 1


( Note: You may be able to use image_downSize cvars to lower resources to load these missions on 32-bit Windows. )
( Note: 32-bit TDM is unsupported as of TDM 2.10. We still provide binaries but no assurance that they will work with all missions and OS versions. )



Optimizing the OS performance

Windows or Linux ?

Historically, TDM had significantly better performance on Windows because Doom 3 had no SIMD optimizations under Linux.
As of 2.06 (and newer) TDM has both SSE SIMD and AVX optimizations under both Windows and Linux
so TDM can now run faster under Linux due to less OS overhead.

Unfortunately, the default "capped FPS mode" has never worked well under Linux (even in vanilla Doom 3) so out-of-box Linux still performs worse.
Hence we advise switching to the new uncapped mode under Linux.


If you have a weaker CPU and can install Linux ( or dual boot, etc ) you may see 5 to 10% performance uplift when configured properly


Drivers

Ensure that all hardware drivers are installed and up-to-date. See "Hardware considerations" and "Linux Secure Boot" for further details.

All OS Variants: File Permissions

Make sure your darkmod folder is located in a non-protected location.

On Windows, "Program Files" is protected and will cause problems saving any settings or installing Fan Missions.

On Linux, you should consider creating your darkmod directory under your /home/<username>/ folder to avoid permission issues.

Stop running programs in the background

Programs running in the background might either eat up memory that is needed for Doom 3 The Dark Mod,
and thus cause swapping to the hard disk, or they might consume CPU time or other resources.

This can cause either general slowdowns or hickups during game play.

Ensure that Programs are the main priority in the OS

To begin the process, type sysdm.cpl in Run box (Windows + R) and hit Enter to open the System Properties.

Select the Advanced tab and under Performance, Click the left mouse button click on Settings.

In the Performance Options box, select the Advanced Tab again.

You will see a section Processor Scheduling

Choose "Programs" then Click the left mouse button click Apply.

Disable Desktop Effects

(If you are willing to sacrifice you desktop visual behavior and effects for better TDM performance. Note: This can be reverted.)

To begin the process, type sysdm.cpl in Run box (Windows + R) and hit Enter to open the System Properties.

Select the Advanced tab and under Performance, Click the left mouse button click on Settings.

In the Performance Options box, select the Visual Effects tab.

Check "Adjust for Best Performance" then click Apply.

White-list TheDarkMod.exe in Security Software

Make sure that Windows Defender or Anti-Virus, Anti-Spyware, etc aren't constantly scanning or interacting

with TheDarkModx64.exe. Add it to your security white-list.

Windows 10 Granular Security Options

With new attacks like Meltdown and Spectre, Windows 10 has added CPU architecture specific security fixes.
Many of these have performance impacts. The impact is mostly on Storage access so loading times would
normally be the only casualty of these changes. Still, it's possible that these protections might interfere
with The Dark Mod in other ways.

Please review:

https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/exploit-protection-reference?view=o365-worldwide

and disable the security options you feel are excessive.

BIOS Mitigations

The Core Isolation vulnerability configuration ( see above ) is known to cause at least 10% FPS loss
Rather than safelisting TDM, if you do not use virtualization features you can disable virtualization in BIOS

Likewise, if you have 4 or more physical CPU cores, you can disable Hyperthreading in BIOS to avoid performance loss
due to many Spectre \ Meltdown mitigations

Disabling features in BIOS is the safest way to improve performance issues related to known CPU hardware exploits
Also, some vulnerabilities can be patched via a BIOS Upgrade

Disable TDM Connectivity

If you decide to bypass / safelist TDM in security software, you can mitigate risks posed by TDM's network connection by setting:


seta tdm_allow_http_access "0"

in Darkmod.cfg to block connectivity.

This comes with the caveat that the in-game mission downloader won't work, you'll need to download missions from https://www.thedarkmod.com/missions
and copying them to your darkmod/fms folder. Unless you know that your TDM executable was at risk for being replaced by a malicious version,
leaving connectivity open on it "while safelisted" is very low risk. You can further mitigate the risk by compiling your own executable.


Priority and Affinity (Advanced)



The following sub-section is a deep dive into forcing your Operating System to treat TDM as the most important application.

A well behaved and maintained OS generally will not need to be configured like this so please consider these options
to be an extreme last resort to ensure that no OS performance factors are slowing down TDM
Before applying any of these changes, ensure that you have tuned other CPU related settings in TDM

Windows Priority and Affinity


Note: As of The Dark Mod 2.08 Frontend Acceleration, defaults to 2 threads. When configuring affinity you should
ensure that at least 2 cores ( preferably 3 ) are allocated to TDM. If you increase the jobs_numThreads value
you should correspondingly increase the number of cores available in process affinity.

Set TheDarkMod to High Priority
  • Launch TheDarkMod

(Note: Do not start a mission or test map yet. If the 3D render is initialized it will take a long time to exit fullscreen and return to it.)

  • Alt + Enter to exit fullscreen
  • Ctrl + Alt + Del to open your Task Manager
  • Click the right mouse button Right-click on TheDarkMod.exe the choose "Go to Details"
  • (On the details\processes pane) Click the right mouse button Right-click on TheDarkMod.exe and mouse-over Set Priority and choose High
  • Alt + Enter to return to fullscreen

You can also edit your Desktop shortcut to start in High priority:

  • Click the right mouse button Right-click your Desktop shortcut to TheDarkMod and select Properties
  • On the Shortcut Tab enter the following into the "Target:" field

cmd.exe /c start "TheDarkMod" /High "C:\darkmod\TheDarkModx64.exe"

(Assuming you installed into C:\darkmod)

  • Then Click the left mouse button click the Change Icon button and browse for the Darkmod.ico icon in your darkmod install path
  • Click the left mouse button Click Apply
Set TheDarkMod Affinity

If you have a limited number of cores or heavy background tasks are always consuming the default cores,
you can set The Dark Mod to run on a specific core via "affinity"

  • Launch TheDarkMod
  • Alt + Enter to exit fullscreen

(Note: Do not start a mission or test map yet. If the 3D render is initialized it will take a long time to exit fullscreen and return to it.)

  • Ctrl + Alt + Del to open your Task Manager
  • Click the Performance Tab and look at the CPU display to see which cores are the least busy
  • (On Windows 10, click the "Open Resource Monitor" link and then click the CPU tab and expand the right pane)
  • Close the Resource Monitor and click the Processes Tab in Task Manager
  • Click the right mouse button Right-click on TheDarkMod.exe the choose "Go to Details"
  • (On the details\processes pane) Click the right mouse button Right-click on TheDarkMod.exe
  • Mouse-over then click "Set Affinity" and uncheck cores you want to prevent TDM from using
  • Alt + Enter to return to fullscreen

As with Priority you can set Affinity in your shortcut.

Example Target:


cmd.exe /c start "TheDarkMod" /affinity 1 "C:\darkmod\TheDarkModx64.exe"

The affinity number is not matched to the number in your performance screen.
For example "Core 0" in Task Manager is affinity 1.
The values are in Hex but are converted from binary where 1 represents an active core and 0 is disabled.
They are in a descending order.

For example: Binary 1110 means Core 3, 2, and 1 are enabled while Core 0 is disabled.
Converting from Binary to Hex gives you /affinty E. This is a useful config if the majority
of your processes are running on Core 0. FE for an 8 core chip would accomplish the same result.

Another useful option is 0101 /affinity 5 which will select core 0 and 2 which are "real" cores
in a Hyperthreading environment.

  • Core 0 is 1
  • Core 1 is 2
  • Core 2 is 4
  • Core 3 is 8
  • Core 4 is 10
  • Core 5 is 20
  • Core 6 is 40
  • Core 7 is 80
  • Core 8 is 100
  • Core 9 is 200
  • Core 10 is 400
  • Core 11 is 800

Again, the core number does not exclude hyperthread cores so if you have an 8 Core \ 16 thread CPU
you must count all real and hyperthread virtual cores when setting affinity.

Windows Combined Example

You can include both priority and affinity switches in your shortcut


C:\Windows\System32\cmd.exe /c start "TheDarkMod" /High /affinity 5 "C:\darkmod\TheDarkModx64.exe" +set r_softShadowsRadius 2.5 +r_useEntityCulling 1

Start TheDarkMod with high priority on Cores 0 and 2 (real cores) and add two launch cvars ( See Conventions ).

As you can see, you can make a huge launch string but once you go past 2 or 3 cvars it's best to

use Darkmod.cfg unless you wish to make multiple launchers for testing (etc).

Process Management Note

You can also either "End Task" on processes that you know you don't need or set them to "below normal" or "low" priority.

Moving these low priority processes to a different core via affinity is also an option.

Some processes, such as OneDrive.exe (which is integrated into the OS) will keep restarting so it's best to set these to "low priority"

If you are unsure what a process does, do not change it until you've researched the process.

Linux Priority and Affinity


Note: Linux generally does a good job of ensuring that other applications or processes are not impacting
game performance ( or really any foreground application performance ).
Managing affinity and\or priority usually has little to no effect in Linux unless you knowingly have lots of other heavy applications running.
Finally, some Linux distros are starting to ship with an enhancement package "Game Mode" that automatically prioritizes gaming

Linux Priority

NOTE: Some modern Linux distros that use pipewire audio will not render audio if
the initial command that invokes the application is run as root or sudo. I am currently investigating a workaround.

You can launch TDM with a very high priority via the "nice" command:

sudo nice --18 su -c /home/user/darkmod/thedarkmod.x64 username

There are two dashes in the above command. The first dash just tells the command that we are passing a parameter,
the second dash indicates a "negative priority number". Confusingly, the larger the negative number the higher
the priority with a maximum value of -20. Conversely the higher the positive integer, the lower the program priority!
For the sake of responsiveness, it is probably best to avoid the top or bottom if the priority range.
Also, note that the command must run as sudo to use negative priority and it's best to use "su -c program username"
so that it is run as "you" (replace username with your username) rather than root so you don't end up with root owned files.
See the visudo change in Linux Combined Example for details on how to run as sudo without a password

Example to launch with lower priority ( lowest possible value 19 ):

nice -10 /home/user/darkmod/thedarkmod.x64

You can also change the priority of TDM while it is running via "renice" and "pidof"

renice -n --18 -p $(pidof thedarkmod.x64)
Linux Affinity

Modern Linux operating systems will list cores with a list starting with 0, so ( for example ) the top core number in an 8 core CPU will be 7.

You can identify cores and whether the cores are hyperthread ( HT ) cores via:

lscpu -e

Example:

    CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ    MINMHZ
    0   0    0      0    0:0:0:0       yes    4100.0000 400.0000
    1   0    0      1    1:1:1:0       yes    4100.0000 400.0000
    2   0    0      2    2:2:2:0       yes    4100.0000 400.0000
    3   0    0      3    3:3:3:0       yes    4100.0000 400.0000
    4   0    0      0    0:0:0:0       yes    4100.0000 400.0000
    5   0    0      1    1:1:1:0       yes    4100.0000 400.0000
    6   0    0      2    2:2:2:0       yes    4100.0000 400.0000
    7   0    0      3    3:3:3:0       yes    4100.0000 400.0000

The CPU number above is what the OS recognizes when using affinity commands, the core number is actual core number.
So in the above results, CPU's 4 to 7 are hyperthreading cores whereas cores 0 to 3 are real cores.

To pin TDM to specific cores, you can change the launch options to:

taskset -c 1,2,3 /path/to/thedarkmod.x64

The above example forces TDM to run on real cores 1, 2, and 3. You may use a dash to specify a range of cores (1-3)
or even mix both syntax forms ( 1-3,6 ).

You can also change the core of a running TDM instance by using pidof to auto-locate the PID of the running process:

taskset -cp 1,2,3 $(pidof thedarkmod.x64)

More advanced users may wish to "cpuset" to create a new logical group of cores and caches (etc) then assign TDM
to run under the new CPU Set

And (of course) you can instead use taskset to move other non-critical processes to other cores or HT cores.

Linux Combined Example

NOTE: Some modern Linux distros that use pipewire audio will not render audio if the initial command that invokes the application is run as root or sudo. I am currently investigating a workaround.

In Linux nice and taskset cannot be invoked at the same time to launch an application.
You can launch TDM and use taskset to change the running process and likewise use renice to change priority
To launch with both priority and affinity at once, you can use "schedtool"
You will first need to use visudo to allow schedtool to run in sudo without a password
visudo will open an editor where you may add the following to the bottom of the file


%sudo ALL = ( ALL ) NOPASSWD: /usr/bin/schedtool,/usr/bin/nice

Then simply edit the "command field" for the properties page of your Darkmod launcher icon as follows:


sudo schedtool -R -p 50 -a 1,2,3,5,6,7 -e nice --17 su -c "/home/user/darkmod/thedarkmod.x64 +set r_shadows 1 +r_ssao 0" username

In the above example, priority (-p ) is set to -50 ( highest is -99 aka realtime ) and affinity ( -a ) is set to use real cores 2 to 4 and corresponding HT cores ).
Setting any application to -99 ( realtime ) priority is unsafe because it may be hard to exit or may lockup the OS trying to request resources.
schedtool has a "-n" flag for the nice value but it only supports positive nice values so we added the nice invoke after the "-e" ( execute flag ) and
made sure to su ( switch user ) to run thedarkmod.x64 as "username" ( eg whatever your username is ).
Finally, for good measure we have set shadows to stencil ( 1 ) and SSAO off ( 0 ) using standard Doom 3 style launch options for example syntax

Optimizing Dark Mod settings

The settings changes below generally can be changed independently of one another.

This means that if your want better settings in one aspect (such as AA) you can

try reducing quality or disabling another aspect (such as soft-shadows, ambient occlusion, v-sync, etc)


Reduce your resolution!



Important!

While the Screen Resolution section mostly applies to legacy displays (CRT's),

if TDM doesn't properly detect the Native Resolution of your modern display


you should still configure it before adjusting the Render Scale


Lower your Render Scale (New 2.07)

The new "Render Scale" slider in 2.07 allows you to reduce the internal resolution that TDM will render to.
Lowering this has a similar performance impact as lowering your Screen Resolution and is the preferred way to improve performance via resolution change
One additional benefit is that lowering Render Scale does not impact Menu and HUD / GUI resolution so you can set it much lower than screen resolution


seta r_fboResolution "0.85"

Note: With the r_fboResolution CVAR, you can also do the opposite...
You can also render to a higher than native resolution and the down-scaled output will look sorta like SSAA.
This is VERY expensive so we recommend going no higher than r_fboResolution 1.5.

Image Sharpening (New 2.09)

In 2.09 a new "Contrast Adaptive Sharpening" shader has been added and is enabled by default.
At the default Render Scale this simply improves the quality of textures (makes lower resolution textures less blurry).
When paired with a lower Render Scale values it can substantially reduce the blur and make the screen look almost like full resolution!


seta r_postprocess_sharpen "1"
seta r_postprocess_sharpness "0.7"

Screen Resolution

On modern LCD, OLED, or MicroLED displays we advise against changing native resolution unless you know that your monitor
has an excellent internal resolution scaler. You should instead change your Render Scale as described in the previous sub-section.
This section is more applicable to players using CRT or Plasma displays which naturally support a wide range of resolutions.
Even if you have a CRT or other legacy display tech, it may be better to change Render Scale to avoid legibility issues in Menus and HUD / GUI.

On older cards (or integrated graphics), Doom 3's TDM's render engine is very expensive for every per pixel drawn, and reducing the resolution will help the most.
For instance, at 1600x1200 the game needs to draw four times as many pixels as when running 800x600.
The result with 800x600 will not look as bad as one might think – but the frame rate improvements might make it much more playable.

If you cannot set the resolution you want in the Video Settings Menu then enter it in Darkmod.cfg. (As shown below)

Example cvars for a Native 1080p HD display:


 seta r_mode "-1"
 seta r_customwidth "1920"
 seta r_customheight "1080"
 seta r_aspectratio "1"


For the lowest possible resolutions, search down for these cvars first and replace them with the values shown:


 seta r_mode "-1"
 seta r_customHeight "640"
 seta r_customWidth "480"

alternate for low resolution on wide screen monitors:

16:9 ratio

seta r_mode "-1"
seta r_customwidth "1280"
seta r_customheight "720"
seta r_aspectratio "1" 

See also: "Resolutions" (for a list of known configurations)


Lower Anti-aliasing

The Dark Mod ships with standard "Multi-Sample Anti-Aliasing" ( MSAA ). This can reduce or eliminate jagged pixelization on geometry edges
by sampling sub-pixels near those edges and blending based on the average color. In practice this means that every visible geometry edge will get rendered
at a multiple of it's native resolution ( depending on your setting; eg. 2x, 4x, 8x, 16x ).
While this is still lower than increasing your overall screen resolution by the same factor, it can still increase the render workload by 50% or more in dense scenes.
MSAA is particularly heavy for Stencil Shadows but 2.11+ have some dedicated optimizations to improve that.

Unfotunately, if you needs the extra performance, you may need accept some aliasing ( jaggies ) unless your GPU vendor offers better in-driver AA options.

Since AA approximates a higher resolution, you may prefer disabling it in favor of choosing a higher resolution ( eg 1080p with 8xAA verses 1440p with no AA )
( Depending on your graphics performance, it may be better to use a lower Render Scale and then use a higher AA value to retain clean edges. )


In the standard video settings, set AA to a lower value or 0


seta r_multiSamples "0" 

in Darkmod.cfg


Screen Refresh and FPS


In theory, screen refresh and FPS should be independent of engine and driver performance.
Unfortunately, the OS, Drivers, and OpenGL API often cause slowdown and performance issues if refresh settings are misconfigured

Uncap FPS (New in v2.06)

Run one game tick per graphics frame, rather than fixed 60 ticks per second.

In 2.06 this is now a GUI option "Uncap FPS" in the Advanced Video settings GUI menu.

This not only makes the player camera move more smoothly but can also improve performance
since some drivers do not work well with the capped FPS design.


seta com_fixedTic "1"

in Darkmod.cfg

Note: Uncapping FPS is crucial to a smooth performance in most Linux environments!.


The default capped design appears to have some flaw for frame timing against the native Linux timer
Uncapping FPS or running TDM capped under Wine will resolve this.
Native Doom 3 builds are also impacted by this problem so it predates The Dark Mod.
The Dark Mod cannot use com_preciseTic 0 as a workaround ( some users have used this to improve Linux Doom 3 frame timing )
Uncapped mode has the additional benefit of making video playback properly sync to audio.
The Dark Mod team has worked hard to ensure that the uncapped mode is bug free at high FPS values but if you wish to
reduce the risk of high-FPS related bugs, set your Max FPS ( com_maxFPS, see below section ) to 75 or less.


NEW: At least 3 Windows 10 low-end users have reported similar performance benefits from uncapped mode. In the future, 2.13 will set this as default.


Max FPS (New in 2.08 )

In 2.08 you can define the max FPS via the Max FPS setting in the Advanced Video settings GUI menu.
(This is setting is meant to be paired with th Uncapped FPS mode above.)


seta com_maxFPS "90"

in Darkmod.cfg


Run The Dark Mod in fullscreen

Running Darkmod in windowed mode might be quite a bit slower than fullscreen mode.

One reason for this is that windowed mode is sometimes forced to V-sync. ( See Disable V-sync )


seta r_fullscreen "1"

in Darkmod.cfg


In 2.08 you can choose between Windowed, Fullscreen, and Borderless Windowed. Fullscreen is the lowest latency option.

Fullscreen Windowed in Modern Windows Versions

It has become widely recognized that v-sync is a source of input delay and forcing it for both Windowed and Fullscreen Windowed modes
is not optimal. The latest Windows versions no longer force v-sync on Fullscreen Windowed applications but if you encounter any issues
or have an older Windows release you should be able to force it off via your driver application profile settings:

If you have a Nvidia card

  • Open Windows start menu and type: Nvidia control panel
  • Click Manage 3D settings, on the left pan
  • Under "I would like to use the following 3D settings" scroll down until you see "Vertical sync."
  • Select Vertical sync choose "Force off" or " disable" ... from the drop down.

For AMD

  • Click the Start button or Windows icon.
  • Type "Catalyst control center" in the search bar.
  • Press Enter on your keyboard.
  • Click Gaming.
  • Under "3D Application Settings" scroll down to "Wait for vertical refresh."
  • Move the slider down to the side that says "Performance" so the text beneath it says Always Off.

The above won't be necessary for users with variable refresh displays and video cards with variable refresh support such as G-Sync or Freesync.


Force Refresh Timing

(Related to vsync)

Some newer video cards may not properly report the refresh rate to this engine (typically digital output like DVI, HDMI, or DisplayPort)
This can cause lag, stutter, and uneven frame pacing.

Create an autoexec.cfg in your darkmod directory and set:


seta r_displayRefresh "60"

(Obviously increase to match your available mode.)

Disable V-sync

Depending on your drivers and driver settings, Vsync will cap FPS to the closest available standard refresh rate.
This means that if your FPS go below 60, TDM may be capped at the next standard value of 30FPS rather than rendering at 40FPS or higher which would feel smoother.
Further, sometimes capping FPS will prevent TDM from recovering from a lower FPS in a timely manner.

Unless you are extremely sensitive to screen-tearing, we advise that you disable vsync

In the standard video settings, disable vsync

seta r_swapInterval "0" 

in Darkmod.cfg


NEW INFO TDM 2.10 has an Adaptive Vsync option in the Video Settings GUI which only performs the sync action when you are at or above refresh rate. Thus avoiding performance loss.

seta r_swapInterval "-1"

in Darkmod.cfg


If your GPU driver supports superior Vsync options such as Fast Sync, Freesync, or G-sync it may be preferable to force that feature via a Driver Profile


Multi-Core Options


Starting with TDM 2.06, there has been an ongoing effort to improve the TDM Engine to take advantage of Multi-Core CPU's
If your CPU has more than 1 core (or offers Hyperthreading), the following settings can dramatically improve performance

Enable Multi-Core (new in v2.06)

In 2.06 the engine splits the Frontend and Backend into separate threads if you enable the Experimental "Multi-Core" setting
in the Advanced Video settings GUI menu.


seta com_smp "1"

in Darkmod.cfg

In 2.09 this is enabled by default. The setting is no longer in the GUI.

Frontend Acceleration (new in v2.09+)

In 2.09 the engine frontend can submit models to the render backend via parallel jobs on multiple CPU cores.
This is similar to how Doom 3 BFG handles rendering.
Enable "Frontend Accelleration" in the Advanced Video settings GUI menu.


seta r_useParallelAddModels "1"

In TDM 2.11 this is enabled by default.

Jobs Settings

Also, you can increase the number of assigned cores:


seta jobs_numThreads "3"

( See the Affinity section regarding OS CPU Core management in relation to these options. )


Shadow Settings


Change Shadow Mode (New 2.07)


In TDM 2.07+ we offer two different "Shadow Implementation" options in the Advanced Video Settings GUI.

  • Maps (Shadow Maps)
  • Stencil (Stencil Shadow Volumes)


( There is a 3rd mode "No Shadows" It's available via the console and can be used for troubleshooting.
Some missions might be playable in this mode but will probably be very difficult with no shadows to hide in.
Darkness can still exist in areas outside the light radius or falloff though. )


Shadow Maps can perform better in scenes with fewer but larger light sources and less small shadow casters.
Shadow Map performance depends on the amount and speed of VRAM on you GPU
Most of the calculations are done on the GPU in this mode so if you have a weak CPU and mid-range GPU ( usually old desktops )
this mode is preferred

Stationary Lights + Big areas + Big Lights = Higher FPS with Maps 


Stencil can perform faster for systems with powerful CPU's and weak GPU's ( usually laptops ) because it mostly relies on fillrate.
Stencil soft shadows sometimes run faster because they don't do calculations for "distance to blocker" ( contact hardening )

Lots of small moving lights + confined spaces = Higher FPS with Stencil


Maps mode:


seta r_shadows "2"

Stencil mode:


seta r_shadows "1"

in Darkmod.cfg

(If you change this via the console, also invoke shadowimplchanged or you may be missing some shadows)

Lower or Disable Soft Shadows (New in v2.06)

Shadow Quality determines how many gradients ( color bands) that soft shadows use.
In the advanced videos settings menu set the Soft Shadows quality slider to low or off


seta r_softShadowsQuality = 0

in Darkmod.cfg

Softening Radius

In the advanced videos settings menu set the Shadow Softness slider to make shadows softer without increasing the quality level


seta r_softShadowsRadius 2.0

in Darkmod.cfg

You can experiment with values between 1.5 and 3.5 or more.
Another way to get blurrier shadows without "cranking the quality" is to use Shadow Maps and set a very low Shadow Map Size

Soft Shadows Mipmaps ( New in 2.11 )

To reduce the impact of sampling shadows for soft shadow effects and MSAA ( in Stencil mode ), 2.11 introduced a new mipmap optimization


     seta r_softShadowsMipmaps "1"

in Darkmod.cfg ( default setting, no change should be needed )



Shadow Map Settings


Shadow Maps require more complex designs to optimize texture usage and reduce \ avoid artifacts.
Correspondingly, TDM has many settings specific to this mode

Single Pass Shadow Maps

Rather than calculating all shadows one-at-a-time, all shadow casting is calculated in one pass for every light in the scene.
THIS CAN OFFER SUBSTANTIAL PERFORMANCE IMPROVEMENT


seta "r_shadowMapSinglePass "1"

in Darkmod.cfg

NEW - All known issues for this mode are fixed. This is enabled by default in 2.12

Shadow Map Size

The larger the Shadow Map texture, the more detail and less artifacts you have further away from the light center or for small objects.
Conversely, smaller Shadow Map textures perform much better (use less resources).
Since stretching a low resolution shadow texture over a large area naturally causes bi-linear blurring,
some players prefer lower resolution maps instead of increasing the quality and softening radius which produces less blur
(due to realistic contact hardening simulation in the light shaders).


seta r_shadowMapSize "384"

You can also increase this to reduce light leaks from the experimental Front Culling Optimization.
On balance enabling Front Culling may offset the performance pitfalls of a bigger shadow map.
You can experiment with shadow map sizes that are slightly larger than 1024 such as 1280 or 1440.

This setting can also be used to reduce the performance impact of Volumetric Lights because they
always use Shadow Maps regardless of Shadow Mode
If your GPU runs missions without Volumetric Lights well in Stencil Mode but struggles with missions that contain them,
try setting the map size to 256 or lower.

Max Light Size

The larger the light, the more Shadow Map resolution you need (see Shadow Map Size ).
There are some lights so large that Shadow Maps will never look good without insane texture sizes.
You can set a threshold to say if lights are bigger than X, use Stencil Shadows.


seta r_maxShadowMapLight "1500"


(Shadow Maps) See also:




Lower or Disable Ambient Occlusion (New in 2.08)

In the advanced video settings menu make sure that Ambient Occlusion is set to low or off.


seta r_ssao "1"

or


seta r_ssao "0"

in Darkmod.cfg

SSAO Radius

You can widen the SSAO radius to improve the appearance or shrink it to improve performance


seta r_ssao_radius "24"

Reduce Color Depth (New in 2.08)

In TDM 2.08 the default Frame Buffer was upgraded to use 64-bit color to reduce color banding.
Some GPU's have poor support for this format or render much slower. Consider reverting to 32-bit.
Change Color to 32-bit under the Advanced Video settings menu or:


seta r_fboColorBits "32"

in Darkmod.cfg


Disable Bloom

In the advanced video settings menu make sure Bloom is disabled


seta r_bloom "0"

in Darkmod.cfg

TDM versions older than 2.08

Disable Postprocess in the GUI or set:


seta r_postprocess "0"

in Darkmod.cfg


Set Object Detail to Low

In the advanced video settings menu lower the Object detail slider below normal

seta tdm_lod_bias "0.5"

in Darkmod.cfg (see also Object Detail )


Field of View Decrease


Motion Sickness Warning

FOV adjustment is mostly for player comfort and to reduce motion sickness.

Lower FOV values are more inclined to cause motion sickness.


16:9 players can lower to FOV 75 to eliminate foveal edge distortion but doing so increases the risk of experiencing discomfort
(The default FOV ( 90 ) for TDM was design for 4:3 ratio screens.)


You can get a performance improvement if you decrease the field of view. By default this is 90 degrees but you might try entering in the console:

g_fov 85

or

seta g_fov "85"

in Darkmod.cfg

In addition, if you are playing a mission that is too good to miss and reach a very low performance area which is almost unplayable on your machine,
you might consider setting the field of view extremely low temporarily to get you through then restore to 90 later...

g_fov 50

or bind a toggle

bind "z" "toggle g_fov 50 90";

in DarkmodKeybinds.cfg so you can tap a key to go between FOV ranges.

See Toggle Settings in Realtime

Note from Fidcal: I have played comfortably on g_fov 75 and even think perhaps it makes nearby objects more realistically close so you can get right up to a table, etc.
Not noticed any problem with restricted view.

Note: On older TDM releases some players reported that changing this setting might occasionally produce odd effects such as a grabbed object seems to move a little on release.

Lower Anisotropic Filtering ( Not recommended )

In the standard video settings, lower or disable Anisotropic Filtering ( AF )


seta image_anisotropy "0" 

in Darkmod.cfg

Note: This has very little performance benefit for most GPU hardware. The mipmaps needed to perform AF are already loaded into
VRAM so the only savings are very inexpensive sampling operations that are normally handled by dedicated filtering hardware.

In 2.09 if you change Anisotropic Filtering and have "r_useBindlessTextures 1" set (default) the game may stutter
when you return from the menu because it must rebuild all the textures.
To avoid this, set "r_useBindlessTextures 0" then restart the game and test your preferred AF mode then once you have found your
performace-to-image quality sweet spot set "r_useBindlessTextures 1" and restart TDM


NEW: In 2.11+, bindless texture support was removed due to multiple issues with AMD drivers.
You should be able to change anisotropic filtering settings in the GUI without encountering stutters.

OBSOLETE Set the ambient shading to "Faster"

Inside the settings, change the ambient rendering method to "Faster".

seta tdm_ambient_method "1"

in Darkmod.cfg

(Note: Some preliminary tests in v2.05 show that the Enhanced Ambient is now faster than the "fast" texture based Ambient.)
(Note: This setting has been removed in 2.09+ )

OBSOLETE Set the interaction.vfp to "Standard"

In the video settings menu, change the interaction shader to Standard. Lighting will not look as good, but you may gain a few frames per second.


seta tdm_interaction_vfp_type "0"

in Darkmod.cfg

In 2.08 this setting is


seta r_interactionProgram "0"

This setting doesn't work in 2.09+ It is a stub cvar that does nothing.
If you wish to test interaction shaders, create a glprogs folder in your mission folder with new shaders having the same name as the default ones.
You can keep the default shaders in the same folder in renamed form then swap filenames and execute reloadGLSLprograms to compare changes.
For a more clean comparison also set g_stopTime to prevent dynamic light changes

Slow loading times

OBSOLETE! TDM 2.10 has very fast loading times!
The only setting that might improve loading times is "seta image_preload 0"

If you find an FM is very slow to load it may be an ATI graphics card problem.
One report says this was cured by turning off Catalyst AI. Also cures HDR-Lite Post-Processing Problems.

Changing the following settings to 0 will also reduce loading time, but be warned:
if you have a lower-end system, poor graphics card, or low ram,
you will likely notice a performance hit in-game since you will now be using uncompressed textures.

 seta image_useNormalCompression "0"
 seta image_useCompression "0"
 seta image_preload "0"


New 2.10+ cvars ( defaults ) for fast loading times:

 seta image_levelLoadParallel "1"
 seta image_useTexStorage "1"
 seta image_mipmapMode "0"

In 2.10 the RXGB normal map compression format has been replaced the higher quality RGTC format.

Note: Disabling compression is not recommended and may lead to Malloc errors due to heavy memory consumption.

If you want to disable compression, you may be able to compensate by setting Image Downsizing settings.

See also Malloc Failure Errors


The game is very slow!

Important!

If you do not have properly installed hardware drivers, TDM may be rendering graphic features using your CPU

or may be performing CPU tasks in legacy modes. THESE ARE INCREDIBLY SLOW. See Hardware Considerations

Likewise, Linux players will need to either have a Signed Kernel ( and Drivers ) or disable Secure Boot since unsigned hardware lacks acceleration
Linux players will also need to ensure that TDM is in "Uncapped FPS mode" or they will have performance problems regardless of their hardware capabilities.

Finally, if you have a laptop with 2 GPU options it can also behave as if you don't have hardware acceleration when using the weaker GPU.

Defaults

The advised performance defaults below should mostly already be set by default on upgrade.

Please consider deleting darkmod.cfg after upgrading to restore these defaults.


If you get less than 10 FPS, or the game even stutters, please try this:

Look into your Darkmod.cfg inside your darkmod folder and check that the following settings are like shown below:

 seta image_usePrecompressedTextures "1"
 seta image_useNormalCompression "1"
 seta image_useAllFormats "1"
 seta image_useCompression "1"
 seta image_preload "1"
 seta r_useCachedDynamicModels "1"
 seta r_useShadowVertexProgram "1"
 seta r_useEntityCulling "1"
 

Note: r_useShadowVertexProgram no longer exists in TDM. All shadow modes use GPU vertex operations.

OBSOLETE 2.09 performance defaults

 seta r_useMultiDrawIndirect "1"
 seta r_useBindlessTextures "1"

2.11 new performance defaults ( in addition to the standard performance defaults above )

 seta r_useNewBackend "1"
 seta r_modelBvhBuild "1"
 seta com_smp "1"
 seta r_useParallelAddModels "1"
 seta r_usePersistentMapping "1"
 seta com_useMinorTics "1"
 seta com_fixedTic "1"
 seta com_maxFPS "166"

2.12 new performance defaults ( in addition to the standard performance defaults above )

 seta r_useLightPortalFlow "2"
 seta r_useLightPortalFlowCulling "1"
 seta r_softShadowsMipmaps "1"
 seta r_useEntityScissors "1" 
 seta r_animationBounds "1"
 seta r_useNewRenderPasses "1"
 seta r_shadowMapSinglePass "1"

Note: 2.12 r_useNewRenderPasses replaces r_useNewBackend


Frame Memory

New in TDM 2.08

r_frameIndexMemory 

and

r_frameVertexMemory

Increasing frame memory may help avoid crashing or slow-down when a scene suddenly requires more resources.
If you are VRAM limited, consider lowering texture quality ( Image Downsize ) or Render Scale before increasing these.


Disabling standard graphics features


At the cost of some pretty severe scene quality, you can disable a number of independent graphic features

that are non-essential to play.

Texture Based Tweaks


These changes reduce or remove texture data to improve performance on GPU's with low VRAM or low memory bandwidth

Image downsizing

TDM can automatically reduce texture resolution for all 3 supported texture types; diffuse,
normal (bump), and specular. Systems with very low quantities of VRAM or low memory bandwidth benefit from this change.
Note: You must restart TDM or invoke reloadImages for image_downsize settings to take effect

In Darkmod.cfg, set image_downSize to 1 and then set a limit with image_downSizeLimit, e.g., "image_downSizeLimit" "256".


seta image_downSize "1"
seta image_downSizeLimit "256"

This reduces texture memory requirements and may completely alleviate hard drive thrashing for dynamic image loading.
Try lowering to 512 and if you still need more VRAM or need lower RAM usage during mission load ( see 64-bit missions ) then move down to 256, 128, or 64

There are similar cvars for bump and specular maps as well.

Example: Downsize Normal Maps


seta image_downSizeBump "1"
seta image_downSizeBumpLimit "256"

Example: Downsize Specular maps


seta image_downSizeSpecular "1"
seta image_downSizeSpecularLimit "64"

Many players have found that they prefer lower resolution normal maps rather than low resolution textures

Image Downsizing verses Lower Resolution


Higher resolutions require larger frame buffers thus more VRAM, likewise higher resolution textures also consume VRAM
This leads to the an interesting decision on visual tradeoffs.

When you lower the resolution substantially, the overall visuals of the scene are roughly preserved in general way
but the scene becomes sort of impressionistic, filled with artifacts, and somewhat hard to read

When you instead lower texture resolution to the extreme (lower than 128), the scene remains sharp but takes on a more stylized \ cartoon aspect
because all these high fidelity 3D objects are coated in blurry images. It makes TDM look like a beefed-up Nintendo 64 game.
If you set image filtering to Nearest mode, TDM instead looks like a strange offset of Minecraft

In this case, there is no objective winner.

Some people actually prefer the low-texture options to the native presentation due to the interesting style or nostalgic appearance.
Whereas others will consider the extreme style variance to violate the immersion of the scene and would prefer to suffer with less
scene fidelity for the sake of cohesion.


Thread:

https://forums.thedarkmod.com/index.php?/topic/19498-image_downsize-in-206/



Disable Specular Maps

Specular gives materials their shine. This option will make all surfaces shine-free.

Note: This may not work with the Enhanced Ambient


seta r_skipSpecular "1"

in Darkmod.cfg

Disable Normal Maps

The main detail attribute for textures in Doom 3 \ Darkmod is the Normal Map.

If you disable this your game will become really ugly.


seta r_skipBump "1"

in Darkmod.cfg

Disable all Ambient Surfaces

Related to skipping particles, r_skipAmbient will get rid of any non-lit* particles
(*most particles are additive blends and don't react to light)
along with any other surfaces that don't change based on illumination (most decals, additive glowing windows, etc.).


seta r_skipAmbient "1"

in Darkmod.cfg

Light and Fog tweaks


These tweaks reduce or eliminate the impact of fogs and volumetric light effects which are often heavier than normal lights.

Disable Volumetric Lights (New in v2.11)

Volumetric lights force shadow map rendering for their light radius ( per light ).
If you have a GPU with low VRAM or poor VRAM bandwidth ( less than 128-bit bus, integrated graphics, etc),
it may be worthwhile to disable them or reduce your default shadow map resolution ( r_shadowMapSize ).

To disable volumetrics entirely, set:


seta r_volumetricEnable "0"

in Darkmod.cfg

Disable Volumetric Shadows

Volumetric Lights force expensive Shadow Maps in Stencil Mode. You can disable that via


seta r_volumetricForceShadowMaps "0"

in Darkmod.cfg

Lower Volumetric Samples

The more samples the smoother the volumetric lights at the cost of lots of performance.
Try lowering the samples. Also try changing the r_volumetricBlur and r_volumetricDither values.


seta r_volumetricSamples "16"

in Darkmod.cfg

Disable BlendLights


seta r_skipBlendLights "1" 

in Darkmod.cfg

Disable Fog


seta r_skipFogLights "2" 

in Darkmod.cfg

As of 2.08 and newer there are several modes of fog disable behavior. Mode 1 only disables it for opaque objects (etc)

Particle Tweaks


Particles mostly impact CPU performance but can impact the GPU due to lots of alpha operations and overdraw

Disable Soft Particles ( New in 2.03 )

The new Soft Particle effects in v2.03+ use a little more GPU than the previous particles.

This is offset by the fact that v2.03+ doesn't render particles during the lightgem calculation.

Still, if you want an extra boost then set:


seta r_useSoftParticles "0"

in Darkmod.cfg

Disable Particles ( Not recommended )

This will seriously mar your image quality. Flames, glares, rain, snow, and smoke will all be gone.


seta r_skipParticles "1"

in Darkmod.cfg .

Entity Shadow Tweaks


Disable Player Shadow

The player shadow slightly reduces performance. It has no game effect at all (not seen by AI for instance) apart from atmospheric effect so if you want to disable it enter in the console:

g_showplayershadow 0

Or, in Darkmod.cfg (see above) change the following line from "1" to "0":

seta g_showplayershadow "0"

This is the default setting as of TDM 1.02 and newer.

Disable Player Lantern Shadow

You may notice a drop in performance while using the player lantern.

Add "noshadows" "1" to entitydef light_lantern_moving in tdm_playertools_lantern.def and this stops the player lantern casting shadows.
This helps improve performance slightly when using the lantern.


Disable Sky

(New in v2.05) Pitch black sky with no clouds, Moon, or stars


seta g_enablePortalSky "0"

in Darkmod.cfg

Disable Lip Sync

AI will not play lipsync animations


seta tdm_ai_opt_nolipsync "1"

in Darkmod.cfg

OBSOLETE Drop in Frame Rates when Viewing Water

Some players have reported a drastic drop in performance when an agitated water surface is in view. (This on a Radeon card.)
Try entering this in the console. It disables the water visible surface effects but at least it might let you play normally...


 seta r_skipPostProcess "1"

or


seta r_postprocess "0"


seta r_bloom "0"

You can also set a key-bind to toggle this instead:


bind "z" "toggle r_bloom 0 1"

See Toggle Settings in Realtime

See also Underwater performance poor

TDM 2.12 has improved underwater performance. It no longer uses the postprocess pipeline.


Gameplay Performance Tips

If you have done everything else you can and performance is still poor then one or two things you might do in game to help:

  • Close all doors after you have passed through. Generally the game has to process both areas until you close the door if the doorway is still in sight.
  • Kill or KO every AI you can. You might not like to play that way but generally, AI still hog resources even out of sight (depending on how set up in the game.)
  • Avoid alerts. A dozen guards searching for you will really slow things down on a low-end machine.
  • Try to look down at the ground when moving along. Gazing up at a grand vista will slow you down. Best to do your gazing while standing still.

Revert to 2.03 AI Search behavior

The new AI "hiding spot" routines in 2.04 (and newer) are more CPU intensive than 2.03's search method. Try the old 2.03 mode.

 
seta tdm_ai_search_type "1"

in Darkmod.cfg

Lightgem Calculation Optimizations



The Lightgem used to be a very taxing calculation because it required the entire scene to be rendered to an off-screen
image that was then slowly passed to parser code to comb all pixels for the brightest value.

As of TDM 2.05 and newer, only shadow casting geometry is rendered during the Lightgem calculation and the
pixels are read directly from an "OpenGL Buffer Object" at high speed.

Further optimizations after 2.05 include:

  • Moving the calculation to it's own Thread and utilizing SMP
  • Making the calculation part of the native Doom 3 sub-view system
  • Excluding Lightgem calculations from many phases of the render system that are not applicable
  • Inheriting optimizations from the overall renderer ( Improving TDM render speeds, improves the Lightgem render speed )


This means that the old configurations to reduce the impact of Lightgem calculation are mostly irrelevant
except for niche scenarios (such as 120FPS+ gaming), very old hardware ( Single Core CPU's ), or very old TDM versions ( older than 2.07).

Lightgem interleaved calculation

By default lightgem calculation occurs every frame. You can set lightgem calculation to happen only once
per several frames by setting tdm_lg_interleave console parameter to values higher than 1.
For example, typing:

tdm_lg_interleave 3

in console tells TDM to recalculate lightgem value every third frame.

This tweak can increase average FPS, but it often produces noticeable stuttering, especially on slow machines when your FPS is below 25 to 30FPS.


Lightgem interleave minimum FPS ( New in 2.05)

In TDM 2.05 there is a new tdm_lg_interleave_min cvar that allows you to set a cutoff point for FPS below which the Lightgem Interleave optimization takes effect.
It is set to 40 by default. If your FPS goes below 40 then tdm_lg_interleave returns to the default value of 1 internally to prevent stutter.
Depending on your sensitivity you may wish to increase this to 50 or more.


tdm_lg_interleave_min 40


As the cost of lightgem calculation is (also) substantially lower in v2.05 and newer, you may be able to set this to 1 for most missions.

In testing, the only mission I found that suffered from "tdm_lg_interleave ( > 1) stuttering" was "Penny Dreadful 3: Erasing the Trail".
For that mission, I set tdm_lg_interleave_min to 50 to cure the stutter.
This setting can also be used to boost already high FPS values for the new unbounded FPS option.
(eg. If you have 90FPS set tdm_lg_interleave to 7 and tdm_lg_interleave_min to 75 to attempt a push towards 120FPS)

In 2.06 with the lightgem calculated on a different thread, this can likely stay at double your interleave value regardless of how low the FPS gets.

Weak Lightgem (Not Recommended)

Setting:


seta tdm_lg_weak "1" 

in Darkmod.cfg will disable the renderer based lightgem and use a simpler math-based solution.
It's a far less accurate lightgem but may allow weaker systems to play the game as a last resort.
This can also be used as a workaround for graphic drivers that don't support features needed by the lightgem FBO / PBO
Android users on the unofficial Android fork have confirmed this workaround

OBSOLETE Lightgem Split

During the initial development of TDM, it was found that you would get better frame pacing and a smoother experience
if you split the Lightgem calculation into half a run per cycle.
This was even better than interleave but could also be "used with interleave" to offer even more performance.
Unfortunately, the "split mode" caused some unwanted flicker in particle effects so it was disabled by default.
The flickering was cured in TDM 2.03 when SteveL prevented particles from rendering during the Lightgem phase
The flickering was rarely experienced even prior to 2.03 so if you are running a Doom 3 mod version
you would likely be able to enable the optimization without any issue.
In TDM 2.06, the feature was hard-coded to enabled, there is no configuration to enable \ disable it now.

For 2.05 and older set:


seta tdm_lg_split "1"

in Darkmod.cfg



Lower Sound Quality

Disable EFX reverb (new 2.06)

The new EFX audio option (equivalent to EAX) has some impact on mission performance, due to additional reverb calculation by the CPU.
Disable this option for extra performance. Especially if you get big stutter or lockup events opening doors from indoor to outdoor areas.
This option, disabled by default, is toggled with the main menu's "Audio/OpenAL EFX".

Turning on this option makes no performance or audio difference if the mapper didn't include an EFX file. For more about that, see Setting Reverb Data of Rooms (EAX).

Force 22khz

2.06: Do not use this optimization. It is known to cause issues with loading missions on some OpenAL hardware:
http://bugs.thedarkmod.com/view.php?id=4814

(This is fixed in 2.07)

You can force 22khz audio processing to reduce the CPU overhead of audio processing.

Obviously, EAX effects will increase CPU load for audio so you should consider disabling

those before lowering audio quality. If normal audio plays fine but EAX causes performace,

this change might give you a boost while EAX is enabled.


seta s_force22kHz "1"


Experimental Features

These settings may offer some performance benefits with caveats \ bugs.

Shadow Map Cull Front

The default shadow map mode calculates shadows for both polygons that are on the side facing
the light (front) and the side facing away from the light (back).
Cull Front mode improves performance by only calculating the back side shadows.
This mode is almost production ready. It actually fixes or improves some visuals that the default mode produces
but it has some glaring artifacts such as light leaks where surfaces meet in corner areas.
In most missions, you will not be able to tell the difference other than the improved performance


seta r_shadowMapCullFront "1"

Alpha Tested Shadow Maps ( New 2.12 )

Shadow Maps can cast shadows through transparent parts of textures. This is not currently possible with stencil shadows.
To enable this feature:


seta r_shadowMapsAlphaTested "1"

in Darkmod.cfg


Note: Be advised that this consumes more performance so if this is enabled then consider disabling it if you are struggling with performance

Use BFG style Portal Culling (new in v2.06)

If you have a system that works well with Multi-Core ( com_smp 1) then you may consider enabling r_useAnonReclaimer to reduce cache thrashing.

2.07 and newer


seta r_useAnonReclaimer "1" 

2.06


seta r_useBfgPortalCulling "1"

in Darkmod.cfg

OBSOLETE Single Pass Light Rendering ( 2.09 )


THIS OPTION DOES NOT WORK IN 2.11

Similar to modern "Forward+" rendering, all lights and shadows are calculated beforehand and rendered in one pass.


seta r_shadowMapSinglePass "2"

in Darkmod.cfg

You have probably noticed that this uses the same CVAR that single pass shadows uses.
Single Pass lighting requires Single Pass shadows.

This mode (2) does not seem to improve FPS for some Nvidia hardware.
This is probably because of the Nvidia's tiling (deferred rendering) hardware optimizations.

OBSOLETE Skip Dynamic Shadows


This setting is no longer available as of TDM 2.12


Only render shadows from Stationary lights. This will break missions where players might need to hide in a moving shadow.


seta r_skipDynamicShadows "1"


Hardware Considerations

If you can correct hardware deficiencies you may not need to perform as many tweaks or setting changes.
Sometimes it is as simple as a Driver or BIOS update. Other times, you may need to consider updating hardware.

Driver Considerations


(IdTech4) The Dark Mod was originally based on OpenGL 2.0. (the same as Doom 3)

GPU manufacturers have largely ignored issues with this older specification so a number of workarounds have been

compiled by the community to attend to erroneous behaviors or poor performance.

As of TDM 2.06 and newer The Dark Mod uses OpenGL 3.x so many of these suggestions are no longer applicable.

That said, even OpenGL 3.2 (current requirement) is an old standard so some newer workarounds may be needed.


Linux UEFI Secure Boot

With Secure Boot enabled in the BIOS, some Linux distros will fallback to (slow) open drivers and wont have access to most hardware features.
If your Linux distro doesn't offer "Signed Kernels" and "Signed Drivers" disabling UEFI may be the only way to have acceptable performance
We recommend that you consider using a Linux distro that offers Signed Kernels such as the latest Ubuntu, OpenSUSE, Debian, Linux Mint versions

Linux Kernel Version

For AMD and Intel hardware, the drivers come with the Linux Kernel. Some Linux distros ship with older Kernels that do not support the latest hardware.
Many of these distros offer options to upgrade to newer Kernel versions with better hardware support.
Ubuntu and Linux Mint offer "OEM Signed Kernels" that offer newer hardware support and are signed so they can be used with Secure Boot.

Try different driver versions

Sometimes updating to the latest driver version or reverting to an older version

will improve performance. Try a few revisions or ask about known good driver versions.

This applies to both GPU drivers and "Motherboard Chipset Drivers".


Lower in-driver quality settings


AMD, Nvidia, and Intel all give users the option to lower texture quality and

also have various quality "optimization" levels for texture LOD Bias and Anisotropy (Filtering).

Driver Anti-Aliasing Settings

TDM ships with standard Multi-Sampling Anti-Aliasing ( MSAA ) which is more taxing on performance than some newer Anti-Aliasing technologies.
It may be better to disable AA in-game and use your in-driver AA settings instead.

For example, Nvidia's in-driver FXAA anti-aliasing setting is substantially faster than the multi-samples settings in game.
AMD has MLAA which works in a similar way.
( Warning: FXAA can make text and GUI's a little blurrier )

Both AMD and Nvidia also offer AA enhancements to smooth transparent texture edges.

Doom 3 is far less susceptible to AA artifacts so FXAA may be an acceptable alternative especially if you are are running the game at native resolution (or nearly native).

Incidentally, if you have GPU power to spare you can either use your GPU driver settings to force even higher quality modes such as SSAA
( that performs sub-sampling to every pixel ) or configure TDM Render Scale ( r_fboResolution ) above native resolution for an SSAA effect.

Driver Vsync Settings

As with AA, AMD, Intel and Nvidia have multiple options to tailor Vsync performance including Enhanced Sync, Fast Sync, Speed Sync
and Variable Frame Rate options like G-Sync and Freesync.
Disabling in-game Vsync and forcing one of these new sync modes in your driver settings will probably be a better Vsync solution


Vendor Specific Issues


Over the years, users have discovered quirks in Intel, Nvidia, or AMD drivers that can be mitigated.

Intel ( new 2.09 )

Some Intel drivers do not perform well with persistent mapping enabled.
In 2.09 there is a special persistent mapping mode that works better for this hardware.
You must disable standard persistent mapping to use this mode.


r_gpuBufferNonpersistentUpdateMode "1"

r_usePersistentMapping 0


(AMD\ATI) Disable Catalyst AI

2018: The latest Radeon Crimson and Adrenalin Drivers:

Surface Format Optimization = OFF

Disable Catalyst AI in recent AMD Drivers

(AMD\ATI) Rename the executable

Most modern drivers have built-in profiles for the executable names of commercial games.

Renaming TheDarkMod.exe to the name of a commercial OpenGL game may gain you some optimizations

or even a Crossfire profile (I believe DarkAthena.exe had one.)

Known working renames:

DarkAthena.exe (thus far the most consistent improvement)

Doom3BFG.exe

Wolf2MP.exe

Amnesia.exe

Brink.exe

Prey.exe

(Nvidia) Optimus Laptop wont use your Nvidia GPU

See also: [1]

Many Laptops now have the ability to use the GPU that is built into the CPU when not "gaming".
Unfortunately, sometimes the drivers for these Laptops don't detect TDM as a "game".

The easiest solution is to create a Driver Profile for TheDarkMod.exe or TheDarkModx64.exe in your driver settings.

  • Right click Click the right mouse button anywhere on your desktop where no icon is shown
  • Left Click Click the left mouse button Nvidia Control Panel
  • Then Click on the Programs Tab
  • Click "Add" and browse for TheDarkMod.exe or TheDarkModx64.exe
  • Then scroll down the settings list and find "OpenGL Rendering GPU"
  • Then select your Nvidia GPU from the list of options





(Nvidia) Disable the Streamer Service

Open your run dialog (Windows + R) or command prompt and type services.msc

On the Extended Tab locate "Nvidia Streamer Network Service"

Click the right mouse button Right-click it and choose "Stop"

Once the service is stopped, Click the right mouse button right click it again and choose Properties

On the General Tab set Startup Type = Disabled then Click the left mouse button click Apply.

Do the same for "Nvidia Streamer Service"

Do the same for "Nvidia Telemetry" service(s).

Note: There is a GUI option to disable streaming in the newest Geforce Experience settings page.

You would still be advised to disable the Telemetry service for extra performance.


You can also perform these steps for any services that you know can be manually started

or are not needed for your daily usage. (Obviously) Do not disable any service that you don't

recognize or know is safe to disable.

NEW INFO:

The Nvidia Streamer Service is now tied to the "Geforce Experience" "In-Game Overlay" setting.
Disabling that feature in Geforce Experience should accomplish the same as the above.


(Nvidia) Disable Threaded Optimizations

Open Nvidia Control Panel ->

Manage 3D Settings ->

Bottom half of list locate "Threaded Optimization" <-- Set to NO / Off

Also set "Multi-display/Mixed GPU acceleration" to "Single display performance mode"

This can also reduce or eliminate driver crashes or rendering anomalies.

  • Note: This might be obsolete information.
    With the latest Nvidia drivers, some users have reported that disabling Threaded Optimizations
    has significantly reduced performance. (Down from 60 to 25FPS in one case.)





Upgrade your BIOS


Sometimes bugs or old specification limits in the BIOS on an older motherboard will prevent it from allowing the CPU or GPU to meet their potential.

Also, some vulnerabilities can be patched via BIOS update so that you wont lose performance due to mitigations.

If your manufacturer has an updated motherboard BIOS available, consider applying it.

Compile Darkmod for your own Hardware

The Dark Mod already contains many hardware specific optimizations and can detect when your system has the needed hardware so that it can accelerate parts of the engine.
Though unlikely, it is possible that MSVC++ or GCC compilers can improve the performance of the executable further when told what hardware you have.
You can try compiling The Dark Mod yourself and add any compiler configurations that are specific to your hardware.

Darkmod Compiling Guide

For Windows \ MSVC++ you may wish to add an AVX flag:

 https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170



For Linux you can add -DCMAKE_CXX_FLAGS=-march=native to your cmake string.

Example:

 cmake -DCMAKE_BUILD_TYPE="Release" .. -DGAME_DIR=/home/user/darkmod -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_CXX_FLAGS=-march=native


Legacy Versions


If your Graphics Card ( GPU ) does not support OpenGL 3.2+ you can still play older TDM missions using Legacy TDM Versions
Some of the OBSOLETE settings referred to in this wiki can also improve performance in these versions

Here is a handy list of version details:


(Mod versions 1.0 to 1.08 ( and both Demo releases ) require the original ( vanilla ) Doom 3 with the latest 1.3.1 patch game to play)

Legacy OpenGL 2.0 Versions

Older TDM versions ( 2.07 and older ) are able to run on OpenGL 2.0 or earlier hardware. If you cannot run the latest TDM versions, try an older release.
( Your hardware will still need to be able to run Doom 3 regardless of which TDM version you try. )

OpenGL 2.0 mode in 2.06 and 2.07 :

     seta r_nvidiaOverride "0"
     seta r_softShadowsQuality "0"
     seta r_useFBO "0"
     seta r_useGLSL "0"

( TDM 2.05 and older only support OpenGL 2.0 mode. No special configuration is required for these older releases. )

The easiest takeaway here is that if your Graphics Card supports OpenGL versions between 2.0 and 3.1,
this means that TDM 2.07 is your best option as it has the most optimizations (and features) yet supports
the older OpenGL versions.

Legacy Doom 3 Mod Versions

As a Doom 3 mod, TDM could render using any OpenGL standard that Doom 3 could ( between GL 1.1 and 2.0 / DX7 to DX9 hardware )
but most TDM versions use ARB assembly (GL 2.0) for water and glass effects so running TDM on DX8 (or lower) hardware
may result in some visual anomalies.

If Doom 3 doesn't detection your OpenGL support, you may need to force it via the r_renderer CVAR

     seta r_renderer "arb"

There are several backends other than the "arb" backend ( arb is for the oldest hardware ):

  • arb (basic)
  • nv10 (Nvidia GF1, GF2, GF4MX)
  • nv20 (Nvidia GF3, GF4)
  • R200 (Radeon 8500)
  • ARB2 (NV30, R300 and above) ( same as "best" ) ( OpenGL 2.0 )


Also the "Enhanced" interaction and ambient video settings require OpenGL 2.0 ( ARB assembly shaders )
(TDM 1.08 and newer have no legacy ( pre-DX9 hardware \ pre-OpenGL 2.0 ) support)

Finally, even in mod form TDM has higher specification requirements than Doom 3 due to higher poly characters and assets.
Further, since Doom 3 does not have some of the culling and multi-core optimizations that TDM 2.06 and newer have,
old missions can be even more taxing even when run on old OpenGL modes (without shaders, etc).
For example the mission "Rightful Property" on TDM 1.07 ( mod version ) has many areas that are below 20FPS
whereas TDM 2.07 (and newer) can render the same areas over 150FPS on the same hardware.


OBSOLETE Configure Video RAM

Change:


seta com_videoRam "128" 

to the appropriate value (in MB) for your GPU in Darkmod.cfg

Eg. A 2GB video card would have 2048 there.


seta com_videoRam "2048" 


Last resort: Upgrade your hardware



This whole wiki article is meant to assist players with making TDM run as best as possible on their current hardware.

That said, you may find that the needed compromises are too harsh or that some missions still do not perform
well enough even with an optimized configuration. As such, it may be time to consider hardware upgrades.

Before upgrading hardware it may still be advised to:


Modern games need a lot of computing power, and while you don't need the absolutely newest hardware to play them,
upgrading single components of your machine can help tremendously:

  • If you got less than 2 GByte main memory, consider upgrading your memory. This really helps to reduce swapping, which introduces quite noticeable slowdowns.
  • If you got a graphic card older than the Nvidia Geforce GT 8x00 series or ATI/AMD HD 4x00 series, consider upgrading it.
  • Upgrading the (spinning) hard disk to SSD / NVME "Solid State" storage should improved loading times, especially on 2.10 and newer.
  • For comparison, see Known System Configurations to see the weakest hardware known to run current TDM versions.


Upgrading your CPU is possible in most cases but can be quite complicated and the cost might be so high that upgrading your whole PC might be a better value.


Configuration Based Issues

A few configuration changes that players apply for performance benefit can cause unexpected problems.

A Warning about cm_backFaceCull

Some users have reported AI pathfinding and tread-milling issues with this enabled. While this can be the fault of poor map design or monsterclip placement,
one thing that can cause this is the performance cvar:


seta cm_backFaceCull "1"

This cvar does improve performance but it is not worth the hassle in most cases.
We recommend disabling it (cm_backFaceCull "0" ) unless you know the mission you're playing has been tested with it enabled.

OBSOLETE Blurry Briefing and Menu Screens

If you get blurry briefing and menu screens then in Darkmod.cfg make sure you do NOT have image_downSize set to 1.

Instead set it to 0.

  • This is fixed in TDM 2.05 (and later.)

Related FXAA and Blurry Fonts

( 2.07+ )

If you disable in-game AA in favor of FXAA in your driver settings, text will be a little blurrier. This is a known problem with FXAA in general.

See also

Tweakguides Doom 3

See also the FAQ.