-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use alpha value from vertex colors in LineMaterial and LineGeometry #92
Use alpha value from vertex colors in LineMaterial and LineGeometry #92
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/three-stdlib/B7wAERGMCY5beH63G381DuoBtwEU |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e39eb68:
|
I think I'll have to rebase this and use an alpha define. three.js built-in defines and shader magic are very much internal and unstable, the defines in question come from: |
@CodyJasonBennett Thanks for reviewing the PR (after it sat there for a long time untouched and sad ;) ) Have you reimplemented the feature in another way? |
None other than https://github.com/pmndrs/meshline no. The above |
Okay, thanks for the explanation! |
Implemented in #335. |
Why
Ability to pass an alpha value as fourth vector component to vertex colors in order to paint a line with varying opacity per vertex.
What
Allowed to set the item size for vertex colors in
LineGeomtry
andLineSegmentsGeometry
.Extended the shaders in
LineMaterial
to be able to use the alpha value from the vertex colors.Checklist
There are still some minor issues that should be improved and for which I need some help.
E. g. I used a varying
vAlpha
to pass the alpha value from the vertex shader to the fragment shader. It should be possible to just use the fourth component from the varyingvColor
as alpha value. But somehow the size of vColor does not properly adapt. It should be a 4 component vector ifUSE_COLOR_ALPHA
is defined, but somehow it isn't.Any help would be much appreciated.