-
Notifications
You must be signed in to change notification settings - Fork 234
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
Clearcoat renders Fresnel reflectance on both coat and base layer. #546
Comments
I created a new version of the clearcoat test model, adding a column where the base material uses IOR = 2.0 Now we just need to adapt the ior extension to allow setting the refractive index on metals as well. |
And here is the adapted clearcoattest glb with an added column using the ior extension. |
The sample viewer probably is following the (non-normative) implementation recommendations in KHR_materials_clearcoat. This implementation has some limitations, in particular:
The implementation details described in ADOBE_materials_clearcoat_specular will not solve this issue right away, because it only affects the clearcoat Fresnel. However, we would require the base layer Fresnel to take the clearcoat IOR into account (clearcoat/base interface). As you explained, this is actually the more physically correct behavior. The downside of this approach is that it is comptutationally more expensive: it requires the base Fresnel to be evaluated twice, because we now have to blend between a base layer with clearcoat on top and a base layer without clearcoat on top, based on the clearcoat strength. |
Well, either way it is a material property that is only calculated once per material based on IOR values.
The reflectivity factor is calculated using the Schlick approximation and is really fast, fixing this will not have an impact on performance. |
Currently we always follow the spec implementation sections. If we want to use a more sophisticated version we need to clarify that this is not following the spec description. From my point of view it would make more sense to first add the described method as an alternative implementation in the clearcoat readme and updated sample viewer afterwards accordingly. |
As clearcoat is an additional layer (with IOR 1.5) that light interacts with prior to interaction with the base-layer, there shall be no Fresnel reflection in the base-layer (unless material uses IOR extension).
The below image is from
ClearCoatTest.glb
in the sample asset repo:Compare 'Base layer' and 'Coated' columns and you will see that the reflection from the 'Base layer' are still present when using clearcoat.
Instead it should look like this - here you can see that the reflection from the 'Base layer' is not present in the coated versions.
The text was updated successfully, but these errors were encountered: