babylonjs.loaders.module.d.ts 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. /// <reference types="babylonjs"/>
  2. declare module 'babylonjs-loaders' {
  3. export = BABYLON;
  4. }
  5. declare module BABYLON {
  6. class STLFileLoader implements ISceneLoaderPlugin {
  7. solidPattern: RegExp;
  8. facetsPattern: RegExp;
  9. normalPattern: RegExp;
  10. vertexPattern: RegExp;
  11. name: string;
  12. extensions: ISceneLoaderPluginExtensions;
  13. importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: Nullable<AbstractMesh[]>, particleSystems: Nullable<ParticleSystem[]>, skeletons: Nullable<Skeleton[]>): boolean;
  14. load(scene: Scene, data: any, rootUrl: string): boolean;
  15. private isBinary(data);
  16. private parseBinary(mesh, data);
  17. private parseASCII(mesh, solidData);
  18. }
  19. }
  20. declare module BABYLON {
  21. /**
  22. * Class reading and parsing the MTL file bundled with the obj file.
  23. */
  24. class MTLFileLoader {
  25. materials: BABYLON.StandardMaterial[];
  26. /**
  27. * This function will read the mtl file and create each material described inside
  28. * This function could be improve by adding :
  29. * -some component missing (Ni, Tf...)
  30. * -including the specific options available
  31. *
  32. * @param scene
  33. * @param data
  34. * @param rootUrl
  35. */
  36. parseMTL(scene: BABYLON.Scene, data: string, rootUrl: string): void;
  37. /**
  38. * Gets the texture for the material.
  39. *
  40. * If the material is imported from input file,
  41. * We sanitize the url to ensure it takes the textre from aside the material.
  42. *
  43. * @param rootUrl The root url to load from
  44. * @param value The value stored in the mtl
  45. * @return The Texture
  46. */
  47. private static _getTexture(rootUrl, value, scene);
  48. }
  49. class OBJFileLoader implements ISceneLoaderPlugin {
  50. static OPTIMIZE_WITH_UV: boolean;
  51. name: string;
  52. extensions: string;
  53. obj: RegExp;
  54. group: RegExp;
  55. mtllib: RegExp;
  56. usemtl: RegExp;
  57. smooth: RegExp;
  58. vertexPattern: RegExp;
  59. normalPattern: RegExp;
  60. uvPattern: RegExp;
  61. facePattern1: RegExp;
  62. facePattern2: RegExp;
  63. facePattern3: RegExp;
  64. facePattern4: RegExp;
  65. /**
  66. * Calls synchronously the MTL file attached to this obj.
  67. * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
  68. * Without this function materials are not displayed in the first frame (but displayed after).
  69. * In consequence it is impossible to get material information in your HTML file
  70. *
  71. * @param url The URL of the MTL file
  72. * @param rootUrl
  73. * @param onSuccess Callback function to be called when the MTL file is loaded
  74. * @private
  75. */
  76. private _loadMTL(url, rootUrl, onSuccess);
  77. importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: Nullable<AbstractMesh[]>, particleSystems: Nullable<ParticleSystem[]>, skeletons: Nullable<Skeleton[]>): boolean;
  78. load(scene: Scene, data: string, rootUrl: string): boolean;
  79. /**
  80. * Read the OBJ file and create an Array of meshes.
  81. * Each mesh contains all information given by the OBJ and the MTL file.
  82. * i.e. vertices positions and indices, optional normals values, optional UV values, optional material
  83. *
  84. * @param meshesNames
  85. * @param scene BABYLON.Scene The scene where are displayed the data
  86. * @param data String The content of the obj file
  87. * @param rootUrl String The path to the folder
  88. * @returns Array<AbstractMesh>
  89. * @private
  90. */
  91. private _parseSolid(meshesNames, scene, data, rootUrl);
  92. }
  93. }
  94. declare module BABYLON {
  95. enum GLTFLoaderCoordinateSystemMode {
  96. AUTO = 0,
  97. PASS_THROUGH = 1,
  98. FORCE_RIGHT_HANDED = 2,
  99. }
  100. interface IGLTFLoaderData {
  101. json: Object;
  102. bin: Nullable<ArrayBufferView>;
  103. }
  104. interface IGLTFLoader extends IDisposable {
  105. importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
  106. loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
  107. }
  108. class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
  109. static CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
  110. static CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
  111. onParsed: (data: IGLTFLoaderData) => void;
  112. static HomogeneousCoordinates: boolean;
  113. static IncrementalLoading: boolean;
  114. coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
  115. compileMaterials: boolean;
  116. compileShadowGenerators: boolean;
  117. useClipPlane: boolean;
  118. onMeshLoaded: (mesh: AbstractMesh) => void;
  119. onTextureLoaded: (texture: BaseTexture) => void;
  120. onMaterialLoaded: (material: Material) => void;
  121. /**
  122. * Raised when the asset is completely loaded, just before the loader is disposed.
  123. * For assets with LODs, raised when all of the LODs are complete.
  124. * For assets without LODs, raised when the model is complete just after onSuccess.
  125. */
  126. onComplete: () => void;
  127. private _loader;
  128. name: string;
  129. extensions: ISceneLoaderPluginExtensions;
  130. dispose(): void;
  131. importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
  132. loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
  133. canDirectLoad(data: string): boolean;
  134. rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
  135. createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
  136. private static _parse(data);
  137. private _getLoader(loaderData);
  138. private static _parseBinary(data);
  139. private static _parseV1(binaryReader);
  140. private static _parseV2(binaryReader);
  141. private static _parseVersion(version);
  142. private static _compareVersion(a, b);
  143. private static _decodeBufferToText(buffer);
  144. }
  145. }
  146. declare module BABYLON.GLTF1 {
  147. /**
  148. * Enums
  149. */
  150. enum EComponentType {
  151. BYTE = 5120,
  152. UNSIGNED_BYTE = 5121,
  153. SHORT = 5122,
  154. UNSIGNED_SHORT = 5123,
  155. FLOAT = 5126,
  156. }
  157. enum EShaderType {
  158. FRAGMENT = 35632,
  159. VERTEX = 35633,
  160. }
  161. enum EParameterType {
  162. BYTE = 5120,
  163. UNSIGNED_BYTE = 5121,
  164. SHORT = 5122,
  165. UNSIGNED_SHORT = 5123,
  166. INT = 5124,
  167. UNSIGNED_INT = 5125,
  168. FLOAT = 5126,
  169. FLOAT_VEC2 = 35664,
  170. FLOAT_VEC3 = 35665,
  171. FLOAT_VEC4 = 35666,
  172. INT_VEC2 = 35667,
  173. INT_VEC3 = 35668,
  174. INT_VEC4 = 35669,
  175. BOOL = 35670,
  176. BOOL_VEC2 = 35671,
  177. BOOL_VEC3 = 35672,
  178. BOOL_VEC4 = 35673,
  179. FLOAT_MAT2 = 35674,
  180. FLOAT_MAT3 = 35675,
  181. FLOAT_MAT4 = 35676,
  182. SAMPLER_2D = 35678,
  183. }
  184. enum ETextureWrapMode {
  185. CLAMP_TO_EDGE = 33071,
  186. MIRRORED_REPEAT = 33648,
  187. REPEAT = 10497,
  188. }
  189. enum ETextureFilterType {
  190. NEAREST = 9728,
  191. LINEAR = 9728,
  192. NEAREST_MIPMAP_NEAREST = 9984,
  193. LINEAR_MIPMAP_NEAREST = 9985,
  194. NEAREST_MIPMAP_LINEAR = 9986,
  195. LINEAR_MIPMAP_LINEAR = 9987,
  196. }
  197. enum ETextureFormat {
  198. ALPHA = 6406,
  199. RGB = 6407,
  200. RGBA = 6408,
  201. LUMINANCE = 6409,
  202. LUMINANCE_ALPHA = 6410,
  203. }
  204. enum ECullingType {
  205. FRONT = 1028,
  206. BACK = 1029,
  207. FRONT_AND_BACK = 1032,
  208. }
  209. enum EBlendingFunction {
  210. ZERO = 0,
  211. ONE = 1,
  212. SRC_COLOR = 768,
  213. ONE_MINUS_SRC_COLOR = 769,
  214. DST_COLOR = 774,
  215. ONE_MINUS_DST_COLOR = 775,
  216. SRC_ALPHA = 770,
  217. ONE_MINUS_SRC_ALPHA = 771,
  218. DST_ALPHA = 772,
  219. ONE_MINUS_DST_ALPHA = 773,
  220. CONSTANT_COLOR = 32769,
  221. ONE_MINUS_CONSTANT_COLOR = 32770,
  222. CONSTANT_ALPHA = 32771,
  223. ONE_MINUS_CONSTANT_ALPHA = 32772,
  224. SRC_ALPHA_SATURATE = 776,
  225. }
  226. /**
  227. * Interfaces
  228. */
  229. interface IGLTFProperty {
  230. extensions?: {
  231. [key: string]: any;
  232. };
  233. extras?: Object;
  234. }
  235. interface IGLTFChildRootProperty extends IGLTFProperty {
  236. name?: string;
  237. }
  238. interface IGLTFAccessor extends IGLTFChildRootProperty {
  239. bufferView: string;
  240. byteOffset: number;
  241. byteStride: number;
  242. count: number;
  243. type: string;
  244. componentType: EComponentType;
  245. max?: number[];
  246. min?: number[];
  247. name?: string;
  248. }
  249. interface IGLTFBufferView extends IGLTFChildRootProperty {
  250. buffer: string;
  251. byteOffset: number;
  252. byteLength: number;
  253. byteStride: number;
  254. target?: number;
  255. }
  256. interface IGLTFBuffer extends IGLTFChildRootProperty {
  257. uri: string;
  258. byteLength?: number;
  259. type?: string;
  260. }
  261. interface IGLTFShader extends IGLTFChildRootProperty {
  262. uri: string;
  263. type: EShaderType;
  264. }
  265. interface IGLTFProgram extends IGLTFChildRootProperty {
  266. attributes: string[];
  267. fragmentShader: string;
  268. vertexShader: string;
  269. }
  270. interface IGLTFTechniqueParameter {
  271. type: number;
  272. count?: number;
  273. semantic?: string;
  274. node?: string;
  275. value?: number | boolean | string | Array<any>;
  276. source?: string;
  277. babylonValue?: any;
  278. }
  279. interface IGLTFTechniqueCommonProfile {
  280. lightingModel: string;
  281. texcoordBindings: Object;
  282. parameters?: Array<any>;
  283. }
  284. interface IGLTFTechniqueStatesFunctions {
  285. blendColor?: number[];
  286. blendEquationSeparate?: number[];
  287. blendFuncSeparate?: number[];
  288. colorMask: boolean[];
  289. cullFace: number[];
  290. }
  291. interface IGLTFTechniqueStates {
  292. enable: number[];
  293. functions: IGLTFTechniqueStatesFunctions;
  294. }
  295. interface IGLTFTechnique extends IGLTFChildRootProperty {
  296. parameters: {
  297. [key: string]: IGLTFTechniqueParameter;
  298. };
  299. program: string;
  300. attributes: {
  301. [key: string]: string;
  302. };
  303. uniforms: {
  304. [key: string]: string;
  305. };
  306. states: IGLTFTechniqueStates;
  307. }
  308. interface IGLTFMaterial extends IGLTFChildRootProperty {
  309. technique?: string;
  310. values: string[];
  311. }
  312. interface IGLTFMeshPrimitive extends IGLTFProperty {
  313. attributes: {
  314. [key: string]: string;
  315. };
  316. indices: string;
  317. material: string;
  318. mode?: number;
  319. }
  320. interface IGLTFMesh extends IGLTFChildRootProperty {
  321. primitives: IGLTFMeshPrimitive[];
  322. }
  323. interface IGLTFImage extends IGLTFChildRootProperty {
  324. uri: string;
  325. }
  326. interface IGLTFSampler extends IGLTFChildRootProperty {
  327. magFilter?: number;
  328. minFilter?: number;
  329. wrapS?: number;
  330. wrapT?: number;
  331. }
  332. interface IGLTFTexture extends IGLTFChildRootProperty {
  333. sampler: string;
  334. source: string;
  335. format?: ETextureFormat;
  336. internalFormat?: ETextureFormat;
  337. target?: number;
  338. type?: number;
  339. babylonTexture?: Texture;
  340. }
  341. interface IGLTFAmbienLight {
  342. color?: number[];
  343. }
  344. interface IGLTFDirectionalLight {
  345. color?: number[];
  346. }
  347. interface IGLTFPointLight {
  348. color?: number[];
  349. constantAttenuation?: number;
  350. linearAttenuation?: number;
  351. quadraticAttenuation?: number;
  352. }
  353. interface IGLTFSpotLight {
  354. color?: number[];
  355. constantAttenuation?: number;
  356. fallOfAngle?: number;
  357. fallOffExponent?: number;
  358. linearAttenuation?: number;
  359. quadraticAttenuation?: number;
  360. }
  361. interface IGLTFLight extends IGLTFChildRootProperty {
  362. type: string;
  363. }
  364. interface IGLTFCameraOrthographic {
  365. xmag: number;
  366. ymag: number;
  367. zfar: number;
  368. znear: number;
  369. }
  370. interface IGLTFCameraPerspective {
  371. aspectRatio: number;
  372. yfov: number;
  373. zfar: number;
  374. znear: number;
  375. }
  376. interface IGLTFCamera extends IGLTFChildRootProperty {
  377. type: string;
  378. }
  379. interface IGLTFAnimationChannelTarget {
  380. id: string;
  381. path: string;
  382. }
  383. interface IGLTFAnimationChannel {
  384. sampler: string;
  385. target: IGLTFAnimationChannelTarget;
  386. }
  387. interface IGLTFAnimationSampler {
  388. input: string;
  389. output: string;
  390. interpolation?: string;
  391. }
  392. interface IGLTFAnimation extends IGLTFChildRootProperty {
  393. channels?: IGLTFAnimationChannel[];
  394. parameters?: {
  395. [key: string]: string;
  396. };
  397. samplers?: {
  398. [key: string]: IGLTFAnimationSampler;
  399. };
  400. }
  401. interface IGLTFNodeInstanceSkin {
  402. skeletons: string[];
  403. skin: string;
  404. meshes: string[];
  405. }
  406. interface IGLTFSkins extends IGLTFChildRootProperty {
  407. bindShapeMatrix: number[];
  408. inverseBindMatrices: string;
  409. jointNames: string[];
  410. babylonSkeleton?: Skeleton;
  411. }
  412. interface IGLTFNode extends IGLTFChildRootProperty {
  413. camera?: string;
  414. children: string[];
  415. skin?: string;
  416. jointName?: string;
  417. light?: string;
  418. matrix: number[];
  419. mesh?: string;
  420. meshes?: string[];
  421. rotation?: number[];
  422. scale?: number[];
  423. translation?: number[];
  424. babylonNode?: Node;
  425. }
  426. interface IGLTFScene extends IGLTFChildRootProperty {
  427. nodes: string[];
  428. }
  429. /**
  430. * Runtime
  431. */
  432. interface IGLTFRuntime {
  433. extensions: {
  434. [key: string]: any;
  435. };
  436. accessors: {
  437. [key: string]: IGLTFAccessor;
  438. };
  439. buffers: {
  440. [key: string]: IGLTFBuffer;
  441. };
  442. bufferViews: {
  443. [key: string]: IGLTFBufferView;
  444. };
  445. meshes: {
  446. [key: string]: IGLTFMesh;
  447. };
  448. lights: {
  449. [key: string]: IGLTFLight;
  450. };
  451. cameras: {
  452. [key: string]: IGLTFCamera;
  453. };
  454. nodes: {
  455. [key: string]: IGLTFNode;
  456. };
  457. images: {
  458. [key: string]: IGLTFImage;
  459. };
  460. textures: {
  461. [key: string]: IGLTFTexture;
  462. };
  463. shaders: {
  464. [key: string]: IGLTFShader;
  465. };
  466. programs: {
  467. [key: string]: IGLTFProgram;
  468. };
  469. samplers: {
  470. [key: string]: IGLTFSampler;
  471. };
  472. techniques: {
  473. [key: string]: IGLTFTechnique;
  474. };
  475. materials: {
  476. [key: string]: IGLTFMaterial;
  477. };
  478. animations: {
  479. [key: string]: IGLTFAnimation;
  480. };
  481. skins: {
  482. [key: string]: IGLTFSkins;
  483. };
  484. currentScene?: Object;
  485. scenes: {
  486. [key: string]: IGLTFScene;
  487. };
  488. extensionsUsed: string[];
  489. extensionsRequired?: string[];
  490. buffersCount: number;
  491. shaderscount: number;
  492. scene: Scene;
  493. rootUrl: string;
  494. loadedBufferCount: number;
  495. loadedBufferViews: {
  496. [name: string]: ArrayBufferView;
  497. };
  498. loadedShaderCount: number;
  499. importOnlyMeshes: boolean;
  500. importMeshesNames?: string[];
  501. dummyNodes: Node[];
  502. }
  503. /**
  504. * Bones
  505. */
  506. interface INodeToRoot {
  507. bone: Bone;
  508. node: IGLTFNode;
  509. id: string;
  510. }
  511. interface IJointNode {
  512. node: IGLTFNode;
  513. id: string;
  514. }
  515. }
  516. declare module BABYLON.GLTF1 {
  517. /**
  518. * Implementation of the base glTF spec
  519. */
  520. class GLTFLoaderBase {
  521. static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
  522. static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
  523. static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: Nullable<ArrayBufferView>) => void, onError: (message: string) => void): void;
  524. static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: Nullable<ArrayBufferView>, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
  525. static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): void;
  526. static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
  527. }
  528. /**
  529. * glTF V1 Loader
  530. */
  531. class GLTFLoader implements IGLTFLoader {
  532. static Extensions: {
  533. [name: string]: GLTFLoaderExtension;
  534. };
  535. static RegisterExtension(extension: GLTFLoaderExtension): void;
  536. dispose(): void;
  537. importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): boolean;
  538. loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
  539. private _loadShadersAsync(gltfRuntime, onload);
  540. private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);
  541. private _createNodes(gltfRuntime);
  542. }
  543. }
  544. declare module BABYLON.GLTF1 {
  545. /**
  546. * Utils functions for GLTF
  547. */
  548. class GLTFUtils {
  549. /**
  550. * Sets the given "parameter" matrix
  551. * @param scene: the {BABYLON.Scene} object
  552. * @param source: the source node where to pick the matrix
  553. * @param parameter: the GLTF technique parameter
  554. * @param uniformName: the name of the shader's uniform
  555. * @param shaderMaterial: the shader material
  556. */
  557. static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void;
  558. /**
  559. * Sets the given "parameter" matrix
  560. * @param shaderMaterial: the shader material
  561. * @param uniform: the name of the shader's uniform
  562. * @param value: the value of the uniform
  563. * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
  564. */
  565. static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean;
  566. /**
  567. * If the uri is a base64 string
  568. * @param uri: the uri to test
  569. */
  570. static IsBase64(uri: string): boolean;
  571. /**
  572. * Decode the base64 uri
  573. * @param uri: the uri to decode
  574. */
  575. static DecodeBase64(uri: string): ArrayBuffer;
  576. /**
  577. * Returns the wrap mode of the texture
  578. * @param mode: the mode value
  579. */
  580. static GetWrapMode(mode: number): number;
  581. /**
  582. * Returns the byte stride giving an accessor
  583. * @param accessor: the GLTF accessor objet
  584. */
  585. static GetByteStrideFromType(accessor: IGLTFAccessor): number;
  586. /**
  587. * Returns the texture filter mode giving a mode value
  588. * @param mode: the filter mode value
  589. */
  590. static GetTextureFilterMode(mode: number): ETextureFilterType;
  591. static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView;
  592. /**
  593. * Returns a buffer from its accessor
  594. * @param gltfRuntime: the GLTF runtime
  595. * @param accessor: the GLTF accessor
  596. */
  597. static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any;
  598. /**
  599. * Decodes a buffer view into a string
  600. * @param view: the buffer view
  601. */
  602. static DecodeBufferToText(view: ArrayBufferView): string;
  603. /**
  604. * Returns the default material of gltf. Related to
  605. * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material
  606. * @param scene: the Babylon.js scene
  607. */
  608. static GetDefaultMaterial(scene: Scene): ShaderMaterial;
  609. private static _DefaultMaterial;
  610. }
  611. }
  612. declare module BABYLON.GLTF1 {
  613. abstract class GLTFLoaderExtension {
  614. private _name;
  615. constructor(name: string);
  616. readonly name: string;
  617. /**
  618. * Defines an override for loading the runtime
  619. * Return true to stop further extensions from loading the runtime
  620. */
  621. loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): boolean;
  622. /**
  623. * Defines an onverride for creating gltf runtime
  624. * Return true to stop further extensions from creating the runtime
  625. */
  626. loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
  627. /**
  628. * Defines an override for loading buffers
  629. * Return true to stop further extensions from loading this buffer
  630. */
  631. loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): boolean;
  632. /**
  633. * Defines an override for loading texture buffers
  634. * Return true to stop further extensions from loading this texture data
  635. */
  636. loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
  637. /**
  638. * Defines an override for creating textures
  639. * Return true to stop further extensions from loading this texture
  640. */
  641. createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: (message: string) => void): boolean;
  642. /**
  643. * Defines an override for loading shader strings
  644. * Return true to stop further extensions from loading this shader data
  645. */
  646. loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
  647. /**
  648. * Defines an override for loading materials
  649. * Return true to stop further extensions from loading this material
  650. */
  651. loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
  652. static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): void;
  653. static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): void;
  654. static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
  655. static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
  656. static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: (message: string) => void): void;
  657. static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
  658. private static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
  659. private static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
  660. private static ApplyExtensions(func, defaultFunc);
  661. }
  662. }
  663. declare module BABYLON.GLTF1 {
  664. class GLTFBinaryExtension extends GLTFLoaderExtension {
  665. private _bin;
  666. constructor();
  667. loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): boolean;
  668. loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
  669. loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
  670. loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
  671. }
  672. }
  673. declare module BABYLON.GLTF1 {
  674. class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
  675. constructor();
  676. loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
  677. loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
  678. private _loadTexture(gltfRuntime, id, material, propertyPath, onError);
  679. }
  680. }
  681. declare module BABYLON.GLTF2 {
  682. /**
  683. * Enums
  684. */
  685. enum EComponentType {
  686. BYTE = 5120,
  687. UNSIGNED_BYTE = 5121,
  688. SHORT = 5122,
  689. UNSIGNED_SHORT = 5123,
  690. UNSIGNED_INT = 5125,
  691. FLOAT = 5126,
  692. }
  693. enum EMeshPrimitiveMode {
  694. POINTS = 0,
  695. LINES = 1,
  696. LINE_LOOP = 2,
  697. LINE_STRIP = 3,
  698. TRIANGLES = 4,
  699. TRIANGLE_STRIP = 5,
  700. TRIANGLE_FAN = 6,
  701. }
  702. enum ETextureMagFilter {
  703. NEAREST = 9728,
  704. LINEAR = 9729,
  705. }
  706. enum ETextureMinFilter {
  707. NEAREST = 9728,
  708. LINEAR = 9729,
  709. NEAREST_MIPMAP_NEAREST = 9984,
  710. LINEAR_MIPMAP_NEAREST = 9985,
  711. NEAREST_MIPMAP_LINEAR = 9986,
  712. LINEAR_MIPMAP_LINEAR = 9987,
  713. }
  714. enum ETextureWrapMode {
  715. CLAMP_TO_EDGE = 33071,
  716. MIRRORED_REPEAT = 33648,
  717. REPEAT = 10497,
  718. }
  719. /**
  720. * Interfaces
  721. */
  722. interface IGLTFProperty {
  723. extensions?: {
  724. [key: string]: any;
  725. };
  726. extras?: any;
  727. }
  728. interface IGLTFChildRootProperty extends IGLTFProperty {
  729. name?: string;
  730. }
  731. interface IGLTFAccessorSparseIndices extends IGLTFProperty {
  732. bufferView: number;
  733. byteOffset?: number;
  734. componentType: EComponentType;
  735. }
  736. interface IGLTFAccessorSparseValues extends IGLTFProperty {
  737. bufferView: number;
  738. byteOffset?: number;
  739. }
  740. interface IGLTFAccessorSparse extends IGLTFProperty {
  741. count: number;
  742. indices: IGLTFAccessorSparseIndices;
  743. values: IGLTFAccessorSparseValues;
  744. }
  745. interface IGLTFAccessor extends IGLTFChildRootProperty {
  746. bufferView?: number;
  747. byteOffset?: number;
  748. componentType: EComponentType;
  749. normalized?: boolean;
  750. count: number;
  751. type: string;
  752. max: number[];
  753. min: number[];
  754. sparse?: IGLTFAccessorSparse;
  755. index: number;
  756. }
  757. interface IGLTFAnimationChannel extends IGLTFProperty {
  758. sampler: number;
  759. target: IGLTFAnimationChannelTarget;
  760. }
  761. interface IGLTFAnimationChannelTarget extends IGLTFProperty {
  762. node: number;
  763. path: string;
  764. }
  765. interface IGLTFAnimationSampler extends IGLTFProperty {
  766. input: number;
  767. interpolation?: string;
  768. output: number;
  769. }
  770. interface IGLTFAnimation extends IGLTFChildRootProperty {
  771. channels: IGLTFAnimationChannel[];
  772. samplers: IGLTFAnimationSampler[];
  773. index: number;
  774. targets: any[];
  775. }
  776. interface IGLTFAsset extends IGLTFChildRootProperty {
  777. copyright?: string;
  778. generator?: string;
  779. version: string;
  780. minVersion?: string;
  781. }
  782. interface IGLTFBuffer extends IGLTFChildRootProperty {
  783. uri?: string;
  784. byteLength: number;
  785. index: number;
  786. loadedData?: ArrayBufferView;
  787. loadedObservable?: Observable<IGLTFBuffer>;
  788. }
  789. interface IGLTFBufferView extends IGLTFChildRootProperty {
  790. buffer: number;
  791. byteOffset?: number;
  792. byteLength: number;
  793. byteStride?: number;
  794. index: number;
  795. }
  796. interface IGLTFCameraOrthographic extends IGLTFProperty {
  797. xmag: number;
  798. ymag: number;
  799. zfar: number;
  800. znear: number;
  801. }
  802. interface IGLTFCameraPerspective extends IGLTFProperty {
  803. aspectRatio: number;
  804. yfov: number;
  805. zfar: number;
  806. znear: number;
  807. }
  808. interface IGLTFCamera extends IGLTFChildRootProperty {
  809. orthographic?: IGLTFCameraOrthographic;
  810. perspective?: IGLTFCameraPerspective;
  811. type: string;
  812. }
  813. interface IGLTFImage extends IGLTFChildRootProperty {
  814. uri?: string;
  815. mimeType?: string;
  816. bufferView?: number;
  817. index: number;
  818. }
  819. interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo {
  820. scale: number;
  821. }
  822. interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo {
  823. strength: number;
  824. }
  825. interface IGLTFMaterialPbrMetallicRoughness {
  826. baseColorFactor: number[];
  827. baseColorTexture: IGLTFTextureInfo;
  828. metallicFactor: number;
  829. roughnessFactor: number;
  830. metallicRoughnessTexture: IGLTFTextureInfo;
  831. }
  832. interface IGLTFMaterial extends IGLTFChildRootProperty {
  833. pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness;
  834. normalTexture?: IGLTFMaterialNormalTextureInfo;
  835. occlusionTexture?: IGLTFMaterialOcclusionTextureInfo;
  836. emissiveTexture?: IGLTFTextureInfo;
  837. emissiveFactor?: number[];
  838. alphaMode?: string;
  839. alphaCutoff: number;
  840. doubleSided?: boolean;
  841. index: number;
  842. babylonMaterial: Material;
  843. }
  844. interface IGLTFMeshPrimitive extends IGLTFProperty {
  845. attributes: {
  846. [name: string]: number;
  847. };
  848. indices?: number;
  849. material?: number;
  850. mode?: EMeshPrimitiveMode;
  851. targets?: {
  852. [name: string]: number;
  853. }[];
  854. vertexData: VertexData;
  855. targetsVertexData: VertexData[];
  856. }
  857. interface IGLTFMesh extends IGLTFChildRootProperty {
  858. primitives: IGLTFMeshPrimitive[];
  859. weights?: number[];
  860. index: number;
  861. }
  862. interface IGLTFNode extends IGLTFChildRootProperty {
  863. camera?: number;
  864. children?: number[];
  865. skin?: number;
  866. matrix?: number[];
  867. mesh?: number;
  868. rotation?: number[];
  869. scale?: number[];
  870. translation?: number[];
  871. weights?: number[];
  872. index: number;
  873. parent?: IGLTFNode;
  874. babylonMesh: Mesh;
  875. babylonBones?: {
  876. [skin: number]: Bone;
  877. };
  878. babylonAnimationTargets?: Node[];
  879. }
  880. interface IGLTFSampler extends IGLTFChildRootProperty {
  881. magFilter?: ETextureMagFilter;
  882. minFilter?: ETextureMinFilter;
  883. wrapS?: ETextureWrapMode;
  884. wrapT?: ETextureWrapMode;
  885. }
  886. interface IGLTFScene extends IGLTFChildRootProperty {
  887. nodes: number[];
  888. index: number;
  889. }
  890. interface IGLTFSkin extends IGLTFChildRootProperty {
  891. inverseBindMatrices?: number;
  892. skeleton?: number;
  893. joints: number[];
  894. index: number;
  895. babylonSkeleton: Skeleton;
  896. }
  897. interface IGLTFTexture extends IGLTFChildRootProperty {
  898. sampler?: number;
  899. source: number;
  900. index: number;
  901. url?: string;
  902. dataReadyObservable?: Observable<IGLTFTexture>;
  903. }
  904. interface IGLTFTextureInfo {
  905. index: number;
  906. texCoord?: number;
  907. }
  908. interface IGLTF extends IGLTFProperty {
  909. accessors?: IGLTFAccessor[];
  910. animations?: IGLTFAnimation[];
  911. asset: IGLTFAsset;
  912. buffers?: IGLTFBuffer[];
  913. bufferViews?: IGLTFBufferView[];
  914. cameras?: IGLTFCamera[];
  915. extensionsUsed?: string[];
  916. extensionsRequired?: string[];
  917. images?: IGLTFImage[];
  918. materials?: IGLTFMaterial[];
  919. meshes?: IGLTFMesh[];
  920. nodes?: IGLTFNode[];
  921. samplers?: IGLTFSampler[];
  922. scene?: number;
  923. scenes?: IGLTFScene[];
  924. skins?: IGLTFSkin[];
  925. textures?: IGLTFTexture[];
  926. }
  927. }
  928. declare module BABYLON.GLTF2 {
  929. class GLTFLoader implements IGLTFLoader {
  930. _gltf: IGLTF;
  931. _babylonScene: Scene;
  932. private _disposed;
  933. private _parent;
  934. private _rootUrl;
  935. private _defaultMaterial;
  936. private _rootNode;
  937. private _successCallback;
  938. private _progressCallback;
  939. private _errorCallback;
  940. private _renderReady;
  941. private _requests;
  942. private _renderReadyObservable;
  943. private _renderPendingCount;
  944. private _loaderPendingCount;
  945. private _loaderTrackers;
  946. static Extensions: {
  947. [name: string]: GLTFLoaderExtension;
  948. };
  949. static RegisterExtension(extension: GLTFLoaderExtension): void;
  950. private static _progressEventFactory;
  951. private static _createProgressEventByConstructor(name, data);
  952. private static _createProgressEventByDocument(name, data);
  953. constructor(parent: GLTFFileLoader);
  954. dispose(): void;
  955. importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
  956. loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
  957. private _loadAsync(nodeNames, scene, data, rootUrl, onSuccess, onProgress, onError);
  958. private _onProgress();
  959. _executeWhenRenderReady(func: () => void): void;
  960. private _onRenderReady();
  961. private _onComplete();
  962. private _loadData(data);
  963. private _getMeshes();
  964. private _getSkeletons();
  965. private _getAnimationTargets();
  966. private _startAnimations();
  967. private _loadDefaultScene(nodeNames);
  968. private _loadScene(context, scene, nodeNames);
  969. _loadNode(context: string, node: IGLTFNode): void;
  970. private _loadMesh(context, node, mesh);
  971. private _loadAllVertexDataAsync(context, mesh, onSuccess);
  972. /**
  973. * Converts a data bufferview into a Float4 Texture Coordinate Array, based on the accessor component type
  974. * @param {ArrayBufferView} data
  975. * @param {IGLTFAccessor} accessor
  976. */
  977. private _convertToFloat4TextureCoordArray(context, data, accessor);
  978. /**
  979. * Converts a data bufferview into a Float4 Color Array, based on the accessor component type
  980. * @param {ArrayBufferView} data
  981. * @param {IGLTFAccessor} accessor
  982. */
  983. private _convertToFloat4ColorArray(context, data, accessor);
  984. private _loadVertexDataAsync(context, mesh, primitive, onSuccess);
  985. private _createMorphTargets(context, node, mesh);
  986. private _loadMorphTargets(context, node, mesh);
  987. private _loadAllMorphTargetVertexDataAsync(context, node, mesh, onSuccess);
  988. private _loadMorphTargetVertexDataAsync(context, vertexData, attributes, onSuccess);
  989. private _loadTransform(node);
  990. private _loadSkin(context, skin);
  991. private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
  992. private _loadBones(context, skin, inverseBindMatrixData);
  993. private _loadBone(node, skin, inverseBindMatrixData, babylonBones);
  994. private _getNodeMatrix(node);
  995. private _traverseNodes(context, indices, action, parentNode?);
  996. _traverseNode(context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: Nullable<IGLTFNode>) => boolean, parentNode?: Nullable<IGLTFNode>): void;
  997. private _loadAnimations();
  998. private _loadAnimation(context, animation);
  999. private _loadAnimationChannel(animation, channelContext, channel, samplerContext, sampler);
  1000. private _loadBufferAsync(context, buffer, onSuccess);
  1001. private _loadBufferViewAsync(context, bufferView, onSuccess);
  1002. private _loadAccessorAsync(context, accessor, onSuccess);
  1003. private _buildArrayBuffer<T>(typedArray, data, byteOffset, count, numComponents, byteStride?);
  1004. _addPendingData(data: any): void;
  1005. _removePendingData(data: any): void;
  1006. _addLoaderPendingData(data: any): void;
  1007. _removeLoaderPendingData(data: any): void;
  1008. _whenAction(action: () => void, onComplete: () => void): void;
  1009. private _getDefaultMaterial();
  1010. private _loadMaterialMetallicRoughnessProperties(context, material);
  1011. _loadMaterial(context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): void;
  1012. _createPbrMaterial(material: IGLTFMaterial): void;
  1013. _loadMaterialBaseProperties(context: string, material: IGLTFMaterial): void;
  1014. _loadMaterialAlphaProperties(context: string, material: IGLTFMaterial, colorFactor: number[]): void;
  1015. _loadTexture(context: string, texture: IGLTFTexture, coordinatesIndex?: number): Texture;
  1016. private _loadImageAsync(context, image, onSuccess);
  1017. _loadUriAsync(context: string, uri: string, onSuccess: (data: ArrayBufferView) => void): void;
  1018. _tryCatchOnError(handler: () => void): void;
  1019. private static _AssignIndices(array?);
  1020. static _GetProperty<T extends IGLTFProperty>(array?: ArrayLike<T>, index?: number): Nullable<T>;
  1021. private static _GetTextureWrapMode(mode?);
  1022. private static _GetTextureSamplingMode(magFilter?, minFilter?);
  1023. private static _GetNumComponents(type);
  1024. private _compileMaterialAsync(babylonMaterial, babylonMesh, onSuccess);
  1025. private _compileMaterialsAsync(onSuccess);
  1026. private _compileShadowGeneratorsAsync(onSuccess);
  1027. }
  1028. }
  1029. declare module BABYLON.GLTF2 {
  1030. /**
  1031. * Utils functions for GLTF
  1032. */
  1033. class GLTFUtils {
  1034. /**
  1035. * If the uri is a base64 string
  1036. * @param uri: the uri to test
  1037. */
  1038. static IsBase64(uri: string): boolean;
  1039. /**
  1040. * Decode the base64 uri
  1041. * @param uri: the uri to decode
  1042. */
  1043. static DecodeBase64(uri: string): ArrayBuffer;
  1044. static ValidateUri(uri: string): boolean;
  1045. }
  1046. }
  1047. declare module BABYLON.GLTF2 {
  1048. abstract class GLTFLoaderExtension {
  1049. enabled: boolean;
  1050. readonly abstract name: string;
  1051. protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: Nullable<IGLTFNode>): boolean;
  1052. protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
  1053. protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  1054. protected _loadExtension<T>(context: string, property: IGLTFProperty, action: (context: string, extension: T, onComplete: () => void) => void): boolean;
  1055. static _Extensions: GLTFLoaderExtension[];
  1056. static TraverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: Nullable<IGLTFNode>): boolean;
  1057. static LoadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
  1058. static LoadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  1059. private static _ApplyExtensions(action);
  1060. }
  1061. }
  1062. declare module BABYLON.GLTF2.Extensions {
  1063. class MSFTLOD extends GLTFLoaderExtension {
  1064. /**
  1065. * Specify the minimal delay between LODs in ms (default = 250)
  1066. */
  1067. Delay: number;
  1068. readonly name: string;
  1069. protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
  1070. protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
  1071. private _loadNodeLOD(loader, context, nodes, index, onComplete);
  1072. protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  1073. private _loadMaterialLOD(loader, context, materials, index, assign, onComplete);
  1074. }
  1075. }
  1076. declare module BABYLON.GLTF2.Extensions {
  1077. class KHRMaterialsPbrSpecularGlossiness extends GLTFLoaderExtension {
  1078. readonly name: string;
  1079. protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  1080. private _loadSpecularGlossinessProperties(loader, context, material, properties);
  1081. }
  1082. }