- KHR_materials_transmission
- KHR_materials_volume
- KHR_materials_variants
Dragon with background, using material variants, transmission, and volume.
- Display in SampleViewer
- Download GLB
- Model Directory
Rasterized (without ray tracing or path tracing) by the Khronos glTF Sample Viewer, using IBL "Footprint Court" by HDR Labs.
This model demonstrates the use of the KHR_materials_transmission
and KHR_materials_volume
extensions to specify an object that appears to be made from colored glass.
The "Attenuation" material on the dragon uses full transmission with a perfectly smooth, clear surface color. The yellow and orange tones are produced by KHR_material_volume
's attenuationColor
and attenuationDistance
.
By default, glTF 2.0 and KHR_materials_transmission
specify "thin-walled" materials, where the mesh's polygons are immeasurably thin. Any ray of light hitting such a polygon would enter and immediately exit the material. There is no refraction present on such a material, except for some possible blurriness introduced by rough microfacets on its surface.
However, KHR_materials_volume
introduces the new parameters thicknessFactor
and thicknessTexture
. When thicknessFactor
is non-zero, the material definition changes from thin-walled to a thick volume. The mesh's polygons are then considered to represent a manifold surface surrounding a solid three-dimensional volume of material. This material produces refraction, as shown in the screenshot above where the view through the dragon distorts the checkerboard grid of the cloth behind it.
For rasterizers that do not use ray tracing or path tracing, the product of thicknessFactor
and thicknessTexture
offer an average mesh thickness per texel along the surface. This allows for example the dragon's thin claws to absorb less light and appear lighter yellow, while the dragon's thicker body appears a deeper orange.
Because the KHR_materials_ior
extension is not present, glTF's default IOR of 1.5 is used for the material.
Path-traced render by the Enterprise PBR Sample Renderer, using IBL "Footprint Court" by HDR Labs.
Ray tracers and path tracers must still test thicknessFactor > 0.0
to determine if the material is in thin-walled mode or thick. Beyond that, they are free to disregard the thickness approximation, and trace the true thickness per ray.
This model features a second material variant (via KHR_materials_variants
), called "Surface Color." This variant specifies the same yellow color, but specifies it as a baseColor
on the surface of a thick volume, with no attenuation inside the volume. This means the yellow color will be constant across the surface of the dragon, and not darken with thickness. The thicknessFactor
and thicknessTexture
are still supplied, so this variant offers the same refraction of the background grid as the other material.
If the dragon appears a deep red color, it may indicate that node scaling has not been properly accounted for. The thicknessFactor
is specified in raw mesh vertex space, so must be adjusted for glTF nodes that have scaling applied. The attenuationDistance
is a material property, specified in world space.
See the "Node Scale" row of the Attenuation Test Model for an example of this effect using uniform thickness values.
The dragon model is based on the one from Morgan McGuire's Computer Graphics Archive.
Original dragon mesh data based on a Stanford Scan
© 1996 Stanford University.
To the extent possible under law, Adobe has waived all copyright and related or neighboring rights to this asset [the cloth backdrop].
© 1996, Stanford University Computer Graphics Laboratory. Stanford Graphics Library
- Stanford University Computer Graphics Laboratory for Original dragon model
© 2017, Morgan McGuire. Stanford Graphics Library
- Morgan McGuire's Computer Graphics Archive for Conversion and clean up
© 2021, Public. CC0 1.0 Universal
- Adobe for Cloth backdrop