Skip to main content

WEBGI_materials_anisotropy glTF Extension

Contributors

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 to extensionsUsed.
  • It is optional to add WEBGI_materials_anisotropy in extensionsRequired.

Extending Materials

Sample values:

{
"materials": [
{
"extensions": {
"WEBGI_materials_anisotropy": {
"anisotropyFactor": 0.6,
"anisotropyNoiseFactor": 0.2,
"anisotropyDirection": [0.0, 1.0, 0.0],
"anisotropyDirectionMode":"CONSTANT"
}
}
}
]
}
TypeDescriptionRequired
anisotropyFactornumberThe anisotropy.No, default: 0.0
anisotropyDirectiontextureInfo or floatThe 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"
anisotropyNoiseFactornumberParameter 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 to Anisotropy Rotation in Blender Cycles Anisotropy BSDF. The texture is expected to be sRGB 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 be sRGB 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