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

3

parent 4a8eb38f
Branches
No related tags found
No related merge requests found
No preview for this file type
......@@ -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);
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment