MantisBT - VTK
View Issue Details
0007111VTK(No Category)public2008-05-28 09:282016-08-12 09:54
Julian Ibarz 
Dave DeMarle 
normalmajoralways
closedmoved 
 
 
0007111: Performance problem when picking very large polydatas with vtkVisibleCellSelector
I'm drawing a polydata that contains about 1 million of triangles. I want to select some triangles, I use vtkVisibleCellSelector. Actually VTK works as follow :

First rendering :
Compiling the display list for each actors. (for 1M triangles it takes about 8-10 seconds in my computer).
Call the display lists (it takes under 1 second).
Time to render : about 10 seconds.

Second rendering :
Call the display lists (it takes under 1 second).
Time to render : under 1 second.

etc.

Picking :
Rendering the actors modifying the coloring to make pick color.
It takes 0 seconds if the rectangle selection is very little and maximum about 2 seconds if the rectangle contains the entire object.

Rendering after a picking :
It recompiles the display lists because the polydatas have been changed when picking.

So in the point of view of the user when he makes a rubberband selection (even if the selection is very little) it tooks : 0-2 seconds to pick + 7 seconds to recompile the display list + 1 second to render so it takes more than 8 seconds to make a picking !

I made a patch that disable the recompilation of the display lists after a picking so instead of taking 8 seconds it takes only 2 seconds for a little selection and 4-5 seconds for a big selection.

So more the scene drawing is complex more the picking take times. With my fix, the time is in function of the size of the selection and is more than two times faster than the actual picking of VTK. And for a point picking (like selection one cell), this patch permits to vtkVisibleCellSelector to be more efficient than vtkCellPicker ! On 1M triangle a cell picking using vtkVisibleCellSelector take about 1-2 seconds and a vtkCellPicker take about 3 seconds on my computer.
The patch works as follow :

A vtkInformation key is append to the class vtkPainter (vtkPainter::PREVIOUS_RENDERING_FOR_SELECTION). When a rendering selection is made this information is added to the painters and becomes true. And on the end of a rendering of a painter this information is removed.

So in vtkOpenGLDisplayListPainter, if the PREVIOUS_RENDERING_FOR_SELECTION exist and is true, the compilation of the display list is skipped.
No tags attached.
patch picking.patch (6,253) 2008-05-28 09:28
https://www.vtk.org/Bug/file/6505/picking.patch
Issue History
2008-05-28 09:28Julian IbarzNew Issue
2008-05-28 09:28Julian IbarzFile Added: picking.patch
2008-07-25 05:25Julian IbarzNote Added: 0012818
2008-07-25 07:23François BertelStatusbacklog => tabled
2008-07-25 07:23François BertelAssigned To => Dave DeMarle
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036979
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0012818)
Julian Ibarz   
2008-07-25 05:25   
I made another patch more cleaned and works with 5.2 branch of VTK. Not sure it works with the last cvs version.
(0036979)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.