Jump to content
  • Advertisement
Sign in to follow this  
Volgogradetzzz

DX11 Antialiasing artifacts with render targets (or something else)

This topic is 1349 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings,

 

I'm developing with flash stage3d api, so I can't say for sure what's going on, but it seems that I have antialiasing artifact.

 

broken_pixels.png

 

It appears only when I render to texture with any antialiasing. On movement everything much worse - this broken pixels randomly appears on the edge of a sphere. I tried to debug with renderdoc (stage3d api uses dx11 under the hood), but this great tool shows me wrong results. So I'll listen for more experienced guys with pleasure - is it trully problems with antialiased render target or somethinf else? And I'll check my shader more carefully.

Share this post


Link to post
Share on other sites
Advertisement

Can you post your shader? Is it possible that the values are not clamped and are overflowing?

Also does it do this at all AA levels, i.e. 2 4, 8 and 16?

Share this post


Link to post
Share on other sites

What wrong results are you getting in renderdoc? Something completely crazy, or just the bug has gone away?

 

One thing that sometimes causes differences between program & capture is that renderdoc by default doesn't save render target contents at the start of the frame if it thinks they'll be overwritten. Try enabling 'save all initials' in the capture window to see if that changes anything.

Share this post


Link to post
Share on other sites

like bwhiting, I would guess that something is going wrong in your pixel shader. One thing to watch out for with MSAA is extrapolation. When you have attributes from your vertex shader that are passed to the pixel shader (positions, texture coordinates, colors, etc.) they will typically get interpolated to the center point of a pixel. With MSAA you will get edge pixels don't cover the center point but do cover 1 or more sub-sample points inside the pixel. In those cases you will get vertex attributes that are actually interpolated outside of your triangle. To help account for this, GPU's support centroid sampling. Centroid sampling causes attributes to be interpolated to the centroid of all covered sub-sample positions, which prevents extrapolation.

Share this post


Link to post
Share on other sites

Thank you everyone,

I didn't post my shader because I don't want to scare people - stage3d shaders are assembler like code. I double checked it and it seems correct - I even don't have divisions. And the main thing - without antialiasing I don't have artifacts. So MJP's answer is the explanation I searched for. Unfortunatelly, stage3d doesn't allow to setup sampling or anything like that.

 

@bwhiiting, for render target AA levels are 0, 1, 2, 3, 4.

 

@baldurk, I have wrong results in fragment shader. For example in vertex shader I have a varing (vi0) and I can see it's value, but in fragment shader I suddenly have vi1 (not vi0) value filled with zeroes only. So I can't step through the code and check intermediate results (and output color actually is wrong too, although on the screen it's ok). But as you say it can be problem with render target - flash internally draws to some texture and internally draws it to back buffer in the end. And I tried to turn on every option.

 

Upd.: I checked on different machine and I can't see this artifacts, so I assume that this is my hardware's fault.

Edited by Volgogradetzzz

Share this post


Link to post
Share on other sites

If you're willing to share it or email to me, I'd be interested to run the program myself or look at a capture. I don't mind assembly shaders :). Getting the wrong inputs in the pixel shader means a bug in renderdoc and I'd like to fix it if I can!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!