I create a vtkpolydata and a vtkImagedata ,add a vtkActor and vtkVolume to the same render,the vtkpolydata is a closed surface, and intersect with the volume .
when I set the vtkActor opacity to 1,
actor->GetProperty()->SetOpacity(1);
it looks all right,but when i set the opacity to 0.5,
actor->GetProperty()->SetOpacity(0.5);
it looks strange , like the volume covers the suface , I don’t know what caused this problem,
Can you give me some advice? thanks
You need to enable the Depth Peeling for volumes on your vtkRenderer
See methods : UseDepthPeelingForVolumesOn
And UseDepthPeelingOn
Also you will need a call to SetAlphaBitPlanes(1) and SetMultiSamples(0) on your render window
Glad it works for you
I’m not a specialist but I believe SetMultiSamples to 0 is meant to disable the hardware antialiasing. That should be a condition for the Depth peeling to work correctly. And probably the same goes for the alpha bit planes, maybe some experts can highlight you here…
Anyway, the images looks nice, so it is indeed working
Have a nice day