# PBR and Specular Aliasing

I have been following LearnOpenGL.com's tutorials on PBR. Everything makes sense and I wrote up a shader for my physically based renderer.

I noticed that the results look great, however all of my metal objects have such a strong specular on the edges thanks to my Fresnel calculation, and it is producing specular aliasing.

See image:

I can't seem to figure out why, or how to fix this. I also uploaded a simplified version of my PBR fragment shader. If someone could take a look, I would really appreciate it.

Here is the tutorial I am following: https://learnopengl.com/PBR/Lighting It doesn't seem to have any of these specular aliasing issues.

Thanks!

• Can you create an none textured specular-only and fresnel-only image to help visualise were the problem is ? – PaulHK Sep 26 '18 at 2:12
• This PBR code contains many calculations prone to math errors like division by zero which cause undefined behaviour, i'd check that first and add some margin to prevent this like max(1e-5, something). I actually implemented this tutorial some time ago and did some corrections. – narthex Sep 30 '18 at 18:11

I'll point out that even if you did implement it correctly, at 1 sample per pixel with low roughness materials you'll still see heavy specular aliasing. It's not uncommon to see the firefly pattern on edges on low roughness materials.

For reference see the Infiltrator demo without TAA