rendering composite data with mixed transparency
I want to render a vtkMultiBlockDataSet with vtkPolyData blocks, where the blocks have cell-scalars with mixed opacity, using vtkCompositePolyDataMapper2. The transparent cells did not get rendered at all whereas vtkCompositePolyDataMapper can render them. I created a script that tests various scenarios and executed it with vtk 8.1.1 and with vtk master. I currently only have vtkpython available on a linux system rendering with mesa, so I don't know what the results are for native graphics.
Four different mapper configurations (left to right):
- a vtkCompositeDataMapper2 (CPDM2) mapping the vtkMultiBlockDataSet
- a vtkCompositeDataMapper (CPDM) mapping the vtkMultiBlockDataSet
- a vtkPolyDataMapper (PDM) mapping all blocks appended into a single vtkPolyData
- a separate vtkPolyDataMapper (PDM) for each of the blocks
Opacity scenarios demonstrated are (top-bottom):
- opaque cylinder, opaque block
- opaque cylinder, transparent block
- transparent cylinder, transparent block
Results for vtk master (commit 80633bad):
I tried to use point scalars instead of cell scalars but this didn't change the results.
Here's the script: composite_opacity.py