babylonjs.materials.module.d.ts 23 KB

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