-
-
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
LinesSegments with World Units have Visible Artifacts from Various Angles (Fat Lines Example) #26916
Comments
Are you able to reproduce and show the issue with just a single line segment? The original thread on the perspective attenuated lines (#16912) contains more information on how exactly the feature works - the vertices effectively form a bounding box around the capsule and then a ray / line segment distance check is used in the fragment shader. It's possible that there's an issue in forming the bounding box vertices or something along those lines if you'd like somewhere to start and take a deeper look. |
I’m unsure if this occurs on a single line segment. Also is there any reason why this isn’t using rectangular prisms per line segment instead of three quads (as I take it this is where things landed based on that thread)? A rectangular prism will always entirely contain a capsule and I’ve had success in using them for rendering thick lines with a similar approach elsewhere. |
Have you tried to reproduce it? I'm not sure where else this kind of artifact could be coming from if not reproduceable with a single segment - it looks like sharper corners near the termination of the lines.
The PR added a flag to the existing Line2 implementation which only supported screenspace thickness and therefore just used three connected quads originally. In theory those three quads (well only really two of them) could be used to fully define the projection of a rectangular prism that was facing the camera which seemed like a simple solution and didn't require changing geometry to toggle. I still think this is a fine solution as long as the math is being handled correctly. |
Agreed. I mentioned the limitation of depth writing here in the original PR. If there's a simple function that gives the surface intersection of a capsule then The quad issue would need to be handled separately. I won't be able to look into this at the moment but if you'd like to try addressing either of them I'm happy to take a look at PRs and help get the fixes merged. |
Description
Artifacts can be see with World Unit lines, visible in webgl_lines_fat example. Attached image with circled problematic regions.
Reproduction steps
Code
Relates to LineMaterial.js
Live example
https://threejs.org/examples/?q=line#webgl_lines_fat
Screenshots
Version
r157
Device
Desktop
Browser
Chrome
OS
MacOS
The text was updated successfully, but these errors were encountered: