You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you have any thoughts about adding a pickingGeometry feature, sort of analogous to the pickingMaterial feature?
This is coming up for me in a project I'm working on right now where I'm using troika-three-text to render text. Troika uses a totally custom glyph geometry and custom shaders to render a paragraph of 2D text. I was able to make the object pickable with a custom pickingMaterial, which is awesome, but the geometry that is now pickable is not ideal (see protectwise/troika#177 (reply in thread)).
Now I'm wondering if it might be generally useful to be able to present objects to the picker with alternative pickingGeometries. Would it ever make sense for performance to e.g. use a simpler picking geometry than the one used for rendering to the user?
One challenge I guess, compared to a pickingMaterial, is that you would somehow need to keep the pickingGeometry up to date with the actual transformations on the object. Maybe pickingGeometry should be a function that is called with the real geometry as its argument, and returns a geometry to use for picking?
The text was updated successfully, but these errors were encountered:
Actually, this is a really good idea! Initially, I was thinking it would be a bit unwieldy due to having to keep things in sync, but all of that information comes from the object, not the geometry. So syncing them isn't really a big deal, you'd only need to worry about sync if you're modifying the geometry itself (then you'd have to update the picking geometry to match it).
Do you have any thoughts about adding a
pickingGeometry
feature, sort of analogous to thepickingMaterial
feature?This is coming up for me in a project I'm working on right now where I'm using troika-three-text to render text. Troika uses a totally custom glyph geometry and custom shaders to render a paragraph of 2D text. I was able to make the object pickable with a custom
pickingMaterial
, which is awesome, but the geometry that is now pickable is not ideal (see protectwise/troika#177 (reply in thread)).Now I'm wondering if it might be generally useful to be able to present objects to the picker with alternative pickingGeometries. Would it ever make sense for performance to e.g. use a simpler picking geometry than the one used for rendering to the user?
One challenge I guess, compared to a
pickingMaterial
, is that you would somehow need to keep thepickingGeometry
up to date with the actual transformations on the object. MaybepickingGeometry
should be a function that is called with the real geometry as its argument, and returns a geometry to use for picking?The text was updated successfully, but these errors were encountered: