Skip to content

[Impeller] Transparent paths overdraw #101330

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

Closed
bdero opened this issue Apr 5, 2022 · 2 comments · Fixed by flutter/impeller#121
Closed

[Impeller] Transparent paths overdraw #101330

bdero opened this issue Apr 5, 2022 · 2 comments · Fixed by flutter/impeller#121
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels.

Comments

@bdero
Copy link
Member

bdero commented Apr 5, 2022

Right now, we don't write to a depth or stencil buffer for draw calls that render solid strokes/fills, and overlapping triangles in the same draw call just draw on top of each other.

image

Here's the equivalent Skia Fiddle for reference:
https://fiddle.skia.org/c/027392122bec8ac2b5d5de00a4b9bbe2
image

Since we're already using the stencil check for the clip stack, one solution would be to use shallow depth attachments per render target, increment the geometry depth slightly with each draw call, draw with MTLCompareFunction.greater, and clear the depth buffer whenever we have enough solid strokes/fills drawn to the target such that we need to loop around.

@chinmaygarde Does the above seem like a reasonable approach to you? We could also trade the increased device memory for solutions with more draw calls (like increment the stencil buffer and discard fragments that don't match the current stencil height, then draw a clip restore at the previous max height), but I suspect we're doing pretty good in the device memory department right now.

@bdero bdero added engine flutter/engine repository. See also e: labels. c: rendering UI glitches reported at the engine/skia or impeller rendering level e: impeller Impeller rendering backend issues and features requests labels Apr 5, 2022
@chinmaygarde
Copy link
Member

The stencil approach sounds great to me.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2022
dnfield pushed a commit to dnfield/engine that referenced this issue Apr 26, 2022
dnfield pushed a commit to flutter/engine that referenced this issue Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants