-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
webgl: use Processing's line vertex shader #2515
Conversation
also fixes #2324, which is a major bonus So I still feel like that snapping that I mentioned in #2488 is too pronounced. You are right that Processing has it, but it is significantly less severe in Processing. Over here it feels like a too big of a problem to ignore. You can see this by rotating any primitive with a large stroke. For example this shows the effect pretty strongly:
This shader does look better otherwise but this is definitely something we should fix before merging. We could probably move the edge toward the camera but then we will probably hit similar problems to #2510 again. I see that the problem is one half of the edge appearing suddenly but I don't understand why the billboarding is sometimes gradual as expected and sometimes it goes from full invisibility, perpendicular to camera, to being fully parallel to the camera in what seems like a single frame. |
Looking at this some more it might be something worth pinging Processing folks about too because it seems shader specific and it definitely is noticeable on their end too now that I am remembering to account for the difference in strokeWeight |
yeah, the snapping is definitely bad. but it's there in master, also.. |
😅 You are very right! I was so caught up in this branch that I forgot to go back to try out the huge strokes on master. I will do a final run through and merge this tomorrow. As for the snapping, it can become a separate issue and we can reach out to the folks that work on P3D and see what they think. The problem seems just as present on Processing even if slightly mitigated by the better joins. |
maybe one way to do this is to project the camera-facing edge quads back onto each face? |
That's a thought. Though now that I have been playing around with Processing more it feels like less of a priority. It might make sense to figure out our joins first. This PR is super straightforward and everything seems to be working nicely with the swap out. Thanks for this! |
ok, this one uses (a tweaked version of) Processing's line vertex shader.
(partially) fixes #2488, fixes #2510.
it doesn't display the same wireframe scaling behavior that Processing does, but it's the same as p5.js currently is.