Skip to content

Commit

Permalink
trying to fix flickering caused by frustum culling
Browse files Browse the repository at this point in the history
  • Loading branch information
bnlrnz committed Oct 15, 2020
1 parent bdaa603 commit 6319c86
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Source/xsite_ue/MultiViewportCameraActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,17 @@ void AMultiViewportCameraActor::BeginPlay()

UE_LOG(LogCave, Display, TEXT("[%s] Spawning Extra Window resolution: %s offset: %s"), *WindowTitle.ToString(), *InitialWindowRes.ToString(), *InitialWindowPos.ToString());

IdentifyScreen();

// IdentifyScreen();

// this enables Hierarchical Z-Buffer Occlusion (see https://docs.unrealengine.com/en-US/Engine/Rendering/VisibilityCulling/index.html)
// we do this method to prevent flickering actors (static meshes) caused by aggressive default frustum/occlusion culling
// whenever an extra window is spawn (with a seperate view frustum than the "main" window) we should make shure to activate this
// we could also set r.AllowOcclusionQueries=0, but this would probably disable culling all together (which we do not want?)
if (this->PlayerController)
{
this->PlayerController->ConsoleCommand("r.HZBOcclusion 1");
}

// initialize everything before we call base class so that in blueprint beginplay everything is ready
Super::BeginPlay();
}
Expand Down

0 comments on commit 6319c86

Please sign in to comment.