I am trying to set opacity for vtkActor but any value less than 1.0 makes it invisible completely.
Opacity test example is working fine. What I am missing here?
Using vtk 8.2.0.
I am trying to set opacity for vtkActor but any value less than 1.0 makes it invisible completely.
Opacity test example is working fine. What I am missing here?
Using vtk 8.2.0.
If you have semi-transparent actors in the scene then you need to order their cells for correct rendering, for example by enabling depth peeling.
SetOpacity is working by taking out UseShadowsOn(). Without enabling peeling.
@lorensen It seems that https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/Opacity/ example is somewhat misleading. It would be better to add at least an option to use depth peeling.
@rai-sam Correct rendering of translucent geometry is shown in this example: https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/CorrectlyRenderTranslucentGeometry/
In some cases, from some viewpoints, some arrangement of objects, translucent objects may look like correctly rendered. However, in general you need to use depth peeling - or other polygon sorting method, or more sophisticated rendering approaches, such as raytracing - to render translucent objects correctly.
Yes, depth peeling affects rendering speed. 5-10 years ago this was a significant issue but nowadays this performance impact is rarely a problem.