-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Line vert shader offsets too much on small coordinates #7200
Comments
Definitely ok with going back to a variant of the old shader, but we will need to look back to the discussion of #6956 and figure out a solution that works for all these cases. |
Haven't looked into the details yet, but since it seems to be related to large and small numbers, maybe we would need to pass in a uniform from the camera to know which case it's in and multiply the scale factor appropriately or displace based on that. |
We have |
I'm not a shader expert, but I'll give it a try. Note to self, validation tests: Current bug: Initial bug discussed in #6956 . |
I did PR #7206 based on distance, which works ... It mixes both approaches based on distance. It feels a little hard coded to me, let me know if there would be a better way to do this. |
I've been looking into this a little bit more deeply, the float scale = mix(1., 0.995, facingCamera); Screen.Recording.2024-09-03.at.14.39.40.movNever letting it hit 1 does the trick for small units at least. float scale = mix(0.999, 0.995, facingCamera); It would be nice to find a solution that works for all use cases 🥲 |
Hmm I think the problem with it never hitting 1 is that if you're using WebGL mode to do 2D content, then strokes will always appear on top of fills instead of respecting the last-drawn-wins approach of 2D mode, which this bug was originally filed for: #2938. It could be that in addition to a |
Most appropriate sub-area of p5.js?
p5.js version
1.10.0
Web browser and version
Chromium: 128.0.6613.85
Operating system
No response
Steps to reproduce this
The change here #7064 introduced a bug for small coordinates.
I'm working on updating p5.xr to work with v1.10.0. WebXR uses real world coordinates, as in 1 unit = 1 meter (handy !), so this rendering issue would come up all the time. See the difference with the old shader and the new one:
line-renderer-new.mov
line-renderer-old.mov
The text was updated successfully, but these errors were encountered: