Hello! I’ve discussed a little with my team about the differents Anti-Aliasing we were testing in UE4 and I can’t find a decent answer about which one we’ll set to make the other particles and stuff, so I came here.
TemporalAA - The particles and the weapon material works fine, but the Material I’m using on the pannels is not. (Kind of blur when I move the camera)
FXAA - The particles and the weapon material kind of get blurry and the weapon material gets so shinny in some edges. The material on the HUD
MSAA - Same thing with FXAA but more sharpness
The Rifle Material I’m just using Layered Materials with some Substance Painter bakes, nothing too complex The white graphics on the pannel is a transluscent material in a square with emissive channel
So my question is which one is the right choice? I know It’s kind of generic question which is better cause it’s relative but, Is there a nice setting to make particles work in any of them without ruinning the other materials?
There isn’t a perfect answer. Every AA technique has its pros and cons.
FXAA
Take the image without any AA applied and blur the high contrast parts. Really that’s it. Can catch large aliased shapes pretty well, but will either completely mash small details or miss them. Basically, if there’s something that can’t be seen in the original un-anti-aliased image, FXAA isn’t going to know about it either. It’ll also generally messes with text pretty badly. On the plus side it’s super inexpensive.
MSAA
Hardware level geometric edge anti-aliasing. This only applies to geometry edges, so any aliasing produced from shading (like specular highlights on smooth surfaces or detailed normal maps) won’t get any benefit. It also has some issues with over interpolation which can produce more aliasing on some geometry edges than not having any AA. Produces close to ground truth results in many cases where lighting / shading isn’t a factor, but can still be expensive, especially at higher sample counts. Also only works when using Forward rendering. Some console games managed to use MSAA on deferred, but it requires a bit more low level control than desktops had prior to DX12 / Vulkan, and isn’t considered worthwhile now.
Temporal AA
Reprojects a history buffer (ie: the previous image before post processing like bloom and color correction) using a velocity buffer and depth buffer. For static scenes this can produce images very close to “ground truth” super sampling ala what you might get from an offline renderer. On anything in motion, if it’s opaque, you’ll get different amounts of ghosting, aliasing, blurring, and occasionally something that looks similar to super sampling depending on the scene and the different heuristics used to determine how much (if any) of the previous frame should be used. TAA works best if you’re using also using motion blur to hide the worst cases, but still has pathological issues with transparent effects, moving lights, reflections, panning textures … basically anything that isn’t represented in the velocity and depth buffer. Generally less expensive than MSAA, but usually has to be paired with actual super sampling to get clarity to the same level as MSAA which usually removes any of the performance benefit.
If the game is intended for non-VR, I’d say stick with TAA and work around the issues. Use dithered transparency in cases where there’s obvious smearing, scale up your particle effects if they’re being smoothed away, or use the the Responsive AA setting on the material to mostly disable TAA for the pixels that effect covers.
If you’re aiming for VR, use MSAA, and modify your content so you don’t have super smooth surfaces on sharp edges or in areas of high normal variance.
As a follow up. MSAA in Unreal is an odd duck of sorts. It was only added quite recently, and only due to constant nagging from VR projects. Epic admitted defeat when they released Robo Recall, they even did a presentation showing how MSAA produced better, cleaner results and was less expensive overall vs TAA of similar quality, with a big asterisk on “it depended on the content”. There are a lot of techniques that benefit heavily from TAA, like SSAO and SSR. There are also a lot of techniques for improving the cases where MSAA falls down in terms of shading aliasing that Unreal skimped on due to their original expectation of relying on TAA. Again, VR has pushed a lot of these techniques back into the spotlight with specular shading anti-aliasing via texture preprocessing and geometric variance estimations.
DLSS and other future machine learning AA techniques may make TAA and MSAA obsolete in the near future, but so far it’s feeling a bit more like FXAA+, failing on some of the cases that MSAA and TAA handle well. I expect the future will be some hybrid of all 3.
Thank you for the explanation man, for now I’ll set the AA to none while I’m doing other stuff for the game. Let just hope to this hybrid AA arrive soon.
If by soon you mean 2-3 hardware generations from now, sure. We’re almost a decade into temporal AA solutions, FXAA is just a little bit older, with similar post processing solutions going back around 15~20 years, and MSAA is 30~40 years old.
DLSS isn’t even a year old, I’m not holding my breath.
For TAA to work really well you basically need a graphics programmer to help fine tune it.
There are ways to exclude things from TAA to avoid smearing/ghosting or losing stuff altogether (like small particles) but I don’t know how easy that would be in UE4 without a programmer. We use our own engine so it’s relatively easy for us to implement that kind of filtering since we have several graphics programmers