How to draw 10000+ object?

Hello,

I work in petroleum industry, and I’ve seen similar applications to render oil rigs and refineries with millions of parts. Do you need to render all the millions of actors? Short answer: no. Long answer: if you do need a large number of actors, one approach to such problem is to use an hierarchical one. I mean, no one can actually view the entirety of such complex objects. One either views the whole model in low detail or views a smaller part in more detail. Either way, you never actually need more than a hundred actors. Your software must be smart. It must discard, load and display actors as they are needed.

For your example: when one views the entire car, you don’t need to render its innards. If the user wants to view the engine, you don’t need to render the other parts of the car and so on. Does it make sense? This can be done on demand or handled automatically.

A scene-graph-based API naturally handles that like charm, but VTK is pipeline-based, so you need to be smart to achive that kind of functionality (e.g. with stacks or using a tree data structure). For example, you can keep all the 10000+ actor objects in memory only, but send to VTK for rendering only the few ones that will be actually viewed as you move about. The pre-selection of actors is mainly affected by: viewing frustum and object occlusions. So, first discard actors whose bounding boxes are outside the viewing frustum volume. This can be relatively easily done with optimized spatial queries on an octree, for example. Discarding actors that would be hidden by foreground ones is a bit more challenging but it’s not rocket science. In the figure below, some of the column actors do not need to be sent to VTK because they are completely hidden by the Pantheon.
image
One way to perform this pre-selection efficiently is with a “shadow frustum”, which is presented here: https://dspace5.zcu.cz/bitstream/11025/6658/1/Papaioannou.pdf .

I hope this helps you get started.

regards,

Paulo

5 Likes