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

Vello image rendering artifacts? #656

Closed
StarArawn opened this issue Aug 5, 2024 · 5 comments · Fixed by #722
Closed

Vello image rendering artifacts? #656

StarArawn opened this issue Aug 5, 2024 · 5 comments · Fixed by #722

Comments

@StarArawn
Copy link

StarArawn commented Aug 5, 2024

Hello! I'm working on a nine-patch rendering system using vello image rendering:
image

The lines that are appearing I believe are the result of texture atlas bleeding. Although I'm not entirely convinced that is the case since the image is rasterized in compute there should be no issue with atlas bleeding as compute shaders do not have UV's and UV address modes. You can see that they(the artifacts) do not exist in the atlas that Vello produces:
image

Another possibility is that anti-aliasing is causing these artifacts. I would think it would be odd if AA ran on images though, but perhaps its an effect that runs "post render" I simply don't know enough about vello's internals.

Its also entirely possible that this issue is entirely my fault in my own code, although I am using fairly well tested(bevy code). I'll attempt to reproduce this in a MRE as soon as I am able to.

@DJMcNab
Copy link
Member

DJMcNab commented Aug 5, 2024

The lines that are appearing

There are lots of lines in your image. Can you clarify to which lines you are referring?

@StarArawn
Copy link
Author

StarArawn commented Aug 5, 2024

There are lots of lines in your image. Can you clarify to which lines you are referring?

The black parts are meant to be completely black:
image

@StarArawn
Copy link
Author

StarArawn commented Aug 5, 2024

I was able to reproduce this using only vello:
image

you can find my MRE here:
StarArawn@0c3b0db

Curiously it appears as though the scale of the image causes the issue.

Zoomed in and highlighted with red box:
image

The gray lines appear on the bottom of the image which is odd too.

@waywardmonkeys waywardmonkeys added this to the Vello 0.3 release milestone Aug 12, 2024
@DJMcNab
Copy link
Member

DJMcNab commented Sep 2, 2024

I believe that the artifacts you are seeing are called conflation artifacts. I don't have a good suggested workaround, although you might be able to introduce some artificial overlap between the sections.

This is a very hard problem to solve, although we are working on it. See #gpu>Conflation Artifact Free Compositing.

I think we probably could close this as a duplicate of #49.

@DJMcNab DJMcNab removed this from the Vello 0.3 release milestone Sep 10, 2024
dfrg added a commit that referenced this issue Oct 23, 2024
Constrains image sampling to the actual atlas region for a given image and adds a half pixel adjustment to sample from the pixel center.

Addresses #719 and maybe #656
@DJMcNab
Copy link
Member

DJMcNab commented Oct 24, 2024

@dfrg has pointed out that I have likely mis-triaged this issue. Could you please try this with #722, which I think should fix at least some of this?

github-merge-queue bot pushed a commit that referenced this issue Nov 8, 2024
#722)

Constrains image sampling to the actual atlas region for a given image
and adds a half pixel adjustment to sample from the pixel center.

Addresses #719 and maybe #656

Example 2x2 image with red, blue, cyan and magenta pixels:

<img width="387" alt="vello_image_sampling"
src="https://github.com/user-attachments/assets/6bc02607-e9fa-4c79-83c9-241e76a42fb0">

---------

Co-authored-by: Daniel McNab <[email protected]>
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 a pull request may close this issue.

3 participants