JoeyDeVries / LearnOpenGL

Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com
https://learnopengl.com
Other
11.12k stars 2.81k forks source link

Possible fix for PBR shader #44

Open FredrickV opened 7 years ago

FredrickV commented 7 years ago

Adding the " + 0.001;" solves similar/identical artifacts noted a few lines bellow (divide by zero), only reason why i say possible is it only occurs in high angles with reflective surfaces (roughness < 1.0f) float G = GeometrySmith(N, V, L, roughness) + 0.001 ;

Easiest surface to test it on is a normal map with low roughness, move view down and look along the horizon and towards the light source

JoeyDeVries commented 7 years ago

I'm not sure the artifact is related to PBR as I don't believe adding the 0.001 would fix anything. It's probably related to normal mapping itself at steep angles.