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

3

parent 4a8eb38f
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -268,7 +268,7 @@ void AOptiXPlayerCameraManager::Init() ...@@ -268,7 +268,7 @@ void AOptiXPlayerCameraManager::Init()
InitPrograms(); InitPrograms();
InitBuffers(); //InitBuffers();
//InitOutputTexture(); //InitOutputTexture();
...@@ -341,7 +341,6 @@ void AOptiXPlayerCameraManager::InitOutputTexture() ...@@ -341,7 +341,6 @@ void AOptiXPlayerCameraManager::InitOutputTexture()
void AOptiXPlayerCameraManager::InitBuffers() void AOptiXPlayerCameraManager::InitBuffers()
{ {
UE_LOG(OptiXPluginCameraActor, Display, TEXT("Initializing output buffers with dims: %i, %i"), Width, Height); UE_LOG(OptiXPluginCameraActor, Display, TEXT("Initializing output buffers with dims: %i, %i"), Width, Height);
......
...@@ -65,7 +65,7 @@ void FOptiXContextManager::PreRenderViewFamily_RenderThread(FRHICommandListImmed ...@@ -65,7 +65,7 @@ void FOptiXContextManager::PreRenderViewFamily_RenderThread(FRHICommandListImmed
// Laser Test part: // Laser Test part:
if (FOptiXModule::Get().bSceneChanged || false) if (FOptiXModule::Get().bSceneChanged && false)
{ {
bTracingLaser.AtomicSet(true); bTracingLaser.AtomicSet(true);
UOptiXBuffer* LaserOutputBuffer = OptiXContext->GetBuffer("result_laser"); UOptiXBuffer* LaserOutputBuffer = OptiXContext->GetBuffer("result_laser");
...@@ -132,26 +132,15 @@ void FOptiXContextManager::PostRenderView_RenderThread(FRHICommandListImmediate ...@@ -132,26 +132,15 @@ void FOptiXContextManager::PostRenderView_RenderThread(FRHICommandListImmediate
//RHICmdList.CopyTexture() //RHICmdList.CopyTexture()
start = FPlatformTime::Seconds();
OptiXContext->Launch(0, Size.X, Size.Y); 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 if (InView.StereoPass == EStereoscopicPass::eSSP_LEFT_EYE) // check validity
{ {
start = FPlatformTime::Seconds();
optix::uchar4* Data = static_cast<optix::uchar4*>(OptiXContext->GetBuffer("result_color")->MapNative()); 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); 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(); OptiXContext->GetBuffer("result_color")->Unmap();
float* Data2 = static_cast<float*>(OptiXContext->GetBuffer("result_depth")->MapNative()); float* Data2 = static_cast<float*>(OptiXContext->GetBuffer("result_depth")->MapNative());
...@@ -223,7 +212,7 @@ void FOptiXContextManager::Init() ...@@ -223,7 +212,7 @@ void FOptiXContextManager::Init()
{ {
InitContext(); InitContext();
InitRendering(); InitRendering();
//InitBuffers(); InitBuffers();
InitCUDADX(); InitCUDADX();
} }
...@@ -279,17 +268,20 @@ void FOptiXContextManager::InitRendering() ...@@ -279,17 +268,20 @@ void FOptiXContextManager::InitRendering()
// Viewport size: // Viewport size:
FViewport* CurrentViewport = GEngine->GameViewport->Viewport; FViewport* CurrentViewport = GEngine->GameViewport->Viewport;
Width = CurrentViewport->GetSizeXY().X; Width = CurrentViewport->GetSizeXY().X / 2.0;
Height = CurrentViewport->GetSizeXY().Y; Height = CurrentViewport->GetSizeXY().Y;
UE_LOG(LogTemp, Warning, TEXT("Res: %i %i"), Width, Height);
// Apparently those can be 0 in a packaged build? // Apparently those can be 0 in a packaged build?
// Catch that case: // Catch that case:
if (Width == 0 || Height == 0) //if (Width == 0 || Height == 0)
{ //{
UGameUserSettings* GameSettings = GEngine->GetGameUserSettings(); // UGameUserSettings* GameSettings = GEngine->GetGameUserSettings();
Width = GameSettings->GetScreenResolution().X; // Width = GameSettings->GetScreenResolution().X;
Height = GameSettings->GetScreenResolution().Y; // Height = GameSettings->GetScreenResolution().Y;
} //}
// Create the textures: // Create the textures:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment