Declaration
Gltf_Anisotropy :: struct @json(rename_all=camelCase) {
anisotropy_strength: float32 = 0.0; @json(default) anisotropy_rotation: float32 = 0.0; @json(default) anisotropy_texture: *Gltf_Texture_Info; @json(default,skip_serializing_if=null) extras: Json_Value; @json(default,skip_serializing_if=null)}KHR_materials_anisotropy: highlights stretched along a direction, as on brushed metal. Read it from
material.extensions. anisotropy_rotation is in radians. The texture is allocated: release the
value with free_json.
#import "Extensions/Json";
asset, error := gltf_load("{\"asset\":{\"version\":\"2.0\"},\"extensionsUsed\":[\"KHR_materials_anisotropy\"],\"materials\":[{\"extensions\":{\"KHR_materials_anisotropy\":{\"anisotropyStrength\":0.6,\"anisotropyRotation\":1.5}}}]}");
assert(error.kind == .NONE);
defer gltf_free(*asset);
stretch, found, _ := gltf_extension(*asset.document.materials[0].extensions, "KHR_materials_anisotropy", Gltf_Anisotropy);
assert(found && stretch.anisotropy_strength == 0.6 && stretch.anisotropy_rotation == 1.5);
free_json(*stretch);