[Feature request] Add per-instance visibility support to InstanceMesh
See original GitHub issueIs your feature request related to a problem? Please describe.
In the project I’m working on (a 3d editor) we have objects in the form of AABB boxes. We have all objects invisible by default and show them when highlighted or selected. The problem arises when selecting a group with many children, which should become visible. Instancing is a perfect solution for this, but we would need a way to show/hide them individually. I’m not sure how possible this request is, or if there’s a way to do this that I missed.
Describe the solution you’d like
A way to set visibility of each instance, like currently exists for color. setVisibilityAt()
and getVisibilityAt()
, for example.
Describe alternatives you’ve considered
I’ve tried setting the scale to zero, but I need to use the raycast on those invisible objects (in the editor objects are highlighted on hover and selected on click).
Additional context
This is what I want to achieve https://gfycat.com/QuestionableOilyLeech
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (3 by maintainers)
Top GitHub Comments
Notice that an additional instanced attribute that controls visibility will not improve the performance. It might be preferable to organize your instances in a way such that the visible instances are defined first and after that the invisible ones. In this way, you can use the count property to decrease the effective draw range.
This will produce the same result and you will have better performance. Of course you have to do more work at app level to get things going.
This is my solution: