@babylonjs/loaders 5.0.0-alpha.8 → 5.0.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. package/OBJ/index.d.ts +2 -0
  2. package/OBJ/index.js +4 -2
  3. package/OBJ/index.js.map +1 -1
  4. package/OBJ/mtlFileLoader.d.ts +4 -2
  5. package/OBJ/mtlFileLoader.js +7 -6
  6. package/OBJ/mtlFileLoader.js.map +1 -1
  7. package/OBJ/objFileLoader.d.ts +12 -84
  8. package/OBJ/objFileLoader.js +50 -667
  9. package/OBJ/objFileLoader.js.map +1 -1
  10. package/OBJ/objLoadingOptions.d.ts +43 -0
  11. package/OBJ/objLoadingOptions.js +2 -0
  12. package/OBJ/objLoadingOptions.js.map +1 -0
  13. package/OBJ/solidParser.d.ts +153 -0
  14. package/OBJ/solidParser.js +700 -0
  15. package/OBJ/solidParser.js.map +1 -0
  16. package/STL/index.js +1 -1
  17. package/STL/stlFileLoader.d.ts +6 -0
  18. package/STL/stlFileLoader.js +38 -11
  19. package/STL/stlFileLoader.js.map +1 -1
  20. package/glTF/1.0/glTFBinaryExtension.js +4 -4
  21. package/glTF/1.0/glTFLoader.d.ts +4 -4
  22. package/glTF/1.0/glTFLoader.js +60 -55
  23. package/glTF/1.0/glTFLoader.js.map +1 -1
  24. package/glTF/1.0/glTFLoaderInterfaces.d.ts +3 -1
  25. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  26. package/glTF/1.0/glTFLoaderUtils.js +6 -6
  27. package/glTF/1.0/glTFMaterialsCommonExtension.js +12 -12
  28. package/glTF/1.0/index.js +5 -5
  29. package/glTF/2.0/Extensions/EXT_lights_image_based.js +8 -5
  30. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  31. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +3 -3
  32. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  33. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +1 -5
  34. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +5 -21
  35. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  36. package/glTF/2.0/Extensions/EXT_texture_webp.js +2 -2
  37. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  38. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +1 -1
  39. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +8 -4
  40. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  41. package/glTF/2.0/Extensions/KHR_lights_punctual.js +9 -8
  42. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  43. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +2 -2
  44. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +30 -0
  45. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +46 -0
  46. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -0
  47. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +1 -2
  48. package/glTF/2.0/Extensions/KHR_materials_ior.js +3 -4
  49. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  50. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +3 -4
  51. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  52. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +0 -1
  53. package/glTF/2.0/Extensions/KHR_materials_sheen.js +3 -4
  54. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  55. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +1 -2
  56. package/glTF/2.0/Extensions/KHR_materials_specular.js +12 -6
  57. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  58. package/glTF/2.0/Extensions/KHR_materials_translucency.js +6 -6
  59. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  60. package/glTF/2.0/Extensions/KHR_materials_transmission.js +93 -84
  61. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  62. package/glTF/2.0/Extensions/KHR_materials_unlit.js +3 -3
  63. package/glTF/2.0/Extensions/KHR_materials_variants.js +70 -5
  64. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  65. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +31 -0
  66. package/glTF/2.0/Extensions/KHR_materials_volume.js +79 -0
  67. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -0
  68. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +1 -1
  69. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +1 -2
  70. package/glTF/2.0/Extensions/KHR_texture_basisu.js +3 -4
  71. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  72. package/glTF/2.0/Extensions/KHR_texture_transform.js +2 -2
  73. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +2 -2
  74. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +6 -3
  75. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  76. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +6 -7
  77. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  78. package/glTF/2.0/Extensions/MSFT_lod.d.ts +2 -1
  79. package/glTF/2.0/Extensions/MSFT_lod.js +48 -8
  80. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  81. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +2 -2
  82. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +2 -2
  83. package/glTF/2.0/Extensions/index.d.ts +2 -0
  84. package/glTF/2.0/Extensions/index.js +26 -24
  85. package/glTF/2.0/Extensions/index.js.map +1 -1
  86. package/glTF/2.0/glTFLoader.d.ts +6 -11
  87. package/glTF/2.0/glTFLoader.js +129 -95
  88. package/glTF/2.0/glTFLoader.js.map +1 -1
  89. package/glTF/2.0/glTFLoaderInterfaces.d.ts +4 -2
  90. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  91. package/glTF/2.0/index.d.ts +1 -1
  92. package/glTF/2.0/index.js +4 -4
  93. package/glTF/2.0/index.js.map +1 -1
  94. package/glTF/glTFFileLoader.d.ts +15 -9
  95. package/glTF/glTFFileLoader.js +62 -76
  96. package/glTF/glTFFileLoader.js.map +1 -1
  97. package/glTF/glTFValidation.js +1 -1
  98. package/glTF/glTFValidation.js.map +1 -1
  99. package/glTF/index.d.ts +2 -2
  100. package/glTF/index.js +4 -4
  101. package/glTF/index.js.map +1 -1
  102. package/index.d.ts +3 -3
  103. package/index.js +3 -3
  104. package/index.js.map +1 -1
  105. package/legacy/legacy-glTF.js +4 -4
  106. package/legacy/legacy-glTF1.d.ts +1 -1
  107. package/legacy/legacy-glTF1.js +1 -1
  108. package/legacy/legacy-glTF1.js.map +1 -1
  109. package/legacy/legacy-glTF1FileLoader.js +2 -2
  110. package/legacy/legacy-glTF2.d.ts +1 -1
  111. package/legacy/legacy-glTF2.js +3 -3
  112. package/legacy/legacy-glTF2.js.map +1 -1
  113. package/legacy/legacy-glTF2FileLoader.js +2 -2
  114. package/legacy/legacy-glTFFileLoader.js +3 -3
  115. package/legacy/legacy-objFileLoader.d.ts +1 -1
  116. package/legacy/legacy-objFileLoader.js +2 -2
  117. package/legacy/legacy-objFileLoader.js.map +1 -1
  118. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  119. package/legacy/legacy-stlFileLoader.js +2 -2
  120. package/legacy/legacy-stlFileLoader.js.map +1 -1
  121. package/legacy/legacy.js +6 -6
  122. package/package.json +16 -4
@@ -1,8 +1,10 @@
1
+ import { AssetContainer } from "@babylonjs/core/assetContainer";
1
2
  import { Bone } from "@babylonjs/core/Bones/bone";
2
3
  import { Skeleton } from "@babylonjs/core/Bones/skeleton";
3
4
  import { Texture } from "@babylonjs/core/Materials/Textures/texture";
4
5
  import { Node } from "@babylonjs/core/node";
5
6
  import { Scene } from "@babylonjs/core/scene";
7
+ import { Nullable } from "@babylonjs/core/types";
6
8
  /**
7
9
  * Enums
8
10
  * @hidden
@@ -395,7 +397,7 @@ export interface IGLTFRuntime {
395
397
  importOnlyMeshes: boolean;
396
398
  importMeshesNames?: string[];
397
399
  dummyNodes: Node[];
398
- forAssetContainer: boolean;
400
+ assetContainer: Nullable<AssetContainer>;
399
401
  }
400
402
  /** @hidden */
401
403
  export interface INodeToRoot {
@@ -1 +1 @@
1
- {"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../sourceES6/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"AAMA;;;EAGE;AACF,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,wDAAY,CAAA;AAChB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAgB,CAAA;IAChB,qDAAc,CAAA;AAClB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,cAsBX;AAtBD,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,oDAAU,CAAA;IACV,sEAAmB,CAAA;IACnB,wDAAY,CAAA;IACZ,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,+DAAgB,CAAA;IAChB,+DAAgB,CAAA;IAChB,+DAAgB,CAAA;IAChB,uDAAY,CAAA;IACZ,iEAAiB,CAAA;IACjB,iEAAiB,CAAA;IACjB,iEAAiB,CAAA;IACjB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;AACtB,CAAC,EAtBW,cAAc,KAAd,cAAc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skeleton } from \"@babylonjs/core/Bones/skeleton\";\r\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\r\nimport { Node } from \"@babylonjs/core/node\";\r\nimport { Scene } from \"@babylonjs/core/scene\";\r\n\r\n/**\r\n* Enums\r\n* @hidden\r\n*/\r\nexport enum EComponentType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n FLOAT = 5126\r\n}\r\n\r\n/** @hidden */\r\nexport enum EShaderType {\r\n FRAGMENT = 35632,\r\n VERTEX = 35633\r\n}\r\n\r\n/** @hidden */\r\nexport enum EParameterType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n INT = 5124,\r\n UNSIGNED_INT = 5125,\r\n FLOAT = 5126,\r\n FLOAT_VEC2 = 35664,\r\n FLOAT_VEC3 = 35665,\r\n FLOAT_VEC4 = 35666,\r\n INT_VEC2 = 35667,\r\n INT_VEC3 = 35668,\r\n INT_VEC4 = 35669,\r\n BOOL = 35670,\r\n BOOL_VEC2 = 35671,\r\n BOOL_VEC3 = 35672,\r\n BOOL_VEC4 = 35673,\r\n FLOAT_MAT2 = 35674,\r\n FLOAT_MAT3 = 35675,\r\n FLOAT_MAT4 = 35676,\r\n SAMPLER_2D = 35678\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureWrapMode {\r\n CLAMP_TO_EDGE = 33071,\r\n MIRRORED_REPEAT = 33648,\r\n REPEAT = 10497\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFilterType {\r\n NEAREST = 9728,\r\n LINEAR = 9728,\r\n NEAREST_MIPMAP_NEAREST = 9984,\r\n LINEAR_MIPMAP_NEAREST = 9985,\r\n NEAREST_MIPMAP_LINEAR = 9986,\r\n LINEAR_MIPMAP_LINEAR = 9987\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFormat {\r\n ALPHA = 6406,\r\n RGB = 6407,\r\n RGBA = 6408,\r\n LUMINANCE = 6409,\r\n LUMINANCE_ALPHA = 6410\r\n}\r\n\r\n/** @hidden */\r\nexport enum ECullingType {\r\n FRONT = 1028,\r\n BACK = 1029,\r\n FRONT_AND_BACK = 1032\r\n}\r\n\r\n/** @hidden */\r\nexport enum EBlendingFunction {\r\n ZERO = 0,\r\n ONE = 1,\r\n SRC_COLOR = 768,\r\n ONE_MINUS_SRC_COLOR = 769,\r\n DST_COLOR = 774,\r\n ONE_MINUS_DST_COLOR = 775,\r\n SRC_ALPHA = 770,\r\n ONE_MINUS_SRC_ALPHA = 771,\r\n DST_ALPHA = 772,\r\n ONE_MINUS_DST_ALPHA = 773,\r\n CONSTANT_COLOR = 32769,\r\n ONE_MINUS_CONSTANT_COLOR = 32770,\r\n CONSTANT_ALPHA = 32771,\r\n ONE_MINUS_CONSTANT_ALPHA = 32772,\r\n SRC_ALPHA_SATURATE = 776\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProperty {\r\n extensions?: { [key: string]: any };\r\n extras?: Object;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFChildRootProperty extends IGLTFProperty {\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAccessor extends IGLTFChildRootProperty {\r\n bufferView: string;\r\n byteOffset: number;\r\n byteStride: number;\r\n count: number;\r\n type: string;\r\n componentType: EComponentType;\r\n\r\n max?: number[];\r\n min?: number[];\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBufferView extends IGLTFChildRootProperty {\r\n buffer: string;\r\n byteOffset: number;\r\n byteLength: number;\r\n byteStride: number;\r\n\r\n target?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBuffer extends IGLTFChildRootProperty {\r\n uri: string;\r\n\r\n byteLength?: number;\r\n type?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFShader extends IGLTFChildRootProperty {\r\n uri: string;\r\n type: EShaderType;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProgram extends IGLTFChildRootProperty {\r\n attributes: string[];\r\n fragmentShader: string;\r\n vertexShader: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueParameter {\r\n type: number;\r\n\r\n count?: number;\r\n semantic?: string;\r\n node?: string;\r\n value?: number | boolean | string | Array<any>;\r\n source?: string;\r\n\r\n babylonValue?: any;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueCommonProfile {\r\n lightingModel: string;\r\n texcoordBindings: Object;\r\n\r\n parameters?: Array<any>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStatesFunctions {\r\n blendColor?: number[];\r\n blendEquationSeparate?: number[];\r\n blendFuncSeparate?: number[];\r\n colorMask: boolean[];\r\n cullFace: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStates {\r\n enable: number[];\r\n functions: IGLTFTechniqueStatesFunctions;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechnique extends IGLTFChildRootProperty {\r\n parameters: { [key: string]: IGLTFTechniqueParameter };\r\n program: string;\r\n\r\n attributes: { [key: string]: string };\r\n uniforms: { [key: string]: string };\r\n states: IGLTFTechniqueStates;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMaterial extends IGLTFChildRootProperty {\r\n technique?: string;\r\n values: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMeshPrimitive extends IGLTFProperty {\r\n attributes: { [key: string]: string };\r\n indices: string;\r\n material: string;\r\n\r\n mode?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMesh extends IGLTFChildRootProperty {\r\n primitives: IGLTFMeshPrimitive[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFImage extends IGLTFChildRootProperty {\r\n uri: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSampler extends IGLTFChildRootProperty {\r\n magFilter?: number;\r\n minFilter?: number;\r\n wrapS?: number;\r\n wrapT?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTexture extends IGLTFChildRootProperty {\r\n sampler: string;\r\n source: string;\r\n\r\n format?: ETextureFormat;\r\n internalFormat?: ETextureFormat;\r\n target?: number;\r\n type?: number;\r\n\r\n // Babylon.js values (optimize)\r\n babylonTexture?: Texture;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAmbienLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFDirectionalLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFPointLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSpotLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n fallOfAngle?: number;\r\n fallOffExponent?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFLight extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraOrthographic {\r\n xmag: number;\r\n ymag: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraPerspective {\r\n aspectRatio: number;\r\n yfov: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCamera extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannelTarget {\r\n id: string;\r\n path: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannel {\r\n sampler: string;\r\n target: IGLTFAnimationChannelTarget;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationSampler {\r\n input: string;\r\n output: string;\r\n\r\n interpolation?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimation extends IGLTFChildRootProperty {\r\n channels?: IGLTFAnimationChannel[];\r\n parameters?: { [key: string]: string };\r\n samplers?: { [key: string]: IGLTFAnimationSampler };\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNodeInstanceSkin {\r\n skeletons: string[];\r\n skin: string;\r\n meshes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSkins extends IGLTFChildRootProperty {\r\n bindShapeMatrix: number[];\r\n inverseBindMatrices: string;\r\n jointNames: string[];\r\n\r\n babylonSkeleton?: Skeleton;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNode extends IGLTFChildRootProperty {\r\n camera?: string;\r\n children: string[];\r\n skin?: string;\r\n jointName?: string;\r\n light?: string;\r\n matrix: number[];\r\n mesh?: string;\r\n meshes?: string[];\r\n rotation?: number[];\r\n scale?: number[];\r\n translation?: number[];\r\n\r\n // Babylon.js values (optimize)\r\n babylonNode?: Node;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFScene extends IGLTFChildRootProperty {\r\n nodes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFRuntime {\r\n extensions: { [key: string]: any };\r\n accessors: { [key: string]: IGLTFAccessor };\r\n buffers: { [key: string]: IGLTFBuffer };\r\n bufferViews: { [key: string]: IGLTFBufferView };\r\n meshes: { [key: string]: IGLTFMesh };\r\n lights: { [key: string]: IGLTFLight };\r\n cameras: { [key: string]: IGLTFCamera };\r\n nodes: { [key: string]: IGLTFNode };\r\n images: { [key: string]: IGLTFImage };\r\n textures: { [key: string]: IGLTFTexture };\r\n shaders: { [key: string]: IGLTFShader };\r\n programs: { [key: string]: IGLTFProgram };\r\n samplers: { [key: string]: IGLTFSampler };\r\n techniques: { [key: string]: IGLTFTechnique };\r\n materials: { [key: string]: IGLTFMaterial };\r\n animations: { [key: string]: IGLTFAnimation };\r\n skins: { [key: string]: IGLTFSkins };\r\n\r\n currentScene?: Object;\r\n scenes: { [key: string]: IGLTFScene }; // v1.1\r\n\r\n extensionsUsed: string[];\r\n extensionsRequired?: string[]; // v1.1\r\n\r\n buffersCount: number;\r\n shaderscount: number;\r\n\r\n scene: Scene;\r\n rootUrl: string;\r\n\r\n loadedBufferCount: number;\r\n loadedBufferViews: { [name: string]: ArrayBufferView };\r\n\r\n loadedShaderCount: number;\r\n\r\n importOnlyMeshes: boolean;\r\n importMeshesNames?: string[];\r\n\r\n dummyNodes: Node[];\r\n\r\n forAssetContainer: boolean;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INodeToRoot {\r\n bone: Bone;\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IJointNode {\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n"]}
1
+ {"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../sourceES6/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"AAQA;;;EAGE;AACF,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,wDAAY,CAAA;AAChB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAgB,CAAA;IAChB,qDAAc,CAAA;AAClB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,cAsBX;AAtBD,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,oDAAU,CAAA;IACV,sEAAmB,CAAA;IACnB,wDAAY,CAAA;IACZ,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,+DAAgB,CAAA;IAChB,+DAAgB,CAAA;IA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AyB,CAAA;IACzB,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,uFAAwB,CAAA;AAC5B,CAAC,EAhBW,iBAAiB,KAAjB,iBAAiB,QAgB5B","sourcesContent":["import { AssetContainer } from \"@babylonjs/core/assetContainer\";\r\nimport { Bone } from \"@babylonjs/core/Bones/bone\";\r\nimport { Skeleton } from \"@babylonjs/core/Bones/skeleton\";\r\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\r\nimport { Node } from \"@babylonjs/core/node\";\r\nimport { Scene } from \"@babylonjs/core/scene\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\n\r\n/**\r\n* Enums\r\n* @hidden\r\n*/\r\nexport enum EComponentType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n FLOAT = 5126\r\n}\r\n\r\n/** @hidden */\r\nexport enum EShaderType {\r\n FRAGMENT = 35632,\r\n VERTEX = 35633\r\n}\r\n\r\n/** @hidden */\r\nexport enum EParameterType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n INT = 5124,\r\n UNSIGNED_INT = 5125,\r\n FLOAT = 5126,\r\n FLOAT_VEC2 = 35664,\r\n FLOAT_VEC3 = 35665,\r\n FLOAT_VEC4 = 35666,\r\n INT_VEC2 = 35667,\r\n INT_VEC3 = 35668,\r\n INT_VEC4 = 35669,\r\n BOOL = 35670,\r\n BOOL_VEC2 = 35671,\r\n BOOL_VEC3 = 35672,\r\n BOOL_VEC4 = 35673,\r\n FLOAT_MAT2 = 35674,\r\n FLOAT_MAT3 = 35675,\r\n FLOAT_MAT4 = 35676,\r\n SAMPLER_2D = 35678\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureWrapMode {\r\n CLAMP_TO_EDGE = 33071,\r\n MIRRORED_REPEAT = 33648,\r\n REPEAT = 10497\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFilterType {\r\n NEAREST = 9728,\r\n LINEAR = 9728,\r\n NEAREST_MIPMAP_NEAREST = 9984,\r\n LINEAR_MIPMAP_NEAREST = 9985,\r\n NEAREST_MIPMAP_LINEAR = 9986,\r\n LINEAR_MIPMAP_LINEAR = 9987\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFormat {\r\n ALPHA = 6406,\r\n RGB = 6407,\r\n RGBA = 6408,\r\n LUMINANCE = 6409,\r\n LUMINANCE_ALPHA = 6410\r\n}\r\n\r\n/** @hidden */\r\nexport enum ECullingType {\r\n FRONT = 1028,\r\n BACK = 1029,\r\n FRONT_AND_BACK = 1032\r\n}\r\n\r\n/** @hidden */\r\nexport enum EBlendingFunction {\r\n ZERO = 0,\r\n ONE = 1,\r\n SRC_COLOR = 768,\r\n ONE_MINUS_SRC_COLOR = 769,\r\n DST_COLOR = 774,\r\n ONE_MINUS_DST_COLOR = 775,\r\n SRC_ALPHA = 770,\r\n ONE_MINUS_SRC_ALPHA = 771,\r\n DST_ALPHA = 772,\r\n ONE_MINUS_DST_ALPHA = 773,\r\n CONSTANT_COLOR = 32769,\r\n ONE_MINUS_CONSTANT_COLOR = 32770,\r\n CONSTANT_ALPHA = 32771,\r\n ONE_MINUS_CONSTANT_ALPHA = 32772,\r\n SRC_ALPHA_SATURATE = 776\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProperty {\r\n extensions?: { [key: string]: any };\r\n extras?: Object;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFChildRootProperty extends IGLTFProperty {\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAccessor extends IGLTFChildRootProperty {\r\n bufferView: string;\r\n byteOffset: number;\r\n byteStride: number;\r\n count: number;\r\n type: string;\r\n componentType: EComponentType;\r\n\r\n max?: number[];\r\n min?: number[];\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBufferView extends IGLTFChildRootProperty {\r\n buffer: string;\r\n byteOffset: number;\r\n byteLength: number;\r\n byteStride: number;\r\n\r\n target?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBuffer extends IGLTFChildRootProperty {\r\n uri: string;\r\n\r\n byteLength?: number;\r\n type?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFShader extends IGLTFChildRootProperty {\r\n uri: string;\r\n type: EShaderType;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProgram extends IGLTFChildRootProperty {\r\n attributes: string[];\r\n fragmentShader: string;\r\n vertexShader: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueParameter {\r\n type: number;\r\n\r\n count?: number;\r\n semantic?: string;\r\n node?: string;\r\n value?: number | boolean | string | Array<any>;\r\n source?: string;\r\n\r\n babylonValue?: any;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueCommonProfile {\r\n lightingModel: string;\r\n texcoordBindings: Object;\r\n\r\n parameters?: Array<any>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStatesFunctions {\r\n blendColor?: number[];\r\n blendEquationSeparate?: number[];\r\n blendFuncSeparate?: number[];\r\n colorMask: boolean[];\r\n cullFace: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStates {\r\n enable: number[];\r\n functions: IGLTFTechniqueStatesFunctions;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechnique extends IGLTFChildRootProperty {\r\n parameters: { [key: string]: IGLTFTechniqueParameter };\r\n program: string;\r\n\r\n attributes: { [key: string]: string };\r\n uniforms: { [key: string]: string };\r\n states: IGLTFTechniqueStates;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMaterial extends IGLTFChildRootProperty {\r\n technique?: string;\r\n values: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMeshPrimitive extends IGLTFProperty {\r\n attributes: { [key: string]: string };\r\n indices: string;\r\n material: string;\r\n\r\n mode?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMesh extends IGLTFChildRootProperty {\r\n primitives: IGLTFMeshPrimitive[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFImage extends IGLTFChildRootProperty {\r\n uri: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSampler extends IGLTFChildRootProperty {\r\n magFilter?: number;\r\n minFilter?: number;\r\n wrapS?: number;\r\n wrapT?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTexture extends IGLTFChildRootProperty {\r\n sampler: string;\r\n source: string;\r\n\r\n format?: ETextureFormat;\r\n internalFormat?: ETextureFormat;\r\n target?: number;\r\n type?: number;\r\n\r\n // Babylon.js values (optimize)\r\n babylonTexture?: Texture;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAmbienLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFDirectionalLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFPointLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSpotLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n fallOfAngle?: number;\r\n fallOffExponent?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFLight extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraOrthographic {\r\n xmag: number;\r\n ymag: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraPerspective {\r\n aspectRatio: number;\r\n yfov: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCamera extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannelTarget {\r\n id: string;\r\n path: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannel {\r\n sampler: string;\r\n target: IGLTFAnimationChannelTarget;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationSampler {\r\n input: string;\r\n output: string;\r\n\r\n interpolation?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimation extends IGLTFChildRootProperty {\r\n channels?: IGLTFAnimationChannel[];\r\n parameters?: { [key: string]: string };\r\n samplers?: { [key: string]: IGLTFAnimationSampler };\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNodeInstanceSkin {\r\n skeletons: string[];\r\n skin: string;\r\n meshes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSkins extends IGLTFChildRootProperty {\r\n bindShapeMatrix: number[];\r\n inverseBindMatrices: string;\r\n jointNames: string[];\r\n\r\n babylonSkeleton?: Skeleton;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNode extends IGLTFChildRootProperty {\r\n camera?: string;\r\n children: string[];\r\n skin?: string;\r\n jointName?: string;\r\n light?: string;\r\n matrix: number[];\r\n mesh?: string;\r\n meshes?: string[];\r\n rotation?: number[];\r\n scale?: number[];\r\n translation?: number[];\r\n\r\n // Babylon.js values (optimize)\r\n babylonNode?: Node;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFScene extends IGLTFChildRootProperty {\r\n nodes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFRuntime {\r\n extensions: { [key: string]: any };\r\n accessors: { [key: string]: IGLTFAccessor };\r\n buffers: { [key: string]: IGLTFBuffer };\r\n bufferViews: { [key: string]: IGLTFBufferView };\r\n meshes: { [key: string]: IGLTFMesh };\r\n lights: { [key: string]: IGLTFLight };\r\n cameras: { [key: string]: IGLTFCamera };\r\n nodes: { [key: string]: IGLTFNode };\r\n images: { [key: string]: IGLTFImage };\r\n textures: { [key: string]: IGLTFTexture };\r\n shaders: { [key: string]: IGLTFShader };\r\n programs: { [key: string]: IGLTFProgram };\r\n samplers: { [key: string]: IGLTFSampler };\r\n techniques: { [key: string]: IGLTFTechnique };\r\n materials: { [key: string]: IGLTFMaterial };\r\n animations: { [key: string]: IGLTFAnimation };\r\n skins: { [key: string]: IGLTFSkins };\r\n\r\n currentScene?: Object;\r\n scenes: { [key: string]: IGLTFScene }; // v1.1\r\n\r\n extensionsUsed: string[];\r\n extensionsRequired?: string[]; // v1.1\r\n\r\n buffersCount: number;\r\n shaderscount: number;\r\n\r\n scene: Scene;\r\n rootUrl: string;\r\n\r\n loadedBufferCount: number;\r\n loadedBufferViews: { [name: string]: ArrayBufferView };\r\n\r\n loadedShaderCount: number;\r\n\r\n importOnlyMeshes: boolean;\r\n importMeshesNames?: string[];\r\n\r\n dummyNodes: Node[];\r\n\r\n assetContainer: Nullable<AssetContainer>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INodeToRoot {\r\n bone: Bone;\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IJointNode {\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n"]}
@@ -1,9 +1,9 @@
1
- import { EParameterType, ETextureWrapMode, ETextureFilterType, EComponentType } from "./glTFLoaderInterfaces";
2
- import { Vector2, Vector3, Vector4, Matrix } from "@babylonjs/core/Maths/math.vector";
3
- import { Color4 } from '@babylonjs/core/Maths/math.color';
4
- import { Effect } from "@babylonjs/core/Materials/effect";
5
- import { ShaderMaterial } from "@babylonjs/core/Materials/shaderMaterial";
6
- import { Texture } from "@babylonjs/core/Materials/Textures/texture";
1
+ import { EParameterType, ETextureWrapMode, ETextureFilterType, EComponentType } from "./glTFLoaderInterfaces.js";
2
+ import { Vector2, Vector3, Vector4, Matrix } from "@babylonjs/core/Maths/math.vector.js";
3
+ import { Color4 } from '@babylonjs/core/Maths/math.color.js';
4
+ import { Effect } from "@babylonjs/core/Materials/effect.js";
5
+ import { ShaderMaterial } from "@babylonjs/core/Materials/shaderMaterial.js";
6
+ import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
7
7
  /**
8
8
  * Utils functions for GLTF
9
9
  * @hidden
@@ -1,16 +1,16 @@
1
1
  import { __extends } from "tslib";
2
- import { GLTFLoaderExtension } from "./glTFLoader";
3
- import { GLTFLoaderBase } from "./glTFLoader";
4
- import { Vector3 } from "@babylonjs/core/Maths/math.vector";
5
- import { Color3 } from '@babylonjs/core/Maths/math.color';
6
- import { Tools } from "@babylonjs/core/Misc/tools";
7
- import { Material } from "@babylonjs/core/Materials/material";
8
- import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial";
9
- import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight";
10
- import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight";
11
- import { PointLight } from "@babylonjs/core/Lights/pointLight";
12
- import { SpotLight } from "@babylonjs/core/Lights/spotLight";
13
- import { GLTFLoader } from "./glTFLoader";
2
+ import { GLTFLoaderExtension } from "./glTFLoader.js";
3
+ import { GLTFLoaderBase } from "./glTFLoader.js";
4
+ import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
5
+ import { Color3 } from '@babylonjs/core/Maths/math.color.js';
6
+ import { Tools } from "@babylonjs/core/Misc/tools.js";
7
+ import { Material } from "@babylonjs/core/Materials/material.js";
8
+ import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial.js";
9
+ import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight.js";
10
+ import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight.js";
11
+ import { PointLight } from "@babylonjs/core/Lights/pointLight.js";
12
+ import { SpotLight } from "@babylonjs/core/Lights/spotLight.js";
13
+ import { GLTFLoader } from "./glTFLoader.js";
14
14
  /** @hidden */
15
15
  var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
16
16
  __extends(GLTFMaterialsCommonExtension, _super);
package/glTF/1.0/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./glTFBinaryExtension";
2
- export * from "./glTFLoader";
3
- export * from "./glTFLoaderInterfaces";
4
- export * from "./glTFLoaderUtils";
5
- export * from "./glTFMaterialsCommonExtension";
1
+ export * from "./glTFBinaryExtension.js";
2
+ export * from "./glTFLoader.js";
3
+ export * from "./glTFLoaderInterfaces.js";
4
+ export * from "./glTFLoaderUtils.js";
5
+ export * from "./glTFMaterialsCommonExtension.js";
6
6
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- import { Scalar } from "@babylonjs/core/Maths/math.scalar";
2
- import { SphericalHarmonics, SphericalPolynomial } from "@babylonjs/core/Maths/sphericalPolynomial";
3
- import { Quaternion, Matrix } from "@babylonjs/core/Maths/math.vector";
4
- import { RawCubeTexture } from "@babylonjs/core/Materials/Textures/rawCubeTexture";
5
- import { GLTFLoader, ArrayItem } from "../glTFLoader";
1
+ import { Scalar } from "@babylonjs/core/Maths/math.scalar.js";
2
+ import { SphericalHarmonics, SphericalPolynomial } from "@babylonjs/core/Maths/sphericalPolynomial.js";
3
+ import { Quaternion, Matrix } from "@babylonjs/core/Maths/math.vector.js";
4
+ import { RawCubeTexture } from "@babylonjs/core/Materials/Textures/rawCubeTexture.js";
5
+ import { GLTFLoader, ArrayItem } from "../glTFLoader.js";
6
6
  var NAME = "EXT_lights_image_based";
7
7
  /**
8
8
  * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_lights_image_based/README.md)
@@ -88,6 +88,9 @@ var EXT_lights_image_based = /** @class */ (function () {
88
88
  }
89
89
  Matrix.FromQuaternionToRef(rotation, babylonTexture.getReflectionTextureMatrix());
90
90
  }
91
+ if (!light.irradianceCoefficients) {
92
+ throw new Error(context + ": Irradiance coefficients are missing");
93
+ }
91
94
  var sphericalHarmonics = SphericalHarmonics.FromArray(light.irradianceCoefficients);
92
95
  sphericalHarmonics.scaleInPlace(light.intensity);
93
96
  sphericalHarmonics.convertIrradianceToLambertianRadiance();
@@ -1 +1 @@
1
- {"version":3,"file":"EXT_lights_image_based.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AAKnF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD,IAAM,IAAI,GAAG,wBAAwB,CAAC;AAUtC;;GAEG;AACH;IAcI,cAAc;IACd,gCAAY,MAAkB;QAd9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAYxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACP,wCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,cAAc;IACP,0CAAS,GAAhB;QACI,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;QAChD,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACrC,IAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAyB,CAAC;YAChE,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC;SACnC;IACL,CAAC;IAED,cAAc;IACP,+CAAc,GAArB,UAAsB,OAAe,EAAE,KAAa;QAApD,iBAiBC;QAhBG,OAAO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C;IACL,6BAAC;AAAD,CAAC,AArHD,IAqHC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAlC,CAAkC,CAAC,CAAC","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\r\nimport { Scalar } from \"@babylonjs/core/Maths/math.scalar\";\r\nimport { SphericalHarmonics, SphericalPolynomial } from \"@babylonjs/core/Maths/sphericalPolynomial\";\r\nimport { Quaternion, Matrix } from \"@babylonjs/core/Maths/math.vector\";\r\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\r\nimport { RawCubeTexture } from \"@babylonjs/core/Materials/Textures/rawCubeTexture\";\r\n\r\nimport { IEXTLightsImageBased_LightReferenceImageBased, IEXTLightsImageBased_LightImageBased, IEXTLightsImageBased } from \"babylonjs-gltf2interface\";\r\nimport { IScene } from \"../glTFLoaderInterfaces\";\r\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\n\r\nconst NAME = \"EXT_lights_image_based\";\r\n\r\ndeclare module \"babylonjs-gltf2interface\" {\r\n /** @hidden */\r\n interface IEXTLightsImageBased_LightImageBased {\r\n _babylonTexture?: BaseTexture;\r\n _loaded?: Promise<void>;\r\n }\r\n}\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_lights_image_based/README.md)\r\n */\r\nexport class EXT_lights_image_based implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n private _lights?: IEXTLightsImageBased_LightImageBased[];\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n delete this._lights;\r\n }\r\n\r\n /** @hidden */\r\n public onLoading(): void {\r\n const extensions = this._loader.gltf.extensions;\r\n if (extensions && extensions[this.name]) {\r\n const extension = extensions[this.name] as IEXTLightsImageBased;\r\n this._lights = extension.lights;\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtensionAsync<IEXTLightsImageBased_LightReferenceImageBased>(context, scene, this.name, (extensionContext, extension) => {\r\n const promises = new Array<Promise<any>>();\r\n\r\n promises.push(this._loader.loadSceneAsync(context, scene));\r\n\r\n this._loader.logOpen(`${extensionContext}`);\r\n\r\n const light = ArrayItem.Get(`${extensionContext}/light`, this._lights, extension.light);\r\n promises.push(this._loadLightAsync(`/extensions/${this.name}/lights/${extension.light}`, light).then((texture) => {\r\n this._loader.babylonScene.environmentTexture = texture;\r\n }));\r\n\r\n this._loader.logClose();\r\n\r\n return Promise.all(promises).then(() => { });\r\n });\r\n }\r\n\r\n private _loadLightAsync(context: string, light: IEXTLightsImageBased_LightImageBased): Promise<BaseTexture> {\r\n if (!light._loaded) {\r\n const promises = new Array<Promise<any>>();\r\n\r\n this._loader.logOpen(`${context}`);\r\n\r\n const imageData = new Array<Array<ArrayBufferView>>(light.specularImages.length);\r\n for (let mipmap = 0; mipmap < light.specularImages.length; mipmap++) {\r\n const faces = light.specularImages[mipmap];\r\n imageData[mipmap] = new Array<ArrayBufferView>(faces.length);\r\n for (let face = 0; face < faces.length; face++) {\r\n const specularImageContext = `${context}/specularImages/${mipmap}/${face}`;\r\n this._loader.logOpen(`${specularImageContext}`);\r\n\r\n const index = faces[face];\r\n const image = ArrayItem.Get(specularImageContext, this._loader.gltf.images, index);\r\n promises.push(this._loader.loadImageAsync(`/images/${index}`, image).then((data) => {\r\n imageData[mipmap][face] = data;\r\n }));\r\n\r\n this._loader.logClose();\r\n }\r\n }\r\n\r\n this._loader.logClose();\r\n\r\n light._loaded = Promise.all(promises).then(() => {\r\n const babylonTexture = new RawCubeTexture(this._loader.babylonScene, null, light.specularImageSize);\r\n babylonTexture.name = light.name || \"environment\";\r\n light._babylonTexture = babylonTexture;\r\n\r\n if (light.intensity != undefined) {\r\n babylonTexture.level = light.intensity;\r\n }\r\n\r\n if (light.rotation) {\r\n let rotation = Quaternion.FromArray(light.rotation);\r\n\r\n // Invert the rotation so that positive rotation is counter-clockwise.\r\n if (!this._loader.babylonScene.useRightHandedSystem) {\r\n rotation = Quaternion.Inverse(rotation);\r\n }\r\n\r\n Matrix.FromQuaternionToRef(rotation, babylonTexture.getReflectionTextureMatrix());\r\n }\r\n\r\n const sphericalHarmonics = SphericalHarmonics.FromArray(light.irradianceCoefficients);\r\n sphericalHarmonics.scaleInPlace(light.intensity);\r\n\r\n sphericalHarmonics.convertIrradianceToLambertianRadiance();\r\n const sphericalPolynomial = SphericalPolynomial.FromHarmonics(sphericalHarmonics);\r\n\r\n // Compute the lod generation scale to fit exactly to the number of levels available.\r\n const lodGenerationScale = (imageData.length - 1) / Scalar.Log2(light.specularImageSize);\r\n return babylonTexture.updateRGBDAsync(imageData, sphericalPolynomial, lodGenerationScale);\r\n });\r\n }\r\n\r\n return light._loaded.then(() => {\r\n return light._babylonTexture!;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_lights_image_based(loader));"]}
1
+ {"version":3,"file":"EXT_lights_image_based.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE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Harmonics, SphericalPolynomial } from \"@babylonjs/core/Maths/sphericalPolynomial\";\r\nimport { Quaternion, Matrix } from \"@babylonjs/core/Maths/math.vector\";\r\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\r\nimport { RawCubeTexture } from \"@babylonjs/core/Materials/Textures/rawCubeTexture\";\r\n\r\nimport { IEXTLightsImageBased_LightReferenceImageBased, IEXTLightsImageBased_LightImageBased, IEXTLightsImageBased } from \"babylonjs-gltf2interface\";\r\nimport { IScene } from \"../glTFLoaderInterfaces\";\r\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\n\r\nconst NAME = \"EXT_lights_image_based\";\r\n\r\ndeclare module \"babylonjs-gltf2interface\" {\r\n /** @hidden */\r\n interface IEXTLightsImageBased_LightImageBased {\r\n _babylonTexture?: BaseTexture;\r\n _loaded?: Promise<void>;\r\n }\r\n}\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_lights_image_based/README.md)\r\n */\r\nexport class EXT_lights_image_based implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n private _lights?: IEXTLightsImageBased_LightImageBased[];\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n delete this._lights;\r\n }\r\n\r\n /** @hidden */\r\n public onLoading(): void {\r\n const extensions = this._loader.gltf.extensions;\r\n if (extensions && extensions[this.name]) {\r\n const extension = extensions[this.name] as IEXTLightsImageBased;\r\n this._lights = extension.lights;\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> {\r\n return GLTFLoader.LoadExtensionAsync<IEXTLightsImageBased_LightReferenceImageBased>(context, scene, this.name, (extensionContext, extension) => {\r\n const promises = new Array<Promise<any>>();\r\n\r\n promises.push(this._loader.loadSceneAsync(context, scene));\r\n\r\n this._loader.logOpen(`${extensionContext}`);\r\n\r\n const light = ArrayItem.Get(`${extensionContext}/light`, this._lights, extension.light);\r\n promises.push(this._loadLightAsync(`/extensions/${this.name}/lights/${extension.light}`, light).then((texture) => {\r\n this._loader.babylonScene.environmentTexture = texture;\r\n }));\r\n\r\n this._loader.logClose();\r\n\r\n return Promise.all(promises).then(() => { });\r\n });\r\n }\r\n\r\n private _loadLightAsync(context: string, light: IEXTLightsImageBased_LightImageBased): Promise<BaseTexture> {\r\n if (!light._loaded) {\r\n const promises = new Array<Promise<any>>();\r\n\r\n this._loader.logOpen(`${context}`);\r\n\r\n const imageData = new Array<Array<ArrayBufferView>>(light.specularImages.length);\r\n for (let mipmap = 0; mipmap < light.specularImages.length; mipmap++) {\r\n const faces = light.specularImages[mipmap];\r\n imageData[mipmap] = new Array<ArrayBufferView>(faces.length);\r\n for (let face = 0; face < faces.length; face++) {\r\n const specularImageContext = `${context}/specularImages/${mipmap}/${face}`;\r\n this._loader.logOpen(`${specularImageContext}`);\r\n\r\n const index = faces[face];\r\n const image = ArrayItem.Get(specularImageContext, this._loader.gltf.images, index);\r\n promises.push(this._loader.loadImageAsync(`/images/${index}`, image).then((data) => {\r\n imageData[mipmap][face] = data;\r\n }));\r\n\r\n this._loader.logClose();\r\n }\r\n }\r\n\r\n this._loader.logClose();\r\n\r\n light._loaded = Promise.all(promises).then(() => {\r\n const babylonTexture = new RawCubeTexture(this._loader.babylonScene, null, light.specularImageSize);\r\n babylonTexture.name = light.name || \"environment\";\r\n light._babylonTexture = babylonTexture;\r\n\r\n if (light.intensity != undefined) {\r\n babylonTexture.level = light.intensity;\r\n }\r\n\r\n if (light.rotation) {\r\n let rotation = Quaternion.FromArray(light.rotation);\r\n\r\n // Invert the rotation so that positive rotation is counter-clockwise.\r\n if (!this._loader.babylonScene.useRightHandedSystem) {\r\n rotation = Quaternion.Inverse(rotation);\r\n }\r\n\r\n Matrix.FromQuaternionToRef(rotation, babylonTexture.getReflectionTextureMatrix());\r\n }\r\n\r\n if (!light.irradianceCoefficients) {\r\n throw new Error(`${context}: Irradiance coefficients are missing`);\r\n }\r\n\r\n const sphericalHarmonics = SphericalHarmonics.FromArray(light.irradianceCoefficients);\r\n sphericalHarmonics.scaleInPlace(light.intensity);\r\n\r\n sphericalHarmonics.convertIrradianceToLambertianRadiance();\r\n const sphericalPolynomial = SphericalPolynomial.FromHarmonics(sphericalHarmonics);\r\n\r\n // Compute the lod generation scale to fit exactly to the number of levels available.\r\n const lodGenerationScale = (imageData.length - 1) / Scalar.Log2(light.specularImageSize);\r\n return babylonTexture.updateRGBDAsync(imageData, sphericalPolynomial, lodGenerationScale);\r\n });\r\n }\r\n\r\n return light._loaded.then(() => {\r\n return light._babylonTexture!;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_lights_image_based(loader));"]}
@@ -1,6 +1,6 @@
1
- import { Vector3, Quaternion, Matrix } from '@babylonjs/core/Maths/math.vector';
2
- import { GLTFLoader, ArrayItem } from "../glTFLoader";
3
- import { TmpVectors } from '@babylonjs/core/Maths/math.vector';
1
+ import { Vector3, Quaternion, Matrix } from '@babylonjs/core/Maths/math.vector.js';
2
+ import { GLTFLoader, ArrayItem } from "../glTFLoader.js";
3
+ import { TmpVectors } from '@babylonjs/core/Maths/math.vector.js';
4
4
  var NAME = "EXT_mesh_gpu_instancing";
5
5
  /**
6
6
  * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/1691)
@@ -1 +1 @@
1
- {"version":3,"file":"EXT_mesh_gpu_instancing.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts"],"names":[],"mappings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,CAAC,CAAC,CAAC;IACP,CAAC;IACL,8BAAC;AAAD,CAAC,AAvFD,IAuFC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAnC,CAAmC,CAAC,CAAC","sourcesContent":["import { Vector3, Quaternion, Matrix } from '@babylonjs/core/Maths/math.vector';\nimport { Mesh } from '@babylonjs/core/Meshes/mesh';\nimport { TransformNode } from \"@babylonjs/core/Meshes/transformNode\";\nimport { Nullable } from \"@babylonjs/core/types\";\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { INode } from \"../glTFLoaderInterfaces\";\nimport { TmpVectors } from '@babylonjs/core/Maths/math.vector';\nimport { IEXTMeshGpuInstancing } from \"babylonjs-gltf2interface\";\n\nconst NAME = \"EXT_mesh_gpu_instancing\";\n\n/**\n * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/1691)\n * [Playground Sample](https://playground.babylonjs.com/#QFIGLW#9)\n * !!! Experimental Extension Subject to Changes !!!\n */\nexport class EXT_mesh_gpu_instancing implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n private _loader: GLTFLoader;\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n }\n\n /** @hidden */\n public loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>> {\n return GLTFLoader.LoadExtensionAsync<IEXTMeshGpuInstancing, TransformNode>(context, node, this.name, (extensionContext, extension) => {\n this._loader._disableInstancedMesh++;\n\n const promise = this._loader.loadNodeAsync(`/nodes/${node.index}`, node, assign);\n\n this._loader._disableInstancedMesh--;\n\n if (!node._primitiveBabylonMeshes) {\n return promise;\n }\n\n const promises = new Array<Promise<Nullable<Float32Array>>>();\n let instanceCount = 0;\n\n const loadAttribute = (attribute: string) => {\n if (extension.attributes[attribute] == undefined) {\n promises.push(Promise.resolve(null));\n return;\n }\n\n const accessor = ArrayItem.Get(`${extensionContext}/attributes/${attribute}`, this._loader.gltf.accessors, extension.attributes[attribute]);\n promises.push(this._loader._loadFloatAccessorAsync(`/accessors/${accessor.bufferView}`, accessor));\n\n if (instanceCount === 0) {\n instanceCount = accessor.count;\n } else if (instanceCount !== accessor.count) {\n throw new Error(`${extensionContext}/attributes: Instance buffer accessors do not have the same count.`);\n }\n };\n\n loadAttribute(\"TRANSLATION\");\n loadAttribute(\"ROTATION\");\n loadAttribute(\"SCALE\");\n\n return promise.then((babylonTransformNode) => {\n return Promise.all(promises).then(([translationBuffer, rotationBuffer, scaleBuffer]) => {\n const matrices = new Float32Array(instanceCount * 16);\n\n TmpVectors.Vector3[0].copyFromFloats(0, 0, 0); // translation\n TmpVectors.Quaternion[0].copyFromFloats(0, 0, 0, 1); // rotation\n TmpVectors.Vector3[1].copyFromFloats(1, 1, 1); // scale\n\n for (let i = 0; i < instanceCount; ++i) {\n translationBuffer && Vector3.FromArrayToRef(translationBuffer, i * 3, TmpVectors.Vector3[0]);\n rotationBuffer && Quaternion.FromArrayToRef(rotationBuffer, i * 4, TmpVectors.Quaternion[0]);\n scaleBuffer && Vector3.FromArrayToRef(scaleBuffer, i * 3, TmpVectors.Vector3[1]);\n\n Matrix.ComposeToRef(TmpVectors.Vector3[1], TmpVectors.Quaternion[0], TmpVectors.Vector3[0], TmpVectors.Matrix[0]);\n\n TmpVectors.Matrix[0].copyToArray(matrices, i * 16);\n }\n\n for (const babylonMesh of node._primitiveBabylonMeshes!) {\n (babylonMesh as Mesh).thinInstanceSetBuffer(\"matrix\", matrices, 16, true);\n }\n\n return babylonTransformNode;\n });\n });\n });\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_mesh_gpu_instancing(loader));\n"]}
1
+ {"version":3,"file":"EXT_mesh_gpu_instancing.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAIhF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D,IAAM,IAAI,GAAG,yBAAyB,CAAC;AAEvC;;;;GAIG;AACH;IAaI,cAAc;IACd,iCAAY,MAAkB;QAb9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAWxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACP,yCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,+CAAa,GAApB,UAAqB,OAAe,EAAE,IAAW,EAAE,MAAqD;QAAxG,iBA6DC;QA5DG,OAAO,UAAU,CAAC,kBAAkB,CAAuC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,gBAAgB,EAAE,SAAS;YAC7H,KAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;YAErC,IAAM,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC,aAAa,CAAC,YAAU,IAAI,CAAC,KAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YAEjF,KAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;YAErC,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;gBAC/B,OAAO,OAAO,CAAC;aAClB;YAED,IAAM,QAAQ,GAAG,I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AAC,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;qBAC7E;oBAED,OAAO,oBAAoB,CAAC;gBAChC,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,8BAAC;AAAD,CAAC,AAvFD,IAuFC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAnC,CAAmC,CAAC,CAAC","sourcesContent":["import { Vector3, Quaternion, Matrix } from '@babylonjs/core/Maths/math.vector';\nimport { Mesh } from '@babylonjs/core/Meshes/mesh';\nimport { TransformNode } from \"@babylonjs/core/Meshes/transformNode\";\nimport { Nullable } from \"@babylonjs/core/types\";\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { INode } from \"../glTFLoaderInterfaces\";\nimport { TmpVectors } from '@babylonjs/core/Maths/math.vector';\nimport { IEXTMeshGpuInstancing } from \"babylonjs-gltf2interface\";\n\nconst NAME = \"EXT_mesh_gpu_instancing\";\n\n/**\n * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/1691)\n * [Playground Sample](https://playground.babylonjs.com/#QFIGLW#9)\n * !!! Experimental Extension Subject to Changes !!!\n */\nexport class EXT_mesh_gpu_instancing implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n private _loader: GLTFLoader;\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n }\n\n /** @hidden */\n public loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>> {\n return GLTFLoader.LoadExtensionAsync<IEXTMeshGpuInstancing, TransformNode>(context, node, this.name, (extensionContext, extension) => {\n this._loader._disableInstancedMesh++;\n\n const promise = this._loader.loadNodeAsync(`/nodes/${node.index}`, node, assign);\n\n this._loader._disableInstancedMesh--;\n\n if (!node._primitiveBabylonMeshes) {\n return promise;\n }\n\n const promises = new Array<Promise<Nullable<Float32Array>>>();\n let instanceCount = 0;\n\n const loadAttribute = (attribute: string) => {\n if (extension.attributes[attribute] == undefined) {\n promises.push(Promise.resolve(null));\n return;\n }\n\n const accessor = ArrayItem.Get(`${extensionContext}/attributes/${attribute}`, this._loader.gltf.accessors, extension.attributes[attribute]);\n promises.push(this._loader._loadFloatAccessorAsync(`/accessors/${accessor.bufferView}`, accessor));\n\n if (instanceCount === 0) {\n instanceCount = accessor.count;\n } else if (instanceCount !== accessor.count) {\n throw new Error(`${extensionContext}/attributes: Instance buffer accessors do not have the same count.`);\n }\n };\n\n loadAttribute(\"TRANSLATION\");\n loadAttribute(\"ROTATION\");\n loadAttribute(\"SCALE\");\n\n return promise.then((babylonTransformNode) => {\n return Promise.all(promises).then(([translationBuffer, rotationBuffer, scaleBuffer]) => {\n const matrices = new Float32Array(instanceCount * 16);\n\n TmpVectors.Vector3[0].copyFromFloats(0, 0, 0); // translation\n TmpVectors.Quaternion[0].copyFromFloats(0, 0, 0, 1); // rotation\n TmpVectors.Vector3[1].copyFromFloats(1, 1, 1); // scale\n\n for (let i = 0; i < instanceCount; ++i) {\n translationBuffer && Vector3.FromArrayToRef(translationBuffer, i * 3, TmpVectors.Vector3[0]);\n rotationBuffer && Quaternion.FromArrayToRef(rotationBuffer, i * 4, TmpVectors.Quaternion[0]);\n scaleBuffer && Vector3.FromArrayToRef(scaleBuffer, i * 3, TmpVectors.Vector3[1]);\n\n Matrix.ComposeToRef(TmpVectors.Vector3[1], TmpVectors.Quaternion[0], TmpVectors.Vector3[0], TmpVectors.Matrix[0]);\n\n TmpVectors.Matrix[0].copyToArray(matrices, i * 16);\n }\n\n for (const babylonMesh of node._primitiveBabylonMeshes!) {\n (babylonMesh as Mesh).thinInstanceSetBuffer(\"matrix\", matrices, 16, true);\n }\n\n return babylonTransformNode;\n });\n });\n });\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_mesh_gpu_instancing(loader));\n"]}
@@ -6,6 +6,7 @@ import { IBufferView } from "../glTFLoaderInterfaces";
6
6
  * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression)
7
7
  *
8
8
  * This extension uses a WebAssembly decoder module from https://github.com/zeux/meshoptimizer/tree/master/js
9
+ * @since 5.0.0
9
10
  */
10
11
  export declare class EXT_meshopt_compression implements IGLTFLoaderExtension {
11
12
  /**
@@ -16,12 +17,7 @@ export declare class EXT_meshopt_compression implements IGLTFLoaderExtension {
16
17
  * Defines whether this extension is enabled.
17
18
  */
18
19
  enabled: boolean;
19
- /**
20
- * Path to decoder module; defaults to https://preview.babylonjs.com/meshopt_decoder.js
21
- */
22
- static DecoderPath: string;
23
20
  private _loader;
24
- private _decoderPromise?;
25
21
  /** @hidden */
26
22
  constructor(loader: GLTFLoader);
27
23
  /** @hidden */
@@ -1,10 +1,11 @@
1
- import { Tools } from "@babylonjs/core/Misc/tools";
2
- import { ArrayItem, GLTFLoader } from "../glTFLoader";
1
+ import { ArrayItem, GLTFLoader } from "../glTFLoader.js";
2
+ import { MeshoptCompression } from "@babylonjs/core/Meshes/Compression/meshoptCompression.js";
3
3
  var NAME = "EXT_meshopt_compression";
4
4
  /**
5
5
  * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression)
6
6
  *
7
7
  * This extension uses a WebAssembly decoder module from https://github.com/zeux/meshoptimizer/tree/master/js
8
+ * @since 5.0.0
8
9
  */
9
10
  var EXT_meshopt_compression = /** @class */ (function () {
10
11
  /** @hidden */
@@ -15,17 +16,10 @@ var EXT_meshopt_compression = /** @class */ (function () {
15
16
  this.name = NAME;
16
17
  this.enabled = loader.isExtensionUsed(NAME);
17
18
  this._loader = loader;
18
- if (this.enabled) {
19
- this._decoderPromise = Tools.LoadScriptAsync(EXT_meshopt_compression.DecoderPath).then(function () {
20
- // Wait for WebAssembly compilation before resolving promise
21
- return MeshoptDecoder.ready;
22
- });
23
- }
24
19
  }
25
20
  /** @hidden */
26
21
  EXT_meshopt_compression.prototype.dispose = function () {
27
22
  this._loader = null;
28
- delete this._decoderPromise;
29
23
  };
30
24
  /** @hidden */
31
25
  EXT_meshopt_compression.prototype.loadBufferViewAsync = function (context, bufferView) {
@@ -36,22 +30,12 @@ var EXT_meshopt_compression = /** @class */ (function () {
36
30
  return bufferViewMeshopt._meshOptData;
37
31
  }
38
32
  var buffer = ArrayItem.Get(context + "/buffer", _this._loader.gltf.buffers, extension.buffer);
39
- var bufferPromise = _this._loader.loadBufferAsync("/buffers/" + buffer.index, buffer, (extension.byteOffset || 0), extension.byteLength);
40
- bufferViewMeshopt._meshOptData = Promise.all([bufferPromise, _this._decoderPromise]).then(function (res) {
41
- var source = res[0];
42
- var count = extension.count;
43
- var stride = extension.byteStride;
44
- var result = new Uint8Array(new ArrayBuffer(count * stride));
45
- MeshoptDecoder.decodeGltfBuffer(result, count, stride, source, extension.mode, extension.filter);
46
- return Promise.resolve(result);
33
+ bufferViewMeshopt._meshOptData = _this._loader.loadBufferAsync("/buffers/" + buffer.index, buffer, (extension.byteOffset || 0), extension.byteLength).then(function (buffer) {
34
+ return MeshoptCompression.Default.decodeGltfBufferAsync(buffer, extension.count, extension.byteStride, extension.mode, extension.filter);
47
35
  });
48
36
  return bufferViewMeshopt._meshOptData;
49
37
  });
50
38
  };
51
- /**
52
- * Path to decoder module; defaults to https://preview.babylonjs.com/meshopt_decoder.js
53
- */
54
- EXT_meshopt_compression.DecoderPath = "https://preview.babylonjs.com/meshopt_decoder.js";
55
39
  return EXT_meshopt_compression;
56
40
  }());
57
41
  export { EXT_meshopt_compression };
@@ -1 +1 @@
1
- {"version":3,"file":"EXT_meshopt_compression.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_meshopt_compression.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAItD,IAAM,IAAI,GAAG,yBAAyB,CAAC;AAQvC;;;;GAIG;AACH;IAmBI,cAAc;IACd,iCAAY,MAAkB;QAnB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAiBxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;gBACnF,4DAA4D;gBAC5D,OAAO,cAAc,CAAC,KAAK,CAAC;YAChC,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAED,cAAc;IACP,yCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;QAC7B,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,cAAc;IACP,qDAAmB,GAA1B,UAA2B,OAAe,EAAE,UAAuB;QAAnE,iBAqBC;QApBG,OAAO,UAAU,CAAC,kBAAkB,CAA0C,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,gBAAgB,EAAE,SAAS;YACtI,IAAM,iBAAiB,GAAG,UAAgC,CAAC;YAC3D,IAAI,iBAAiB,CAAC,YAAY,EAAE;gBAChC,OAAO,iBAAiB,CAAC,YAAY,CAAC;aACzC;YAED,IAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAI,OAAO,YAAS,EAAE,KAAI,CAAC,OAAO,CAAC,IAAI,C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"../glTFLoaderExtension\";\nimport { ArrayItem, GLTFLoader } from \"../glTFLoader\";\nimport { IBufferView } from \"../glTFLoaderInterfaces\";\nimport { IEXTMeshoptCompression } from \"babylonjs-gltf2interface\";\n\nconst NAME = \"EXT_meshopt_compression\";\n\ndeclare var MeshoptDecoder: any;\n\ninterface IBufferViewMeshopt extends IBufferView {\n _meshOptData?: Promise<ArrayBufferView>;\n}\n\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression)\n *\n * This extension uses a WebAssembly decoder module from https://github.com/zeux/meshoptimizer/tree/master/js\n */\nexport class EXT_meshopt_compression implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n /**\n * Path to decoder module; defaults to https://preview.babylonjs.com/meshopt_decoder.js\n */\n public static DecoderPath: string = \"https://preview.babylonjs.com/meshopt_decoder.js\";\n\n private _loader: GLTFLoader;\n private _decoderPromise?: Promise<any>;\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this.enabled = loader.isExtensionUsed(NAME);\n this._loader = loader;\n\n if (this.enabled) {\n this._decoderPromise = Tools.LoadScriptAsync(EXT_meshopt_compression.DecoderPath).then(() => {\n // Wait for WebAssembly compilation before resolving promise\n return MeshoptDecoder.ready;\n });\n }\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n delete this._decoderPromise;\n }\n\n /** @hidden */\n public loadBufferViewAsync(context: string, bufferView: IBufferView): Nullable<Promise<ArrayBufferView>> {\n return GLTFLoader.LoadExtensionAsync<IEXTMeshoptCompression, ArrayBufferView>(context, bufferView, this.name, (extensionContext, extension) => {\n const bufferViewMeshopt = bufferView as IBufferViewMeshopt;\n if (bufferViewMeshopt._meshOptData) {\n return bufferViewMeshopt._meshOptData;\n }\n\n const buffer = ArrayItem.Get(`${context}/buffer`, this._loader.gltf.buffers, extension.buffer);\n const bufferPromise = this._loader.loadBufferAsync(`/buffers/${buffer.index}`, buffer, (extension.byteOffset || 0), extension.byteLength);\n\n bufferViewMeshopt._meshOptData = Promise.all([bufferPromise, this._decoderPromise]).then((res) => {\n const source = res[0] as Uint8Array;\n const count = extension.count;\n const stride = extension.byteStride;\n const result = new Uint8Array(new ArrayBuffer(count * stride));\n MeshoptDecoder.decodeGltfBuffer(result, count, stride, source, extension.mode, extension.filter);\n return Promise.resolve(result);\n });\n\n return bufferViewMeshopt._meshOptData;\n });\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_meshopt_compression(loader));\n"]}
1
+ {"version":3,"file":"EXT_meshopt_compression.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_meshopt_compression.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,IAAM,IAAI,GAAG,yBAAyB,CAAC;AAMvC;;;;;GAKG;AACH;IAaI,cAAc;IACd,iCAAY,MAAkB;QAb9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAWxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,cAAc;IACP,yCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,qDAAmB,GAA1B,UAA2B,OAAe,EAAE,UAAuB;QAAnE,iBAcC;QAbG,OAAO,UAAU,CAAC,kBAAkB,CAA0C,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,gBAAgB,EAAE,SAAS;YACtI,IAAM,iBAAiB,GAAG,UAAgC,CAAC;YAC3D,IAAI,iBAAiB,CAAC,YAAY,EAAE;gBAChC,OAAO,iBAAiB,CAAC,YAAY,CAAC;aACzC;YAED,IAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAI,OAAO,YAAS,EAAE,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YAC/F,iBAAiB,CAAC,YAAY,GAAG,KAAI,CAAC,OAAO,CAAC,eAAe,CAAC,cAAY,MAAM,CAAC,KAAO,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAC,MAAM;gBAC7J,OAAO,kBAAkB,CAAC,OAAO,CAAC,qBAAqB,CAAC,MAAoB,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YAC3J,CAAC,CAAC,CAAC;YAEH,OAAO,iBAAiB,CAAC,YAAY,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC;IACL,8BAAC;AAAD,CAAC,AAxCD,IAwCC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAnC,CAAmC,CAAC,CAAC","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { ArrayItem, GLTFLoader } from \"../glTFLoader\";\nimport { IBufferView } from \"../glTFLoaderInterfaces\";\nimport { IEXTMeshoptCompression } from \"babylonjs-gltf2interface\";\nimport { MeshoptCompression } from \"@babylonjs/core/Meshes/Compression/meshoptCompression\";\n\nconst NAME = \"EXT_meshopt_compression\";\n\ninterface IBufferViewMeshopt extends IBufferView {\n _meshOptData?: Promise<ArrayBufferView>;\n}\n\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression)\n *\n * This extension uses a WebAssembly decoder module from https://github.com/zeux/meshoptimizer/tree/master/js\n * @since 5.0.0\n */\nexport class EXT_meshopt_compression implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n private _loader: GLTFLoader;\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this.enabled = loader.isExtensionUsed(NAME);\n this._loader = loader;\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n }\n\n /** @hidden */\n public loadBufferViewAsync(context: string, bufferView: IBufferView): Nullable<Promise<ArrayBufferView>> {\n return GLTFLoader.LoadExtensionAsync<IEXTMeshoptCompression, ArrayBufferView>(context, bufferView, this.name, (extensionContext, extension) => {\n const bufferViewMeshopt = bufferView as IBufferViewMeshopt;\n if (bufferViewMeshopt._meshOptData) {\n return bufferViewMeshopt._meshOptData;\n }\n\n const buffer = ArrayItem.Get(`${context}/buffer`, this._loader.gltf.buffers, extension.buffer);\n bufferViewMeshopt._meshOptData = this._loader.loadBufferAsync(`/buffers/${buffer.index}`, buffer, (extension.byteOffset || 0), extension.byteLength).then((buffer) => {\n return MeshoptCompression.Default.decodeGltfBufferAsync(buffer as Uint8Array, extension.count, extension.byteStride, extension.mode, extension.filter);\n });\n\n return bufferViewMeshopt._meshOptData;\n });\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_meshopt_compression(loader));\n"]}
@@ -1,4 +1,4 @@
1
- import { GLTFLoader, ArrayItem } from "../glTFLoader";
1
+ import { GLTFLoader, ArrayItem } from "../glTFLoader.js";
2
2
  var NAME = "EXT_texture_webp";
3
3
  /**
4
4
  * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_texture_webp/)
@@ -23,7 +23,7 @@ var EXT_texture_webp = /** @class */ (function () {
23
23
  var image = ArrayItem.Get(extensionContext + "/source", _this._loader.gltf.images, extension.source);
24
24
  return _this._loader._createTextureAsync(context, sampler, image, function (babylonTexture) {
25
25
  assign(babylonTexture);
26
- });
26
+ }, undefined, !texture._textureInfo.nonColorData);
27
27
  });
28
28
  };
29
29
  return EXT_texture_webp;
@@ -1 +1 @@
1
- {"version":3,"file":"EXT_texture_webp.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_texture_webp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAMtD,IAAM,IAAI,GAAG,kBAAkB,CAAC;AAEhC;;GAEG;AACH;IASI,cAAc;IACd,0BAAY,MAAkB;QAT9B,kCAAkC;QAClB,SAAI,GAAG,IAAI,CAAC;QASxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,cAAc;IACP,kCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,4CAAiB,GAAxB,UAAyB,OAAe,EAAE,OAAiB,EAAE,MAA6C;QAA1G,iBAQC;QAPG,OAAO,UAAU,CAAC,kBAAkB,CAA+B,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,gBAAgB,EAAE,SAAS;YACxH,IAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAI,OAAO,aAAU,EAAE,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9J,IAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAI,gBAAgB,YAAS,EAAE,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YACtG,OAAO,KAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAC,cAAc;gBAC5E,MAAM,CAAC,cAAc,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,uBAAC;AAAD,CAAC,AA9BD,IA8BC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAA5B,CAA4B,CAAC,CAAC","sourcesContent":["import { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\nimport { ITexture } from \"../glTFLoaderInterfaces\";\r\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { IEXTTextureWebP } from 'babylonjs-gltf2interface';\r\n\r\nconst NAME = \"EXT_texture_webp\";\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_texture_webp/)\r\n */\r\nexport class EXT_texture_webp implements IGLTFLoaderExtension {\r\n /** The name of this extension. */\r\n public readonly name = NAME;\r\n\r\n /** Defines whether this extension is enabled. */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /** @hidden */\r\n public _loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {\r\n return GLTFLoader.LoadExtensionAsync<IEXTTextureWebP, BaseTexture>(context, texture, this.name, (extensionContext, extension) => {\r\n const sampler = (texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler));\r\n const image = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source);\r\n return this._loader._createTextureAsync(context, sampler, image, (babylonTexture) => {\r\n assign(babylonTexture);\r\n });\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_texture_webp(loader));\r\n"]}
1
+ {"version":3,"file":"EXT_texture_webp.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/EXT_texture_webp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAMtD,IAAM,IAAI,GAAG,kBAAkB,CAAC;AAEhC;;GAEG;AACH;IASI,cAAc;IACd,0BAAY,MAAkB;QAT9B,kCAAkC;QAClB,SAAI,GAAG,IAAI,CAAC;QASxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,cAAc;IACP,kCAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,4CAAiB,GAAxB,UAAyB,OAAe,EAAE,OAAiB,EAAE,MAA6C;QAA1G,iBAQC;QAPG,OAAO,UAAU,CAAC,kBAAkB,CAA+B,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,gBAAgB,EAAE,SAAS;YACxH,IAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAI,OAAO,aAAU,EAAE,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9J,IAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAI,gBAAgB,YAAS,EAAE,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YACtG,OAAO,KAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAC,cAAc;gBAC5E,MAAM,CAAC,cAAc,CAAC,CAAC;YAC3B,CAAC,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACP,CAAC;IACL,uBAAC;AAAD,CAAC,AA9BD,IA8BC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAA5B,CAA4B,CAAC,CAAC","sourcesContent":["import { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\nimport { ITexture } from \"../glTFLoaderInterfaces\";\r\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { IEXTTextureWebP } from 'babylonjs-gltf2interface';\r\n\r\nconst NAME = \"EXT_texture_webp\";\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_texture_webp/)\r\n */\r\nexport class EXT_texture_webp implements IGLTFLoaderExtension {\r\n /** The name of this extension. */\r\n public readonly name = NAME;\r\n\r\n /** Defines whether this extension is enabled. */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose() {\r\n (this._loader as any) = null;\r\n }\r\n\r\n /** @hidden */\r\n public _loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {\r\n return GLTFLoader.LoadExtensionAsync<IEXTTextureWebP, BaseTexture>(context, texture, this.name, (extensionContext, extension) => {\r\n const sampler = (texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler));\r\n const image = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source);\r\n return this._loader._createTextureAsync(context, sampler, image, (babylonTexture) => {\r\n assign(babylonTexture);\r\n }, undefined, !texture._textureInfo.nonColorData);\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_texture_webp(loader));\r\n"]}
@@ -1,4 +1,4 @@
1
- import { GLTFLoader } from "../glTFLoader";
1
+ import { GLTFLoader } from "../glTFLoader.js";
2
2
  var NAME = "ExtrasAsMetadata";
3
3
  /**
4
4
  * Store glTF extras (if present) in BJS objects' metadata
@@ -1,7 +1,7 @@
1
- import { DracoCompression } from "@babylonjs/core/Meshes/Compression/dracoCompression";
2
- import { VertexBuffer } from "@babylonjs/core/Meshes/buffer";
3
- import { Geometry } from "@babylonjs/core/Meshes/geometry";
4
- import { GLTFLoader, ArrayItem } from "../glTFLoader";
1
+ import { DracoCompression } from "@babylonjs/core/Meshes/Compression/dracoCompression.js";
2
+ import { VertexBuffer } from "@babylonjs/core/Buffers/buffer.js";
3
+ import { Geometry } from "@babylonjs/core/Meshes/geometry.js";
4
+ import { GLTFLoader, ArrayItem } from "../glTFLoader.js";
5
5
  var NAME = "KHR_draco_mesh_compression";
6
6
  /**
7
7
  * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)
@@ -52,6 +52,10 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
52
52
  loadAttribute("TANGENT", VertexBuffer.TangentKind);
53
53
  loadAttribute("TEXCOORD_0", VertexBuffer.UVKind);
54
54
  loadAttribute("TEXCOORD_1", VertexBuffer.UV2Kind);
55
+ loadAttribute("TEXCOORD_2", VertexBuffer.UV3Kind);
56
+ loadAttribute("TEXCOORD_3", VertexBuffer.UV4Kind);
57
+ loadAttribute("TEXCOORD_4", VertexBuffer.UV5Kind);
58
+ loadAttribute("TEXCOORD_5", VertexBuffer.UV6Kind);
55
59
  loadAttribute("JOINTS_0", VertexBuffer.MatricesIndicesKind);
56
60
  loadAttribute("WEIGHTS_0", VertexBuffer.MatricesWeightsKind);
57
61
  loadAttribute("COLOR_0", VertexBuffer.ColorKind);
@@ -1 +1 @@
1
- {"version":3,"file":"KHR_draco_mesh_compression.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAM3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD,IAAM,IAAI,GAAG,4BAA4B,CAAC;AAM1C;;GAEG;AACH;IAkBI,cAAc;IACd,oCAAY,MAAkB;QAlB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAgBxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,gBAAgB,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC3F,CAAC;IAED,cAAc;IACP,4CAAO,GAAd;QACI,OAAO,IAAI,CAAC,gBAAgB,CAAC;QAC5B,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,yDAAoB,GAA3B,UAA4B,OAAe,EAAE,SAAyB,E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AC;AAAD,CAAC,AAtFD,IAsFC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,0BAA0B,CAAC,MAAM,CAAC,EAAtC,CAAsC,CAAC,CAAC","sourcesContent":["import { DracoCompression } from \"@babylonjs/core/Meshes/Compression/dracoCompression\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { VertexBuffer } from \"@babylonjs/core/Meshes/buffer\";\r\nimport { Geometry } from \"@babylonjs/core/Meshes/geometry\";\r\nimport { Mesh } from \"@babylonjs/core/Meshes/mesh\";\r\n\r\nimport { MeshPrimitiveMode, IKHRDracoMeshCompression } from \"babylonjs-gltf2interface\";\r\nimport { IMeshPrimitive, IBufferView } from \"../glTFLoaderInterfaces\";\r\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\n\r\nconst NAME = \"KHR_draco_mesh_compression\";\r\n\r\ninterface IBufferViewDraco extends IBufferView {\r\n _dracoBabylonGeometry?: Promise<Geometry>;\r\n}\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)\r\n */\r\nexport class KHR_draco_mesh_compression implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * The draco compression used to decode vertex data or DracoCompression.Default if not defined\r\n */\r\n public dracoCompression?: DracoCompression;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = DracoCompression.DecoderAvailable && this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose(): void {\r\n delete this.dracoCompression;\r\n (this._loader as any) = null;\r\n }\r\n\r\n /** @hidden */\r\n public _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRDracoMeshCompression, Geometry>(context, primitive, this.name, (extensionContext, extension) => {\r\n if (primitive.mode != undefined) {\r\n if (primitive.mode !== MeshPrimitiveMode.TRIANGLE_STRIP &&\r\n primitive.mode !== MeshPrimitiveMode.TRIANGLES) {\r\n throw new Error(`${context}: Unsupported mode ${primitive.mode}`);\r\n }\r\n\r\n // TODO: handle triangle strips\r\n if (primitive.mode === MeshPrimitiveMode.TRIANGLE_STRIP) {\r\n throw new Error(`${context}: Mode ${primitive.mode} is not currently supported`);\r\n }\r\n }\r\n\r\n const attributes: { [kind: string]: number } = {};\r\n const loadAttribute = (name: string, kind: string) => {\r\n const uniqueId = extension.attributes[name];\r\n if (uniqueId == undefined) {\r\n return;\r\n }\r\n\r\n babylonMesh._delayInfo = babylonMesh._delayInfo || [];\r\n if (babylonMesh._delayInfo.indexOf(kind) === -1) {\r\n babylonMesh._delayInfo.push(kind);\r\n }\r\n\r\n attributes[kind] = uniqueId;\r\n };\r\n\r\n loadAttribute(\"POSITION\", VertexBuffer.PositionKind);\r\n loadAttribute(\"NORMAL\", VertexBuffer.NormalKind);\r\n loadAttribute(\"TANGENT\", VertexBuffer.TangentKind);\r\n loadAttribute(\"TEXCOORD_0\", VertexBuffer.UVKind);\r\n loadAttribute(\"TEXCOORD_1\", VertexBuffer.UV2Kind);\r\n loadAttribute(\"JOINTS_0\", VertexBuffer.MatricesIndicesKind);\r\n loadAttribute(\"WEIGHTS_0\", VertexBuffer.MatricesWeightsKind);\r\n loadAttribute(\"COLOR_0\", VertexBuffer.ColorKind);\r\n\r\n var bufferView = ArrayItem.Get(extensionContext, this._loader.gltf.bufferViews, extension.bufferView) as IBufferViewDraco;\r\n if (!bufferView._dracoBabylonGeometry) {\r\n bufferView._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {\r\n const dracoCompression = this.dracoCompression || DracoCompression.Default;\r\n return dracoCompression.decodeMeshAsync(data, attributes).then((babylonVertexData) => {\r\n const babylonGeometry = new Geometry(babylonMesh.name, this._loader.babylonScene);\r\n babylonVertexData.applyToGeometry(babylonGeometry);\r\n return babylonGeometry;\r\n }).catch((error) => {\r\n throw new Error(`${context}: ${error.message}`);\r\n });\r\n });\r\n }\r\n\r\n return bufferView._dracoBabylonGeometry;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_draco_mesh_compression(loader));"]}
1
+ {"version":3,"file":"KHR_draco_mesh_compression.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAM3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD,IAAM,IAAI,GAAG,4BAA4B,CAAC;AAM1C;;GAEG;AACH;IAkBI,cAAc;IACd,oCAAY,MAAkB;QAlB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAgBxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,gBAAgB,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC3F,CAAC;IAED,cAAc;IACP,4CAAO,GAAd;QACI,OAAO,IAAI,CAAC,gBAAgB,CAAC;QAC5B,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,yDAAoB,GAA3B,UAA4B,OAAe,EAAE,SAAyB,EAAE,WAAiB;QAAzF,iBA0DC;QAzDG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wBACX,MAAM,IAAI,KAAK,CAAI,OAAO,UAAK,KAAK,CAAC,OAAS,CAAC,CAAC;oBACpD,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;aACN;YAED,OAAO,UAAU,CAAC,qBAAqB,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC;IACL,iCAAC;AAAD,CAAC,AA1FD,IA0FC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,0BAA0B,CAAC,MAAM,CAAC,EAAtC,CAAsC,CAAC,CAAC","sourcesContent":["import { DracoCompression } from \"@babylonjs/core/Meshes/Compression/dracoCompression\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { VertexBuffer } from \"@babylonjs/core/Buffers/buffer\";\r\nimport { Geometry } from \"@babylonjs/core/Meshes/geometry\";\r\nimport { Mesh } from \"@babylonjs/core/Meshes/mesh\";\r\n\r\nimport { MeshPrimitiveMode, IKHRDracoMeshCompression } from \"babylonjs-gltf2interface\";\r\nimport { IMeshPrimitive, IBufferView } from \"../glTFLoaderInterfaces\";\r\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\r\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\r\n\r\nconst NAME = \"KHR_draco_mesh_compression\";\r\n\r\ninterface IBufferViewDraco extends IBufferView {\r\n _dracoBabylonGeometry?: Promise<Geometry>;\r\n}\r\n\r\n/**\r\n * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)\r\n */\r\nexport class KHR_draco_mesh_compression implements IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n public readonly name = NAME;\r\n\r\n /**\r\n * The draco compression used to decode vertex data or DracoCompression.Default if not defined\r\n */\r\n public dracoCompression?: DracoCompression;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n public enabled: boolean;\r\n\r\n private _loader: GLTFLoader;\r\n\r\n /** @hidden */\r\n constructor(loader: GLTFLoader) {\r\n this._loader = loader;\r\n this.enabled = DracoCompression.DecoderAvailable && this._loader.isExtensionUsed(NAME);\r\n }\r\n\r\n /** @hidden */\r\n public dispose(): void {\r\n delete this.dracoCompression;\r\n (this._loader as any) = null;\r\n }\r\n\r\n /** @hidden */\r\n public _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>> {\r\n return GLTFLoader.LoadExtensionAsync<IKHRDracoMeshCompression, Geometry>(context, primitive, this.name, (extensionContext, extension) => {\r\n if (primitive.mode != undefined) {\r\n if (primitive.mode !== MeshPrimitiveMode.TRIANGLE_STRIP &&\r\n primitive.mode !== MeshPrimitiveMode.TRIANGLES) {\r\n throw new Error(`${context}: Unsupported mode ${primitive.mode}`);\r\n }\r\n\r\n // TODO: handle triangle strips\r\n if (primitive.mode === MeshPrimitiveMode.TRIANGLE_STRIP) {\r\n throw new Error(`${context}: Mode ${primitive.mode} is not currently supported`);\r\n }\r\n }\r\n\r\n const attributes: { [kind: string]: number } = {};\r\n const loadAttribute = (name: string, kind: string) => {\r\n const uniqueId = extension.attributes[name];\r\n if (uniqueId == undefined) {\r\n return;\r\n }\r\n\r\n babylonMesh._delayInfo = babylonMesh._delayInfo || [];\r\n if (babylonMesh._delayInfo.indexOf(kind) === -1) {\r\n babylonMesh._delayInfo.push(kind);\r\n }\r\n\r\n attributes[kind] = uniqueId;\r\n };\r\n\r\n loadAttribute(\"POSITION\", VertexBuffer.PositionKind);\r\n loadAttribute(\"NORMAL\", VertexBuffer.NormalKind);\r\n loadAttribute(\"TANGENT\", VertexBuffer.TangentKind);\r\n loadAttribute(\"TEXCOORD_0\", VertexBuffer.UVKind);\r\n loadAttribute(\"TEXCOORD_1\", VertexBuffer.UV2Kind);\r\n loadAttribute(\"TEXCOORD_2\", VertexBuffer.UV3Kind);\r\n loadAttribute(\"TEXCOORD_3\", VertexBuffer.UV4Kind);\r\n loadAttribute(\"TEXCOORD_4\", VertexBuffer.UV5Kind);\r\n loadAttribute(\"TEXCOORD_5\", VertexBuffer.UV6Kind);\r\n loadAttribute(\"JOINTS_0\", VertexBuffer.MatricesIndicesKind);\r\n loadAttribute(\"WEIGHTS_0\", VertexBuffer.MatricesWeightsKind);\r\n loadAttribute(\"COLOR_0\", VertexBuffer.ColorKind);\r\n\r\n var bufferView = ArrayItem.Get(extensionContext, this._loader.gltf.bufferViews, extension.bufferView) as IBufferViewDraco;\r\n if (!bufferView._dracoBabylonGeometry) {\r\n bufferView._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {\r\n const dracoCompression = this.dracoCompression || DracoCompression.Default;\r\n return dracoCompression.decodeMeshAsync(data, attributes).then((babylonVertexData) => {\r\n const babylonGeometry = new Geometry(babylonMesh.name, this._loader.babylonScene);\r\n babylonVertexData.applyToGeometry(babylonGeometry);\r\n return babylonGeometry;\r\n }).catch((error) => {\r\n throw new Error(`${context}: ${error.message}`);\r\n });\r\n });\r\n }\r\n\r\n return bufferView._dracoBabylonGeometry;\r\n });\r\n }\r\n}\r\n\r\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_draco_mesh_compression(loader));"]}
@@ -1,10 +1,10 @@
1
- import { Vector3 } from "@babylonjs/core/Maths/math.vector";
2
- import { Color3 } from '@babylonjs/core/Maths/math.color';
3
- import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight";
4
- import { PointLight } from "@babylonjs/core/Lights/pointLight";
5
- import { SpotLight } from "@babylonjs/core/Lights/spotLight";
6
- import { Light } from "@babylonjs/core/Lights/light";
7
- import { GLTFLoader, ArrayItem } from "../glTFLoader";
1
+ import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
2
+ import { Color3 } from '@babylonjs/core/Maths/math.color.js';
3
+ import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight.js";
4
+ import { PointLight } from "@babylonjs/core/Lights/pointLight.js";
5
+ import { SpotLight } from "@babylonjs/core/Lights/spotLight.js";
6
+ import { Light } from "@babylonjs/core/Lights/light.js";
7
+ import { GLTFLoader, ArrayItem } from "../glTFLoader.js";
8
8
  var NAME = "KHR_lights_punctual";
9
9
  /**
10
10
  * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual)
@@ -40,7 +40,7 @@ var KHR_lights = /** @class */ (function () {
40
40
  var babylonLight;
41
41
  var light = ArrayItem.Get(extensionContext, _this._lights, extension.light);
42
42
  var name = light.name || babylonMesh.name;
43
- _this._loader.babylonScene._blockEntityCollection = _this._loader._forAssetContainer;
43
+ _this._loader.babylonScene._blockEntityCollection = !!_this._loader._assetContainer;
44
44
  switch (light.type) {
45
45
  case "directional" /* DIRECTIONAL */: {
46
46
  babylonLight = new DirectionalLight(name, Vector3.Backward(), _this._loader.babylonScene);
@@ -62,6 +62,7 @@ var KHR_lights = /** @class */ (function () {
62
62
  throw new Error(extensionContext + ": Invalid light type (" + light.type + ")");
63
63
  }
64
64
  }
65
+ babylonLight._parentContainer = _this._loader._assetContainer;
65
66
  _this._loader.babylonScene._blockEntityCollection = false;
66
67
  babylonLight.falloffType = Light.FALLOFF_GLTF;
67
68
  babylonLight.diffuse = light.color ? Color3.FromArray(light.color) : Color3.White();
@@ -1 +1 @@
1
- {"version":3,"file":"KHR_lights_punctual.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;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C,IAAI,MAAG,CAAC,CAAC;qBAC9E;iBACJ;gBAED,KAAI,CAAC,OAAO,CAAC,YAAY,CAAC,sBAAsB,GAAG,KAAK,CAAC;gBACzD,YAAY,CAAC,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC;gBAC9C,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;gBACpF,YAAY,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAC5E,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC/E,YAAY,CAAC,MAAM,GAAG,WAAW,CAAC;gBAElC,KAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAE/C,UAAU,CAAC,kBAAkB,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;gBAE9D,MAAM,CAAC,WAAW,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,iBAAC;AAAD,CAAC,AAnFD,IAmFC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,UAAU,CAAC,MAAM,CAAC,EAAtB,CAAsB,CAAC,CAAC","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\nimport { Vector3 } from \"@babylonjs/core/Maths/math.vector\";\nimport { Color3 } from '@babylonjs/core/Maths/math.color';\nimport { DirectionalLight } from \"@babylonjs/core/Lights/directionalLight\";\nimport { PointLight } from \"@babylonjs/core/Lights/pointLight\";\nimport { SpotLight } from \"@babylonjs/core/Lights/spotLight\";\nimport { Light } from \"@babylonjs/core/Lights/light\";\nimport { TransformNode } from \"@babylonjs/core/Meshes/transformNode\";\n\nimport { IKHRLightsPunctual_LightType, IKHRLightsPunctual_LightReference, IKHRLightsPunctual_Light, IKHRLightsPunctual } from \"babylonjs-gltf2interface\";\nimport { INode } from \"../glTFLoaderInterfaces\";\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\n\nconst NAME = \"KHR_lights_punctual\";\n\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual)\n */\nexport class KHR_lights implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n private _loader: GLTFLoader;\n private _lights?: IKHRLightsPunctual_Light[];\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n delete this._lights;\n }\n\n /** @hidden */\n public onLoading(): void {\n const extensions = this._loader.gltf.extensions;\n if (extensions && extensions[this.name]) {\n const extension = extensions[this.name] as IKHRLightsPunctual;\n this._lights = extension.lights;\n }\n }\n\n /** @hidden */\n public loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>> {\n return GLTFLoader.LoadExtensionAsync<IKHRLightsPunctual_LightReference, TransformNode>(context, node, this.name, (extensionContext, extension) => {\n return this._loader.loadNodeAsync(context, node, (babylonMesh) => {\n let babylonLight: Light;\n\n const light = ArrayItem.Get(extensionContext, this._lights, extension.light);\n const name = light.name || babylonMesh.name;\n\n this._loader.babylonScene._blockEntityCollection = this._loader._forAssetContainer;\n\n switch (light.type) {\n case IKHRLightsPunctual_LightType.DIRECTIONAL: {\n babylonLight = new DirectionalLight(name, Vector3.Backward(), this._loader.babylonScene);\n break;\n }\n case IKHRLightsPunctual_LightType.POINT: {\n babylonLight = new PointLight(name, Vector3.Zero(), this._loader.babylonScene);\n break;\n }\n case IKHRLightsPunctual_LightType.SPOT: {\n const babylonSpotLight = new SpotLight(name, Vector3.Zero(), Vector3.Backward(), 0, 1, this._loader.babylonScene);\n babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;\n babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;\n babylonLight = babylonSpotLight;\n break;\n }\n default: {\n this._loader.babylonScene._blockEntityCollection = false;\n throw new Error(`${extensionContext}: Invalid light type (${light.type})`);\n }\n }\n\n this._loader.babylonScene._blockEntityCollection = false;\n babylonLight.falloffType = Light.FALLOFF_GLTF;\n babylonLight.diffuse = light.color ? Color3.FromArray(light.color) : Color3.White();\n babylonLight.intensity = light.intensity == undefined ? 1 : light.intensity;\n babylonLight.range = light.range == undefined ? Number.MAX_VALUE : light.range;\n babylonLight.parent = babylonMesh;\n\n this._loader._babylonLights.push(babylonLight);\n\n GLTFLoader.AddPointerMetadata(babylonLight, extensionContext);\n\n assign(babylonMesh);\n });\n });\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_lights(loader));"]}
1
+ {"version":3,"file":"KHR_lights_punctual.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAA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ylonjs/core/Maths/math.color';\nimport { DirectionalLight } from \"@babylonjs/core/Lights/directionalLight\";\nimport { PointLight } from \"@babylonjs/core/Lights/pointLight\";\nimport { SpotLight } from \"@babylonjs/core/Lights/spotLight\";\nimport { Light } from \"@babylonjs/core/Lights/light\";\nimport { TransformNode } from \"@babylonjs/core/Meshes/transformNode\";\n\nimport { IKHRLightsPunctual_LightType, IKHRLightsPunctual_LightReference, IKHRLightsPunctual_Light, IKHRLightsPunctual } from \"babylonjs-gltf2interface\";\nimport { INode } from \"../glTFLoaderInterfaces\";\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { GLTFLoader, ArrayItem } from \"../glTFLoader\";\n\nconst NAME = \"KHR_lights_punctual\";\n\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual)\n */\nexport class KHR_lights implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n private _loader: GLTFLoader;\n private _lights?: IKHRLightsPunctual_Light[];\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n delete this._lights;\n }\n\n /** @hidden */\n public onLoading(): void {\n const extensions = this._loader.gltf.extensions;\n if (extensions && extensions[this.name]) {\n const extension = extensions[this.name] as IKHRLightsPunctual;\n this._lights = extension.lights;\n }\n }\n\n /** @hidden */\n public loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>> {\n return GLTFLoader.LoadExtensionAsync<IKHRLightsPunctual_LightReference, TransformNode>(context, node, this.name, (extensionContext, extension) => {\n return this._loader.loadNodeAsync(context, node, (babylonMesh) => {\n let babylonLight: Light;\n\n const light = ArrayItem.Get(extensionContext, this._lights, extension.light);\n const name = light.name || babylonMesh.name;\n\n this._loader.babylonScene._blockEntityCollection = !!this._loader._assetContainer;\n\n switch (light.type) {\n case IKHRLightsPunctual_LightType.DIRECTIONAL: {\n babylonLight = new DirectionalLight(name, Vector3.Backward(), this._loader.babylonScene);\n break;\n }\n case IKHRLightsPunctual_LightType.POINT: {\n babylonLight = new PointLight(name, Vector3.Zero(), this._loader.babylonScene);\n break;\n }\n case IKHRLightsPunctual_LightType.SPOT: {\n const babylonSpotLight = new SpotLight(name, Vector3.Zero(), Vector3.Backward(), 0, 1, this._loader.babylonScene);\n babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;\n babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;\n babylonLight = babylonSpotLight;\n break;\n }\n default: {\n this._loader.babylonScene._blockEntityCollection = false;\n throw new Error(`${extensionContext}: Invalid light type (${light.type})`);\n }\n }\n\n babylonLight._parentContainer = this._loader._assetContainer;\n this._loader.babylonScene._blockEntityCollection = false;\n babylonLight.falloffType = Light.FALLOFF_GLTF;\n babylonLight.diffuse = light.color ? Color3.FromArray(light.color) : Color3.White();\n babylonLight.intensity = light.intensity == undefined ? 1 : light.intensity;\n babylonLight.range = light.range == undefined ? Number.MAX_VALUE : light.range;\n babylonLight.parent = babylonMesh;\n\n this._loader._babylonLights.push(babylonLight);\n\n GLTFLoader.AddPointerMetadata(babylonLight, extensionContext);\n\n assign(babylonMesh);\n });\n });\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_lights(loader));"]}
@@ -1,5 +1,5 @@
1
- import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial";
2
- import { GLTFLoader } from "../glTFLoader";
1
+ import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
2
+ import { GLTFLoader } from "../glTFLoader.js";
3
3
  var NAME = "KHR_materials_clearcoat";
4
4
  /**
5
5
  * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_materials_clearcoat/README.md)