Setepenre
(Setepenre)
December 25, 2022, 10:53pm
1
The landscape appears “chunky” on packaged build & StandAlone game but it looks fine in the editor.
Do you know what could be wrong here ?
This happens in 5.0 and 5.1, how could I fix this ? I tried to rebuild the Landscape a few times.
Things I tried:
Deleting DDC/Intermediate folder
Building All Landscape
Changing Scaling parameters
Tweaking Landscape LOD settings
Deleting Game/Engine/Editor Configs
1 Like
jopely2022
(jopely2022)
January 5, 2023, 11:50am
2
Also experiencing this problem.
Setepenre
(Setepenre)
January 20, 2023, 12:38am
3
The hack I came up with to “fix” this is to call, this function for a few frames at the beginning of the game.
void UGKSharedBlueprint::FixLandscape(UObject* WorldCtx) {
for (auto* LandscapeComponent : TObjectRange<ULandscapeComponent>(RF_ClassDefaultObject | RF_ArchetypeObject, true, EInternalObjectFlags::Garbage))
{
LandscapeComponent->MarkRenderStateDirty();
}
}
On my side I firmly believe this is an engine bug.
Background
I came up with this hack when I noticed that running r.LandscapeLOD0DistributionScale 1
seemed to fix the issue.
Nevertheless, calling this inside a Shipping build does nothing, so I deduced that what fixed the rendering was the delegate that gets called on non-shipping builds when the distribution scale gets modified.
#if !UE_BUILD_SHIPPING
static void OnLODDistributionScaleChanged(IConsoleVariable* CVar)
{
for (auto* LandscapeComponent : TObjectRange<ULandscapeComponent>(RF_ClassDefaultObject | RF_ArchetypeObject, true, EInternalObjectFlags::Garbage))
{
LandscapeComponent->MarkRenderStateDirty();
}
}
#endif
float GLandscapeLOD0DistributionScale = 1.f;
FAutoConsoleVariableRef CVarLandscapeLOD0DistributionScale(
TEXT("r.LandscapeLOD0DistributionScale"),
GLandscapeLOD0DistributionScale,
TEXT("Multiplier for the landscape LOD0DistributionSetting property"),
#if !UE_BUILD_SHIPPING
FConsoleVariableDelegate::CreateStatic(&OnLODDistributionScaleChanged),
#endif
ECVF_Scalability
);