I know that I can set the min/max cull distance for the foliage in the editor. Is there a way to set those values dynamically at runtime depending on the quality desired by the user? E.g. at Epic quality, set the cull values to 0, while at low quality, set the cull values to like 1000-2000.
In the BeginPlay
to my game mode, I added the following
for (TActorIterator<AInstancedFoliageActor> foliage(GetWorld()); foliage; ++foliage)
{
TMap<UFoliageType*, FFoliageMeshInfo*> foliageInfos = foliage->GetAllInstancesFoliageType();
TArray<UFoliageType*> foliageTypes = TArray<UFoliageType*>();
foliageInfos.GetKeys(foliageTypes);
for (int i = 0; i < foliageInfos.Num(); i++)
{
foliageTypes[i]->CullDistance = FInt32Interval(5000, 10000);
}
}
since that appeared to expose the cull distance values to the C++ code. However, that did not work to change the cull distance when I started the game in standalone mode.
Is there a known way to do this?
The other dumb idea I had is to make two copies of each map, one with no culling, and the other with culling. However, that seems like a very clunky and inefficient way to do it.