Skip to content

Fix multi-view picking

Paul Lemire requested to merge lemirep/qt3d:patch2 into kde/5.15

When using Scene3DView, qt3d still has a single scene graph and and a single framegraph. It automatically creates layers and layer filters to make sure the right objects are only rendered in the right view.

This affects picking though as it was not aware of layer filters. This patch collects the filtered layers for each view and makes sure only entities matching those layers are tested for picking (this uses code that existed for ray casting).

This changes the behavior of Qt3D though as non rendered objects (ie, excluded by layer filtering) are no longer pickable. Only way now would be to provide a shader that just discarded everything.

Note: Scene3DView is not available in Qt6 so on this branch this only really affects custom scenes with multiple views each showing different content.

[ChangeLog] Non rendered entities (due to layer filtering) are no longer pickable

Ticket-number: QTBUG-94214 Change-Id: I8515368e43342b33ac219dff533e92efa72fbe7d Reviewed-by: Paul Lemire (cherry picked from commit d7937673) Reviewed-by: Mike Krus

Merge request reports