Skip to content

Fix two issues with picking on large datasets

Ken Martin requested to merge ken-martin/vtk:fix_high24_picking into master

The first issue was that the high24 cellid pass was never invoked. Very simple fix in a for loop.

The second issue was more complicated. With large datasets the algorithm break the attribute id passes (point and cell) into two 24 bit passes. That way it can handle larger datasets. The algorithm does low24, high24 and then low24 a second time. Recall that these values can be remapped by data arrays on a dataset and the raw opengl values have to be converted to vtk values. During the first low pass, when the high data is not yet available, those conversions can easily underflow or overflow as the numbers we are working with are not correct. They are missing their top 24 bits. This patch fixes those cases to avoid those issues (which often result in a segfault)

At the same time the old code was adding 1.0 to all the values written to the framebuffer and then later subtracting 1.0 to account for it. This added some complexity to a number of places in the code. This change removes that logic for all passes except for ACTOR and PROCESS. The actor pass does use 0 to indicate a miss. The process pass uses 0 to indicate no process information.

One additional change is to replace some of the ++, --, code with += or -= ID_OFFSET to make it more clear where these +1 offsets are being used in the HardwareSelector.

Merge request reports