-
Notifications
You must be signed in to change notification settings - Fork 1.2k
EXT_materials_anisotropy_openpbr #2521
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
Open
MiiBond
wants to merge
4
commits into
KhronosGroup:main
Choose a base branch
from
MiiBond:mbond/EXT_materials_anisotropy_openpbr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3365ea3
Add EXT_materials_anisotropy_openpbr
MiiBond 9a20e74
Update extensions/2.0/Vendor/EXT_materials_anisotropy_openpbr/README.md
MiiBond 9e85f67
Update extensions/2.0/Vendor/EXT_materials_anisotropy_openpbr/README.md
MiiBond aaf2905
Update extensions/2.0/Vendor/EXT_materials_anisotropy_openpbr/README.md
MiiBond File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
extensions/2.0/Vendor/EXT_materials_anisotropy_openpbr/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # EXT\_materials\_anisotropy\_openpbr | ||
|
|
||
| ## Contributors | ||
|
|
||
| * Gary Hsu, Microsoft [@bghgary](https://twitter.com/bghgary) | ||
| * Mike Bond, Adobe, [@miibond](https://github.com/MiiBond) | ||
|
|
||
| ## Status | ||
|
|
||
| Draft | ||
|
|
||
| ## Dependencies | ||
|
|
||
| Written against the glTF 2.0 spec. | ||
| * Requires the `KHR_materials_anisotropy` 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 | ||
|
|
||
| This extension defines a way to interpret the `anisotropyStrength` parameter from `KHR_materials_anisotropy` using OpenPBR conventions instead of the default glTF interpretation. This allows materials to achieve consistent appearance when authoring content for OpenPBR-compliant renderers while maintaining compatibility with existing glTF workflows. | ||
|
|
||
| ## Extending Materials | ||
|
|
||
| OpenPBR anisotropy interpretation can be enabled by adding the `EXT_materials_anisotropy_openpbr` extension as a sub-extension of `KHR_materials_anisotropy` on a glTF material. For example: | ||
|
|
||
| ```json | ||
| { | ||
| "materials": [ | ||
| { | ||
| "name": "brushed_metal", | ||
| "extensions": { | ||
| "KHR_materials_anisotropy": { | ||
| "anisotropyStrength": 0.6, | ||
| "anisotropyRotation": 0.0, | ||
| "extensions": { | ||
| "EXT_materials_anisotropy_openpbr": { | ||
| "anisotropyUseOpenPbr": true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| | | Type | Description | Required | | ||
| |----------------------------------|---------------------------------------------------------------------------------|----------------------------------------|----------------------| | ||
| |**openPbrAnisotropyEnabled** | `boolean` | Enables OpenPBR interpretation of anisotropy strength. | No, default: `false` | | ||
|
|
||
| When `openPbrAnisotropyEnabled` is `false` or not present, the standard glTF anisotropy calculations should be used as defined in `KHR_materials_anisotropy`. | ||
|
|
||
| When `openPbrAnisotropyEnabled` is `true`, implementations should interpret the anisotropic strength using the OpenPBR conventions described below. | ||
|
|
||
| ## Anisotropic Strength Behavior | ||
|
|
||
| In both glTF and OpenPBR, the strength of the anisotropic effect in the tangent and bitangent direction is calculated using the material's specular roughness as well as the anisotropic strength parameter from the `KHR_materials_anisotropy` extension. It is these calculations that differ between glTF and OpenPBR. The rotation and texture packing remains the same. | ||
|
|
||
| In glTF: \ | ||
| $alphaTangent = mix( alphaRoughness, 1.0, anisotropyStrength^2 )$ \ | ||
| $alphaBiTangent = alphaRoughness$ | ||
|
|
||
| In OpenPBR: \ | ||
| $alphaTangent = alphaRoughness \sqrt{2 / (1+ (1-anisotropyStrength)^2)}$ \ | ||
| $alphaBiTangent = alphaTangent(1 - anisotropyStrength)$ | ||
|
|
||
|
|
||
| When `openPbrAnisotropyEnabled` is `true`, the anisotropic strength from `KHR_materials_anisotropy` is applied according to the OpenPBR conventions to obtain the tangent and bitangent roughness values. | ||
22 changes: 22 additions & 0 deletions
22
...materials_anisotropy_openpbr/schema/material.EXT_materials_anisotropy_openpbr.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "material.EXT_materials_anisotropy_openpbr.schema.json", | ||
| "title": "EXT_materials_anisotropy_openpbr glTF Material Extension", | ||
| "type": "object", | ||
| "description": "OpenPBR anisotropy interpretation extension.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "glTFProperty.schema.json" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "openPbrAnisotropyEnabled": { | ||
| "type": "boolean", | ||
| "description": "Enables OpenPBR interpretation of anisotropy parameters.", | ||
| "default": false | ||
| }, | ||
| "extensions": {}, | ||
| "extras": {} | ||
| }, | ||
| "additionalProperties": false | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spacing