raycasting initially renders at low resolution

Hi VTK-experts,
I’m working on an app for viewing CT scans in 3D or 2D. When I initially render the CT scan in 3D, the raycast rendering looks great (see the attached normalResolution.png). However, when I switch from a 2D view (performed via a vtkImageViewer2) back to the 3D raycast rendering, the resolution is low (see the attached lowResolution.png). As soon as I interact with the 3D rendering, the resolution returns to normal.
Can anyone tell me how to fix this? I have AutoAdjustSampleDistance set to “off” on the vtkFixedPointVolumeRayCastMapper that I’mnormalResolution lowResolution using for the raycasting. I would have thought that this would keep the resolution of the raycasting constant.
thank you in advance,

You may also need to fix image sample distance, for example:


You can also set the render window’s DesiredUpdateRate to a very low value to effectively disable level-of-detail rendering; or change interactor style to not invoke interactive mode related events.

Note that these are all useful features that allow your renderer to work reasonably well in a wide range of hardware environments, so I would recommend to not disable level-of-detail rendering but find combination of values that work well (or maybe have 2-3 quality levels that users can choose from, depending on their hardware capabilities).

I have a very similar problem.
I am using the latest VTK v8.2.0 from a Java application.
I am rendering a volume through vtkFixedPointVolumeRayCastMapper.

Even if I set:

// Initialize the mapper
volumeMapper = new vtkFixedPointVolumeRayCastMapper();



the very first rendering of my volume appears very low resolution:

Then, the first time I interact with the view (mouse drag to rotate the camera), then my rendering restores to high resolution, and remains hi-res from now on:

Can you guess why the very first rendering of my CPU volumer mapper is so low res? How to fix this?

Thanks in advance.
Best regards,

Marco Sambin

Thanks Andras and Marco. I’m using VTK 8.1 in C# and when I implement Andras’s suggestions, I still get the same problem. Here’s a snippet of the code I’m currently using:

var VolumeMapper = vtkFixedPointVolumeRayCastMapper.New();

Note that I’m using the default value of ScalarOpacityUnitDistance (i.e., 1), so it should not be affecting VolumeMapper’s ImageSampleDistance.

Do you get lower quality rendering only on the very first render? Does it help if you force a few renderings after you add the volume mapper to the renderer?

Hi, and thanks for your reply.

In my case, just forcing additional renderings does not help. I can even zoom, azimuth, tilt my camera programmatically (pressing buttons on my GUI), but my rendering remains low-resolution until I interact with the scene through the mouse (i.e., through the vtkCanvas interactor).
Ideas about what the Interactor does to trigger the high-resolution rendering?
Thanks in advance and best regards,


The interactor emits start/end interaction events, you can try to invoke these and see if they make a difference.

Hi Andras,

thanks a lot for your reply.
If I correctly understood your suggestion, it didn’t help in my case.
Here is what I’ve done, in code (consider that I am working in Java, and this code is in the initialization of my vtkCanvas-derived panel):


  final vtkGenericRenderWindowInteractor interactor = getRenderWindowInteractor();

  ActionListener laterGUITask1 = new ActionListener() 
    public void actionPerformed(ActionEvent evt) 
  javax.swing.Timer laterGUITaskTimer1 = new javax.swing.Timer(5000, laterGUITask1);


In order to ensure that I am invoking the appropriate events, I also added the following Observers on my interactor:


  interactor.AddObserver("StartInteractionEvent", this, "interactorStartInteractionEvent");
  interactor.AddObserver("InteractionEvent", this, "interactorInteractionEvent");
  interactor.AddObserver("EndInteractionEvent", this, "interactorEndInteractionEvent");


and I can indeed see that these events are the ones which are called when I am interacting with my 3D scene through the mouse.

However, explicitly invoking these events in my timer (just to simulate a “delayed” invocation, exactly as happens when I start interacting with the scene through my mouse) does not change the situation: rendered volume remains “low resolution” until I drag it with the mouse. In particular, now that I am observing the interaction events, I can say that the resolution is fixed upon the “InteractionEvent” (i.e., mouse drag). Just pressing (“StartInteractionEvent”) and releasing (“EndInteractionEvent”) my mouse button without moving the mouse doesn’t fix the low resolution issue. Resolution is fixed at the first drag (“InteractionEvent”).

Any other idea about how to fix the initial rendering of my vtkFixedPointVolumeRayCastMapper?

Thanks a lot in advance for any suggestion.
Best regards,


You can have a look at what happens when you click and drag the mouse and call the exact same methods.

Does rendering work correctly with the GPU volume renderer?

Did anyone succeed in solving this?

I appear to have a similar issue, I need to interact with the render window before the full resolution is achieved. However, I’m not using vtkFixedPointVolumeRayCastMapper however, just showing simple Sphere sources.

I’ve tried invoking events as:


However, no success, the initial image is very low resolution.