Skip to content
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

KHR_materials_ior #1718

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
61 changes: 61 additions & 0 deletions extensions/2.0/Khronos/KHR_materials_ior/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# KHR\_materials\_ior

## Khronos 3D Formats Working Group
emackey marked this conversation as resolved.
Show resolved Hide resolved

* TODO

## Acknowledgments

* TODO

## Status

Experimental

## Dependencies

Written against the glTF 2.0 spec.

## Overview

The dielectric BRDF of the metallic-roughness material in glTF uses a fixed value of 1.5 for the index of refraction. This is a good fit for many plastics and glass, but not for other materials like water or asphalt, sapphire or diamond. This extensions allows users to set the index of refraction to a certain value.

## Extending Materials

The index of refraction of a material is configured by adding the `KHR_materials_ior` extension to any glTF material.

```json
{
"materials": [
{
"extensions": {
"KHR_materials_ior": {
"ior": 1.4,
"iorTexture": 0
}
}
}
]
}
```

The index of refraction typically is a value between 1 and 2, in rare cases it may be larger than 2. In contrast to other texturable values in glTF, `ior` and `iorTexture` are not multiplied: if no texture is given, `ior` is used, otherwise the texture overrides it.

| |Type|Description|Required|
|-|----|-----------|--------|
| **ior** | `number` | The index of refraction. | No, default: `1.5`|
| **iorTexture** | [`textureInfo`](/specification/2.0/README.md#reference-textureInfo) | A greyscale texture that defines the index of refraction as 1/ior. | No |
emackey marked this conversation as resolved.
Show resolved Hide resolved

## Implementation

The index of refraction affects the Fresnel term in the dielectric BRDF:

```
dielectric_brdf =
fresnel_mix(
diffuse_brdf(baseColor),
microfacet_brdf(roughness^2),
ior)
```

In case `KHR_materials_transmission` is enabled, the index of refraction also affects the refraction of light rays passing through the transparent surface.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "KHR_materials_ior glTF extension",
"type": "object",
"description": "glTF extension that defines the index of refraction of a material.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"ior": {
"type": "number",
"description": "The index of refraction.",
"default": 1.5,
"minimum": 1.0,
emackey marked this conversation as resolved.
Show resolved Hide resolved
"gltf_detailedDescription": "The index of refraction (IOR) 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 a material. It also influences the ratio between reflected and transmitted light, calculated from the Fresnel equations."
},
"iorTexture": {
"allOf": [ { "$ref": "textureInfo.schema.json" } ],
"description": "A greyscale texture that defines the index of refraction.",
"gltf_detailedDescription": "The texture stores the inverse of the index of refraction (1/ior) to keep the values in the range 0 to 1."
emackey marked this conversation as resolved.
Show resolved Hide resolved
},
"extensions": { },
"extras": { }
}
}