-
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
[PBR extension] Specify formula to calculate BRDF inputs from material properties #810
Comments
+1 from me for including this. |
I already pinged @mlimper and @tsturm vial mail. In fact, this issue might be nearly a duplicate of #697 , which was also about an example implementation (but much more - admittedly, I didn't read it entirely...). In the end, some implementation of the shaders has to exist somewhere - the question might be whether the core (shader) code can be published as a reference implementation. |
Thanks, this looks very very useful! We'll put the shader code for a minimalistic example into the appendix as soon as the example implementation is ready - @moneimne is currently working on one. The original idea for the way the spec works comes from @tsturm, he might be able to judge best if your proposal is accurate. Otherwise, I'd check this as soon as the example implementation is ready, to make sure everything is coherent and then let it check by other contributors that worked on actual implementations. |
@mlimper Sounds good. Hoping someone can verify the math. @javagl I think this should be separated out from #697 because the math above should be identical in all implementations. It's different than the BRDF equations because not all implementations will use the same approximations (due to complexity/performance of the equations). Or are we saying we want all implementations to use the same BRDF equations? I'm not sure that's realistic. |
@bghgary set roughness to zero / glossiness to one, is it expected that the curves at the top of the spheres go in the opposite direction like they are mirrored? Makes it harder to compare. |
Yes. The environment map depends on the position of the object. There should be a way to tweak the shaders so that they match. |
Added as explanation part of #830 https://github.com/KhronosGroup/glTF/pull/830/files#diff-a787a363bd89618cda440f087cd0e0e1R798 lets resolve this |
The PBR spec does a good job of describing the two material models and their properties, but there is currently no information about how to calculate the BRDF inputs from the material properties, not even in the appendix. There is also little information about this on the web. I realize this math can be inferred from the example shaders, but I propose that we add this information explicitly since all implementations should be doing the same thing. The approximations for the BRDF can differ between implementations. Thoughts?
This is my understanding of the math. All values are in linear space.
BRDF Inputs
Specular-Glossiness
where
Metallic-Roughness
where
Is this information accurate?
(Updated: Removed A from specular in specular-glossiness and added .rgb to diffuse and baseColor)
The text was updated successfully, but these errors were encountered: