diff --git a/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts b/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts index d012cbc24cd..9180adc2bc4 100644 --- a/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts +++ b/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts @@ -5,7 +5,7 @@ import type { ITextureInfo, IMaterial, IMaterialPbrMetallicRoughness, IMaterialOcclusionTextureInfo, ISampler, IImage } from "babylonjs-gltf2interface"; import { ImageMimeType, MaterialAlphaMode, TextureMagFilter, TextureMinFilter, TextureWrapMode } from "babylonjs-gltf2interface"; -import type { Nullable } from "core/types"; +import type { DeepImmutable, Nullable } from "core/types"; import { Color3 } from "core/Maths/math.color"; import { Scalar } from "core/Maths/math.scalar"; import { Tools } from "core/Misc/tools"; @@ -29,10 +29,10 @@ import { GetMimeType } from "core/Misc/fileTools"; import type { OpenPBRMaterial } from "core/Materials/PBR/openPbrMaterial"; const Epsilon = 1e-6; -const DielectricSpecular = new Color3(0.04, 0.04, 0.04); +const DielectricSpecular = new Color3(0.04, 0.04, 0.04) as DeepImmutable; const MaxSpecularPower = 1024; -const White = Color3.White(); -const Black = Color3.Black(); +const White = Color3.White() as DeepImmutable; +const Black = Color3.BlackReadOnly; /** * Interface for storing specular glossiness factors @@ -124,7 +124,6 @@ async function GetCachedImageAsync(babylonTexture: BaseTexture): Promise; +export const DefaultScale = Vector3.OneReadOnly; +const DefaultLoaderCameraParentScaleLh = new Vector3(-1, 1, 1) as DeepImmutable; /** * Get the information necessary for enumerating a vertex buffer.