(H)ybrid high-(Q)uality (A)nti-(A)liasing (HQAA)
- EFermi
The ever-atrocious one pixel dot problem is still omnipresent despite softening, in fact, it makes it even worse since since everything else gets smoother but dots are still obvious.
Examples:
imgur.com/b109sX9 - dots in the trees, both left and right, HQAA applied, no softening
imgur.com/FLuE36h - softening on, dots are still there, just SLIGHTLY less pronounced
imgur.com/jTGy1yx - this is pronounced even in less vibrant games, such as FEAR, for example.
How I fix this BS in games with robust and highly pronounced details (read - cell shading titles, e.g. Firewatch or Borderlands, which do not suffer much if you blur the heck outa them):
imgur.com/HmMQ0Bt - add FXAA with maximum (1.0) subpix and 0.0 Edge Thresholds; it has serous drawbacks though, standart FXAA shenanigans
imgur.com/YbEftL7 - apply HQAA with softening in top to smooth the result; the BLUR, though, is overwhelming, therefore, as I mentioned, it is only viable for games with robust, pronounced details, of which cell-shaded or cartoonish titles are the most typical representatives since everything significant is outlined. But this method is only viable for a handful of games which can be counted on one's fingers. This needs a better solution viable everywhere. I know I already mentioned this problem before at least twice, but it is very annoying and very in-your-face in quite a huge number of titles, since most games have, in some shape or another, foliage such as trees, which have leaves, and grass, which produce this defect en masse.
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
Btw, you can download any previous version you want from Github by looking at the commit history for the file. You have to jump through a couple of extra hoops to get it to show you the old file as it was without doing the change highlighting thing, but older versions are all still there.
Please Log in or Create an account to join the conversation.
- EFermi
The new softening looks very much like DLAA on textures, and not in a positive way. Older softening was closer to gaussian filter you get from nVidia's DSR when setting it to 50% or above smoothness, in a good way. It would be best to just put these under the drop-down choice menu, similar to that of HQAA quality level. Or maybe make it so inputting "1" into the field enables new softening mode, and "2" switches it to the older version.
Please Log in or Create an account to join the conversation.
- klotim
github.com/LordOfLunacy/Insane-Shaders/b...er/Shaders/CMAA_2.fx
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
I just pushed 27.5.5 with what are hopefully improvements to the image softener. Realized I had an incomplete set of geometric patterns being used for horizontal/vertical, which might have been negatively affecting the output.
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
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
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.
- Gonzito
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
github.com/lordbean-git/HQAA
Please Log in or Create an account to join the conversation.
- EFermi
Not sure if it was a bug or a feature, but when you select an "HQAA_TAA_ASSIST_MODE" option in 27.5, it disables the normal antialiasing function, but the Softening is still enabled (can't do that in latest versions). Not a big deal on it's own, but you can slap any other AA shader on top of that softening, obviously. So, armed with "HqaaImageSoftenStrength" = 0.750 and "HqaaImageSoftenThreshold" = 0, I went on and SMAA'd it on top, using minimum "EdgeDetectionThreshold" (0.05) for it to better grab a hold of those thicc edges. The quality was there, dare I say, at least not too far worse than the original HQAA with softening, arguably even better(?), but(t), so was the blur.
Just then, a brilliant idea shined upon me. As people here know, for quite some time already there's a built-in supersampling function in videodrivers (DSR for nVidia, VSR for AMD). So why not use it? Well, for me, it is quite limited. Unfortunately in the January of 2021, due to severe deficit on the GPU market (#f*ckyouminers), I was only able to afford an RX 6900XT ("only" because it was, like, 40% the price of 3090 where I live, and I damn was not going to waste half a kidney's worth of money for a laughable 10Gb of 3080). And the maximum AMD goes in that department is 5K (5120x2880), which is not even an 1.5x increment from my native 3840x2160. To add insult to injury, nVidia has a configurable built-in softening function with their DSR (DSR Smoothness, as far as I remember from my experience), while AMD does sad and soggy default bilinear interpolation, you can't even set it to Lanczos like GeDoSaTo. So the function just sat there pitifully disabled.
But now, with the newfound strength of Soft HQ-SMAA hybrid, I turned it On, and that is so good! Yes, you can still see the blur if you look for it, after all it's not even a 1.5x supersampling factor, more like 1.3(3), but it's still REALLY good.
PROS: amazing quality, the only things better are probably straight on 8x+ SSAA, 2.5x or higher factor DSR with 33~50% smoothness and maybe DLSS(?).
CONS: the performance hit is palpable, F.E.A.R. drops down 100+ FPS sometimes (although using just HQAA at 5K produced similar results, so it's an inherent demerit).
(P.S.: Yes, while downscaling, the difference between using SMAA, FXAA, HQAA or the loathsome soft hybrid is relatively miniscule, but this "relatively" is what can make your experience. Even at 5K->4K downsampling the imperfections of FXAA are visible, you can see SMAA with too low edge detection threshold flicker on edges, HQAA is mostly fine (e.g. Postal 2) but depending on the game may not be the better option (e.g. F.E.A.R.). When I still ran a GTX1080, I used DSR proactively in very old games that can still get 60+FPS with it, and these visual defects start blending in and become actually unnoticeable only at very high supersampling factors, along the lines of 8K->4K downsampling, that's why I'm so excited about the combined use of HQAA Softening with SMAA on top).
Please Log in or Create an account to join the conversation.
- EFermi
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
In other news, version 28.0 LTS (long-term support) is now available. I'm more or less considering HQAA to be done at this point, and future updates are only likely if I discover bugs or optimizations. While preparing the code for this release I was able to shrink the total number of compiled instructions of the SMAA edge detection function considerably, so v28.0 should actually be slightly faster than the v27 strain as a bonus.
Please Log in or Create an account to join the conversation.
- EFermi
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
github.com/lordbean-git/reshade-shaders/...aders/ImageSoften.fx
This is ripped from the original version in HQAA v27.5 since it didn't use any SMAA data. I added an extra pattern to it, removed the silly contrast threshold thing I tried to do, and replaced that with the ability to scale the sampling offset that I added in later versions. You'll have to recalibrate it as compared to whatever you were using in HQAA, but it should be reasonably flexible.
Please Log in or Create an account to join the conversation.
- EFermi
I didn't even need to change the values. This seems to look exactly like 27.5's SoftenStrength=0.75, SoftenThreshold=0 with the default settings of 0.75, 0.75, or at least so close to it that I couldn't really tell the difference. The performance impact is also significantly lower compared to HQAA's TAA_ASSIST mode.
Here are a few screenshot fragments for comparison: imgur.com/a/Ohfq6IU
(FEAR 2 has 7680x4320->3840x2160 lanczos downscaling via GeDoSaTo, FEAR has 5120x2880->3840x2160 VSR + Softening + SMAA)
Please Log in or Create an account to join the conversation.
- lordbean
- Topic Author
I discovered an improved way to calculate the local contrast adaptation factor during edge detection, resulting in a significant increase in the function's sensitivity to edges. If you are using advanced mode setup, you will need to use the debug outputs to recalibrate your options after updating to this version as your old settings will likely cause a considerable amount of overdetection.
Additionally, I have also made the brightness booster optional feature available as a separate shader since I've come to use it a lot of the time. This is for cases where for example you are using DLSS or DLAA and therefore do not need HQAA to fix any remaining jaggies (QXAA or even a plain old FXAA will typically work for this as DLAA is very accurate in most cases). It's a fairly fast shader, requiring slightly less time to compute than a normal AMD CAS pass.
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.