Skip to content

Bring 2.0 stroke ordering fixes to 1.x #7996

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

Merged
merged 1 commit into from
Jul 27, 2025

Conversation

davepagurek
Copy link
Contributor

@davepagurek davepagurek commented Jul 27, 2025

Resolves #6386 for 1.x

We noticed that this sketch https://editor.p5js.org/davepagurek/sketches/yohhELoPC works on Mac but not Windows, where strokes don't render and just appear blank. @Stefterv narrowed it down to a change in 1.10.0 (it works in 1.9.4) and that it also works in 2.0.

I realized that this was fixed in 2.0 in #7369 (we also were adding more visual tests and were noticing that some stroke ones regularly fail on Windows) but that the same changes never made it to 1.11.x. This PR git cherry-picks that PR onto the main branch to get the same changes.

There's more context in the comments of that PR, but the main problem is that an earlier change picked a small number that happened to rely on rounding that only happened on Macs, leaving Windows broken by accident. A later change (#7206) made it so that we can just turn that small negative number to 0 and avoid the Windows issues. You'll also see in the diff that the precision was bumped to high to fix discrepancies on mobile too (desktop basically always ignores the precision and uses high, but mobile will treat it differently, which in this case would cause similar visual bugs.)

https://editor.p5js.org/davepagurek/sketches/yohhELoPC now uses a custom p5 build to test the changes.

@davepagurek
Copy link
Contributor Author

@Stefterv doule-checked for me that the sketch works on Windows again so I'm going to merge this in to make the shaders the same again on 2.0/1.x!

@davepagurek davepagurek merged commit 1f68fb0 into processing:main Jul 27, 2025
2 checks passed
@davepagurek davepagurek deleted the fix/strokes-behind-objects branch July 27, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Line shaders not working on Chrome/Linux
1 participant