Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions extensions/2.0/Khronos/KHR_materials_clearcoat_ior/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!--
SPDX-License-Identifier: LicenseRef-KhronosSpecCopyright
-->

# KHR\_materials\_clearcoat\_ior

## Contributors

- Mike Bond, Adobe, [@miibond](https://github.com/MiiBond)

## Status

Draft

## Dependencies

Written against the glTF 2.0 spec.
- Requires the `KHR_materials_clearcoat` extension to also be defined on the material.

## Exclusions

- This extension must not be used on a material that also uses `KHR_materials_pbrSpecularGlossiness`.
- This extension must not be used on a material that also uses `KHR_materials_unlit`.

## Overview

The clearcoat BRDF in `KHR_materials_clearcoat` uses a fixed value of 1.5 for the index of refraction (IOR). This extension allows users to override that default and set the IOR for the clearcoat layer explicitly, analogous to how `KHR_materials_ior` sets the IOR for the base layer.

## Extending Materials

The index of refraction of the clearcoat layer is configured by adding the `KHR_materials_clearcoat_ior` extension as a sub-extension to `KHR_materials_clearcoat`.

```json
{
"materials": [
{
"extensions": {
"KHR_materials_clearcoat": {
"clearcoatFactor": 1.0,
"extensions": {
"KHR_materials_clearcoat_ior": {
"clearcoatIor": 1.4
}
}
}
}
}
]
}
```

| |Type|Description|Required|
|-|----|-----------|--------|
| **clearcoatIor** | `number` | The index of refraction of the clearcoat layer. | No, default: `1.5` |

Typical values for the index of refraction range from 1 to 2. In rare cases values greater than 2 are possible.

### Layering

The clearcoat effect is modeled as a microfacet BRDF layered on top of the base material using `fresnel_coat` as defined in `KHR_materials_clearcoat`. This extension updates the IOR parameter of that Fresnel term to use `clearcoatIor` instead of the default `1.5`.

```
# clearcoat
clearcoat_brdf = specular_brdf(
normal = clearcoatNormal,
α = clearcoatRoughness^2)

# layering
coated_material =
fresnel_coat(
normal = clearcoatNormal,
ior = clearcoatIor,
weight = clearcoat,
base = material,
layer = clearcoat_brdf)
```

### Implementation

This extension changes only the computation of the Fresnel term for the clearcoat layer:

```
dielectric_f0_clearcoat = ((clearcoatIor - 1)/(clearcoatIor + 1))^2
```

Note that for the default index of refraction `clearcoatIor = 1.5` this term evaluates to `0.04`.

## Schema

- [material.KHR_materials_clearcoat_ior.schema.json](schema/material.KHR_materials_clearcoat_ior.schema.json)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "KHR_materials_clearcoat_ior glTF Material Extension",
"type": "object",
"description": "glTF extension that defines the index of refraction of the clearcoat layer.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"clearcoatIor": {
"type": "number",
"description": "The index of refraction of the clearcoat layer.",
"default": 1.5,
"oneOf": [
{
"minimum": 0.0,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how the base layer IOR extension is defined but, to be honest, I don't quite understand this. What's with the minimum: 0 and maximum 0?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base IOR extension allows (ior == 0.0) || (ior >= 1.0). The zero is a special case to support legacy content, see the extension spec for details.

"maximum": 0.0
},
{
"minimum": 1.0
}
],
"gltf_detailedDescription": "The index of refraction (IOR) of the clearcoat layer is a measured physical number usually in the range between 1 and 2 that determines how much the path of light is bent, or refracted, when entering the clearcoat material. It also influences the ratio between reflected and transmitted light in the clearcoat layer, calculated from the Fresnel equations."
},
"extensions": { },
"extras": { }
}
}