Closed KirillAlekseeenko closed 3 months ago
Hi, @KirillAlekseeenko and thanks for PR!
Currently busy with gpu-driven, - will look closely into PR afterward.
Some notes in a meantime:
Fxaa3_11.h
- for sake of bookkeeping. And one more thing to note: there was a debate in last release comments about better AA technique, so it best next time to raise ticket and ask. On my end I was looking toward programmable-resolve based AA (can do on Apple, but not yet on Vulkan). It is OK with you, if after 6-12 months this FXAA will be replaced by else algorithm?
Hi! Accroding to nvidia nsight frame capture FXAA takes from 0.06 to 0.08 ms (depends on quality preset) on nvidia 3070 card with full hd resolution. Source for Fxaa3_11.h can be found here: https://gist.github.com/jwoolston/c96c22473110c9924d831cebb5f2cdb4 Originally it's a part of NVIDIA samples: https://docs.nvidia.com/gameworks/content/gameworkslibrary/graphicssamples/opengl_samples/fxaa.htm https://docs.nvidia.com/gameworks/content/gameworkslibrary/graphicssamples/d3d_samples/fxaa311sample.htm
It's ok if FXAA will be removed in future releases, it's just a starting AA solution and not good comparing to alternatives, but it's cheap and simple though. What did you mean by programmable-resolve based AA?
There are shots before and after applying FXAA
What did you mean by programmable-resolve based AA?
This is though direction, rather a complete technique at this point. Basic idea here is to use (or abuse :D ) MSAA rendering with some extensions to get full-res gBuffer + 4x-coverage buffer. This method originally was intended only to deal with sky-to-object aliasing (trees/ship) - coverage buffer is perfect to compose sky on top of scene.
Naturally there are quite a few challenges to make it work, and one of then is to be able to resolve MSAA image into single-sampled image from shader, rather then from fixed-function hardware.
There some code-style issues - I'll fix it afterward. Merged, thanks!
Integrated FXAA as a relatively simple spatial antialiasing algorithm at the end of the frame just before UI rendering
There are multiple presets: 0 -- no FXAA from 1 to 5 -- the higher this number the more expensive filtering is used
To set FXAA preset add "-fxaa preset_num" parameter to the command line arguments