Geometric Specular Anti-aliasing

The inconsistent sampling frequency and signal change of the specular BRDF in PBR often leads to specular aliasing, which is very common in JME3. You can import a PBR model with obvious highlights. When rotating the view or moving away, you will find a series of discrete highlight points.
The solution is to apply highlight anti-aliasing for the specular term, which has become a mainstream practice. Below is Unity’s explanation of it and relevant papers:


I have implemented the method mentioned in the aforementioned paper on JME(Especially when I was testing global illumination recently, the highlight aliasing became more obvious.), currently, it looks like effective highlight anti-aliasing has been applied to the specular term. When moving the camera and zooming out, there are no more obvious discrete highlight points. I wonder if I should allow this part to be included as part of PBRLighting? (with very minimal code changes)

disable SpecularAA:

enable SpecularAA:

disable SpecularAA:

enable SpecularAA:


I’m all for it. It would be nice to use specular without those annoying artifacts. :smiley:


Alright, I will include these minimal modifications as part of PBRLighting, enabled or disabled via param, without affecting any existing functionalities. I will submit it later through a separate PR. :grinning:


I have submitted this part of the modifications in this PR.


Thank you for efforts @JhonKkk . You give us a lot of hope for the future of this engine :clap: :clap:


While i do not really see much difference in this pictures, i do know i seen it could help a lot even with my Terrain moisture shader where i noticed some visual issues where specAA could help :slight_smile:

Ofc usually Bloom/blur/etc lower artifact levels, but still specAA is nice :slight_smile:

Thanks Jhon!


SpecularAA has been set to true by default, while PBRTerrain has been updated.@yaRnMcDonuts