Improved antialiasing ?

Hello,

We have always been concerned about anti-aliasing on our 3D objects with Unity, especially on thin and rounded surfaces when we are in motion, despite a sampling x8 in the quality parameters of Unity.

Of course, we have tested various shaders and plugin but none of them seems satisfactory at the moment.

Do you know whether Unity 5.6 or Unity 2017 improves this aspect?
Or do you have an effective method to improve antialiasing? (Without passed through a drastic reduction of the number of polygons for thin surfaces)

Thanks in advance

1 Like

From my observations it seems that classic anti-aliasing is dying out. The GTX 1080 for example only allows up to 8x anti-aliasing, when older cards allowed up to 32x. A likely cause of this is the prominence of deferred rendering, which doesn’t work with typical anti-aliasing techniques. The industry appears to be moving towards super resolution rendering. E.g. NVIDIA GeForce Experience comes with a feature called Dynamic Super Resolution, which can make this happen without the application needing to support it. I don’t currently know whether this can be run with rearranged sampling patterns such as the one used by RCSAA for the usual power-of-two quality increase though, and it’s obviously going to be more expensive, but then again it also solves other problems such as over-sharpening on anisotropically sampled surfaces.

1 Like

Technically it does, it’s just Unity’s deferred doesn’t, and supporting MSAA with deferred takes a bit more work than forward. Several late Xbox 360 titles were deferred w/ MSAA. It’s just not done much anymore since post processing AA (FXAA, MLAA, SMAA, and lately TAA) are far less costly and can often produce “good enough” or even better results. The latest deferred techniques are actually going back to using MSAA again, though in a slightly different way.

This appears to be a software limitation, and not hardware. People gotten GeForce cards to appear as a professional Quadro card to the drivers and it unlocks up to 64x MSAA. CAD often use a lot of thin geometry, so MSAA is more useful. Nvidia (and AMD) have long artificially segregated certain features to their professional cards, and >8x MSAA is one of those features that rarely sees use for consumer hardware. Super sampling, or just higher framerates, are usually higher priority to gamers.

If 8x MSAA isn’t enough, I would certainly suggest looking into super sampling.

2 Likes

Oh, another thing with thin geometry. If this is thin, round, and lit geometry, specifically with reflections or specular highlights, sometimes using centroid sampling on the normals can help significantly. This isn’t something Unity’s built in Standard shaders have any support for as it requires using an additional interpolated to pass the surface normals twice, but it can help significantly in some situations. If you’re seeing worse aliasing with MSAA turned on, or seeing “sparkles” on the edges of geometry, it’s probably due to over interpolation.

You can read a little about it on page 44 of Alex Vlachos’ (Valve) Advanced VR Rendering:

It looks a little like a throw away page after the many pages on specular anti-aliasing, but I know from experience the increase in quality can be huge. A project I was working on for VR we had cranked up the MSAA to 8x and just weren’t getting the quality we wanted and started contemplating using FXAA or SMAA to just basically blur things a little to make the aliasing less obvious. Then I tried implementing centroid sampling and everything magically fixed itself.

Upgrading the standard shader to include centroid sampling is no simple task though, just because of all the files the Standard shader actually uses, and I don’t think it can be done with just a surface shader easily either, unfortunately. I modified the Standard shader to add it for another project, but it didn’t make an appreciable difference due to the art style being mostly large, soft objects with little specular (Wayward Sky for the PSVR) so I removed it and honestly don’t remember exactly how I did it.

I can tell you to get centroid sampling you just need to pass the Normal from the vertex shader to the fragment shader using a v2f struct with:

half3 normal : NORMAL0;
half3 normalCentroid : NORMAL1_centroid;

4 Likes

It never occurred to me that interpolation modifiers are a thing. Now I have something new to mess around with. It’s really good to have you around bgolus. :smile:

Hi. I could not sleep because all the bright pixel flickering on the edges and finally found this thread after reading the valve presentation.
Did you find all the places in the Standard Shader to implement the centroid sampling. I am on 8xMSAA and use the Adaptive Quality out of the VRTK. This bright pixel specular flickering on fine geometries and edges from high glossy materials finishs me.)

Did someone know if the specular aa in the alloy shader asset does this. Documentation gives no detailed info how it is inplemented.

The use of partial derivatives for the roughness term on site 43 look nice too.
Extending the Standard Shader is not as easy for me.

Did you tried one of these methods inbetween?

@4sascha
Alloy does specular AA by analyzing a material’s normal map mipmap chain, and baking the AA for it into the material’s roughness map. Since the output is just a regular roughness map, the shader doesn’t need to do anything special and the effect is completely free at runtime.

Thanks for the detailed explaination of Alloys specular AA. I will try it. The most problems i have on highly reflective chrome materials on really thin geometries. E.g. everthing with small radius on car interior geometries.
Think the centroid normal would help there most.

Oh yeah!! Good ideas, Thank a lot.
ไฮโลออนไลน์