Popov72 4 vuotta sitten
vanhempi
commit
73760e76ef

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat.ts

@@ -2,9 +2,9 @@ import { Nullable } from "babylonjs/types";
 import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
 import { Material } from "babylonjs/Materials/material";
 
-import { IMaterial, TextureDataType } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
-import { GLTFLoader } from "../glTFLoader";
+import { GLTFLoader, TextureDataType } from "../glTFLoader";
 import { IKHRMaterialsClearcoat } from 'babylonjs-gltf2interface';
 
 const NAME = "KHR_materials_clearcoat";

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts

@@ -3,9 +3,9 @@ import { Color3 } from "babylonjs/Maths/math.color";
 import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
 import { Material } from "babylonjs/Materials/material";
 
-import { IMaterial, TextureDataType } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
-import { GLTFLoader } from "../glTFLoader";
+import { GLTFLoader, TextureDataType } from "../glTFLoader";
 import { IKHRMaterialsPbrSpecularGlossiness } from 'babylonjs-gltf2interface';
 
 const NAME = "KHR_materials_pbrSpecularGlossiness";

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_sheen.ts

@@ -2,9 +2,9 @@ import { Nullable } from "babylonjs/types";
 import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
 import { Material } from "babylonjs/Materials/material";
 
-import { IMaterial, TextureDataType } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
-import { GLTFLoader } from "../glTFLoader";
+import { GLTFLoader, TextureDataType } from "../glTFLoader";
 import { Color3 } from 'babylonjs/Maths/math.color';
 import { IKHRMaterialsSheen } from 'babylonjs-gltf2interface';
 

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_specular.ts

@@ -2,9 +2,9 @@ import { Nullable } from "babylonjs/types";
 import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
 import { Material } from "babylonjs/Materials/material";
 
-import { IMaterial, TextureDataType } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
-import { GLTFLoader } from "../glTFLoader";
+import { GLTFLoader, TextureDataType } from "../glTFLoader";
 import { Color3 } from 'babylonjs/Maths/math.color';
 import { IKHRMaterialsSpecular } from 'babylonjs-gltf2interface';
 

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_transmission.ts

@@ -2,9 +2,9 @@ import { Nullable } from "babylonjs/types";
 import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
 import { Material } from "babylonjs/Materials/material";
 import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
-import { IMaterial, TextureDataType } from "../glTFLoaderInterfaces";
+import { IMaterial } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
-import { GLTFLoader } from "../glTFLoader";
+import { GLTFLoader, TextureDataType } from "../glTFLoader";
 import { IKHRMaterialsTransmission } from 'babylonjs-gltf2interface';
 import { Scene } from "babylonjs/scene";
 import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts

@@ -1,6 +1,6 @@
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
-import { GLTFLoader, ArrayItem } from "../glTFLoader";
-import { ITexture, TextureDataType } from "../glTFLoaderInterfaces";
+import { GLTFLoader, ArrayItem, TextureDataType } from "../glTFLoader";
+import { ITexture } from "../glTFLoaderInterfaces";
 import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
 import { Nullable } from "babylonjs/types";
 import { IKHRTextureBasisU } from 'babylonjs-gltf2interface';

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts

@@ -2,9 +2,9 @@ import { Nullable } from "babylonjs/types";
 import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
 import { Texture } from "babylonjs/Materials/Textures/texture";
 
-import { ITextureInfo, TextureDataType } from "../glTFLoaderInterfaces";
+import { ITextureInfo } from "../glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
-import { GLTFLoader } from "../glTFLoader";
+import { GLTFLoader, TextureDataType } from "../glTFLoader";
 import { IKHRTextureTransform } from 'babylonjs-gltf2interface';
 
 const NAME = "KHR_texture_transform";

+ 24 - 1
loaders/src/glTF/2.0/glTFLoader.ts

@@ -24,7 +24,7 @@ import { MorphTargetManager } from "babylonjs/Morph/morphTargetManager";
 import { ISceneLoaderProgressEvent } from "babylonjs/Loading/sceneLoader";
 import { Scene } from "babylonjs/scene";
 import { IProperty, AccessorType, CameraType, AnimationChannelTargetPath, AnimationSamplerInterpolation, AccessorComponentType, MaterialAlphaMode, TextureMinFilter, TextureWrapMode, TextureMagFilter, MeshPrimitiveMode } from "babylonjs-gltf2interface";
-import { _IAnimationSamplerData, IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ISkin, ICamera, IAnimation, IAnimationChannel, IAnimationSampler, IBuffer, IBufferView, IMaterialPbrMetallicRoughness, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem, _ISamplerData, TextureDataType } from "./glTFLoaderInterfaces";
+import { _IAnimationSamplerData, IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ISkin, ICamera, IAnimation, IAnimationChannel, IAnimationSampler, IBuffer, IBufferView, IMaterialPbrMetallicRoughness, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem, _ISamplerData } from "./glTFLoaderInterfaces";
 import { IGLTFLoaderExtension } from "./glTFLoaderExtension";
 import { IGLTFLoader, GLTFFileLoader, GLTFLoaderState, IGLTFLoaderData, GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, IImportMeshAsyncOutput } from "../glTFFileLoader";
 import { IAnimationKey, AnimationKeyInterpolation } from 'babylonjs/Animations/animationKey';
@@ -57,6 +57,29 @@ interface IRegisteredExtension {
 }
 
 /**
+ * Type of data held by a texture
+ * @hidden
+ */
+export enum TextureDataType {
+    /** color data (albedo, emissive, ...) */
+    Color,
+    /** roughness data */
+    Roughness,
+    /** normal map */
+    Normal,
+    /** glossiness data */
+    Glossiness,
+    /** specular map */
+    Specular,
+    /** transmission map (thickness) */
+    Transmission,
+    /** metallic/roughness data */
+    MetallicRoughness,
+    /** occlusion data */
+    Occlusion
+}
+
+/**
  * Helper class for working with arrays when loading the glTF asset
  */
 export class ArrayItem {

+ 3 - 1
loaders/src/glTF/2.0/glTFLoaderExtension.ts

@@ -8,10 +8,12 @@ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
 import { Mesh } from "babylonjs/Meshes/mesh";
 import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
 import { IDisposable } from "babylonjs/scene";
-import { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer, TextureDataType } from "./glTFLoaderInterfaces";
+import { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from "./glTFLoaderInterfaces";
 import { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader";
 import { IProperty } from 'babylonjs-gltf2interface';
 
+declare type TextureDataType = import("./glTFLoader").TextureDataType;
+
 /**
  * Interface for a glTF loader extension.
  */

+ 0 - 14
loaders/src/glTF/2.0/glTFLoaderInterfaces.ts

@@ -208,20 +208,6 @@ export interface ISkin extends GLTF2.ISkin, IArrayItem {
 }
 
 /**
- * Type of data held by a texture
- */
-export enum TextureDataType {
-    Color,
-    Roughness,
-    Normal,
-    Glossiness,
-    Specular,
-    Transmission,
-    MetallicRoughness,
-    Occlusion
-}
-
-/**
  * Loader interface with additional members.
  */
 export interface ITexture extends GLTF2.ITexture, IArrayItem {