Skip to content

Instantly share code, notes, and snippets.

@Batname
Created November 23, 2017 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Batname/2985ad5386511fc880d23b43a97351b3 to your computer and use it in GitHub Desktop.
Save Batname/2985ad5386511fc880d23b43a97351b3 to your computer and use it in GitHub Desktop.
void ACaptureActor::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("AMyGameModeBase::BeginPlay()"));
UGameViewportClient* GameViewportClient = GEngine->GameViewport;
FViewport* Viewport = GameViewportClient->Viewport;
ULocalPlayer* LocalPlayer = GEngine->GetDebugLocalPlayer();
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
// create the view family for rendering the world scene to the viewport's render target
FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues(
Viewport,
GetWorld()->Scene,
LocalPlayer->ViewportClient->EngineShowFlags)
.SetRealtimeUpdate(true));
// Calculate the player's view information.
FVector ViewLocation;
FRotator ViewRotation;
FSceneView* View = LocalPlayer->CalcSceneView(&ViewFamily, ViewLocation, ViewRotation, Viewport, nullptr, EStereoscopicPass::eSSP_FULL);
View->FinalPostProcessSettings;
float PostProcessBlendWeight = PlayerController->PlayerCameraManager->CameraCache.POV.PostProcessBlendWeight;
UE_LOG(LogTemp, Warning, TEXT("AutoExposureBias %f"), View->FinalPostProcessSettings.AutoExposureBias);
UE_LOG(LogTemp, Warning, TEXT("PostProcessBlendWeight %f"), PostProcessBlendWeight);
UE_LOG(LogTemp, Warning, TEXT(">>SceneCaptureComponent2D PostProcessBlendWeight %f"), SceneCaptureComponent2D->PostProcessBlendWeight);
SceneCaptureComponent2D->PostProcessSettings = View->FinalPostProcessSettings;
SceneCaptureComponent2D->PostProcessBlendWeight = 1.f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment