Hello everyone! I want to render (2D and 3D) many shapes, mostly polyhedrons and partially voxels. I group them into groups (do not worry how we decide on the grouping but it can be in the order of thousands) and we need to be able to change each group’s color and opacity.
Our current flow (described into detail later) does not scale as expected e.g., a testcase with 150,000 voxels and 850,000 polyhedrons grouped in 15,385 groups renders with 0.4fps on 2D and with 0.3fps on 3D which makes the application unusable, so I am wondering how to improve it.
- Parse data (don’t worry about that)
- Create a list of
MergePointsOn()), a filter for each group of shapes
- Create a
vtkUnstructuredGridfor each group of shapes like this:
-If the shape is a cuboid, insert in grid as
-If the shape is polyhedron, insert in grid as
- For each
vtkDataSetMapperand set input data:
vtkActorand set the mapper
- Colors and opacities are changed interactively for every
Some important notes:
- We have limited hardware resources: no GPU
- Shapes can be abutting or overlapping but usually only within the same group
- We want the edges of the shapes to be visible (currently we do it with
- Currently using
I have been looking for a solution in many posts here and around the web with no luck so here are some questions:
- Do you see any flaws in our flow? Because to my knowledge, this is a standard flow
- Given the type of geometry/shapes are the selected VTK structures the most appropriate (
- Last… is there a way to improve performance outside the code e.g. with some OpenGL settings? As mentioned earlier, GPU is not available and OpenGL cannot be upgraded.