Crash Landscape proxy tesselation UE4.26

Im using world composition with multiple levels.
When i select my landscape source and i try to configure the tesselation settings,
if any landscapes proxies are loads in the editor it will crash instantly with this error:

Assertion failed: TessellationFalloffSettings.UseTessellationComponentScreenSizeFalloff == SceneProxy->UseTessellationComponentScreenSizeFalloff [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Landscape/Private/LandscapeRender.cpp] [Line: 722]

UE4Editor_Core!AssertFailedImplV() [D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:104]
UE4Editor_Core!FDebug::CheckVerifyFailedImpl() [D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:461]
UE4Editor_Landscape!FLandscapeRenderSystem::RegisterEntity() [D:\Build++UE4\Sync\Engine\Source\Runtime\Landscape\Private\LandscapeRender.cpp:722]
UE4Editor_Landscape!FLandscapeNeighborInfo::RegisterNeighbors() [D:\Build++UE4\Sync\Engine\Source\Runtime\Landscape\Private\LandscapeRender.cpp:4507]
UE4Editor_Renderer!FScene::OnLevelAddedToWorld_RenderThread() [D:\Build++UE4\Sync\Engine\Source\Runtime\Renderer\Private\RendererScene.cpp:3620]
UE4Editor_Renderer!TEnqueueUniqueRenderCommandType<FScene::OnLevelAddedToWorld'::2’::FLevelAddedToWorldName,<lambda_d6db94a44fde36c8904796a160128bfb> >::DoTask() [D:\Build++UE4\Sync\Engine\Source\Runtime\RenderCore\Public\RenderingThread.h:183]
UE4Editor_Renderer!TGraphTask<TEnqueueUniqueRenderCommandType<FScene::OnLevelAddedToWorld'::2’::FLevelAddedToWorldName,<lambda_d6db94a44fde36c8904796a160128bfb> > >::ExecuteTask() [D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:886]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:709]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:601]
UE4Editor_RenderCore!RenderingThreadMain() [D:\Build++UE4\Sync\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:373]
UE4Editor_RenderCore!FRenderingThread::Run() [D:\Build++UE4\Sync\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:509]
UE4Editor_Core!FRunnableThreadWin::Run() [D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:86]

So I’ve tried a couple of things :

-First, I’ve tried to update my project to 4.27 to see if this issue has disapeared
but the same scenario happened.

-I’ve tried to search online for some similars issues but i haven’t find anything revelant yet.

-So I’ve tried to replicate this in a blank project :
Here the steps that i followed :

-Create a blank project
-Enable world composition in the world settings
-Create one level
-Make it current level
-Add a landscape
-Go to summons world composition window
-Add multiples adjacents levels
-Select the landscape source
-Edit one of the three tesselation settings in the details panel
-And then the editor crashed

I don’t understand what is going on, i may be wrong but it might be that the landscapes proxies can not change their tessellation settings once created?
Because when i set the settings in the landscape source before adding the adjacents levels everythings works fine. This could be a solution but i already have existings landscapes which I’ve been working for a while so erased them to start again would be very annoying.

Since i don’t understand how world composition is made and why i having this issue i wanna ask if someone know how i can configure the landscape tessellation without my editor crashing.

Thank you for your time

There seems to be a bug in UE_4.27\Engine\Source\Runtime\Landscape\Private\LandscapeRender.cpp : line 4353
in

void ALandscapeProxy::ChangeTessellationComponentScreenSizeFalloff(float InTessellationComponentScreenSizeFalloff)

passed parameter is not actually set.

When sublevel is loaded it tries to set default tessellation parameters from persistent (master level).
Unfortunately there is a check that fails in
UE_4.27\Engine\Source\Runtime\Landscape\Private\LandscapeRender.cpp : line 724

check(TessellationFalloffSettings.TessellationComponentScreenSizeFalloff == SceneProxy->TessellationComponentScreenSizeFalloff);

This fails because when we modify tessellation parameters in persistent level and we try to load sublevel it first sets the

TessellationFalloffSettings.TessellationComponentScreenSizeFalloff

to the previous tessellation values of sublevel because it tried to override it with new value from persistent level but the method called did not set the proper new value (bug i mentioned) and then compares it to the new modified value. This result in check fails and editor crashes.

for example

  1. we had TessellationComponentScreenSizeFalloff = 0.75 (on persistent and sublevels)
  2. we set in persistent level on main Landcape TessellationComponentScreenSizeFalloff = 0.2
  3. we try to load sublevel in editor
    it sets TessellationFalloffSettings.TessellationComponentScreenSizeFalloff to 0.75 (because it failed to set it to Persistent Level value)
    then sets SceneProxy->TessellationComponentScreenSizeFalloff to 0.2 and then check fails.

This can be solved in messy and hacky way…
You would need to create editor tool that will run following code f.e when clicked some editor tool button. But this had to be run on Debug Game Editor (see configuration manager in visual studio) so the editor is being debugged and checks wont crush but pause in visual studio:

if (World != nullptr)
{
	TArray<AActor*> FoundLandscapeProxies;
	UGameplayStatics::GetAllActorsOfClass(World, ALandscapeProxy::StaticClass(), FoundLandscapeProxies);

	//Set Undo context for upcoming modifications
	const FScopedTransaction Transaction(NSLOCTEXT("MyEditorTool", "ChangeTessellation", "Change tessellation parameters"));

	for (auto& FoundActor : FoundLandscapeProxies)
	{
		auto FoundLandscape = Cast<ALandscapeProxy>(FoundActor);
		if (FoundLandscape != nullptr)
		{
			//Set support for Undo
			FoundLandscape->SetFlags(RF_Transactional);

			//Register following changes and modifications so Level will be marked as dirty and will detect save required on exiting editor
			FoundLandscape->Modify();

			FoundLandscape->TessellationComponentScreenSize = 0.6f;
			FoundLandscape->TessellationComponentScreenSizeFalloff = 0.2f;
			FoundLandscape->PostEditChange();
		}
	}
	World->PostEditChange();
}

This will update sublevel tessellation values (that are read only in editor). But there is a refresh worker thread running, and it will eventually fail on the check I’ve described above. When execution stops on the check we can in visual studio debugger jump over the check line (by dragging yellow pointer in visual studio) and repeat this step until all workers passes. What it does it basically updates the sublevel assets. Now you have to save the sublevels with new tessellation. Restart the editor and now they have new value and won’t crush when being loaded.

1 Like