How to disable 5.1 on demand shader compilation?

I’m trying out 5.1 again and I don’t particularly like this feature. Surely there is a way to disable it? Although I suppose I’ll get used to it. I would think something this fundamental should be optional and off by default.

Hi @Astaraa,

How is shader compilation different for you in 5.1?

I know even pre-5.1 shader compilation would sometimes be deferred until you open the materials/meshes/maps. (Like after adding a marketplace asset pack).

On demand shader compilation is experimental and should already be off by default.

I don’t know if this will work in your situations, but I found to fix the problems I was having with things not being compiled when I used them, I call this routine first:

	FWorldContext* worldctx=GEngine->GetWorldContextFromGameViewport(GEngine->GameViewport);
	if(worldctx) {
		UWorld* world=worldctx->World();
		if(world) {
			UMaterialInterface::SubmitRemainingJobsForWorld(world);
		}
	}
	FAssetCompilingManager::Get().FinishAllCompilation();

Previously everything would be ready when I hit Play.
With 5.1, I’ll hit Play… Cast a spell, lag as 4 shaders load… Take damage, lag as a shader or sound load. Random event goes off, lag as a sound loads. I’ll see blank materials on FX or weather changes until the shaders load. If I want to record a video I’d have to go in and make sure everything is loaded first.

I figure it’s aimed at helping complex levels. But it feels clunky for basic use.

3 Likes

try add ”r.ShaderCompiler.JobCacheDDC=false“ in defaultengine.ini which may help

1 Like