Daemon
Daemon copied to clipboard
set r_lazyShaders to 1 for faster startup and prevent errors on first launch before being able to switch preset
The r_lazyShaders has three values:
0: current default: compute all the GLSL shaders at startup before reaching main menu.- advantages:
- When you reach the main menu, you don't have other GLSL shader to compile.
- problems:
- First startup can be extremly slow,
- Shader compilation may even fail before being able to switch preset,
- User may believe the game crashed and closes it before the menu is reached.
- advantages:
1: GLSL shaders are compiled on demand until loading a map, compile everything remaining at map startup.- advantages:
- Fast game loading.
- Make possible to change graphical options in game if one is crashing the game.
- problems:
- Unvanquished does not implement any feedback to tell the user why the map loading is apparently stuck.
- advantages:
2: GLSL shaders are compiled on demand.- advantages:
- User never compile more GLSL shaders than needed.
- problems:
- A shader may get compiled in a middle of an action when uncovering some surface, resulting in an annoying freeze for some time.
- advantages:
Some user reported in the IRC chat the game was crashing on its computer. After investigation it turned out the user closed the game on every startup because the engine was stuck compiling shaders.
Some hardware may be able to run the game with some optional effects disabled. For example the SSAO shader has too large operations for the ALU of some older Radeon GPUs, and some shaders are too long for some drivers for some older Intel GPUs. In such case, the game may even crash or quit without reaching the main menu to be able to select the preset.
On my old Intel GMA 965, starting the game with a high preset (which is believed to be close to the default engine options) and no existing shader cache takes 25 seconds with r_lazyShaders 0 (actual value), and only 6 seconds with r_lazyShaders 1.
I believe it would be better to set r_lazyShaders to 1, but we need feedback on game side about what's going on:
- [ ] https://github.com/Unvanquished/Unvanquished/issues/1469
Note: to delete both engine shader caches and Mesa driver shader cache on Linux, one may do:
rm -r ~/.local/share/unvanquished/glsl/ ~/.cache/mesa_shader_cache/