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_dispersion #2340

Merged
merged 27 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3065257
draft of EXT_materials_dispersion
bhouston Oct 22, 2023
23b436c
incorporating feedback
bhouston Oct 23, 2023
ecd02f0
use inline latex
bhouston Oct 23, 2023
115ae7b
fix typo
bhouston Oct 23, 2023
a6fbf9c
specify defaults and range in extension.
bhouston Oct 23, 2023
6e27535
make clear that it is an enhancement on top of KHR_materials_dispersion
bhouston Oct 23, 2023
d00043a
make clear the names used in other material models.
bhouston Oct 23, 2023
87bd64a
add references from OpenPBR.
bhouston Oct 23, 2023
84365aa
change to storing 20/V
bhouston Nov 13, 2023
f1ad0bd
improve equations
bhouston Nov 13, 2023
9c2bb5f
wording cleanup.
bhouston Nov 13, 2023
c6c6860
split equations apart.
bhouston Nov 13, 2023
d8189a9
test
bhouston Nov 13, 2023
238a23b
improve the json to match dispersion spec
bhouston Nov 13, 2023
eead161
address @lexaknyazev's feedback
bhouston Nov 27, 2023
74f42f4
remove mention of texture
bhouston Nov 27, 2023
2079ab8
Some updates based on review (GitHub and PBR TSG) feedback.
emackey Jan 19, 2024
0b954f8
Update visible light wording
emackey Jan 26, 2024
3fed586
Change $V$ to $V_d$ per review, add note about internal reflections
emackey Jan 26, 2024
03cb95a
Update to reference Cauchy's equation
emackey Jan 29, 2024
ed3665b
Fix blank line
emackey Jan 29, 2024
c4e6d86
Add note box per review.
emackey Jan 29, 2024
2be11e5
Lambda fix per review
emackey Jan 29, 2024
e2760ba
Tweak
emackey Jan 29, 2024
852fd28
Status changed from "Draft" to "RC" in an official PBR TSG vote today.
emackey Jan 29, 2024
72b1006
Contributor list update
emackey Jan 29, 2024
0674552
Clarify Fraunhofer spectral lines and define lambda symbols
lexaknyazev Jan 29, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EXT\_materials\_disperson
# KHR\_materials\_disperson
lexaknyazev marked this conversation as resolved.
Show resolved Hide resolved

## Contributors

Expand All @@ -24,19 +24,39 @@ Written against the glTF 2.0 spec.

This extension adds one parameters to the metallic-roughness material: `dispersion`.
bhouston marked this conversation as resolved.
Show resolved Hide resolved

`disperson` allows users to configure the strength of the dispersion effect in terms of its Abby number. The dispersion effect is a result of the wavelength-dependent index of refraction of a material. It is also known as chromatic aberration.
`dispersion` allows users to configure the strength of the angular separation of colors (chromatic aberration) transmitting through a relatively clear volume. Dispersion is represented in terms of the Abbe number parameterization. The dispersion effect is a result of the wavelength-dependent index of refraction of a material. Dispersion is a widely adopted parameter in modern PBR models. It is present in both OpenPBR and the Dassault Enterprise PBR Shading Model.

The Abbe number \( V \) is computed from the index of refraction at three wavelengths of visible light: 486.1 nm (short wavelength blue, Ns), 587.6 nm (central yellow, Nc), and 656.3 nm (long wavelength red, Nl). The Abbe number makes the simplifying assumption that the index of refraction variance is linear:

\[
V = \frac{N_c - 1}{N_l - N_s}
\]

To calculate the index of refraction at a specific wavelength \( \lambda \), given an Abbe number \( V \) and the central index of refraction (assumed to be at the color blue, \( N_d \), as specified by the KHR_materials_ior extension):

\[
B = \frac{N_c - 1}{V \times \left( \frac{1}{\lambda_s} - \frac{1}{\lambda_l} \right)}
\]
\[
A = N_c - \frac{B}{\lambda_c}
\]
\[
N(\lambda) = A + \frac{B}{\lambda^2}
\]

![Dispersion on a Gem](./figures/Dispersion.jpg)

## Extending Materials

The dispersion, defined in terms of Abby number, is defined by adding the `KHR_materials_dispersion` extension to any glTF material.
The dispersion, defined in terms of Abbe number, is defined by adding the `KHR_materials_dispersion` extension to any glTF material.

```json
{
"materials": [
{
"extensions": {
"EXT_materials_dispersion": {
"dispersion": 42
"KHR_materials_dispersion": {
"dispersion": 55
}
}
}
Expand All @@ -48,25 +68,45 @@ Factor and texture are combined by multiplication to describe a single value.

| |Type|Description|Required|
|-|----|-----------|--------|
| **dispersion** | `number` | The strength of the dispersion effect, specified as an Abby number. | No, default: `59`|
| **dispersion** | `number` | The strength of the dispersion effect, specified as an Abbe number. | No, default: `0`|

The default value of 0 has a special meaning in that no dispersion should be used. This is the default value for backwards compatibility. Any value other than zero is considered to be a valid dispersion value.

Here is a table of common material dispersion Abbe numbers:

The default value of 59 is taken from the low dispersion of crown glass.
| Material | Abbe Number |
| -------- | ----------- |
| Polycarbonate | 32 |
| Diamond | 55 |
| Water | 55 |
| Crown Glass | 59 |

## Implementation

*This section is non-normative.*

*TODO*
One real-time method for rendering dispersion effects is to trace volume transmission separately for each of color channel accounting for the per channel ior as determined by the Abbe number. The resulting composite image will show color separation between the channels as a result.
bhouston marked this conversation as resolved.
Show resolved Hide resolved

## Interaction with other extensions

*TODO*


## Schema

- [material.KHR_materials_dispersion.schema.json](schema/material.KHR_materials_dispersion.schema.json)

## Reference

### Theory, Documentation and Implementations

[Abbe Number - Wikipedia](https://en.wikipedia.org/wiki/Abbe_number)

[Abbe Number - Wolfram Formula Repository](https://resources.wolframcloud.com/FormulaRepository/resources/Abbe-Number#:~:text=The%20Abbe%20number%2C%20also%20known,of%20V%20indicating%20low%20dispersion.)
emackey marked this conversation as resolved.
Show resolved Hide resolved

[OpenPBR Surface specification](https://academysoftwarefoundation.github.io/OpenPBR/)

[Enterprise PBR Shading Model](https://dassaultsystemes-technology.github.io/EnterprisePBRShadingModel/spec-2022x.md.html)
emackey marked this conversation as resolved.
Show resolved Hide resolved

## Appendix: Full Khronos Copyright Statement

Copyright 2023 The Khronos Group Inc.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.