GeomSubset picking through Hydra?

Hello, we are looking into implementing GeomSubset picking through Hydra (on our application side).

As there is no direct support for this in core Hydra currently, our current approach is the following :
We start with Hydra subprims/components picking (faces, edges, points), and from a pick hit, look at the children of the prim that was hit to find out its geomSubset prims (in the Hydra scene index tree). We then check each geomSubset’s type and contents to find out if there is a match.

However, we have two main concerns with this approach :

#1 : As there is no way from a given prim to know what its geomSubsets are or where they are located in the scene index tree, we resort to depending on the restriction that GeomSubsets in USD must be direct children of their geometric prims, as per the USD documentation (Universal Scene Description: UsdGeomSubset Class Reference) :

To apply to a geometric prim, a GeomSubset prim must be the prim’s direct child in namespace, and possess a concrete defining specifier (i.e. def).

The docs seem to imply this is for efficiency reasons :

This restriction makes it easy and efficient to discover subsets of a prim.

However, the documentation also states that this restriction might be loosened if needed :

We might want to relax this restriction if it’s common to have multiple families of subsets on a gprim and if it’s useful to be able to organize subsets belonging to a family under a common scope.

Our worry is that the restriction gets loosened without ways to keep retrieval relatively efficient. Is this a valid worry, or is GeomSubset retrieval a sufficient performance concern that loosening of this restriction will inevitably come alongside ways to efficiently retrieve GeomSubsets?

#2 : Even once we know where the GeomSubsets are, iterating over their contents could potentially be quite slow, as opposed to say performing a set lookup : is this an issue that you have experienced, or have ideas on how to tackle?

Generally speaking, is this approach suitable, or are there other methods we should be looking at, or are there plans to support GeomSubset picking more directly?

Thanks!

Hi Philippe,
Your general approach of querying the scene index to discover and map the picked element id’s to the subsets sounds correct. It has the benefit of being renderer plugin agnostic, so all renderers would benefit from this. I expect that this logic is triggered only when the user/app is in pickGeomSubsets mode, so it shouldn’t affect picking performance otherwise.

#1. If performance of discovering geom subsets under a prim shows up, you can consider adding a scene index plugin that overlays data on the prim data source to aid performance, or use a scene index that’s registered via the callback mechanism to provide caching and geom subset picking behavior.

If the restriction of the geom subsets being direct children of the prim is relaxed, I still expect that they are descendants of the prim. Geometry prims typically don’t have many children, so my hunch is that is shouldn’t affect performance all that much.

#2. I think the callback based registration for a geom subset picking scene index can help here too.

I’m sure you’re aware, but I’ll call it out nonetheless:
To provide selection highlighting behavior for picked subsets, you’ll need to aggregate all of the element ID’s of each subset to populate the HdSelection entry.

Hope that helps!

1 Like