MantisBT - VTK
View Issue Details
0007296VTK(No Category)public2008-07-07 08:142016-08-12 09:55
Julian Ibarz 
Kitware Robot 
normalfeatureN/A
closedmoved 
 
 
0007296: Not erasing Z-buffer on selection rendering
When using pick color selection, only the pickable actors are drawn. But they could be hidden by an unpickable actor in a normal rendering and the user could select an unvisible actor that is not desired in general.
A workaround is to set all the actors pickable to be sure that all the actors will be drawn on pick color rendering. But if we have a scene that contains 1000 actors and we have only 10 actors really pickable for the user we will draw 990 actors for nothing. I tried this solution but it's too slow for my purpose.

A solution is to not erase the z-buffer before making a rendering selection so only really visible actors will be drawn. This permits to gain more than 1 or 2 seconds for really big scenes.

I made a patch to do that. The feature is used as follows :

    vtkVisibleCellSelector selector = new vtkVisibleCellSelector();
    selector.SetRenderer(canvas.GetRenderer());
    selector.SetArea(firstPoint[0], firstPoint[1], secondPoint[0],
        secondPoint[1]);
    selector.SetRenderPasses(0, 1, 0, 0, 1, 0);

    canvas.lock();
    canvas.GetRenderer().ClearDepthForSelectionOff(); // Do not erase the Z-buffer on selection rendering
    selector.Select();
    canvas.unlock();

It's a very light patch not intrusive and I think it should help some projects.
No tags attached.
patch 01_depth.patch (2,249) 2008-07-07 08:14
https://www.vtk.org/Bug/file/6583/01_depth.patch
Issue History
2008-07-07 08:14Julian IbarzNew Issue
2008-07-07 08:14Julian IbarzFile Added: 01_depth.patch
2008-10-16 04:36dbarbierNote Added: 0013890
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0036996
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0013890)
dbarbier   
2008-10-16 04:36   
This flag has been added in CVS HEAD into vtkRenderer, or more precisely
an inverse flag (named PreserveDepthBuffer), it would be really nice if
it could also be added to 5.2 branch.

It is used by vtkHardwareSelector, and even enabled by default, this means
that there is some demand for this feature ;-)
Thanks
(0036996)
Kitware Robot   
2016-08-12 09:55   
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.