From df8c01ae412d495c7be6f829cf6abd333b071fa5 Mon Sep 17 00:00:00 2001 From: Yogesh9000 <96904418+Yogesh9000@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:01:11 +0530 Subject: [PATCH] Improve Startup Performance (#1635) --- vtkext/private/module/vtkF3DGenericImporter.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vtkext/private/module/vtkF3DGenericImporter.cxx b/vtkext/private/module/vtkF3DGenericImporter.cxx index 8ba35b36ed..49c07d72b7 100644 --- a/vtkext/private/module/vtkF3DGenericImporter.cxx +++ b/vtkext/private/module/vtkF3DGenericImporter.cxx @@ -32,7 +32,6 @@ struct ReaderPipeline ReaderPipeline() { this->GeometryActor->GetProperty()->SetInterpolationToPBR(); - this->VolumeMapper->SetRequestedRenderModeToGPU(); this->PolyDataMapper->InterpolateScalarsBeforeMappingOn(); } @@ -47,7 +46,7 @@ struct ReaderPipeline vtkNew VolumeProp; vtkNew PolyDataMapper; vtkNew PointGaussianMapper; - vtkNew VolumeMapper; + vtkSmartPointer VolumeMapper; vtkDataSet* Output = nullptr; vtkDataSetAttributes* PointDataForColoring = nullptr; @@ -213,6 +212,12 @@ void vtkF3DGenericImporter::ImportActors(vtkRenderer* ren) // Add filter outputs to mapper inputs pipe.PolyDataMapper->SetInputConnection(pipe.PostPro->GetOutputPort(0)); pipe.PointGaussianMapper->SetInputConnection(pipe.PostPro->GetOutputPort(1)); + + if (!pipe.VolumeMapper) + { + pipe.VolumeMapper = vtkSmartPointer::New(); + pipe.VolumeMapper->SetRequestedRenderModeToGPU(); + } pipe.VolumeMapper->SetInputConnection(pipe.PostPro->GetOutputPort(2)); // Set geometry actor default properties