2
$\begingroup$

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:

Illustration of shading aliasing

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.

Simplified PBR fragment shader: https://textuploader.com/dv3h1

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!

$\endgroup$
2
  • $\begingroup$ Can you create an none textured specular-only and fresnel-only image to help visualise were the problem is ? $\endgroup$
    – PaulHK
    Sep 26, 2018 at 2:12
  • 1
    $\begingroup$ 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. $\endgroup$
    – narthex
    Sep 30, 2018 at 18:11

1 Answer 1

1
$\begingroup$

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

http://advances.realtimerendering.com/s2014/epic/TemporalAA_Compare.mov

http://advances.realtimerendering.com/s2014/index.html#_HIGH-QUALITY_TEMPORAL_SUPERSAMPLING

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.