tl;dr: I’m trying to achieve the the same effect as a THREE.Sprite
or THREE.Points
across all of my 2D BufferGeometry instances, while still being able to rotate the camera around the geometry. However, doing this in the vertex shader seems like the best option as there may be many points (possibly hundreds of thousands).
Here’s the stackblitz editor link with a very basic framework
More detail:
I’m currently working on a project where I need to create a cloud of points for an interactive data visualization tool. In the past, I’ve accomplished something similar using THREE.Points()
and manipulating them in the fragment shader. You can find the post here from my previous project, where I received invaluable help from @prisoner849
This worked, but I ended up having to use display picking in order to accurately convey when a user was mousing over a point on the screen. This had the limitation of not being able to select points occluding other points in 3d space since it was not using rays, but a flat representation of the scene in memory. I’d like to be able to select points behind others (for example, with a lasso tool of some sort), so gpu picking the way I wad doing it before will not work.
Anyways, I found three-mesh-bvh
, and while messing around with it, it seems awesome, but when using THREE.Points()
there are limitations there, as well (i.e. when having points painted of various sizes, it’s impossible to have pixel-precise picking).
THREE.Sprite()
seemed like a nice option, but it’s essentially just a texture on a plane, and so if I’m doing something with crosses (for example, in the stackblitz link at the top of this post), the transparent areas can occlude the ability to pick objects behind.
Anyways, appreciate any advice you can provide!