dxvk icon indicating copy to clipboard operation
dxvk copied to clipboard

[d3d9] Anno 1701 - vertical banding artifacts with anti-alias enabled

Open WinterSnowfall opened this issue 5 years ago • 9 comments

Anno 1701/Anno 1701: The Sunken Dragon with all settings maxed out @ 720p, and anti-alias enabled. Vertical banding artifacts can be observed on most UI elements.

anno_1701_aa_dxvk

Here's how it looks with WineD3D:

anno_1701_aa_wined3d

Software information

Anno 1701 + The Sunken Dragon Addon (GOG version).

System information

  • GPU: GeForce GTX 1070
  • Driver: 440.48.2
  • Wine version: 5.1 Staging
  • DXVK version: v1.5.4

Apitrace file(s)

Anno1701AddOn_aa.trace.tar.xz

Log files

WinterSnowfall avatar Feb 07 '20 13:02 WinterSnowfall

Looks like this relies on the D3DRS_MULTISAMPLEANTIALIAS state being implemented correctly, which isn't really possible unfortunately.

Edit: It might be doable with VK_EXT_sample_locations, but this extension is not supported by all drivers.

doitsujin avatar Feb 07 '20 14:02 doitsujin

Looks like this relies on the D3DRS_MULTISAMPLEANTIALIAS state being implemented correctly, which isn't really possible unfortunately.

Edit: It might be doable with VK_EXT_sample_locations, but this extension is not supported by all drivers.

A pity. Early Anno games have no UI scaling, so while it's possible to play them in 4K, I don't see anyone doing it without UI scaling mods (or maybe with cybernetic eyes in the future). Some AA would have been nice for better quality at low-res. I know - it's the epitome of first world problems :).

This may be a dumb question, but is it feasible/possible to have like an override logic which makes drivers use FXAA (or any other "usually harmless" shader AA technique) instead of MSAA in these cases, albeit with a loss in quality?

Obviously, you are the person to decide if any of this is worth pursuing (including the VK_EXT_sample_locations path), since you are the expert on these matters. Thanks for looking into this.

Edit: Nevermind about forcing it at driver level. This is Vulkan and I'm still stuck in an OpenGL mindset.

WinterSnowfall avatar Feb 07 '20 15:02 WinterSnowfall

MSAA is fundamentally different from post-processing AA, so no, that's not possible.

I'm looking at VK_EXT_sample_locations right now, but it looks like it's going to be exceptionally painful to use.

doitsujin avatar Feb 07 '20 15:02 doitsujin

MSAA is fundamentally different from post-processing AA, so no, that's not possible.

I know and just to clarify I was referring to something in the likes of:

FXAA_force

"Yes, Anno, you want me to do MSAA, but you're gonna have FXAA and be happy about it" :).

I've played it a bit with FXAA forced already (as per the above, mind you with WineD3D), and it certainly looks better than with no AA @720p, aside from the specific minor blurring, which I don't mind.

I'm looking at VK_EXT_sample_locations right now, but it looks like it's going to be exceptionally painful to use.

If it's not worth the effort, then it's just not, no worries. Bottom line, this is a cosmetic fix - the game is fully playable and as of 1.5.4 has no graphical artifacts. I'm happy to park this indefinitely until Vulkan provides a less painful way to do this (if ever).

WinterSnowfall avatar Feb 07 '20 15:02 WinterSnowfall

So essentially D3DRS_MULTISAMPLEANTIALIAS is the equivelant of ForcedSampleCount = 1 in D3D12... However, if we were to have a Vk ext to do something similar, we end up with the problem that there are also a bunch of weird edge cases of things that suddenly become illegal to do, which I don't understand why:

Note  If you want to render with ForcedSampleCount set to 1 or greater, you must follow these guidelines:

    Don't bind depth-stencil views.
    Disable depth testing.
    Ensure the shader doesn't output depth.

misyltoad avatar Feb 07 '20 16:02 misyltoad

This could also be centroid-ness...

misyltoad avatar Feb 07 '20 16:02 misyltoad

It's not, I already tested that. The problem is sample coverage, not interpolation.

doitsujin avatar Feb 07 '20 16:02 doitsujin

Just a quick update that it is still a issue. Tho you probably already know that if it's missing vulkan extensions that make it fixable.

Blisto91 avatar Apr 01 '22 22:04 Blisto91

Yes, we're aware that it's still an issue but programmable sample positions are an absolute pain in the arse to use in Vulkan. It's just not a priority.

The feature is already there, it's just very annoying since it interacts with the depth buffer for some stupid reason.

doitsujin avatar Apr 02 '22 00:04 doitsujin