How can I force the shader manager to finish compiling?

The AssetCompilingManager has a static function Get().
But

  1. how can i get the ShaderCompilingManager?
  2. and next, how can i force the shader manager to finish all compile jobs?
FAssetCompilingManager::Get().FinishAllCompilation();

I am working on a Mod Manager. Here is my test case:
a) set virtual path /Game/ to mod
b) load mod level
c) set virtual path /Game/ to main game

Textures are currently missing from all mod levels because material compilation is asynchronous. All compilation have to be done at step b). Otherwise the mod materials/textures cannot be found.

I found a workaround by disabling the Share Material Shader Code option in the project settings.

For future reference, in 5.0 and above you can:

#if ENGINE_MAJOR_VERSION>4 && ENGINE_MINOR_VERSION>0
	UMaterialInterface::SubmitRemainingJobsForWorld(GetWorld());
#endif

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.