[vtkusers] image rendering speed
Ken Martin
ken.martin at kitware.com
Fri Jul 21 14:32:03 EDT 2017
Be aware that in the new OpenGL2 backend rendering is asynchronous. That is
VTK sends commands to the OpenGL hardware and continues processing. When
the OpenGL hardware gets around to executing those commands is up to the
hardware.
Fortunately there is vtkRenderTimerLog which I believe works quite well as
of a month or two ago. See TestGPURayCastDepthPeeling.cxx in VTK for an
example of its usage. Below is some sample output
- 100.0% 63.655 ms "vtkRenderWindow::Render"
- 98.2% 62.535 ms "vtkRenderer::Render this=@0x2437a80 Layer=0"
- 0.0% 0.001 ms "Culling props"
- 100.0% 62.532 ms "DeviceRender"
- 0.0% 0.025 ms "vtkRenderer::UpdateCamera"
- 0.0% 0.001 ms "vtkRenderer::UpdateLightGeometry"
- 0.0% 0.001 ms "vtkOpenGLRenderer::UpdateLights"
- 100.0% 62.501 ms "vtkOpenGLRenderer::UpdateGeometry"
- 0.0% 0.015 ms "Opaque Geometry"
- 100.0% 62.481 ms "Translucent Geometry"
- 100.0% 62.479 ms "vtkDualDepthPeelingPass::Render"
- 0.0% 0.001 ms "vtkDualDepthPeelingPass::Initialize"
- 4.1% 2.586 ms "vtkDualDepthPeelingPass::Prepare"
- 95.0% 2.457 ms
"vtkDualDepthPeelingPass::CopyOpaqueDepthBuffer"
- 4.0% 0.103 ms
"vtkDualDepthPeelingPass::InitializeDepth"
- 98.4% 0.102 ms
"vtkDualDepthPeelingPass::RenderTranslucentPass"
- 51.2% 31.968 ms
"vtkDualDepthPeelingPass::PeelVolumesOutsideTranslucentRange"
- 100.0% 31.966 ms
"vtkDualDepthPeelingPass::RenderVolumetricPass"
- 30.4% 19.021 ms "vtkDualDepthPeelingPass::Peel"
- 0.4% 0.074 ms
"vtkDualDepthPeelingPass::InitializeTargetsForTranslucentPass"
- 86.4% 0.064 ms
"vtkDualDepthPeelingPass::CopyFrontSourceToFrontDestination"
- 0.6% 0.123 ms
"vtkDualDepthPeelingPass::PeelTranslucentGeometry"
- 98.7% 0.122 ms
"vtkDualDepthPeelingPass::RenderTranslucentPass"
- 0.2% 0.044 ms
"vtkDualDepthPeelingPass::BlendBackBuffer"
- 2.5% 0.466 ms
"vtkDualDepthPeelingPass::EndTranslucentOcclusionQuery"
- 0.3% 0.049 ms
"vtkDualDepthPeelingPass::InitializeTargetsForVolumetricPass"
- 90.2% 0.045 ms
"vtkDualDepthPeelingPass::CopyFrontSourceToFrontDestination"
- 88.7% 16.878 ms
"vtkDualDepthPeelingPass::PeelVolumeGeometry"
- 100.0% 16.876 ms
"vtkDualDepthPeelingPass::RenderVolumetricPass"
- 0.2% 0.044 ms
"vtkDualDepthPeelingPass::BlendBackBuffer"
- 7.0% 1.330 ms
"vtkDualDepthPeelingPass::EndVolumetricOcclusionQuery"
- 10.2% 6.349 ms "vtkDualDepthPeelingPass::Peel"
- 1.2% 0.075 ms
"vtkDualDepthPeelingPass::InitializeTargetsForTranslucentPass"
- 87.5% 0.065 ms
"vtkDualDepthPeelingPass::CopyFrontSourceToFrontDestination"
- 2.0% 0.124 ms
"vtkDualDepthPeelingPass::PeelTranslucentGeometry"
- 98.7% 0.123 ms
"vtkDualDepthPeelingPass::RenderTranslucentPass"
- 0.7% 0.044 ms
"vtkDualDepthPeelingPass::BlendBackBuffer"
- 8.9% 0.565 ms
"vtkDualDepthPeelingPass::EndTranslucentOcclusionQuery"
- 0.8% 0.049 ms
"vtkDualDepthPeelingPass::InitializeTargetsForVolumetricPass"
- 90.2% 0.045 ms
"vtkDualDepthPeelingPass::CopyFrontSourceToFrontDestination"
- 76.8% 4.878 ms
"vtkDualDepthPeelingPass::PeelVolumeGeometry"
- 100.0% 4.876 ms
"vtkDualDepthPeelingPass::RenderVolumetricPass"
- 0.7% 0.044 ms
"vtkDualDepthPeelingPass::BlendBackBuffer"
- 8.9% 0.563 ms
"vtkDualDepthPeelingPass::EndVolumetricOcclusionQuery"
- 4.0% 2.492 ms "vtkDualDepthPeelingPass::Peel"
- 3.0% 0.074 ms
"vtkDualDepthPeelingPass::InitializeTargetsForTranslucentPass"
- 87.7% 0.065 ms
"vtkDualDepthPeelingPass::CopyFrontSourceToFrontDestination"
- 4.9% 0.123 ms
"vtkDualDepthPeelingPass::PeelTranslucentGeometry"
- 98.7% 0.121 ms
"vtkDualDepthPeelingPass::RenderTranslucentPass"
- 1.7% 0.043 ms
"vtkDualDepthPeelingPass::BlendBackBuffer"
- 12.7% 0.315 ms
"vtkDualDepthPeelingPass::EndTranslucentOcclusionQuery"
- 2.0% 0.049 ms
"vtkDualDepthPeelingPass::InitializeTargetsForVolumetricPass"
- 90.2% 0.044 ms
"vtkDualDepthPeelingPass::CopyFrontSourceToFrontDestination"
- 53.7% 1.338 ms
"vtkDualDepthPeelingPass::PeelVolumeGeometry"
- 99.9% 1.337 ms
"vtkDualDepthPeelingPass::RenderVolumetricPass"
- 1.8% 0.044 ms
"vtkDualDepthPeelingPass::BlendBackBuffer"
- 20.0% 0.498 ms
"vtkDualDepthPeelingPass::EndVolumetricOcclusionQuery"
- 0.1% 0.056 ms "vtkDualDepthPeelingPass::Finalize"
- 94.8% 0.053 ms
"vtkDualDepthPeelingPass::BlendFinalImage"
- 0.0% 0.001 ms "Overlay"
- 1.8% 1.118 ms "glXSwapBuffers (may stall for VSync)"
On Fri, Jul 21, 2017 at 2:16 PM, mikewithascarf via vtkusers <
vtkusers at vtk.org> wrote:
> Hi! I'm attempting to speed up some image rendering (lots of images in
> sequence). Right now rendering time varies a lot, anywhere between 0.001
> and
> 0.059 seconds. Here is my pipeline:
>
> vtkImageData (3D) -> vtkImageReslice -> vtkImageMapToColors (using a lookup
> table with color/opacity) -> vtkImageActor -> vtkRenderer -> QVTKWidget
>
> I move the vtkImageReslice through the 3D volume, displaying images as I
> go.
> Is there any way to speed things up? I'm in release mode, using a NVidia
> GTX
> 1070. If I could get it to always be less than 0.012 seconds that would be
> great. Here are example timings for multiple frames in a row:
>
> 0.001 s
> 0.006 s
> 0.059 s
> 0.002 s
> 0.014 s
> 0.003 s
> 0.013 s
> 0.011 s
> 0.036 s
> 0.001 s
> 0.038 s
> 0.001 s
> 0.028 s
> 0.001 s
>
> It's not even consistent per image. If I run the same test multiple times,
> different frames will have very different render times. Any help would be
> awesome!
>
> Mike
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.
> com/image-rendering-speed-tp5744115.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
--
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee. Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170721/ab364cc9/attachment.html>
More information about the vtkusers
mailing list