Skip to content
Snippets Groups Projects
Commit 52cccc39 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

- green lenses are fixed, apparently when capturing in begin play the scene...

- green lenses are fixed, apparently when capturing in begin play the scene isn't correctly renderable yet for the captures
- capturedeferred works
parent e9e0aa46
No related branches found
No related tags found
No related merge requests found
......@@ -158,6 +158,8 @@ void UOptiXLensComponent::InitOptiXGroups()
void UOptiXLensComponent::InitCubemap(FRHICommandListImmediate & RHICmdList)
{
UE_LOG(LogTemp, Display, TEXT("Init Cubemap"));
//OptiXContext->SetBuffer("skyboxBuffer", CubemapBuffer);
CubemapSampler = OptiXContext->CreateTextureSampler();
......@@ -184,11 +186,16 @@ void UOptiXLensComponent::InitCubemap(FRHICommandListImmediate & RHICmdList)
// Writes the variable into the input buffer
FOptiXModule::Get().GetOptiXContextManager()->AddCubemapToBuffer(OptiXCubemapId, CubemapSampler->GetId());
UE_LOG(LogTemp, Display, TEXT("Finished Init Cubemap"));
}
void UOptiXLensComponent::UpdateCubemap(FRHICommandListImmediate & RHICmdList)
{
UE_LOG(LogTemp, Display, TEXT("Updating Cubemap"));
int32 X = 1024; // todo hardcoded
int32 Y = X;
......@@ -225,6 +232,10 @@ void UOptiXLensComponent::UpdateCubemap(FRHICommandListImmediate & RHICmdList)
FMemory::Memcpy(BufferData + X * Y * 5, SurfaceDataCube[5].GetData(), MemSize); //
CubemapBuffer->Unmap();
UE_LOG(LogTemp, Display, TEXT("Finished Updating Cubemap"));
}
......
......@@ -235,6 +235,7 @@ void UOptiXCubemapComponent::BeginPlay()
TextureTarget = CubeRenderTarget;
CaptureScene();
CaptureSceneDeferred();
CubeRenderTarget->UpdateResource();
bCubemapCaptured.AtomicSet(true);
......@@ -325,6 +326,4 @@ void UOptiXCubemapComponent::RequestCubemapUpdate()
{
CaptureScene();
FOptiXModule::Get().GetOptiXContextManager()->RequestCubemapUpdate(this);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment