Modify the maximum number of decals in Cryengine

To increase the number of visible decals in Cryengine;

1. Ensure that CryEngine source and GameSDK has been properly configured (see Preliminary Setup below)
- assume CryEngine Source has been installed to D:\Files\CRYENGINE-5.4.0
- assume CryEngine has been installed to D:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_preview_5.4.0.130_pc

2. Increase the number of decals stored in memory:

Line 17:
#define DECAL_COUNT (512) // must be pow2
#define DECAL_COUNT (65536) // must be pow2

3. Increase the number of decals simultaneously visible in FOV to 65536:

Line 12 (class CDeferredDecalsStage : public CGraphicsPipelineStage):
enum { kMaxDeferredDecals = 256 };
enum { kMaxDeferredDecals = 65536 };

Line 1731 (in CRenderer::EF_AddDeferredDecal):
if (passInfo.GetRenderView()->GetDeferredDecalsCount() < 1024)
if (passInfo.GetRenderView()->GetDeferredDecalsCount() < 65536)

4. Recompile CryEngine source (see Preliminary Setup 1A below)

5. Create a backup of CryRenderD3D11.dll/CryRenderD3D12.dll/Cry3DEngine.dll in D:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_preview_5.4.0.130_pc\bin\win_x64

6. Copy CryRenderD3D11.dll/CryRenderD3D12.dll/Cry3DEngine.dll from D:\Files\CRYENGINE-5.4.0_preview5\bin\win_x64 to D:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_preview_5.4.0.130_pc\bin\win_x64


Note the frame rate will drop based on some non-linear function of the number of decals present in the FOV. E.g. for 1024x1024 size decals with diffuse maps only;

Number of Decals visible | Frame Rate
0 130
1000 75
2000 57
3000 44
4000 36
5000 31

Preliminary Setup;

1A. Compile CryEngine source:
- download CryEngine 5.4 source (corresponding to the version of CryEngine installed e.g. CryEngine 5.4 Preview 5)
- execute download_sdks.exe OR manually download the third party SDK source;
mkdir E:\Files\CRYENGINE-5.4.0_preview5\Code\SDKs
extract to E:\Files\CRYENGINE-5.4.0_preview5\Code\SDKs
- open cry_cmake - Visual Studio 2015 Win64 - generate solution
open project [in VS 2015]
- VS 2015 - select compilation profile: Profile x64 - build

1B. Verify that GameSDK is up to date (matched with the version of CryEngine installed) [NB this step is only required for preview versions of CryEngine 5.4]:
- backup and delete D:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\gamesdk_5.3\GameSDK\bin\win_x64\Game.dll
- copy D:\Files\CRYENGINE-5.4.0_preview5\bin\win_x64\CryGameSDK.dll to D:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\gamesdk_5.3\GameSDK\bin\win_x64
- copy D:\Files\CRYENGINE-5.4.0_preview5\GameSDK.cryproject to D:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\gamesdk_5.3
- open GameSDK.cryproject with a text editor and add "CryGameSDK" as a plugin:
.. ,
{ "type": "EPluginType::Native", "path": "CryGameSDK" }
cryengineMaxDecalModificationUpload.jpg (254.33 KiB) Viewed 805 times

Who is online

Users browsing this forum: No registered users and 1 guest