babylonjs.materials.d.ts 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. declare module BABYLON {
  2. class ShadowOnlyMaterial extends PushMaterial {
  3. private _renderId;
  4. private _activeLight;
  5. constructor(name: string, scene: Scene);
  6. shadowColor: Color3;
  7. needAlphaBlending(): boolean;
  8. needAlphaTesting(): boolean;
  9. getAlphaTestTexture(): Nullable<BaseTexture>;
  10. activeLight: IShadowLight;
  11. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  12. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  13. clone(name: string): ShadowOnlyMaterial;
  14. serialize(): any;
  15. getClassName(): string;
  16. static Parse(source: any, scene: Scene, rootUrl: string): ShadowOnlyMaterial;
  17. }
  18. }
  19. declare module BABYLON {
  20. class GradientMaterial extends PushMaterial {
  21. private _maxSimultaneousLights;
  22. maxSimultaneousLights: number;
  23. topColor: Color3;
  24. topColorAlpha: number;
  25. bottomColor: Color3;
  26. bottomColorAlpha: number;
  27. offset: number;
  28. scale: number;
  29. smoothness: number;
  30. disableLighting: boolean;
  31. private _scaledDiffuse;
  32. private _renderId;
  33. constructor(name: string, scene: Scene);
  34. needAlphaBlending(): boolean;
  35. needAlphaTesting(): boolean;
  36. getAlphaTestTexture(): Nullable<BaseTexture>;
  37. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  38. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  39. getAnimatables(): IAnimatable[];
  40. dispose(forceDisposeEffect?: boolean): void;
  41. clone(name: string): GradientMaterial;
  42. serialize(): any;
  43. getClassName(): string;
  44. static Parse(source: any, scene: Scene, rootUrl: string): GradientMaterial;
  45. }
  46. }
  47. declare module BABYLON {
  48. class NormalMaterial extends PushMaterial {
  49. private _diffuseTexture;
  50. diffuseTexture: BaseTexture;
  51. diffuseColor: Color3;
  52. private _disableLighting;
  53. disableLighting: boolean;
  54. private _maxSimultaneousLights;
  55. maxSimultaneousLights: number;
  56. private _renderId;
  57. constructor(name: string, scene: Scene);
  58. needAlphaBlending(): boolean;
  59. needAlphaBlendingForMesh(mesh: AbstractMesh): boolean;
  60. needAlphaTesting(): boolean;
  61. getAlphaTestTexture(): Nullable<BaseTexture>;
  62. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  63. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  64. getAnimatables(): IAnimatable[];
  65. getActiveTextures(): BaseTexture[];
  66. hasTexture(texture: BaseTexture): boolean;
  67. dispose(forceDisposeEffect?: boolean): void;
  68. clone(name: string): NormalMaterial;
  69. serialize(): any;
  70. getClassName(): string;
  71. static Parse(source: any, scene: Scene, rootUrl: string): NormalMaterial;
  72. }
  73. }
  74. declare module BABYLON {
  75. class LavaMaterial extends PushMaterial {
  76. private _diffuseTexture;
  77. diffuseTexture: BaseTexture;
  78. noiseTexture: BaseTexture;
  79. fogColor: Color3;
  80. speed: number;
  81. movingSpeed: number;
  82. lowFrequencySpeed: number;
  83. fogDensity: number;
  84. private _lastTime;
  85. diffuseColor: Color3;
  86. private _disableLighting;
  87. disableLighting: boolean;
  88. private _unlit;
  89. unlit: boolean;
  90. private _maxSimultaneousLights;
  91. maxSimultaneousLights: number;
  92. private _scaledDiffuse;
  93. private _renderId;
  94. constructor(name: string, scene: Scene);
  95. needAlphaBlending(): boolean;
  96. needAlphaTesting(): boolean;
  97. getAlphaTestTexture(): Nullable<BaseTexture>;
  98. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  99. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  100. getAnimatables(): IAnimatable[];
  101. getActiveTextures(): BaseTexture[];
  102. hasTexture(texture: BaseTexture): boolean;
  103. dispose(forceDisposeEffect?: boolean): void;
  104. clone(name: string): LavaMaterial;
  105. serialize(): any;
  106. getClassName(): string;
  107. static Parse(source: any, scene: Scene, rootUrl: string): LavaMaterial;
  108. }
  109. }
  110. declare module BABYLON {
  111. class SimpleMaterial extends PushMaterial {
  112. private _diffuseTexture;
  113. diffuseTexture: BaseTexture;
  114. diffuseColor: Color3;
  115. private _disableLighting;
  116. disableLighting: boolean;
  117. private _maxSimultaneousLights;
  118. maxSimultaneousLights: number;
  119. private _renderId;
  120. constructor(name: string, scene: Scene);
  121. needAlphaBlending(): boolean;
  122. needAlphaTesting(): boolean;
  123. getAlphaTestTexture(): Nullable<BaseTexture>;
  124. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  125. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  126. getAnimatables(): IAnimatable[];
  127. getActiveTextures(): BaseTexture[];
  128. hasTexture(texture: BaseTexture): boolean;
  129. dispose(forceDisposeEffect?: boolean): void;
  130. clone(name: string): SimpleMaterial;
  131. serialize(): any;
  132. getClassName(): string;
  133. static Parse(source: any, scene: Scene, rootUrl: string): SimpleMaterial;
  134. }
  135. }
  136. declare module BABYLON {
  137. class WaterMaterial extends PushMaterial {
  138. renderTargetSize: Vector2;
  139. private _bumpTexture;
  140. bumpTexture: BaseTexture;
  141. diffuseColor: Color3;
  142. specularColor: Color3;
  143. specularPower: number;
  144. private _disableLighting;
  145. disableLighting: boolean;
  146. private _maxSimultaneousLights;
  147. maxSimultaneousLights: number;
  148. /**
  149. * @param {number}: Represents the wind force
  150. */
  151. windForce: number;
  152. /**
  153. * @param {Vector2}: The direction of the wind in the plane (X, Z)
  154. */
  155. windDirection: Vector2;
  156. /**
  157. * @param {number}: Wave height, represents the height of the waves
  158. */
  159. waveHeight: number;
  160. /**
  161. * @param {number}: Bump height, represents the bump height related to the bump map
  162. */
  163. bumpHeight: number;
  164. /**
  165. * @param {boolean}: Add a smaller moving bump to less steady waves.
  166. */
  167. private _bumpSuperimpose;
  168. bumpSuperimpose: boolean;
  169. /**
  170. * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
  171. */
  172. private _fresnelSeparate;
  173. fresnelSeparate: boolean;
  174. /**
  175. * @param {boolean}: bump Waves modify the reflection.
  176. */
  177. private _bumpAffectsReflection;
  178. bumpAffectsReflection: boolean;
  179. /**
  180. * @param {number}: The water color blended with the refraction (near)
  181. */
  182. waterColor: Color3;
  183. /**
  184. * @param {number}: The blend factor related to the water color
  185. */
  186. colorBlendFactor: number;
  187. /**
  188. * @param {number}: The water color blended with the reflection (far)
  189. */
  190. waterColor2: Color3;
  191. /**
  192. * @param {number}: The blend factor related to the water color (reflection, far)
  193. */
  194. colorBlendFactor2: number;
  195. /**
  196. * @param {number}: Represents the maximum length of a wave
  197. */
  198. waveLength: number;
  199. /**
  200. * @param {number}: Defines the waves speed
  201. */
  202. waveSpeed: number;
  203. protected _renderTargets: SmartArray<RenderTargetTexture>;
  204. private _mesh;
  205. private _refractionRTT;
  206. private _reflectionRTT;
  207. private _reflectionTransform;
  208. private _lastTime;
  209. private _lastDeltaTime;
  210. private _renderId;
  211. private _useLogarithmicDepth;
  212. private _waitingRenderList;
  213. /**
  214. * Gets a boolean indicating that current material needs to register RTT
  215. */
  216. readonly hasRenderTargetTextures: boolean;
  217. /**
  218. * Constructor
  219. */
  220. constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
  221. useLogarithmicDepth: boolean;
  222. readonly refractionTexture: Nullable<RenderTargetTexture>;
  223. readonly reflectionTexture: Nullable<RenderTargetTexture>;
  224. addToRenderList(node: any): void;
  225. enableRenderTargets(enable: boolean): void;
  226. getRenderList(): Nullable<AbstractMesh[]>;
  227. readonly renderTargetsEnabled: boolean;
  228. needAlphaBlending(): boolean;
  229. needAlphaTesting(): boolean;
  230. getAlphaTestTexture(): Nullable<BaseTexture>;
  231. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  232. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  233. private _createRenderTargets;
  234. getAnimatables(): IAnimatable[];
  235. getActiveTextures(): BaseTexture[];
  236. hasTexture(texture: BaseTexture): boolean;
  237. dispose(forceDisposeEffect?: boolean): void;
  238. clone(name: string): WaterMaterial;
  239. serialize(): any;
  240. getClassName(): string;
  241. static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
  242. static CreateDefaultMesh(name: string, scene: Scene): Mesh;
  243. }
  244. }
  245. declare module BABYLON {
  246. class FireMaterial extends PushMaterial {
  247. private _diffuseTexture;
  248. diffuseTexture: Nullable<BaseTexture>;
  249. private _distortionTexture;
  250. distortionTexture: Nullable<BaseTexture>;
  251. private _opacityTexture;
  252. opacityTexture: Nullable<BaseTexture>;
  253. diffuseColor: Color3;
  254. speed: number;
  255. private _scaledDiffuse;
  256. private _renderId;
  257. private _lastTime;
  258. constructor(name: string, scene: Scene);
  259. needAlphaBlending(): boolean;
  260. needAlphaTesting(): boolean;
  261. getAlphaTestTexture(): Nullable<BaseTexture>;
  262. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  263. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  264. getAnimatables(): IAnimatable[];
  265. getActiveTextures(): BaseTexture[];
  266. hasTexture(texture: BaseTexture): boolean;
  267. getClassName(): string;
  268. dispose(forceDisposeEffect?: boolean): void;
  269. clone(name: string): FireMaterial;
  270. serialize(): any;
  271. static Parse(source: any, scene: Scene, rootUrl: string): FireMaterial;
  272. }
  273. }
  274. declare module BABYLON {
  275. class FurMaterial extends PushMaterial {
  276. private _diffuseTexture;
  277. diffuseTexture: BaseTexture;
  278. private _heightTexture;
  279. heightTexture: BaseTexture;
  280. diffuseColor: Color3;
  281. furLength: number;
  282. furAngle: number;
  283. furColor: Color3;
  284. furOffset: number;
  285. furSpacing: number;
  286. furGravity: Vector3;
  287. furSpeed: number;
  288. furDensity: number;
  289. furOcclusion: number;
  290. furTexture: DynamicTexture;
  291. private _disableLighting;
  292. disableLighting: boolean;
  293. private _maxSimultaneousLights;
  294. maxSimultaneousLights: number;
  295. highLevelFur: boolean;
  296. _meshes: AbstractMesh[];
  297. private _renderId;
  298. private _furTime;
  299. constructor(name: string, scene: Scene);
  300. furTime: number;
  301. needAlphaBlending(): boolean;
  302. needAlphaTesting(): boolean;
  303. getAlphaTestTexture(): Nullable<BaseTexture>;
  304. updateFur(): void;
  305. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  306. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  307. getAnimatables(): IAnimatable[];
  308. getActiveTextures(): BaseTexture[];
  309. hasTexture(texture: BaseTexture): boolean;
  310. dispose(forceDisposeEffect?: boolean): void;
  311. clone(name: string): FurMaterial;
  312. serialize(): any;
  313. getClassName(): string;
  314. static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
  315. static GenerateTexture(name: string, scene: Scene): DynamicTexture;
  316. static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];
  317. }
  318. }
  319. declare module BABYLON {
  320. class TerrainMaterial extends PushMaterial {
  321. private _mixTexture;
  322. mixTexture: BaseTexture;
  323. private _diffuseTexture1;
  324. diffuseTexture1: Texture;
  325. private _diffuseTexture2;
  326. diffuseTexture2: Texture;
  327. private _diffuseTexture3;
  328. diffuseTexture3: Texture;
  329. private _bumpTexture1;
  330. bumpTexture1: Texture;
  331. private _bumpTexture2;
  332. bumpTexture2: Texture;
  333. private _bumpTexture3;
  334. bumpTexture3: Texture;
  335. diffuseColor: Color3;
  336. specularColor: Color3;
  337. specularPower: number;
  338. private _disableLighting;
  339. disableLighting: boolean;
  340. private _maxSimultaneousLights;
  341. maxSimultaneousLights: number;
  342. private _renderId;
  343. constructor(name: string, scene: Scene);
  344. needAlphaBlending(): boolean;
  345. needAlphaTesting(): boolean;
  346. getAlphaTestTexture(): Nullable<BaseTexture>;
  347. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  348. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  349. getAnimatables(): IAnimatable[];
  350. getActiveTextures(): BaseTexture[];
  351. hasTexture(texture: BaseTexture): boolean;
  352. dispose(forceDisposeEffect?: boolean): void;
  353. clone(name: string): TerrainMaterial;
  354. serialize(): any;
  355. getClassName(): string;
  356. static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
  357. }
  358. }
  359. declare module BABYLON {
  360. class MixMaterial extends PushMaterial {
  361. /**
  362. * Mix textures
  363. */
  364. private _mixTexture1;
  365. mixTexture1: BaseTexture;
  366. private _mixTexture2;
  367. mixTexture2: BaseTexture;
  368. /**
  369. * Diffuse textures
  370. */
  371. private _diffuseTexture1;
  372. diffuseTexture1: Texture;
  373. private _diffuseTexture2;
  374. diffuseTexture2: Texture;
  375. private _diffuseTexture3;
  376. diffuseTexture3: Texture;
  377. private _diffuseTexture4;
  378. diffuseTexture4: Texture;
  379. private _diffuseTexture5;
  380. diffuseTexture5: Texture;
  381. private _diffuseTexture6;
  382. diffuseTexture6: Texture;
  383. private _diffuseTexture7;
  384. diffuseTexture7: Texture;
  385. private _diffuseTexture8;
  386. diffuseTexture8: Texture;
  387. /**
  388. * Uniforms
  389. */
  390. diffuseColor: Color3;
  391. specularColor: Color3;
  392. specularPower: number;
  393. private _disableLighting;
  394. disableLighting: boolean;
  395. private _maxSimultaneousLights;
  396. maxSimultaneousLights: number;
  397. private _renderId;
  398. constructor(name: string, scene: Scene);
  399. needAlphaBlending(): boolean;
  400. needAlphaTesting(): boolean;
  401. getAlphaTestTexture(): Nullable<BaseTexture>;
  402. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  403. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  404. getAnimatables(): IAnimatable[];
  405. getActiveTextures(): BaseTexture[];
  406. hasTexture(texture: BaseTexture): boolean;
  407. dispose(forceDisposeEffect?: boolean): void;
  408. clone(name: string): MixMaterial;
  409. serialize(): any;
  410. getClassName(): string;
  411. static Parse(source: any, scene: Scene, rootUrl: string): MixMaterial;
  412. }
  413. }
  414. declare module BABYLON {
  415. class TriPlanarMaterial extends PushMaterial {
  416. mixTexture: BaseTexture;
  417. private _diffuseTextureX;
  418. diffuseTextureX: BaseTexture;
  419. private _diffuseTextureY;
  420. diffuseTextureY: BaseTexture;
  421. private _diffuseTextureZ;
  422. diffuseTextureZ: BaseTexture;
  423. private _normalTextureX;
  424. normalTextureX: BaseTexture;
  425. private _normalTextureY;
  426. normalTextureY: BaseTexture;
  427. private _normalTextureZ;
  428. normalTextureZ: BaseTexture;
  429. tileSize: number;
  430. diffuseColor: Color3;
  431. specularColor: Color3;
  432. specularPower: number;
  433. private _disableLighting;
  434. disableLighting: boolean;
  435. private _maxSimultaneousLights;
  436. maxSimultaneousLights: number;
  437. private _renderId;
  438. constructor(name: string, scene: Scene);
  439. needAlphaBlending(): boolean;
  440. needAlphaTesting(): boolean;
  441. getAlphaTestTexture(): Nullable<BaseTexture>;
  442. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  443. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  444. getAnimatables(): IAnimatable[];
  445. getActiveTextures(): BaseTexture[];
  446. hasTexture(texture: BaseTexture): boolean;
  447. dispose(forceDisposeEffect?: boolean): void;
  448. clone(name: string): TriPlanarMaterial;
  449. serialize(): any;
  450. getClassName(): string;
  451. static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
  452. }
  453. }
  454. declare module BABYLON {
  455. class SkyMaterial extends PushMaterial {
  456. luminance: number;
  457. turbidity: number;
  458. rayleigh: number;
  459. mieCoefficient: number;
  460. mieDirectionalG: number;
  461. distance: number;
  462. inclination: number;
  463. azimuth: number;
  464. sunPosition: Vector3;
  465. useSunPosition: boolean;
  466. private _cameraPosition;
  467. private _renderId;
  468. constructor(name: string, scene: Scene);
  469. needAlphaBlending(): boolean;
  470. needAlphaTesting(): boolean;
  471. getAlphaTestTexture(): Nullable<BaseTexture>;
  472. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  473. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  474. getAnimatables(): IAnimatable[];
  475. dispose(forceDisposeEffect?: boolean): void;
  476. clone(name: string): SkyMaterial;
  477. serialize(): any;
  478. getClassName(): string;
  479. static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
  480. }
  481. }
  482. declare module BABYLON {
  483. /**
  484. * The grid materials allows you to wrap any shape with a grid.
  485. * Colors are customizable.
  486. */
  487. class GridMaterial extends BABYLON.PushMaterial {
  488. /**
  489. * Main color of the grid (e.g. between lines)
  490. */
  491. mainColor: Color3;
  492. /**
  493. * Color of the grid lines.
  494. */
  495. lineColor: Color3;
  496. /**
  497. * The scale of the grid compared to unit.
  498. */
  499. gridRatio: number;
  500. /**
  501. * Allows setting an offset for the grid lines.
  502. */
  503. gridOffset: Vector3;
  504. /**
  505. * The frequency of thicker lines.
  506. */
  507. majorUnitFrequency: number;
  508. /**
  509. * The visibility of minor units in the grid.
  510. */
  511. minorUnitVisibility: number;
  512. /**
  513. * The grid opacity outside of the lines.
  514. */
  515. opacity: number;
  516. /**
  517. * Determine RBG output is premultiplied by alpha value.
  518. */
  519. preMultiplyAlpha: boolean;
  520. private _opacityTexture;
  521. opacityTexture: BaseTexture;
  522. private _gridControl;
  523. private _renderId;
  524. /**
  525. * constructor
  526. * @param name The name given to the material in order to identify it afterwards.
  527. * @param scene The scene the material is used in.
  528. */
  529. constructor(name: string, scene: Scene);
  530. /**
  531. * Returns wehter or not the grid requires alpha blending.
  532. */
  533. needAlphaBlending(): boolean;
  534. needAlphaBlendingForMesh(mesh: AbstractMesh): boolean;
  535. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  536. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  537. dispose(forceDisposeEffect?: boolean): void;
  538. clone(name: string): GridMaterial;
  539. serialize(): any;
  540. getClassName(): string;
  541. static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
  542. }
  543. }
  544. declare module BABYLON {
  545. class CustomShaderStructure {
  546. FragmentStore: string;
  547. VertexStore: string;
  548. constructor();
  549. }
  550. class ShaderSpecialParts {
  551. constructor();
  552. Fragment_Begin: string;
  553. Fragment_Definitions: string;
  554. Fragment_MainBegin: string;
  555. Fragment_Custom_Diffuse: string;
  556. Fragment_Custom_Alpha: string;
  557. Fragment_Before_FragColor: string;
  558. Vertex_Begin: string;
  559. Vertex_Definitions: string;
  560. Vertex_MainBegin: string;
  561. Vertex_Before_PositionUpdated: string;
  562. Vertex_Before_NormalUpdated: string;
  563. }
  564. class CustomMaterial extends StandardMaterial {
  565. static ShaderIndexer: number;
  566. CustomParts: ShaderSpecialParts;
  567. _isCreatedShader: boolean;
  568. _createdShaderName: string;
  569. _customUniform: string[];
  570. _newUniforms: string[];
  571. _newUniformInstances: any[];
  572. _newSamplerInstances: Texture[];
  573. FragmentShader: string;
  574. VertexShader: string;
  575. AttachAfterBind(mesh: Mesh, effect: Effect): void;
  576. ReviewUniform(name: string, arr: string[]): string[];
  577. Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines): string;
  578. constructor(name: string, scene: Scene);
  579. AddUniform(name: string, kind: string, param: any): CustomMaterial;
  580. Fragment_Begin(shaderPart: string): CustomMaterial;
  581. Fragment_Definitions(shaderPart: string): CustomMaterial;
  582. Fragment_MainBegin(shaderPart: string): CustomMaterial;
  583. Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial;
  584. Fragment_Custom_Alpha(shaderPart: string): CustomMaterial;
  585. Fragment_Before_FragColor(shaderPart: string): CustomMaterial;
  586. Vertex_Begin(shaderPart: string): CustomMaterial;
  587. Vertex_Definitions(shaderPart: string): CustomMaterial;
  588. Vertex_MainBegin(shaderPart: string): CustomMaterial;
  589. Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial;
  590. Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial;
  591. }
  592. }
  593. declare module BABYLON {
  594. class CellMaterial extends PushMaterial {
  595. private _diffuseTexture;
  596. diffuseTexture: BaseTexture;
  597. diffuseColor: Color3;
  598. _computeHighLevel: boolean;
  599. computeHighLevel: boolean;
  600. private _disableLighting;
  601. disableLighting: boolean;
  602. private _maxSimultaneousLights;
  603. maxSimultaneousLights: number;
  604. private _renderId;
  605. constructor(name: string, scene: Scene);
  606. needAlphaBlending(): boolean;
  607. needAlphaTesting(): boolean;
  608. getAlphaTestTexture(): Nullable<BaseTexture>;
  609. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  610. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  611. getAnimatables(): IAnimatable[];
  612. getActiveTextures(): BaseTexture[];
  613. hasTexture(texture: BaseTexture): boolean;
  614. dispose(forceDisposeEffect?: boolean): void;
  615. getClassName(): string;
  616. clone(name: string): CellMaterial;
  617. serialize(): any;
  618. static Parse(source: any, scene: Scene, rootUrl: string): CellMaterial;
  619. }
  620. }