-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Specify opacity in LineMaterial object properties #16570
Specify opacity in LineMaterial object properties #16570
Conversation
In other words, as it stands now, I would not be inclined to add opacity support. Can you please explain your use-case? |
Thank you for your reply. I understand your concern with the artifacts. My use-case is a data visualisation composed of many flat shaded or wireframe polygons. The visualisation must work on different platforms/browsers and looks best when using lines that are both fat and transparent (better readability). The artifacts don't affect my use-case much as the joins are obfuscated by other geometry, though, disabling Does this use-case make sense or is it clasping at the edges of what Regardless, I can keep using Also, what is the future plan for |
Try THREE.MeshLlne. It bevels corners, instead. |
I have attempted to use My use-case requires that I can draw the wireframes of meshes, of which |
Are you drawing only the wireframes of meshes? If so, you can just render the mesh, discarding the center of each triangle. I would expect such a technique would support opacity. https://codeflow.org/webgl/barycentric-wireframe/www/ And this three.js example, but it is old and needs work: https://threejs.org/examples/webgl_materials_wireframe.html |
Closing since #16570 (comment) explained why transparency is not supported for wide lines. The alternative solutions mentioned in #16570 (comment) are reasonable workarounds. |
Change
When using
LineMaterial
I would like to specify an opacity value to create transparent lines. Currently, you must dive into the uniforms to set the opacity like this:This pull request changes
LineMaterial
so that a more direct approach can be used to set the opacity:This change makes
LineMaterial
more consistent with existing materials, despite not being properly "wired-in" as a built-in material yet (#11349 (comment)).Testing
To test this change you can modify the
webgl_lines_fat_wireframe.html
example. E.g: Addtransparent: true
andopacity: 0.1
tomatLine
which is defined on line 102.