How to Generate Shaders Cache
There are four scripts located in the <SDK>/source/tools/Interpreter/scripts/render directory that can generate cache files for shaders:
- shader_cache_d3d9_default.usc - for DirectX 9 shaders
- shader_cache_d3d11_default.usc - for DirectX 11 shaders
- shader_cache_d3d11_simple.usc - for simple mobile shaders
Inside these scripts text files you can modify definitions (such as quality, MSAA, used effects etc.) and materials list (for example, if you are not interested in generating shader cache for some of them).
Shader cache generation is available only for full source Microsoft DirectX SDK versions. Also, fxc.exe should be included to the PATH system variable for Windows OS.
To generate shaders cache you need to perform the following steps:
- Copy the usc_x64.exe (or usc_x86.exe) file to the <SDK>/source/tools/Interpreter/scripts/render directory.
- Execute the following command inside this folder (while pressing Shift button press the right mouse button and choose the Open command window here option):
usc_x64 (usc_x86) needed_shader_script.usc
- Output shaders cache will be generated inside the <SDK>/data folder.
Generally, the size of generated cache files will exceed 400 MB and generation process itself will take more than 20 hours for each of the default scripts (they can be executed in parallel).