drei
drei copied to clipboard
Introduce into Points, per-Point (vertex) alpha
Describe the feature you'd like:
three's default points supports per-vertex opacity: https://codesandbox.io/s/react-three-fiber-per-vertex-opacity-6ox99v
I would drei's Points API (buffer and Point
) to support individual opacity, for feature parity.
Suggested implementation:
To keep drei's API congruent with three, I would suggest allowing passing of a 4-tuple to Point
's color
prop, like so: https://codesandbox.io/s/react-three-drei-per-vertex-opacity-p6by7r?file=/src/App.tsx
This alone is not enough, because Point
's color
attribute only supports a 3-tuple, and itemSize
attribute is not exposed. I would suggest that, when the transparent
prop is present on Points
, to set itemSize
4 for color
. This is a bit "magical", but it is straightforward and expected.
I would also like to see this feature! I'm not sure how best to implement it, but it's definitely an important effect in some situations to be able to control per-point opacity. (For variation and for fading in and out!)