(H)ybrid high-(Q)uality (A)nti-(A)liasing (HQAA)
- lordbean
- Topic Author
Please Log in or Create an account to join the conversation.
- klotim
Your shader is great btw!
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
SMAA edge detection (whether color or luma) has problems with scenes that are very blue or very unsaturated (grayscale). To work around this, HQAA now runs luma edge detection a total of 4 times to construct its edge data.
First pass: uses normal backbuffer as input
Second pass: uses a copy of the backbuffer with the color channels left-shifted
Third pass: uses a copy of the backbuffer with the color channels right-shifted
Fourth pass: uses a copy of the backbuffer with the negative of the color channels
Due to these changes luma edge detection will no longer attempt to fall back to color edge detection, it will simply return no edges if it does not detect any. Since this removes a fair amount of math from each iteration of luma edge detection, performance of this version is not significantly worse than version 8.
Since each new source of backbuffer data requires a copy of the back buffer to be written, the HQAA technique's expected number of passes is now 11 when inspected in the statistics tab.
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Please Log in or Create an account to join the conversation.
- Tojkar
There is something funky happening with the green colour. The effects can be seen in the Rage2 near the green neon sign. Specifically in the rain cover or whatever that metal plate is called. Another one is on the truck game on right where the street sign shafts are against the green backdrop.
Most of the time there seems to be no problem with green but those small anomalies instantly caught my eye. Maybe something with bluish grey and green together with high luma change in between?
On the other hand, on my fullHD screen I have nothing to complain about. Haven't seen such clear anomalies. Also, it has been effectively impossible to see things getting better after about versions in page 3 but I think that's more a function of low resolution than anything else.
One request, though. Could you enable debug views for different textures to help making more informed decisions and trouble shooting?
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
As far as troubleshooting goes the aspect of HQAA that currently has no effective way to judge other than purely visually by the result is what the FXAA passes are doing - since there are no steps in between detection and blending for FXAA (hence why it's fast), there's nothing to output in the middle to see what it's actually doing. I might try fiddling around with some sort of negative output mode though where instead of rendering the correct result, the debug mode will output the negative of the result (which will be glaringly obvious on the screen).
For SMAA, seeing what it's doing is still actually pretty straightforward as long as you know how to read the data in the edgesTex texture on the statistics tab (the one that's in RG8 format at the same resolution as the back buffer). Green means edge detection has flagged a probable horizontal edge and red means edge detection has flagged a probable vertical edge (yellow means it's flagged both, which will likely be picked up by the diagonal processing functions). The changes I have made to the core workings of SMAA are still purely in the first step of detecting where the probable edges are (with the one notable exception of implementing sharpening of the final result that blends with the screen at the end of the process). Everything that SMAA is doing inside of HQAA after it completes the edge detection process is otherwise still totally by-the-book SMAA.
Edit: of minor note also (as I imagine you've likely noticed it, but just in case you haven't), imgsli.com uses linear scaling to resize the source images to fit the window, so they can often look weirdly distorted when it's shrinking them (which it often is, unless your monitor is higher res than the screenshots). You can target a zoom-in by rolling the mousewheel up with the pointer moved to the approximate area you want to see, which will give you a much closer inspection of the images.
Please Log in or Create an account to join the conversation.
- SilentPrayerCG
CAS slider is working, but no actual AA applied, only sharpen.
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Done. v9.3 is up and includes SMAA debug modes identical to SMAA.fx as well as experimental (but honestly hard to read for the moment) FXAA debug mode.One request, though. Could you enable debug views for different textures to help making more informed decisions and trouble shooting?
Please stop apologizing for complaining, your complaints have typically been very helpful to me.
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Edit: I just found a way to make the FXAA debug outputs readable, too - now available as v9.3.2.
Can we get another chicken dinner for Tojkar?
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Please Log in or Create an account to join the conversation.
- Wicked Sick
Please Log in or Create an account to join the conversation.
- klotim
I think it should be a bit more visible for people.
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
As klotim mentions, there's a standing link to it in my first post. I actually can't edit it due to this board's automatic edit time-out after 12 hours or so, and I kinda wish I could because some of the information that was originally correct is out of date (you do not need the FXAA and SMAA headers anymore, only the SMAA search textures).
Edit: we're now at 9.6.1, which is worth the update from 9.5 or below. I came up with a new trick in FXAA that eliminates the bulk of the overcorrection errors it used to produce, resulting in an even cleaner final image than before. I also allowed the custom preset options to go way beyond what the internal presets do for those who want to see older games look their absolute best on their $2G+ GPU (this comment is only mildly sarcastic, I bought a 6700XT for 30% more than MSRP. In most games at 1440p, I have a ton of room for GPU-powered post processing).
Please Log in or Create an account to join the conversation.
- Wicked Sick
@lorbean I will try this shader, thank you very much for your work.
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Edit: now also includes potentially significant improvements to the FXAA code. It now does a full neighborhood luma check to decide whether to early-exit or not (instead of just a + pattern) and I converted a lot of the per-component operations to vector math.
Please Log in or Create an account to join the conversation.
- klotim
codeshare.io/8pn3pv
Its available 24h
Question, how does the AA behave with different aliasing scales, like a large aliasing scale compared to a small aliasing scale? I guess large scale anti-aliasing could cause false detects?
Please Log in or Create an account to join the conversation.
- SilentPrayerCG
nvm, it have same settings for both shaders in latest version, i think it was separate before
Please Log in or Create an account to join the conversation.
- Riadon
Still does not work in HDR, the preprocessor definitions don't seem to do anything. HQAA (9.7) minus the sharpening pass kills the highlight brightness, with the sharpening pass the highlights are inverted.Version 9.7 beta now available, I need help testing this one. I put in experimental support for HDR displays but I don't own one. I'd appreciate it if someone could test whether it works or not and let me know.
Edit: now also includes potentially significant improvements to the FXAA code. It now does a full neighborhood luma check to decide whether to early-exit or not (instead of just a + pattern) and I converted a lot of the per-component operations to vector math.
Here is what it looks like: (tested on an LG CX)
imgsli.com/ODk1MTY
Please Log in or Create an account to join the conversation.