Caching of rendering results in VTK render window layers?

Hi all,

We would like to draw some simple 2D polygonal geometry on top of a volume rendering. The drawing of the polygonal data should ideally rendered at a high frame rate, because it is supposed to follow the mouse and if the frame rate is too low, the geometry will be perceived as “lagging behind” the mouse movements.

Is it possible to have VTK cache the result from the volume rendering in the layer underneath, which is somewhat slow to render from scratch, so that a when the render window is re-rendered, the cached result from that layer, which is unchanged, could simply be blended with the result from the layer on top? Or is this already happening by default?

The drawing we wish to do on top is a simple horizontal line across the view, which always follows the mouse.

You should activate the “BackingStore” option on the renderer that contains the volume rendering and leave normal the renderer that contains the simple 2D polygonial

Thanks Simon, we will have a go at this.

@estan As long as nothing is changing from the point of view of the volume mapper (input image data, volume properties, camera, etc.), it wouldn’t re-render. There are multiple MTime checks in the GPURender call of the GPU volume ray cast mapper. Having said that, it is possible that we are missing some checks. Do you see the volume re-rendering due to something that shouldn’t trigger that?