mrhaandi's: injectSMAA

Arkadrel

Diamond Member
Oct 19, 2010
3,681
2
0
When AMD came out with Morphological Anti-Aliasing (MLAA), a post-processing full-scene anti-aliasing technique, that runs via GPU-accelerated DirectCompute, many where quick to try it and then dismiss it again because of some of the faults it had.

Nvidia followed with slightly differnt technique (FXAA), that again has alot of faults simular to MLAA (the insane blurr/detail loss).

The new kid on the block, is SMAA.

What is SMAA?

SMAA is a very efficient GPU-based MLAA implementation, capable of handling subpixel features seamlessly, and featuring an advanced pattern detection & handling mechanism.
Here is a link to the site I found the SMAA injector at:
http://mrhaandi.blogspot.dk/p/injectsmaa.html



One of the nice things about it is,
the text fonts arnt totally ruined like FXAA/MLAA usually do.


Exsample:
GTA4 NOAA:
GTA4_NOAA.png


GTA4 SMAA:
GTA4_SMAA.png


***
Look at the font area in the top left hand corner.
MLAA/FXAA usually dont leave text/fonts that well intact.

***

How well does SMAA do?
Lets look at some exsamples:



Skyrim 4xMSAA:
skyrim4xmsaa.jpg


Skyrim SMAA:
skyrimsmaa.jpg






Ive tried this on a few games, and it impressed me.
Makeing a thread here, in the hope more notice this great little tool.

You can download version 1.2 here:
https://sites.google.com/site/mrhaandi/injectSMAA_by_mrhaandi_1.2.7z
 

cmdrdredd

Lifer
Dec 12, 2001
27,052
357
126
Tried on skyrim and ended up with screwed up textures and smoke. Probably some mod I have installed too.
 

Arkadrel

Diamond Member
Oct 19, 2010
3,681
2
0
By the way, here are a couple of pictures, showing how awful (and blurry) the ingame FXAA is.

NIi0A.png


EgXvE.png


Fullsize pics: No-AA, FXAA, SMAA. (blegh, imgur destroyed the original jpg-quality)

Not only, did ArenaNet go the 'lazy-way', by not supporting MSAA but instead, implementing FXAA. They also did a real shitty job doing so.

Don't get me wrong, I love ArenaNet for their enthusiasm, openness, community-involvement and general awesomeness, and their game is certainly one of the greatest things I've played since many years.
However, its quite apparent that they really don't care about 'niche' things like MSAA, SSAA and FXAA, at least not until now, which is understandable, since they've been working their asses off to get GW2 out of the door, but I still think its a damn shame the graphical-options aren't as polished as the rest of the game.

^ this post was the one that got me intrested, and made me google "SMAA injector"
So I just wanted to thank SomeoneSimple, for his/her post.

Ive since tried it in a few games, and loveing it.
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
^ this post was the one that got me intrested, and made me google "SMAA injector"
So I just wanted to thank SomeoneSimple, for his/her post.

Ive since tried it in a few games, and loveing it.

Hey no problem, I'm just spreading the love. I'm happy that someone else tried it and is spreading the word, because of my small comparison. :biggrin:

Hopefully game developers will start picking SMAA up, too. The post-process part of SMAA is just as easily implementable as FXAA, while delivering better image quality.
 
Last edited:

KingFatty

Diamond Member
Dec 29, 2010
3,034
1
81
Looks interesting. The source page has an abstract that uses buzzwords like "synergies" and "robust."

http://www.iryoku.com/smaa/

Looking at the pics above, it was interesting on this one how the SMAA seems to not apply smoothing to the intricate insides of the bunch of filament things. The algorithm seems to intelligently focus on the outside filaments but not the inside. Contrast that with the other technique that seems to apply to everything in a dumb brute force sort of way.
EgXvE.png
 

Face2Face

Diamond Member
Jun 6, 2001
4,100
215
106
Hmm... this might be the cure for the dreaded no MSAA in GTA 4? So will this look better than 4X MSAA in Skyrim as well? I don't like the look of FXAA, too blurry. How is performance comparded to MSAA in Skyrim?
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
How is performance comparded to MSAA in Skyrim?
SMAA Injector on its default 'SMAA_PRESET_HIGH' is just a bit more gpu-intensive then plain FXAA, so performance loss is pretty negligible in most cases.

SMAA doesn't compare to MSAA though. MSAA actually adds (subpixel-)detail to smooth polygon edges, SMAA only tries to hide jaggies (but does a good job doing so).
Most noticeably, you'll still have pixel-crawling/flickering with SMAA.

However, SMAA does support being used in combination with MSAA. That's the 'subpixel' part of its name, unlike any other post-process AA filter (i know of), it can correctly detect gradients, thus it can be used in conjunction with other forms of non-PP AA, like MSAA and SSAA.

That said, I'm currently using 1.2x OGSSAA (NV custom resolution override) with SMAA injected, in games that don't play nice with MSAA. SMAA takes care of anti-aliasing, and SSAA greatly lessens the amount of pixel-crawling.
It looks gorgeous, far better than only 1.2x OGSSAA or SMAA on its own.

It's great to have such flexibility with AA. ^_^
 
Last edited:

ZeroRift

Member
Apr 13, 2005
195
6
81
This looks pretty awesome! Thanks for sharing!

I am a little concerned about trying to use it on an mmo / Online DRM game, since very similar methods (injecting dlls) are used to cheat. I don't want to get falsely accused of cheating / banned for using a better graphics filter :(

I really hope that AMD / Nvidia take notice....

It's depressing when a small dev shop or "just some guy in his garage" can write a better filter than the combined efforts of multi-billion dollar GPU companies....
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
It's depressing when a small dev shop or "just some guy in his garage" can write a better filter than the combined efforts of multi-billion dollar GPU companies....

I would hardly call Jorge Jimenez (one of the guys behind Jimenez-MLAA and SMAA) "just some guy in his garage". :p (he works for Activision atm)

IMHO, Nvidia and Timothy Lottes deserve similar credit. While most "in-game" implementations of his tech is just plain awful (most likely due to lazyness/ignorance of game-developers), at least he, and Nvidia, are putting a lot of thought, time and resources in unconventional anti-aliasing methods like SRAA, FXAA and TXAA. As long as they keep that up, maybe one day, they'll find the perfect solution to all aliasing, without the performance cost of SSAA. ^_^
 

Face2Face

Diamond Member
Jun 6, 2001
4,100
215
106
SMAA Injector on its default 'SMAA_PRESET_HIGH' is just a bit more gpu-intensive then plain FXAA, so performance loss is pretty negligible in most cases.

SMAA doesn't compare to MSAA though. MSAA actually adds (subpixel-)detail to smooth polygon edges, SMAA only tries to hide jaggies (but does a good job doing so).
Most noticeably, you'll still have pixel-crawling/flickering with SMAA.

However, SMAA does support being used in combination with MSAA. That's the 'subpixel' part of its name, unlike any other post-process AA filter (i know of), it can correctly detect gradients, thus it can be used in conjunction with other forms of non-PP AA, like MSAA and SSAA.

That said, I'm currently using 1.2x OGSSAA (NV custom resolution override) with SMAA injected, in games that don't play nice with MSAA. SMAA takes care of anti-aliasing, and SSAA greatly lessens the amount of pixel-crawling.
It looks gorgeous, far better than only 1.2x OGSSAA or SMAA on its own.

It's great to have such flexibility with AA. ^_^

I currently have a HD 6870, and playing Skyrim with 2X MSAA and 16XAF @ 1080P ultra settings. Would you suggest using a certain level of SMAA with the 2XMSAA? I trying to make the game look better without the extra load using 4XMSAA or 8XMSAA.
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
Would you suggest using a certain level of SMAA with the 2XMSAA? I trying to make the game look better without the extra load using 4XMSAA or 8XMSAA.

I would stick with 'SMAA_PRESET_HIGH' (the default setting). Below that, edge- and gradient detection starts to get wonky, which is especially apparent on text. SMAA_PRESET_ULTRA has a noticable performance hit, so unless you still have some gpu-power to spare, you should probably avoid that.
 
Last edited:

Face2Face

Diamond Member
Jun 6, 2001
4,100
215
106
I would stick with 'SMAA_PRESET_HIGH' (the default setting). Below that, edge- and gradient detection starts to get wonky, which is especially apparent on text. SMAA_PRESET_ULTRA has a noticable performance hit, so unless you still have some gpu-power to spare, you should probably avoid that.

Ok great. Is going to look much better with the MSAA and the SMAA?
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
Ok great. Is going to look much better with the MSAA and the SMAA?
I hope I understand you correctly, but yeah, 2x MSAA only anti-aliases one plane (either horizontal or vertical (well, except for quincunx *shudder*)), so adding SMAA to it will certainly look better, compared to using 2xMSAA standalone.
 

Face2Face

Diamond Member
Jun 6, 2001
4,100
215
106
I hope I understand you correctly, but yeah, 2x MSAA only anti-aliases one plane (either horizontal or vertical (well, except for quincunx *shudder*)), so adding SMAA to it will certainly look better, compared to using 2xMSAA standalone.

Ok, you answered my question. You are way over my head on this........ :)

I will try it out this week.
 

Face2Face

Diamond Member
Jun 6, 2001
4,100
215
106
Well I tried out Skyrim last night with the SMAA. I used it with 2XMSAA and saw zero difference in the graphics quality. toggling between SMAA and no SMAA made no difference. One thing I did noticed it screwed up some textures while playing the game. May be to many mods installed? I will be trying this on GTA 4, which desperately needs some type of AA.
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
toggling between SMAA and no SMAA made no difference.
Then it wasn't working.
Don't forget to use the correct files, in this case, the DX9-files for Skyrim.

I guess the problem is, that you where using ENB-mod (or similar 'injectable' graphical mod) for Skyrim.
That, and other "overlays" like MSI Afterburner won't work together with the injector since they override the DirectX-DLL and inject itself the same way SMAA does. You'll have to disable that overlay, or enable some sort of compatibility mode in the overlay's options (if applicable).

One thing I did noticed it screwed up some textures while playing the game.
I've neven seen, or heard about SMAA injector causing graphical issues, in any game. It's probably unrelated.
 
Last edited:

Fox5

Diamond Member
Jan 31, 2005
5,957
7
81
Does the steam overlay mess with these AA techniques? I haven't tried this yet, but none of the in game aa settings in deus ex hr seemed to make a difference to me.

Also, is there any cure for shimmering and crawling? That bothers me way more than jaggies!
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
Does the steam overlay mess with these AA techniques? I haven't tried this yet, but none of the in game aa settings in deus ex hr seemed to make a difference to me.

For SMAA there is a compatibility bit for steam, at the end of the 'Injector.INI' configuration file (shown below). And I agree, the selectable AA-modes in DE:HR are all equally bad.
Code:
;set to 1 to improve steam overlay compatibility
weird_steam_hack = 0

Also, is there any cure for shimmering and crawling? That bothers me way more than jaggies!
SMAA does a better job at handling pixel-crawling then other AA filters since its ability to smooth 'lines' is simply better (as you can see in image on the third post). However, SMAA 1x doesn't do anything with "single-pixel geometry", so flickering/shimmering on distant or small objects will still occur.
 
Last edited:

djsb

Member
Jun 14, 2011
81
0
61
I've found a perceptible difference between High and Ultra in Stalker games which makes the performance hit worth it. I think it's because there is a lot of skinny geometry (scaffolding, broken pipes, wires and the like, not to mention the reeds in the swamp areas) which gets improved at the highest quality. Native AA was always a bit wonky in those games anyway (and nonfunctional in the first).
 

Face2Face

Diamond Member
Jun 6, 2001
4,100
215
106
Then it wasn't working.
Don't forget to use the correct files, in this case, the DX9-files for Skyrim.

I guess the problem is, that you where using ENB-mod (or similar 'injectable' graphical mod) for Skyrim.
That, and other "overlays" like MSI Afterburner won't work together with the injector since they override the DirectX-DLL and inject itself the same way SMAA does. You'll have to disable that overlay, or enable some sort of compatibility mode in the overlay's options (if applicable).


I've neven seen, or heard about SMAA injector causing graphical issues, in any game. It's probably unrelated.

I copied the DX9 files into the root directory, and the game would not start. I then tried the DX10 files and the game would start and said I was using the SMAA injector. I did notice when using the pause key, the textures would look fine and then once I pressed the key they looked broken. I am not using any ENB or PP filters. I am just using texture resolution enhancements.
 

SomeoneSimple

Member
Aug 15, 2012
63
0
0
I copied the DX9 files into the root directory, and the game would not start. I then tried the DX10 files and the game would start and said I was using the SMAA injector.

SMAA outputs a log-file when it bumps up against a problem, it also stops the executable.
You shouldn't try to use the DX10-dll with a DX9 game, it will never work, I'm actually surprised you where able to start the game without it crashing in some horrible way. :D