On a DDC hit, the SubstrateMaterialBsdfFeatures variable restored into MaterialCompilationOutput is not copied into SubstrateTranslatorData.SubstrateMaterialBsdfFeatures, which is referenced by the subsequent GetMaterialEnvironment function. As a result, the MATERIAL_SHADINGMODEL_TOON flag fails to propagate to the material.
The following fix works:
else
{
MaterialCompilationOutput = DDCMaterialCompilationOutput;
// workaround : SubstrateTranslatorData.SubstrateMaterialBsdfFeatures is refenrenced in GetMaterialEnvironment
SubstrateTranslatorData.SubstrateMaterialBsdfFeatures = MaterialCompilationOutput.SubstrateMaterialCompilationOutput.SubstrateMaterialBsdfFeatures;
In FHLSLMaterialTranslator::Translate, there is a race between the DDC load and the local translate.
Inserting a wait makes it easier to reproduce the issue.
// Asynchronously query the DDC for results
if (!bForceDisableDDCQuery && !bDisableTranslationDDC)
{
AsyncQueryDDC(DDCRequestOwner, EnvironmentDefinesBuffer);
}
// Synchronously begin translating the material
{
SCOPE_SECONDS_COUNTER(TranslationOnlyTime);
TranslateMaterial();
}
// One of the two has terminated. This will be a NOOP if DDC query task has completed.
#if 0
DDCRequestOwner.Cancel();
#else
DDCRequestOwner.Wait();
#endif
if (EnvironmentDefines->ParameterCollections.Contains(nullptr))
{
TranslationResult = EHLSLMaterialTranslatorResult::RetryWithoutDDC;
}
else
{
MaterialCompilationOutput = DDCMaterialCompilationOutput;
// Add log to debug
if (EnumHasAnyFlags( MaterialCompilationOutput.SubstrateMaterialCompilationOutput.SubstrateMaterialBsdfFeatures, ESubstrateBsdfFeature::Toon ) )
{
UE_LOGF(LogMaterial, Display, "Material BSDFFlag %x %x.", MaterialCompilationOutput.SubstrateMaterialCompilationOutput.SubstrateMaterialBsdfFeatures, SubstrateTranslatorData.SubstrateMaterialBsdfFeatures );
}
STAT(DDCRequestSerializeTime += SerializeTime - FPlatformTime::Seconds());
STAT(GShaderCompilerStats->IncrementMaterialCacheHit());
TranslationResult = EHLSLMaterialTranslatorResult::Success;
}
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-388460 in the post.
| 0 |
| Component | UE - Rendering - Features - Shading Models |
|---|---|
| Affects Versions | 5.8 |
| Created | Jul 27, 2026 |
|---|---|
| Updated | Aug 4, 2026 |