Volume opacity

Hi everyone,

I’ve met a problem when trying to change the volume opacity, see these pics:



When a volume is placed in a same renderer with a polyData actor and is applied an RGBTransferFunction and a PiecewiseFunction.

If I change the opacity of the actor by calling actor.getProperty().setOpacity(number), part of the overlapping part of the volume becomes invisible, seems like that part did not join the opacity test, looks similar to the situation that the blend is disabled and depth test is enabled.

Is there anyway I can do to change this behavior? The expected result should be that the part of the volume is visible.


What you want to achieve can only be done with a DepthPeeling technique however it has not been implemented yet in VTK.js.

It would be a great feature to add indeed. We would be happy to help you with the implementation of such feature.

Hi Julien,

Is it a kind of achievement like this example? WebGL 2 Example: Order-independent Transparency

I’m still studying on it, my CPR will also need this, if it is finished, I can continue with the implementation.

WebGL 2 Example: Order-independent Transparency

This won’t do it. It is not fit to support both meshes AND volumes. Only DepthPeeling will work with my understanding.

You can look at the VTK C++/OpenGL implementation.