- Posts: 312
- Forum
- Shaders & Effects
- Presentation
- Advanced Screen-space Subpixel Morphological Anti-Aliasing (ASSMAA)
Advanced Screen-space Subpixel Morphological Anti-Aliasing (ASSMAA)
- lordbean
-
Topic Author
- Offline
# ASSMAA
Advanced Screen-space Subpixel Morphological Anti-Aliasing is an edited version of traditional Subpixel Morphological Anti-Aliasing for ReShade 3.0+. It removes the optional depth edge detection and predication features of the original shader for best performance in multiplayer games and adds two advanced detection methods based on weighing the outputs of both Luminance and Color edge detection against each other in two different ways. ASSMAA also exposes the internal contrast adaptation setting to the user, allowing for finer control over the blurring caused as a side effect of the routine.
The two new detection modes offer up a way to use extra GPU horsepower to effectively interpolate the results of the outputs of both Color and Luminance edge detection. To be frank, I'm surprised this worked (I have a bad case of imposter syndrome right now) but during my testing in No Man's Sky (if you've played it you know it has tons upon tons of jaggies) I was able to identify subtle differences in the output weights of both new methods that identified them as distinct from either Color or Luma modes (or each other, for that matter). I've defaulted the options to a combination I've found to be very visually pleasing after some gameplay, but feel free to experiment - a lot of the idea of this edit is to give the user more power to fine-tune the shader.
Please Log in or Create an account to join the conversation.
- lordbean
-
Topic Author
- Offline
- Posts: 312
Please Log in or Create an account to join the conversation.
- someone_for
-
- Offline
- Posts: 22
Please Log in or Create an account to join the conversation.
- Judge_K
-
- Offline
- Posts: 10
On a side note, I still laugh about the the filter's name, particularly the acronym. Any ways, keep up the great work.
Please Log in or Create an account to join the conversation.
- EFermi
-
- Offline
- Posts: 30
Please Log in or Create an account to join the conversation.
- Judge_K
-
- Offline
- Posts: 10
A person could use something like DSR or VSR, which would apply the shader on the supersampled back buffer. Then the driver downscales the image.
Please Log in or Create an account to join the conversation.
- EFermi
-
- Offline
- Posts: 30
The reason being that SMAA has much more accurate color mediation, but it results in not being able to process pixel-sized dots on transparent textures, like those tree leafs below, while FXAA does the job almost perfectly, if a bit mushy:
SMAA - imgur.com/hnhqzpt
FXAA - imgur.com/LMvsaDV
Unfortunately, FXAA has it's own serious demerit, huge enough to make me never use it and prefer no AA instead when only those two options (FXAA or SMAA) are available - inaccurate pixel inerpolation, which captures unwanted neighbouring pixels a lot, as an example see the farther table leg on images below (upscaled in linear interpolation for better visibility):
NoAA - imgur.com/rsF7Ns6
SMAA - imgur.com/mHwYBgD
FXAA - imgur.com/N5bmJvB
Notice how FXAA bleed surrounding pixels into the table leg on several instances. With more accurate color mediation of SMAA this should not be the problem.
Please Log in or Create an account to join the conversation.
- EFermi
-
- Offline
- Posts: 30
(View at 100% scale for better visualization)
NoAA - imgur.com/kS4yic4
SMAA - imgur.com/pCAW9kT
FXAA (never fails to disappoint, making even a simple multi-shaded line look like a mess) - imgur.com/pYZ0wkX
Postal 2 being Postal, even 4x supersampling with lanczos downscaling cannot be smooth, holy @$$ - imgur.com/mutzlIA
And, while we're on the topic, here's some more examples of foliage coverage.
FXAA (decent, but mushy) - imgur.com/effyVjY
SMAA (does it even do AA in that tree?) - imgur.com/O1QHRIE
Fun thing is, even SMAA T2X cannot do foliage properly as I've witnessed in Crysis Remastered and Kingdom Come Deliverance - despite it being more generally blurry, it still misses those 1 pixel dots in the foliage among the tree leafs, it's just not as blatantly obvious as with normal SMAA.
Please Log in or Create an account to join the conversation.
- EFermi
-
- Offline
- Posts: 30
a) it glitches the hell out in 7-8 out of 10 games putting my game into a borderless window 2/3 size of the monitor space, as if the monitor is above native, but the game still runs at it;
b) for some unexplainable reason AMD does not allow above 5K VSR for 4K mons, meaning I'm getting f**k all in terms of supersampling, getting from 3840x2160 up to 5120x2880, which is not even 1.5x supersampling (that would be 5760x3240), which looks arguably worse than native because the system struggles to interpolate whatever it has to work with resulting in "bad fxaa" kind of effect on edges when it sorta kinda has some semblance of an attempt at antialiasing, but fails miserably. FML. At least I can afford to not use AA and not suffer from it at my resolution.
Regardless. An ideal antialiasing shader, in my opinion, should process within the textures similar to FXAA, but more cleanly, without capturing odd stray pixels and turning it all into mush, something you can see when using DSR with around 50% softness or very high levels of TSAA (transparency antialiasing). I am absolutely certain this is acievable with SMAA shader modified to unrecognisable state, probably, based on how cleanly it filters vast majority of edges compared to the original MLAA or FXAA, maybe by introducing some of the FXAA code into SMAA shader and creating an atrocious, but extremely capable hybrid of both.
This is what is expected to happen within the texture margins.
Then, when shader reaches texture border, it works identical to old-fashioned SMAA with a small fix to balance the dark and bright pixel mediation shenanigans.
Alternatively, the entire shader may be reconstructed to process the entire frame buffer regardless of edge detection, like I mentioned earlier, similar to FXAA, but far more smooth and accurate, without messing up edge pixels together, producing a significantly softened image which is then sharpened by other sharpening shaders like LumaSharpen and CAS.
Please Log in or Create an account to join the conversation.
- lordbean
-
Topic Author
- Offline
- Posts: 312
Alternatively, is there a way to make SMAA sample the entire image just like FXAA does instead of just precisely targeting edges?It actually does sample the entire image, interestingly enough. The first thing SMAA does is to basically copy the back buffer into a new texture, but as it does so, it runs a series of checks on the input to detect whether it thinks there's an edge there. If it detects an edge, it allows the data to be written to the sampled texture; if it doesn't, it simply drops the data and nothing shows on the sampler image. One of the things I've been looking at (but don't think I understand it well enough yet) is to try playing around with how it's actually determining whether or not it detects an edge.
Please Log in or Create an account to join the conversation.
- EFermi
-
- Offline
- Posts: 30
Please Log in or Create an account to join the conversation.
- lordbean
-
Topic Author
- Offline
- Posts: 312
Please Log in or Create an account to join the conversation.
- EFermi
-
- Offline
- Posts: 30
Please Log in or Create an account to join the conversation.
- EFermi
-
- Offline
- Posts: 30
Please Log in or Create an account to join the conversation.
- lordbean
-
Topic Author
- Offline
- Posts: 312
Please Log in or Create an account to join the conversation.
- geisalt
-
- Offline
- Posts: 6
i always used smaa at medium values as a prepass and depth detection is particularly effective in this case as it reduces the amount of bluriness by telling the shaders which parts of the picture to avoid. Adding luma to the mix may add a lot of ignored edges thoo...
The interpolation idea is great but i dont undestand why you remove the depth detection.
We can also access depth in online game by forcing it with forks or a "trick" in old versions of reshade ( as it is not intended i wont talk further about it). by doing this, smaa quality and bluriness is definitively improved.. To reduce the quality of a shader to adapt it for online games, it is a bit strange considering the goal of improving the picture quality with more horse power.
note that i use particularly tweaked values for smaa, with low amount of search steps
[SMAA.fx]
PredicationEnabled=4294967295
CornerRounding=0
DepthEdgeDetectionThreshold=0.003000
DebugOutput=0
EdgeDetectionThreshold=0.083333
EdgeDetectionType=1
MaxSearchSteps=16
PredicationScale=1.000000
MaxSearchStepsDiagonal=4
PredicationStrength=0.500000
PredicationThreshold=0.001667
such setting is an efficient prepass for the rests of the effects in the shader chain. then i add sharpen and dark blur aimed at bright pixels that smaa always misses (or very light fxaa avoiding dark pixels if the remaining aliasing is too high)
Please Log in or Create an account to join the conversation.
- lordbean
-
Topic Author
- Offline
- Posts: 312
As far as your comments about not noticing a difference, that honestly isn't surprising. Comparing final images of traditional detection vs my new methods, I generally can't see a difference either. It takes a good amount of time spent scrutinizing the debug output layers in each mode to learn where the differences actually are in order to train your eyes to see them in the final product image. The differences are typically quite subtle and mostly center around how the shader handles difficult cases (where it isn't quite sure if it's really seeing an edge or not).
Essentially, I haven't re-invented the wheel. I've just done my best to try to grind it down into a more perfect circle.
Please Log in or Create an account to join the conversation.