SMAA – Subpixel Morphological Antialiasing integration

I am pretty sure SMAA from Crysis 3 is awesome. It’s not fair to compare quarter-implemented SMAA to fully featured UE4’s TAA.

It’s not a question of usage. One thing being relatively better than another doesn’t mean it’s good in the absolute sense, does it? TAA is imperfect, but I see it as better in the vast majority of use cases.

Implementing the remaining “three quarters”, as you put it, requires MSAA. Given that the primary UE4 renderer is deferred, it would mean a non-trivial rewrite of half of it, with serious performance and code usability implications. There’s a simple demo by NVIDIA, but this approach doesn’t scale well to a fully-fledged renderer. If you want to do it and go all the way to “100%”, be my guest and prove me wrong! :wink:

Yup, you’re correct on all accounts. In fact, the reason I integrated SMAA for The Vanishing of Ethan Carter in the first place was because our artists hated the blurry looks of TAA, plus it completely stopped the apparent movement of foliage at a distance. SMAA was an aesthetic compromise between aliasing and definition.

Very cool!! For some reason when I read the thread title I kind of assumed it would be a thread about “why doesn’t epic have this yet”, but low and behold, in a box! That doesn’t happen often, so thanks!

Fwiw, with the option to have the foliage output their velocity from the vertex shader motion, it should fix a good deal of that. The problem that persists and we still don’t have a good solution for though is the smearing you get when a foreground object moves past those moving noisy background elements like grass or trees. I understand how for certain projects that artifact can be too nasty so having more options with different tradeoffs makes sense.

This is exactly my with TAA and has been ever since I’ve used the engine. I actually made a small test scene to test the difference with TAA and SMAA. I forgot to enable “Accurate velocities from Vertex Deformation” on project settings on that video, so tree animations look bit more blurred on TAA than they could look but I tested with the setting on and it didn’t really make any difference to the ghosting when the camera itself is moving.

I know that TAA is really bad when you have this kind of setup, so please take that into account when watching this. Anything with big contrast and fast moving camera is poison to TAA on my own tests and SMAA also suffers for this (but the artifact is different). Anyway, here’s my test video (definitely not a showcase material): https://youtu.be/-TpBF0iTwsY

edit-> The AA text is just attached to camera, hence getting the PP . Motion blur and SSR were turned off for this test (actually motion blur was totally unusable with anything but TAA on this case and even with TAA it didn’t look good as you get even worse trail along with the ghosting effect). I know this ghosting isn’t as visible when the contrast between objects isn’t this big, but it is a huge on my project where I have chrome bumpers on cars for example. Also note that trees on the other side has translucent material while other side trees had masked material, trees themselves are based on the same speedtree model.

If anyone has a proper solution to making this less of an, I’d love to hear about it. TAA for antialiasing is superior when looking more into distance on the level, all other AA methods I tested here shimmer a lot, but ghosting artifacts are that bad on every other solution that I have to just stick to FXAA.

Btw, I don’t recall playing games, ever, with AA. I always have AA off :o

Just watched your video. In PostProcessTemporalCommon.usf try to replace #define AA_DYNAMIC_ANTIGHOST 0 with #define AA_DYNAMIC_ANTIGHOST 1. It should decrease level of ghosting in temporal aa.

Thanks for the info, I tried this, it reduces the ghosting to not show the white part on the ghosting artifact, but there’s still a huge dark area trailing the movement. It’s not just under the car but on the sides as well like the ghosting effect on that video was for the white part.

Forgot to mention that with that ANTIGHOST 1, TAA ghosting isn’t that bad against regular ground materials, it just fails on that worst case high contrast scenario and it actually makes the vehicle mesh look way worse than FXAA in motion as it’s all too “alive”.

Yeah, this trick doesn’t works good enough for fast gameplay. But on textured scene with dark background (for example asphalt) it should look more or less acceptable… I miss old good msaa

Thanks for sharing Godlewski. We will try it soon.

Awesome stuff! Thanks! :smiley:

UE4 absolutely needs a better AA alternative, the current options are a joke.
TAA is the worst AA I ever seen, it’s not usable for natural scenes with trees, grass, rivers or other movable objects, with TAA everything looks blurred, every scene I make looks like stylized cartoonish Sht with TAA,
I don’t care if some Epic developer or even Sweeney itself came here to say that TAA is the most advanced AA ever built, NO It isn’t!!!
the trick they do with TAA to make the hard edges disappear is the f
**ing blur, that’s a very cheap and ugly method, you take the blur out and you will see the edges.

FXAA almost have no effect, specially on grass, too much aliasing, works okish on big trees, but its not an option…

I see some developers here implementing successfully SMAA on their games like “Vanishing of Ethan Carter Redux”, my question is, why epic doesn’t implement SMAA from the beginning?
A game engine needs to have options, a good AA is very important and cannot be limited to 2 crappy options.

True, just tested it.

haha, nice one :wink:

Thank you for sharing! Awesome awesome work! :slight_smile: :cool:

The Smaa patch break the Linux client. Has anyone tried? I know that you aren’t providing support, but perhaps someone could try.

holy sh*t son. I struggled with this for months. I saw this just now but the link 404’ed. please help?

I’m not an AA expert by all means so I have a question about taking screenshots in-game.

With TXAA, when you want a high res shot, since the image is captured in tiles, you don’t get ssr in your final image. I’ve heard it’s because tXAA is a temporal (duh!!) solution.

Does it work the same way with SMAA ? Or could we finally take huge screenshots with ssr included in the final image? This is probably the no.1 on my wish list at this point.

You can change the screen percentage setting to 200% and/or use Nvidia DSR to change your desktop resolution to get clean high resolution images with no issues.

I wish Epic would remove tile shot because it does not work with screen space , and there’s a lot of them on by default in UE4. And replace it with something that doesn’t require those 2 work arounds I mentioned.

Would it be possible to make this into a plugin for us less c++ minded?

I’m interested to try it out as I am struggling with aliasing but I am very hesitant to convert my project to c++ and try to make this work as I can easily see myself loosing two-three weeks trying to figure this out.