babylon.glTFFileLoader.d.ts 41 KB

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