Volume disappears when mixing with polydata [VTK 8.2 - bug]

Hi,

We are using VTK for 3D rendering in our image analysis software and lately we are trying to migrate to VTK 8.2 as the version we are using (VTK 6.3) isn’t anymore compatible on newer OSX system (because of the used JOGL library version).
As every time we migrate to a new VTK version we need to address some problems to get everything working properly… I think the difficulties comes from the fact that we have a Java application (so we are using the java wrapper) and we also need to use the OpenGL window component for display (again because of issues with OSX when trying to use native window component) with OpenGL2 backend.
Anyway, that said i was able to sort almost of all the issues i had and only one remains but having spent several days on it, i was not able to sort it yet:
When using the vtkFixedPointVolumeRayCastMapper for 3D volume rendering (we cannot just stick to the GPU accelerated one, again because of OSX systems which doesn’t always handle them correctly) it looks like there is a rendering bug when we try to mix volume with polydata. As soon we have polydata visible then the volume disappears. The bug only occurs with the vtkFixedPointVolumeRayCastMapper mapper (GPU is ok) and only when polydata is visible.

An animation probably explains better than words (on the animation we can see some residues of the volume sometime but almost of time it just completely disappears):

Animation

If i disable the IntermixIntersectingGeometry flag by using IntermixIntersectingGeometryOff() the bug disappears but obviously the rendering is wrong then (bad mixing between the polydata object and the volume).

Investigating some time in the code, it looks like the bug come from the way the ZBuffer is captured (CaptureZBuffer() method) but i couldn’t find a workaround to avoid the problem unfortunately.
Is it a known issue ? Is there a solution to overcome it ? I tried to use different version of Paraview (i’m not sure which version use VTK 8.2 internally) but i wasn’t not able to reproduce the problem in it, still i think it doesn’t use the OGL component so that may explains the difference.

Thanks for any help or advice !

Best,

– Stephane

I tried to use VTK 8.0.1 and VTK 8.1.2, and it’s working correctly on VTK 8.0.1 but 8.1.2 is affected by the same issue… i will continue to investigate to see where the bug appeared. I cannot use recent VTK 9.0 as i saw that M1 target is not yet supported for these versions and we want to support them.

Best,

– Stephane

Same issue with addactor2d on vtk 9.2.6 on mac with windows parallels.

Anyone help please ?

So here is some work around that working :

Actually I see that

vtkUnstructuredGridVolumeRayCastMapper.cxx

and

vtkFixedPointVolumeRayCastMapper.cxx

Both doing Capture the zbuffer but slightly different code , will go compare to see if its the same.

Actually only SetMultiSamples(0) is enough and everything is ok (:

Can anyone pleaseeee explain why ?

I see examples and here also doing the same with rendering polydata with fixed vtkFixedPointVolumeRayCastMapper


So I FINALY FOUND THIS !!!

// APPLE Intel systems seem to have buggy multisampled AMAZING FIX

What about if I compile\build VTK without APPLE flag for windows parallels on MAC APPLE ?

If you’re compiling for Windows, VTK is targeting Windows. VTK has no idea what VM (if any) is in use or what platform is running the VM. Forwarding hardware into VMs is always a hairy question for “what is supported” as there can be different interactions at the VM boundary.

In my case, the APPLE tag has no rule, the fix should be :

GetVendor().find(“parallels”) → || is apple tag set and vendor is intel
{
… setmultisamples=0
}

I don’t run on mac OS , I run on windows Paralles installed on MAC

A merge request updating the check would be appreciated. I don’t know if any VTK developers have your setup to test that it is working as you intend.

Done :

https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10246#ac594c483e90a1f2ca197fdbd19c0dd9bfa3f3ef