@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
23 lines (21 loc) • 613 B
JavaScript
const ext = {
id: "KHR_materials_anisotropy",
async applyMaterial(mat, ctx) {
const a = mat._rawMatDef?.extensions?.KHR_materials_anisotropy;
if (!a) {
return null;
}
const rot = a.anisotropyRotation ?? 0;
const texture = a.anisotropyTexture ? await ctx._texture(a.anisotropyTexture, false) : void 0;
return {
anisotropy: {
isEnabled: true,
intensity: a.anisotropyStrength ?? 0,
direction: [Math.cos(rot), Math.sin(rot)],
texture
}
};
}
};
export { ext as default };
//# sourceMappingURL=gltf-ext-anisotropy-l1Zw3YTh.esm.js.map