-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Line2NodeMaterial: Add opacityNode
support
#29964
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I had to modify @Mugen87 let me know what you think of it, i didn't see bad side effects |
opacityNode
support
Wide line materials do not support alpha because of the resulting artifacts, see #23680. I'm not familiar enough with the wide line implementation so I hope @WestLangley or @gkjohnson can have a look at this PR. |
Without something like a stencil test (see #23680 (comment)) it won't be possible to avoid these artifacts. Even with the pre-depth / stencil test, though, overlapping lines won't display correctly which would be even more noticeable with per-line opacity. I don't have strong opinions on this other than it won't look right or work "out of the box" in the connected line segments case - this can be useful for users who know how to work around it, though. Separated line segments should look okay, as well. With more control over render order or ability to render an object with two passes in three.js it would be more possible to make a variant of this that "just works" (overlapping aside). I wonder if something like a compute shader rasterizer or some custom per-segment depth adjustment could help with the artifacts. |
@WestLangley Edit : My bad it still not working, i didnt see than i remove More complex approach like suggest by @gkjohnson might be necessary for it ? |
I ported https://github.com/pmndrs/meshline/ to nodeMaterial today and it's working great with alpha / uv / map / dash / gradient / etc.., i can clean it and will open a new PR. Is there a reason why threejs used another approach than this one ? |
This is years ago but originally we wanted to port this implementation, see #11040. We've decided for #11349 though because it was more robust ( |
Related issue: #29962
Add opacityNode support to line2NodeMaterial
wip : worked almost straightforward but at the intersection of line there is a round corner added