WEBGI_materials_anisotropy glTF Extension
Contributors
- Palash Bansal, @repalash
Status
Draft.
This is different from KHR_materials_anisotropy
draft
Dependencies
Written against the glTF 2.0 spec.
Exclusions
- This extension must be used only on a material that also uses
pbrMetallicRoughness
. - 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
. - This extension must not be used on a material that also uses
KHR_materials_volume
.
Overview
This extension defines the anisotropic property of a material as observable with brushed metals for instance. An asymmetric specular lobe model is introduced to allow for such phenomena. The visually distinct feature of that lobe is the elongated appearance of the specular reflection. For a single punctual light source, the specular reflection will eventually degenerate into a zero width line in the limit, that is where the material is fully anisotropic, as opposed to be fully isotropic in which case the specular reflection is radially symmetric.
When using this extension:
WEBGI_materials_anisotropy
must be added toextensionsUsed
.- It is optional to add
WEBGI_materials_anisotropy
inextensionsRequired
.
Extending Materials
Sample values:
{
"materials": [
{
"extensions": {
"WEBGI_materials_anisotropy": {
"anisotropyFactor": 0.6,
"anisotropyNoiseFactor": 0.2,
"anisotropyDirection": [0.0, 1.0, 0.0],
"anisotropyDirectionMode":"CONSTANT"
}
}
}
]
}
Type | Description | Required | |
---|---|---|---|
anisotropyFactor | number | The anisotropy. | No, default: 0.0 |
anisotropyDirection | textureInfo or float | The anisotropy direction value or direction/rotation texture. | No, default: [0.0] |
anisotropyDirectionMode | "CONSTANT" or "ROTATION" or "DIRECTION" | Specifies type for anisotropyDirection , whether constant or specific texture. | No, default: "CONSTANT" |
anisotropyNoiseFactor | number | Parameter to control noise/sparkle. | No, default: 0.0 |
anisotropyDirection
contains an array for a constant direction vector or the texture for 1D or 2D direction.
When anisotopyDirectionMode
is:
CONSTANT
: constant float is expected, specifies the rotation angle.ROTATION
, texture is expected with 1D rotation value in R channel. Direction is computed as[sin(rot), cos(rot)]
. This works similar toAnisotropy Rotation
in Blender Cycles Anisotropy BSDF. The texture is expected to besRGB
encoded. TODO: add sample texture.DIRECTION
, texture is expected with 2D rotation value in RG channels. Direction is taken as[texel.r, texel.g]
. The texture is expected to besRGB
encoded. TODO: add sample texture.
Anisotropy details
TODO: add technical details. reference: KHR_materials_anisotropy Draft
See gltf_materials_anisotropy repository for shader snippets and implementation details.
Known Implementations
Resources
- Simple Plane glTF with Anisotropy Material: https://dist.pixotronics.com/webgi/assets/gltf/cube_diamond_sample.gltf.
- Anisotropy plugin sample: https://showcase.pixotronics.com/demos/plugins~anisotropy.html
- Showcase Model files: https://showcase.pixotronics.com/?q=watch