Prioritize higher renderingGroupId for onPointerObservable picking events?

Unsure if this is feasible, and I realise renderingGroupId is more about forcing render order, but I was wondering if it could also be (optionally?) factored into scene.onPointerObservable picking events i.e. meshes with higher renderingGroupIds would be prioritized in picking events, regardless of actual mesh depth along the picking ray? I’d imagine this might have a performance hit?

I have some conflicting pickable meshes in a scenario where I can’t use the utilityLayer and scene.onPonterObservable doesn’t seem to use a multi-pick ray - it always returns the first hit?

1 Like

I reckon ignore this request :slight_smile:

I was just being lazy in proposing a quick (and dirty) workaround. I spent some time extending my asset loader, HUD and various other systems to support both the main scene and the utility layer, so in combination with renderingGroupId, I was able to get everything layered correctly and picking without conflicts.

2 Likes