Cooking Crash - Materials

Hi folks,

We’re seeing a crash in 5.8 when cooking, it appears that something within materials is providing incorrect data to the serialiser. I’ve provided the callstack, and here’s a snippet of the log we’re seeing when it’s occurring.

[2026.06.10-19.23.48:198][ 0]LogMaterial: Display: Missing cached shadermap for REDACTED in PCD3D_SM6, Low, SM6, Game (DDC key hash: REDACTED), compiling. 
[2026.06.10-19.23.48:216][ 0]LogOutputDevice: Warning: 

Script Stack (0 frames) :

Assertion failed: ShaderMapId.ContainsShaderType(ShaderType, kUniqueShaderPermutationId) [File:D:\p4\game\int\Engine\Source\Runtime\Engine\Private\Materials\MaterialShader.cpp] [Line: 2565] 
Material shader map REDACTED from material /Game/REDACTED is missing expected shader type TShadowDepthPSCombined
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in UnrealEditor.exe.

I’m not sure how to debug this one however, so I’m reaching out in hopes that either you’re already aware and have a fix, or can offer advice on what to investigate. Any help would be appreciated.

Many thanks,

David

[Attachment Removed]

Hi!

Looks like the fix for this should be present in 5.8.1 with CL 55039716.

This happens because we have a Conservative set of material parameters which detect node usage in materials. These are used for the DDC key and they need to be present before translation.

There’s a second second of Compilation parameters which are based on translation output. These are used to determine what shaders should actually get compiled.

The shaders from the Conservative parameters should always >= the ones from the Compilation ones.

This check triggers when that is false.

Using the conservative parameters for shader compilation as well leads to the possibility of unnecessary shaders being compiled just from a node that is placed in the graph, but not used.

This can be done as a temporary solution or if you don’t mind the additional shaders using “r.Material.UseShaderCompilationParameters 0”.

I would recommend pulling 5.8.1 or just that CL. Do please let us know if that fixes it.

Thanks,

Cristian

[Attachment Removed]

Hey David,

Yeah, that is true. It should be present in //UE5/Main under CL 55041599.

Do please let me know if that works.

Kind regards,

Cristian

[Attachment Removed]

Hi David,

That does not seem to be related in any way to what we have discussed up until now.

I’ll try to find out more info regarding what might cause the error.

Kind regards,

Cristian

[Attachment Removed]

Hi David,

We can make another UDN and leave this one for the shader change. Let’s just have a quick look at one thing first.

The main issue here seems like it’s the fact that it simply tries to serialize a MID, which should not happen.

Could you add a PreSave method in Text3DDefaultMaterialExtension.cpp to make sure any MID we have is RF_Transient?

void UText3DDefaultMaterialExtension::PreSave(FObjectPreSaveContext SaveContext)
{
	Super::PreSave(SaveContext);
 
	// Ensure all MID subobjects are RF_Transient before save.
	ForEachObjectWithOuter(this, [](UObject* Inner)
	{
		if (Inner->IsA<UMaterialInstanceDynamic>() && !Inner->HasAnyFlags(RF_Transient))
		{
			Inner->SetFlags(RF_Transient);
		}
	}, EGetObjectsFlags::None);
}

Kind regards,

Cristian

[Attachment Removed]

Hi David,

That’s great news! Happy to hear that it helped!

Kind regards,

Cristian

[Attachment Removed]

Hey Cristian, thanks for your reply.

I’m looking at Epic’s Perforce just now and can’t see a specific stream for 5.8.1. I don’t think 5.8.0 is technically even out yet, though I imagine Unreal Fest will change that imminently. :slight_smile:

In lieu of that, is there a specific CL on a certain stream that would get us there? Otherwise I’ll just cherry pick that CL like you suggest. :slight_smile:

Many thanks,

David

[Attachment Removed]

Unfortunately, even after cherry picking that we still seem to be getting hit with a Fatal Error.

Fatal error: [File:D:\p4\game\int\Engine\Source\Runtime\CoreUObject\Private\UObject\SavePackage2.cpp] [Line: 1638] 
MaterialInstanceDynamic /Script/Text3D.Default__Text3DActor:Text3DComponent.MaterialExtension.MID_M_Text3DOpaqueUnlit_0 was an archetype of MaterialInstanceDynamic /Game/gm/MAP/gameMap/_Generated_/2GQDLC8RSGDVY3QR2C1SNMIUM.L_gameMap:PersistentLevel.Text3DActor_UAID_24FBE343930CFFD302_1534492954.Text3DComponent.MaterialExtension.MID_M_Text3DOpaqueUnlit_0 but returned a null index mapping the object.
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in UnrealEditor.exe.

The save context object farther up the callstack is also pointing to _Generated_/2GQD… actor. I’m a noob when it comes to the PCG stuff in Unreal so I’m not 100% if my assumption is right. Would that actor have come from PCG?

Is this fatal error related in any way to what we’ve already discussed?

Many thanks,

David

[Attachment Removed]

Do you think it’d be best for me to create a new ticket for this issue? I have a sneaking suspicion it’s tied to the changes in Text3DActor.

Many thanks,

David

[Attachment Removed]

Will add that now and kick off a cook, and report back as soon as I can :slight_smile:

Many thanks

[Attachment Removed]

This workaround seemed to get us a lot further. Nearly 80% of the way through our cook before another issue struck us. One which I believe our teams should be able to resolve.

Many thanks!

David

[Attachment Removed]