Skip to content

Commit

Permalink
KHR_materials_ior: Clarify zero value operation (#2448)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexaknyazev authored Sep 30, 2024
1 parent 7f386dc commit 0251c5c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion extensions/2.0/Khronos/KHR_materials_ior/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,21 @@ dielectric_brdf =
α = roughness^2))
```

Valid values for `ior` are numbers greater than or equal to 1. In addition, a value of 0 is allowed. This value gives full weight to `layer`, i.e., the Fresnel term evaluates to 1 independent of the view or light direction. It is useful in combination with `KHR_materials_specular` to seamlessly support the specular-glossiness workflow.
Valid values for `ior` are numbers greater than or equal to one. As a special case, a value of zero is allowed as described below.

### Specular-Glossiness Backwards Compatibility Mode

Setting IOR to zero permanently switches the material into a special specular-glossiness backwards compatibility mode designed to ease content transition from the legacy specular-glossiness model (previously available via `KHR_materials_pbrSpecularGlossiness` extension) to the glTF 2.0 core metallic-roughness PBR model.

This mode has the following implications:

- The effective IOR becomes positive infinity and the Fresnel term **MUST** evaluate to `1.0` independently of the view or light direction.

- All material features **MUST** treat IOR as having a very large value representing positive infinity, subject to numerical precision. For example, this would cause the `dispersion` property (as defined in `KHR_materials_dispersion`) to have no effect on the material appearance.

- This mode cannot be toggled dynamically, e.g., with `KHR_animation_pointer` or `KHR_interactivity` extensions. If the IOR property is set to zero in JSON, glTF Asset Object Model updates of it **MUST** be ignored.

- A value of zero (as well as any other value less than one) **MUST NOT** be used in an animation sampler targeting the IOR property, even if the IOR is set to zero in glTF JSON.

## Implementation

Expand Down

0 comments on commit 0251c5c

Please sign in to comment.