Enjoy this small tutorial showing how to compile Vulkan Shaders on windows 64bit platform.
- Make sure your engine is correctly installed*, and is the default for your machine.
- Be sure you have a working game, with all assets etc in the correct stated locations.
^ The above short-hands may appear in any part of these instructions (text/code snippets).
Code: Select all
The following short-hands will be used to generalize these instructions:
%ENGINE_ROOT% The root folder of your CRYENGINE installation.
%GAME_ASSETS% The Game Assets folder name, by default 'Assets'.
%REND_DRIVER% One of 'VK' (Vulkan), 'DX11' (DirectX 11), 'DX12' (DirectX 12), 'GL' (OpenGL)
Setup the Remote Shader Compiler
- Open %ENGINE_ROOT%/Tools/RemoteShaderCompiler/config.ini in your favourite text editor.
- Put the following contents into the open file, then save and close:
Setup the Game Client
Code: Select all
port = 31455
PrintErrors = 1
- Remove any value for any CVAR named "sys_user_folder" in either your cryproject file or any .cfg file.
- Put the following contents into %ENGINE_ROOT%/system.cfg, then save and close:
Setup and use the RC Package batch scripts
Code: Select all
-- Location under %ENGINE_ROOT% which contains the game assets
-- Force the user directory to be in the engine root
-- More robust logging
-- Make sure we use source files when spossible
r_fullscreen = 0
r_width = 800
r_height = 600
-- Optimal CVARS for compiling shaders
sys_vr_support = 0
-- Enable Remote Shader Compiler
-- Disable this in-game to stop sending requests to RSC
-- Automatically check for shader changes
-- Store compiled shaders in the user folder
---- Enable asynchronous shader compiling
---- Usage: r_ShadersAsyncCompiling [0/1/2/3]
---- 0 = off, (stalling) shaders compiling
---- 1 = on, shaders are compiled in parallel, missing shaders are rendered in yellow
---- 2 = on, shaders are compiled in parallel, missing shaders are not rendered
---- 3 = on, shaders are compiled in parallel in precache mode
-- Make sure to use your desired renderer
- Delete all .pak type files from the %ENGINE_ROOT%/Engine folder
- Copy RCJobFiles folder from the supplied package to your engine root (post attachment)
- Read the RCJobFiles\README.txt file
- Run RCJobFiles\tools\setup.bat
- Run RCJobFiles\JOB_fresh_start.bat
- Copy contents of RCData\RCOut\engine to the root\engine folder
- Start %ENGINE_ROOT%/Tools/RemoteShaderCompiler
- Launch %ENGINE_ROOT%/bin/win_x64/GameLauncher.exe
- Move around your level, check the console for shader compilation messages, as well as the RSC console window
- Keep moving around etc until you are satisfied the shaders have been compiled. (Generally, you keep adding to the cache through playtests etc)
- Close the game
- Run RCJobFiles/JOB_shadercache.bat NOTE: (This copies generated shaders from the user folder in the engine root. if you user folder is somewhere else, copy them to the user folder in the engine root before executing this batch file).
- Close the RemoteShaderCompiler console window
- Copy the new shadercache/shadersbin and shadercachestartup .pak files from RCData\RCOut\engine to the root\engine folder
- Start the game without compilation support and verify
Special note (correctly installed*).. preferred method for 5.4 previews:
- Clone repo at tag 5.4.0_previewX (where X is the preview number)
- Download release zip for preview X and merge with/overwrite into your cloned repo folder.