Skip to content

Commit

Permalink
Merge pull request #15769 from alexchuber/anisotropy-texture-fix
Browse files Browse the repository at this point in the history
Mark anisotropyTexture as non-color data in glTF loader
  • Loading branch information
sebavan authored Nov 4, 2024
2 parents c267a4a + afaf575 commit 8a06790
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Nullable } from "core/types";
import { PBRMaterial } from "core/Materials/PBR/pbrMaterial";
import type { Material } from "core/Materials/material";

import type { IMaterial } from "../glTFLoaderInterfaces";
import type { IMaterial, ITextureInfo } from "../glTFLoaderInterfaces";
import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
import { GLTFLoader } from "../glTFLoader";
import type { IKHRMaterialsAnisotropy } from "babylonjs-gltf2interface";
Expand Down Expand Up @@ -81,6 +81,7 @@ export class KHR_materials_anisotropy implements IGLTFLoaderExtension {
babylonMaterial.anisotropy.angle = properties.anisotropyRotation ?? 0;

if (properties.anisotropyTexture) {
(properties.anisotropyTexture as ITextureInfo).nonColorData = true;
promises.push(
this._loader.loadTextureInfoAsync(`${context}/anisotropyTexture`, properties.anisotropyTexture, (texture) => {
texture.name = `${babylonMaterial.name} (Anisotropy Intensity)`;
Expand Down

0 comments on commit 8a06790

Please sign in to comment.