diff --git a/Source/OptiX/Private/OptiXLensComponent.cpp b/Source/OptiX/Private/OptiXLensComponent.cpp index 641f567f002d598bd4885c6980be38c9e135a3da..d756e2e5d027960e973a58a5b10b843720312a12 100644 --- a/Source/OptiX/Private/OptiXLensComponent.cpp +++ b/Source/OptiX/Private/OptiXLensComponent.cpp @@ -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")); + + } diff --git a/Source/OptiX/Private/OptiXObjectComponent.cpp b/Source/OptiX/Private/OptiXObjectComponent.cpp index a2b3e33f8f1768611ead33c9c777ca36bce44bde..49c1c0c0c87c776be9f2480bc9bab6e38d311cd8 100644 --- a/Source/OptiX/Private/OptiXObjectComponent.cpp +++ b/Source/OptiX/Private/OptiXObjectComponent.cpp @@ -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); - - }