-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference PBR Implementation is not Physically Based because it loses Energy due to bad Fresnel used on Diffuse #1853
Comments
@proog128 you might be interested. |
Thanks @devshgraphicsprogramming, have you seen @proog128's #1717? It's a work-in-progress on a revised Appendix B. |
@devshgraphicsprogramming Since the recent update, #1717 describes some of the issues regarding physical accuracy of the |
Yes sometimes it produces, sometimes it loses energy.
I've already got this covered in my framework (I'll probably upgrade to Enterprise PBR for the multiscatter compensation), I'd like to see glTF address that problem, because the current "PBR" model is really off the mark from ground truth, its not a matter of just simply losing some energy that would be accounted for in multiple scattering, but using the completely wrong fresnel transmission weight with no physical justification for the diffuse surface underneath the specular. |
Think this can be closed, as it has been revisited in PBR next and the latest implementation of the glTF Sample Viewer. |
The section here is not Physically Based
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#appendix-b-brdf-implementation
That "reference" implementation makes the same errors as learnopengl.com and it results in severe energy loss.
(Disclaimer, its not my project, but of a developer I've helped out)


vs.
The Diffuse component cannot be weighted by 1 minus the Fresnel given by the angle between the half vector (same as used for the specular), it actually needs two weights of Fresnel transmittance computed with angles between normal and view direction or light direction respectively (its not exact integral, but a very good approximation).
For details c.f. Earl Hammon's GDC presentation on PBR in Titanfall
https://twvideo01.ubm-us.net/o1/vault/gdc2017/Presentations/Hammon_Earl_PBR_Diffuse_Lighting.pdf
or this stackexchange post (less authoritative)
https://computergraphics.stackexchange.com/questions/2285/how-to-properly-combine-the-diffuse-and-specular-terms
or a snapshot of a discussion I've had
https://docs.google.com/document/d/1ZLT1-fIek2JkErN9ZPByeac02nWipMbO89oCW2jxzXo/edit
@snagy @UX3D-nopper @McNopper you've authored this, am I correct?
P.S. Hammon computed his correction factor of 1.05 for multiple internal scatter of diffuse using the Schlick's approximation which only works for materials with IoR 1.33.... ( so you're always stuck with a "glass coating" assumption). We've computed the proper correction factor for a range of IoR in [0.5,2.5] derived from the full Fresnel equations (equally mixed polarization) and fitted a rational polynomial with a few coefficients to it (
n
is IoR, andn2
is IoR squared)https://github.com/buildaworldnet/IrrlichtBAW/blob/shader_pipeline/include/irr/builtin/glsl/bxdf/brdf/diffuse/fresnel_correction.glsl
as expected, its valued exactly 1.0 for IoR 1.0 (very important if we do not want a specular coating at all) and around 1.05 for an IoR of 1.33... in line with Hammon's.
The text was updated successfully, but these errors were encountered: