Skip to content
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

Fix issues with stroke depth ordering #7369

Merged
merged 4 commits into from
Nov 9, 2024
Merged

Conversation

davepagurek
Copy link
Contributor

@davepagurek davepagurek commented Nov 9, 2024

Resolves #6386

On some machines, for some tests, lines are rendering behind fills in WebGL. This resolves the issue. More info in the comments on what specifically is involved.

@davepagurek
Copy link
Contributor Author

  • highp doesn't make a difference to the test failures but would address Line shaders not working on Chrome/Linux #6386 and prevent mobile issues
  • It looks like Line.vert fix for small units #7206 isn't in the dev-2.0 branch, so I tried adding that. No effect, but it should be here anyway
  • it seems the actual cause is modified stroke vertex shader #7064, specifically the line float zOffset = mix(-0.00045, -1., facingCamera);. It was pushing lines backwards, relying on it to round to the same value when facing the camera, but this breaks things if the depth precision is high enough or things round slightly differently.

@davepagurek
Copy link
Contributor Author

The original issue that seems to have been causing this, #6956, has a test case where strokes were cutting through ortho cubes incorrectly due to the shift in depth of lines. Testing that same example again, the same issue is no longer present (I think thanks to #7206) even when I replace -0.00045 with 0. So I think this is all set!

I've added a new test case with a mini version of the original ortho cube issue in order to prevent regression.

@davepagurek davepagurek marked this pull request as ready for review November 9, 2024 17:30
@davepagurek davepagurek changed the title Will high precision floats make lines render on top? Fix issues with stroke depth ordering Nov 9, 2024
@davepagurek davepagurek merged commit fe0cae3 into dev-2.0 Nov 9, 2024
2 checks passed
@davepagurek davepagurek deleted the feat/highp-lines branch November 9, 2024 17:31
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.

1 participant