Fixed grass maps not being able to detect that the grass map material is finished compiling

#rb arciel.rekman, ben.ingram, jason.nadro

#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 17747180 via CL 17747314 via CL 17747321 via CL 17747324
#ROBOMERGE-BOT: STARSHIP (Release-5.0 -> Release-Engine-Staging) (v879-17706426)

[CL 17747327 by jonathan bard in ue5-release-engine-staging branch]
This commit is contained in:
jonathan bard
2021-10-07 05:31:23 -04:00
parent 83d04912da
commit 3531868aea

View File

@@ -975,7 +975,20 @@ bool ULandscapeComponent::CanRenderGrassMap() const
FMaterialResource* MaterialResource = MaterialInstance != nullptr ? MaterialInstance->GetMaterialResource(ComponentWorld->FeatureLevel) : nullptr;
// Check we can render the material
if (MaterialResource == nullptr || !MaterialResource->HasValidGameThreadShaderMap())
if (MaterialResource == nullptr)
{
return false;
}
// We only need the GrassWeight shaders on the fixed grid vertex factory to render grass maps :
FMaterialShaderTypes ShaderTypes;
ShaderTypes.AddShaderType<FLandscapeGrassWeightVS>();
ShaderTypes.AddShaderType<FLandscapeGrassWeightPS>();
FVertexFactoryType* LandscapeGrassVF = FindVertexFactoryType(FName(TEXT("FLandscapeFixedGridVertexFactory"), FNAME_Find));
FMaterialShaders Shaders;
if (!MaterialResource->TryGetShaders(ShaderTypes, LandscapeGrassVF, Shaders))
{
return false;
}