diff --git a/Content/TextureMaterialVR.uasset b/Content/TextureMaterialVR.uasset index 1c0de04ecae45ffb86deb5d6781c280f986ed842..b1fa2b02822341e8941dde402baaa5f6190fd6ec 100644 Binary files a/Content/TextureMaterialVR.uasset and b/Content/TextureMaterialVR.uasset differ diff --git a/Source/OptiX/Private/OptiXCameraActor.cpp b/Source/OptiX/Private/OptiXCameraActor.cpp index fcfd0be506a11188dd76a9915414110b6ec42bfe..3086ff62740fc0d7b9bcaedbba388711c335d636 100644 --- a/Source/OptiX/Private/OptiXCameraActor.cpp +++ b/Source/OptiX/Private/OptiXCameraActor.cpp @@ -268,7 +268,7 @@ void AOptiXPlayerCameraManager::Init() InitPrograms(); - InitBuffers(); + //InitBuffers(); //InitOutputTexture(); @@ -341,7 +341,6 @@ void AOptiXPlayerCameraManager::InitOutputTexture() void AOptiXPlayerCameraManager::InitBuffers() { - UE_LOG(OptiXPluginCameraActor, Display, TEXT("Initializing output buffers with dims: %i, %i"), Width, Height); diff --git a/Source/OptiX/Private/OptiXContextManager.cpp b/Source/OptiX/Private/OptiXContextManager.cpp index fee39709ced43a03c2a482d31b4bb80d8294e94d..66e4bd5dae1943af4f9f504bb7540ac6c4ce5507 100644 --- a/Source/OptiX/Private/OptiXContextManager.cpp +++ b/Source/OptiX/Private/OptiXContextManager.cpp @@ -65,7 +65,7 @@ void FOptiXContextManager::PreRenderViewFamily_RenderThread(FRHICommandListImmed // Laser Test part: - if (FOptiXModule::Get().bSceneChanged || false) + if (FOptiXModule::Get().bSceneChanged && false) { bTracingLaser.AtomicSet(true); UOptiXBuffer* LaserOutputBuffer = OptiXContext->GetBuffer("result_laser"); @@ -132,26 +132,15 @@ void FOptiXContextManager::PostRenderView_RenderThread(FRHICommandListImmediate //RHICmdList.CopyTexture() - start = FPlatformTime::Seconds(); OptiXContext->Launch(0, Size.X, Size.Y); + UE_LOG(LogTemp, Warning, TEXT("Res : %i %i"), Width, Height); - end = FPlatformTime::Seconds(); - UE_LOG(LogTemp, Warning, TEXT("OptiX Launch took %f seconds"), end - start); if (InView.StereoPass == EStereoscopicPass::eSSP_LEFT_EYE) // check validity { - start = FPlatformTime::Seconds(); optix::uchar4* Data = static_cast<optix::uchar4*>(OptiXContext->GetBuffer("result_color")->MapNative()); - end = FPlatformTime::Seconds(); - UE_LOG(LogTemp, Warning, TEXT("OptiX Mapping took %f seconds"), end - start); - - start = FPlatformTime::Seconds(); RHICmdList.UpdateTexture2D(OutputTextureColorLeftRef, 0, TextureRegion, Size.X * 4, (uint8*)Data); - - end = FPlatformTime::Seconds(); - UE_LOG(LogTemp, Warning, TEXT("Texture Update took %f seconds"), end - start); - OptiXContext->GetBuffer("result_color")->Unmap(); float* Data2 = static_cast<float*>(OptiXContext->GetBuffer("result_depth")->MapNative()); @@ -223,7 +212,7 @@ void FOptiXContextManager::Init() { InitContext(); InitRendering(); - //InitBuffers(); + InitBuffers(); InitCUDADX(); } @@ -279,17 +268,20 @@ void FOptiXContextManager::InitRendering() // Viewport size: FViewport* CurrentViewport = GEngine->GameViewport->Viewport; - Width = CurrentViewport->GetSizeXY().X; + Width = CurrentViewport->GetSizeXY().X / 2.0; Height = CurrentViewport->GetSizeXY().Y; + UE_LOG(LogTemp, Warning, TEXT("Res: %i %i"), Width, Height); + + // Apparently those can be 0 in a packaged build? // Catch that case: - if (Width == 0 || Height == 0) - { - UGameUserSettings* GameSettings = GEngine->GetGameUserSettings(); - Width = GameSettings->GetScreenResolution().X; - Height = GameSettings->GetScreenResolution().Y; - } + //if (Width == 0 || Height == 0) + //{ + // UGameUserSettings* GameSettings = GEngine->GetGameUserSettings(); + // Width = GameSettings->GetScreenResolution().X; + // Height = GameSettings->GetScreenResolution().Y; + //} // Create the textures: