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

Any solutions to MSAA artifacts on edges? #7

Open
zhongyuan-zhao opened this issue Jul 11, 2023 · 1 comment
Open

Any solutions to MSAA artifacts on edges? #7

zhongyuan-zhao opened this issue Jul 11, 2023 · 1 comment

Comments

@zhongyuan-zhao
Copy link

I can see wireframes when I enabled pixel shading with MSAA as the closed issue said.

@NBickford-NV
Copy link
Contributor

Thanks for asking!

The problem's pretty much what Triang3l described in #3 (comment) -- with MSAA, roughly 2x as many triangles can cover a pixel along edges and many more can cover a pixel at triangle vertices, so it's more likely for the OIT buffers to overflow and for fragments to go to tail blending instead.

Here's an example using spinlock with 8 layers and 4x MSAA pixel-shading. The wireframe artifacts appear when enough spheres overlap:

image

The main solutions are to increase the number of layers, or to use MSAA sample-shading. For instance, it looks good with 16 layers:

image

and also looks good when changed to sample-shading:

image

The downside is that these use more memory. (simple in particular requires a lot of layers to look good, and I think linkedlist only works well with sample-shading MSAA.) Another way to get the visual effects of antialiasing without the memory/time cost is to apply an anti-aliasing post effect like DLAA - we have a dedicated sample for that at https://github.com/nvpro-samples/vk_streamline.

Now, loop32 and loop64 don't look good at all under pixel-shading MSAA; that's because their algorithms don't support it:

image

So, hopefully this sample accurately shows some of the artifacts that can occur with these algorithms when MSAA is enabled, and how to change the parameters to avoid them.

It's an interesting direction for future research - if you find a way to improve these algorithms in the case of MSAA pixel-shading to avoid wireframe artifacts, let us know! Or if you spot a bug in the code that produces these artifacts unnecessarily, please let us know.

Otherwise, I'm not sure if there's anything actionable here - for now, the answers to wireframe artifacts appear to be to

  • increase the value in the "layers" combobox
  • or to switch to "MSAA sample-shading"
    (and to make sure you're using an algorithm that supports MSAA.)

Thanks,

--Neil

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

No branches or pull requests

2 participants