-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add support for glTF KHR_materials_clearcoat extension #11995
Comments
To implement this extension, our PBR shaders will require a fairly significant refactoring. Current flow
Steps 2 and 3 each compute 3 parts:
The specular component has different paths for the anisotropic and isotropic cases. Note that Step 3 is problematic for image-based lighting. If a user supplies environment maps, they probably expect those to be the only light source. Or if the user does want both point and environment lighting, they need to be able to scale them separately. Step 4 applies the ambient occlusion to both image-based and point lighting. This is different from the reference implementation, which does not apply occlusion to the point lighting specular component. Problems for clearcoat implementationThe clearcoat is layered on top of the base material. It contributes light via a specular component only. It also contributes a second Fresnel coefficient for use in combining the layers. The obvious way to implement clearcoat is to re-use the specular and Fresnel calculations in both
Possible new code structure
The refactored
|
Feature
The KHR_materials_clearcoat extension extends the PBR metallic roughness model to enable layering of a clear coating on top of an existing material. This clear coating can provide more realistic rendering of objects such as cars with a two-layered coating, where the color comes from the underlying layer.
CesiumJS does not currently recognize the extension parameters in a glTF. Here is how the clearcoat test model is currently rendered. Note how the first two columns appear identical:
Compare to the result from the reference implementation with the extension enabled:
The text was updated successfully, but these errors were encountered: