babylonjs.materials.d.ts 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. declare module BABYLON {
  2. /** @hidden */
  3. export var cellPixelShader: {
  4. name: string;
  5. shader: string;
  6. };
  7. }
  8. declare module BABYLON {
  9. /** @hidden */
  10. export var cellVertexShader: {
  11. name: string;
  12. shader: string;
  13. };
  14. }
  15. declare module BABYLON {
  16. export class CellMaterial extends BABYLON.PushMaterial {
  17. private _diffuseTexture;
  18. diffuseTexture: BABYLON.BaseTexture;
  19. diffuseColor: BABYLON.Color3;
  20. _computeHighLevel: boolean;
  21. computeHighLevel: boolean;
  22. private _disableLighting;
  23. disableLighting: boolean;
  24. private _maxSimultaneousLights;
  25. maxSimultaneousLights: number;
  26. private _renderId;
  27. constructor(name: string, scene: BABYLON.Scene);
  28. needAlphaBlending(): boolean;
  29. needAlphaTesting(): boolean;
  30. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  31. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  32. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  33. getAnimatables(): BABYLON.IAnimatable[];
  34. getActiveTextures(): BABYLON.BaseTexture[];
  35. hasTexture(texture: BABYLON.BaseTexture): boolean;
  36. dispose(forceDisposeEffect?: boolean): void;
  37. getClassName(): string;
  38. clone(name: string): CellMaterial;
  39. serialize(): any;
  40. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): CellMaterial;
  41. }
  42. }
  43. declare module BABYLON {
  44. export class CustomShaderStructure {
  45. FragmentStore: string;
  46. VertexStore: string;
  47. constructor();
  48. }
  49. export class ShaderSpecialParts {
  50. constructor();
  51. Fragment_Begin: string;
  52. Fragment_Definitions: string;
  53. Fragment_MainBegin: string;
  54. Fragment_Custom_Diffuse: string;
  55. Fragment_Custom_Alpha: string;
  56. Fragment_Before_FragColor: string;
  57. Vertex_Begin: string;
  58. Vertex_Definitions: string;
  59. Vertex_MainBegin: string;
  60. Vertex_Before_PositionUpdated: string;
  61. Vertex_Before_NormalUpdated: string;
  62. }
  63. export class CustomMaterial extends BABYLON.StandardMaterial {
  64. static ShaderIndexer: number;
  65. CustomParts: ShaderSpecialParts;
  66. _isCreatedShader: boolean;
  67. _createdShaderName: string;
  68. _customUniform: string[];
  69. _newUniforms: string[];
  70. _newUniformInstances: any[];
  71. _newSamplerInstances: BABYLON.Texture[];
  72. FragmentShader: string;
  73. VertexShader: string;
  74. AttachAfterBind(mesh: BABYLON.Mesh, effect: BABYLON.Effect): void;
  75. ReviewUniform(name: string, arr: string[]): string[];
  76. Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: BABYLON.StandardMaterialDefines): string;
  77. constructor(name: string, scene: BABYLON.Scene);
  78. AddUniform(name: string, kind: string, param: any): CustomMaterial;
  79. Fragment_Begin(shaderPart: string): CustomMaterial;
  80. Fragment_Definitions(shaderPart: string): CustomMaterial;
  81. Fragment_MainBegin(shaderPart: string): CustomMaterial;
  82. Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial;
  83. Fragment_Custom_Alpha(shaderPart: string): CustomMaterial;
  84. Fragment_Before_FragColor(shaderPart: string): CustomMaterial;
  85. Vertex_Begin(shaderPart: string): CustomMaterial;
  86. Vertex_Definitions(shaderPart: string): CustomMaterial;
  87. Vertex_MainBegin(shaderPart: string): CustomMaterial;
  88. Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial;
  89. Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial;
  90. }
  91. }
  92. declare module BABYLON {
  93. /** @hidden */
  94. export var firePixelShader: {
  95. name: string;
  96. shader: string;
  97. };
  98. }
  99. declare module BABYLON {
  100. /** @hidden */
  101. export var fireVertexShader: {
  102. name: string;
  103. shader: string;
  104. };
  105. }
  106. declare module BABYLON {
  107. export class FireMaterial extends BABYLON.PushMaterial {
  108. private _diffuseTexture;
  109. diffuseTexture: BABYLON.Nullable<BABYLON.BaseTexture>;
  110. private _distortionTexture;
  111. distortionTexture: BABYLON.Nullable<BABYLON.BaseTexture>;
  112. private _opacityTexture;
  113. opacityTexture: BABYLON.Nullable<BABYLON.BaseTexture>;
  114. diffuseColor: BABYLON.Color3;
  115. speed: number;
  116. private _scaledDiffuse;
  117. private _renderId;
  118. private _lastTime;
  119. constructor(name: string, scene: BABYLON.Scene);
  120. needAlphaBlending(): boolean;
  121. needAlphaTesting(): boolean;
  122. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  123. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  124. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  125. getAnimatables(): BABYLON.IAnimatable[];
  126. getActiveTextures(): BABYLON.BaseTexture[];
  127. hasTexture(texture: BABYLON.BaseTexture): boolean;
  128. getClassName(): string;
  129. dispose(forceDisposeEffect?: boolean): void;
  130. clone(name: string): FireMaterial;
  131. serialize(): any;
  132. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FireMaterial;
  133. }
  134. }
  135. declare module BABYLON {
  136. /** @hidden */
  137. export var furPixelShader: {
  138. name: string;
  139. shader: string;
  140. };
  141. }
  142. declare module BABYLON {
  143. /** @hidden */
  144. export var furVertexShader: {
  145. name: string;
  146. shader: string;
  147. };
  148. }
  149. declare module BABYLON {
  150. export class FurMaterial extends BABYLON.PushMaterial {
  151. private _diffuseTexture;
  152. diffuseTexture: BABYLON.BaseTexture;
  153. private _heightTexture;
  154. heightTexture: BABYLON.BaseTexture;
  155. diffuseColor: BABYLON.Color3;
  156. furLength: number;
  157. furAngle: number;
  158. furColor: BABYLON.Color3;
  159. furOffset: number;
  160. furSpacing: number;
  161. furGravity: BABYLON.Vector3;
  162. furSpeed: number;
  163. furDensity: number;
  164. furOcclusion: number;
  165. furTexture: BABYLON.DynamicTexture;
  166. private _disableLighting;
  167. disableLighting: boolean;
  168. private _maxSimultaneousLights;
  169. maxSimultaneousLights: number;
  170. highLevelFur: boolean;
  171. _meshes: BABYLON.AbstractMesh[];
  172. private _renderId;
  173. private _furTime;
  174. constructor(name: string, scene: BABYLON.Scene);
  175. furTime: number;
  176. needAlphaBlending(): boolean;
  177. needAlphaTesting(): boolean;
  178. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  179. updateFur(): void;
  180. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  181. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  182. getAnimatables(): BABYLON.IAnimatable[];
  183. getActiveTextures(): BABYLON.BaseTexture[];
  184. hasTexture(texture: BABYLON.BaseTexture): boolean;
  185. dispose(forceDisposeEffect?: boolean): void;
  186. clone(name: string): FurMaterial;
  187. serialize(): any;
  188. getClassName(): string;
  189. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FurMaterial;
  190. static GenerateTexture(name: string, scene: BABYLON.Scene): BABYLON.DynamicTexture;
  191. static FurifyMesh(sourceMesh: BABYLON.Mesh, quality: number): BABYLON.Mesh[];
  192. }
  193. }
  194. declare module BABYLON {
  195. /** @hidden */
  196. export var gradientPixelShader: {
  197. name: string;
  198. shader: string;
  199. };
  200. }
  201. declare module BABYLON {
  202. /** @hidden */
  203. export var gradientVertexShader: {
  204. name: string;
  205. shader: string;
  206. };
  207. }
  208. declare module BABYLON {
  209. export class GradientMaterial extends BABYLON.PushMaterial {
  210. private _maxSimultaneousLights;
  211. maxSimultaneousLights: number;
  212. topColor: BABYLON.Color3;
  213. topColorAlpha: number;
  214. bottomColor: BABYLON.Color3;
  215. bottomColorAlpha: number;
  216. offset: number;
  217. scale: number;
  218. smoothness: number;
  219. private _disableLighting;
  220. disableLighting: boolean;
  221. private _renderId;
  222. constructor(name: string, scene: BABYLON.Scene);
  223. needAlphaBlending(): boolean;
  224. needAlphaTesting(): boolean;
  225. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  226. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  227. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  228. getAnimatables(): BABYLON.IAnimatable[];
  229. dispose(forceDisposeEffect?: boolean): void;
  230. clone(name: string): GradientMaterial;
  231. serialize(): any;
  232. getClassName(): string;
  233. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): GradientMaterial;
  234. }
  235. }
  236. declare module BABYLON {
  237. /** @hidden */
  238. export var gridPixelShader: {
  239. name: string;
  240. shader: string;
  241. };
  242. }
  243. declare module BABYLON {
  244. /** @hidden */
  245. export var gridVertexShader: {
  246. name: string;
  247. shader: string;
  248. };
  249. }
  250. declare module BABYLON {
  251. /**
  252. * The grid materials allows you to wrap any shape with a grid.
  253. * Colors are customizable.
  254. */
  255. export class GridMaterial extends BABYLON.PushMaterial {
  256. /**
  257. * Main color of the grid (e.g. between lines)
  258. */
  259. mainColor: BABYLON.Color3;
  260. /**
  261. * Color of the grid lines.
  262. */
  263. lineColor: BABYLON.Color3;
  264. /**
  265. * The scale of the grid compared to unit.
  266. */
  267. gridRatio: number;
  268. /**
  269. * Allows setting an offset for the grid lines.
  270. */
  271. gridOffset: BABYLON.Vector3;
  272. /**
  273. * The frequency of thicker lines.
  274. */
  275. majorUnitFrequency: number;
  276. /**
  277. * The visibility of minor units in the grid.
  278. */
  279. minorUnitVisibility: number;
  280. /**
  281. * The grid opacity outside of the lines.
  282. */
  283. opacity: number;
  284. /**
  285. * Determine RBG output is premultiplied by alpha value.
  286. */
  287. preMultiplyAlpha: boolean;
  288. private _opacityTexture;
  289. opacityTexture: BABYLON.BaseTexture;
  290. private _gridControl;
  291. private _renderId;
  292. /**
  293. * constructor
  294. * @param name The name given to the material in order to identify it afterwards.
  295. * @param scene The scene the material is used in.
  296. */
  297. constructor(name: string, scene: BABYLON.Scene);
  298. /**
  299. * Returns wehter or not the grid requires alpha blending.
  300. */
  301. needAlphaBlending(): boolean;
  302. needAlphaBlendingForMesh(mesh: BABYLON.AbstractMesh): boolean;
  303. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  304. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  305. /**
  306. * Dispose the material and its associated resources.
  307. * @param forceDisposeEffect will also dispose the used effect when true
  308. */
  309. dispose(forceDisposeEffect?: boolean): void;
  310. clone(name: string): GridMaterial;
  311. serialize(): any;
  312. getClassName(): string;
  313. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): GridMaterial;
  314. }
  315. }
  316. declare module BABYLON {
  317. /** @hidden */
  318. export var lavaPixelShader: {
  319. name: string;
  320. shader: string;
  321. };
  322. }
  323. declare module BABYLON {
  324. /** @hidden */
  325. export var lavaVertexShader: {
  326. name: string;
  327. shader: string;
  328. };
  329. }
  330. declare module BABYLON {
  331. export class LavaMaterial extends BABYLON.PushMaterial {
  332. private _diffuseTexture;
  333. diffuseTexture: BABYLON.BaseTexture;
  334. noiseTexture: BABYLON.BaseTexture;
  335. fogColor: BABYLON.Color3;
  336. speed: number;
  337. movingSpeed: number;
  338. lowFrequencySpeed: number;
  339. fogDensity: number;
  340. private _lastTime;
  341. diffuseColor: BABYLON.Color3;
  342. private _disableLighting;
  343. disableLighting: boolean;
  344. private _unlit;
  345. unlit: boolean;
  346. private _maxSimultaneousLights;
  347. maxSimultaneousLights: number;
  348. private _scaledDiffuse;
  349. private _renderId;
  350. constructor(name: string, scene: BABYLON.Scene);
  351. needAlphaBlending(): boolean;
  352. needAlphaTesting(): boolean;
  353. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  354. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  355. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  356. getAnimatables(): BABYLON.IAnimatable[];
  357. getActiveTextures(): BABYLON.BaseTexture[];
  358. hasTexture(texture: BABYLON.BaseTexture): boolean;
  359. dispose(forceDisposeEffect?: boolean): void;
  360. clone(name: string): LavaMaterial;
  361. serialize(): any;
  362. getClassName(): string;
  363. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): LavaMaterial;
  364. }
  365. }
  366. declare module BABYLON {
  367. /** @hidden */
  368. export var mixPixelShader: {
  369. name: string;
  370. shader: string;
  371. };
  372. }
  373. declare module BABYLON {
  374. /** @hidden */
  375. export var mixVertexShader: {
  376. name: string;
  377. shader: string;
  378. };
  379. }
  380. declare module BABYLON {
  381. export class MixMaterial extends BABYLON.PushMaterial {
  382. /**
  383. * Mix textures
  384. */
  385. private _mixTexture1;
  386. mixTexture1: BABYLON.BaseTexture;
  387. private _mixTexture2;
  388. mixTexture2: BABYLON.BaseTexture;
  389. /**
  390. * Diffuse textures
  391. */
  392. private _diffuseTexture1;
  393. diffuseTexture1: BABYLON.Texture;
  394. private _diffuseTexture2;
  395. diffuseTexture2: BABYLON.Texture;
  396. private _diffuseTexture3;
  397. diffuseTexture3: BABYLON.Texture;
  398. private _diffuseTexture4;
  399. diffuseTexture4: BABYLON.Texture;
  400. private _diffuseTexture5;
  401. diffuseTexture5: BABYLON.Texture;
  402. private _diffuseTexture6;
  403. diffuseTexture6: BABYLON.Texture;
  404. private _diffuseTexture7;
  405. diffuseTexture7: BABYLON.Texture;
  406. private _diffuseTexture8;
  407. diffuseTexture8: BABYLON.Texture;
  408. /**
  409. * Uniforms
  410. */
  411. diffuseColor: BABYLON.Color3;
  412. specularColor: BABYLON.Color3;
  413. specularPower: number;
  414. private _disableLighting;
  415. disableLighting: boolean;
  416. private _maxSimultaneousLights;
  417. maxSimultaneousLights: number;
  418. private _renderId;
  419. constructor(name: string, scene: BABYLON.Scene);
  420. needAlphaBlending(): boolean;
  421. needAlphaTesting(): boolean;
  422. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  423. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  424. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  425. getAnimatables(): BABYLON.IAnimatable[];
  426. getActiveTextures(): BABYLON.BaseTexture[];
  427. hasTexture(texture: BABYLON.BaseTexture): boolean;
  428. dispose(forceDisposeEffect?: boolean): void;
  429. clone(name: string): MixMaterial;
  430. serialize(): any;
  431. getClassName(): string;
  432. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): MixMaterial;
  433. }
  434. }
  435. declare module BABYLON {
  436. /** @hidden */
  437. export var normalPixelShader: {
  438. name: string;
  439. shader: string;
  440. };
  441. }
  442. declare module BABYLON {
  443. /** @hidden */
  444. export var normalVertexShader: {
  445. name: string;
  446. shader: string;
  447. };
  448. }
  449. declare module BABYLON {
  450. export class NormalMaterial extends BABYLON.PushMaterial {
  451. private _diffuseTexture;
  452. diffuseTexture: BABYLON.BaseTexture;
  453. diffuseColor: BABYLON.Color3;
  454. private _disableLighting;
  455. disableLighting: boolean;
  456. private _maxSimultaneousLights;
  457. maxSimultaneousLights: number;
  458. private _renderId;
  459. constructor(name: string, scene: BABYLON.Scene);
  460. needAlphaBlending(): boolean;
  461. needAlphaBlendingForMesh(mesh: BABYLON.AbstractMesh): boolean;
  462. needAlphaTesting(): boolean;
  463. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  464. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  465. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  466. getAnimatables(): BABYLON.IAnimatable[];
  467. getActiveTextures(): BABYLON.BaseTexture[];
  468. hasTexture(texture: BABYLON.BaseTexture): boolean;
  469. dispose(forceDisposeEffect?: boolean): void;
  470. clone(name: string): NormalMaterial;
  471. serialize(): any;
  472. getClassName(): string;
  473. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): NormalMaterial;
  474. }
  475. }
  476. declare module BABYLON {
  477. /** @hidden */
  478. export var shadowOnlyPixelShader: {
  479. name: string;
  480. shader: string;
  481. };
  482. }
  483. declare module BABYLON {
  484. /** @hidden */
  485. export var shadowOnlyVertexShader: {
  486. name: string;
  487. shader: string;
  488. };
  489. }
  490. declare module BABYLON {
  491. export class ShadowOnlyMaterial extends BABYLON.PushMaterial {
  492. private _renderId;
  493. private _activeLight;
  494. constructor(name: string, scene: BABYLON.Scene);
  495. shadowColor: BABYLON.Color3;
  496. needAlphaBlending(): boolean;
  497. needAlphaTesting(): boolean;
  498. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  499. activeLight: BABYLON.IShadowLight;
  500. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  501. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  502. clone(name: string): ShadowOnlyMaterial;
  503. serialize(): any;
  504. getClassName(): string;
  505. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): ShadowOnlyMaterial;
  506. }
  507. }
  508. declare module BABYLON {
  509. /** @hidden */
  510. export var simplePixelShader: {
  511. name: string;
  512. shader: string;
  513. };
  514. }
  515. declare module BABYLON {
  516. /** @hidden */
  517. export var simpleVertexShader: {
  518. name: string;
  519. shader: string;
  520. };
  521. }
  522. declare module BABYLON {
  523. export class SimpleMaterial extends BABYLON.PushMaterial {
  524. private _diffuseTexture;
  525. diffuseTexture: BABYLON.BaseTexture;
  526. diffuseColor: BABYLON.Color3;
  527. private _disableLighting;
  528. disableLighting: boolean;
  529. private _maxSimultaneousLights;
  530. maxSimultaneousLights: number;
  531. private _renderId;
  532. constructor(name: string, scene: BABYLON.Scene);
  533. needAlphaBlending(): boolean;
  534. needAlphaTesting(): boolean;
  535. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  536. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  537. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  538. getAnimatables(): BABYLON.IAnimatable[];
  539. getActiveTextures(): BABYLON.BaseTexture[];
  540. hasTexture(texture: BABYLON.BaseTexture): boolean;
  541. dispose(forceDisposeEffect?: boolean): void;
  542. clone(name: string): SimpleMaterial;
  543. serialize(): any;
  544. getClassName(): string;
  545. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): SimpleMaterial;
  546. }
  547. }
  548. declare module BABYLON {
  549. /** @hidden */
  550. export var skyPixelShader: {
  551. name: string;
  552. shader: string;
  553. };
  554. }
  555. declare module BABYLON {
  556. /** @hidden */
  557. export var skyVertexShader: {
  558. name: string;
  559. shader: string;
  560. };
  561. }
  562. declare module BABYLON {
  563. /**
  564. * This is the sky material which allows to create dynamic and texture free effects for skyboxes.
  565. * @see https://doc.babylonjs.com/extensions/sky
  566. */
  567. export class SkyMaterial extends BABYLON.PushMaterial {
  568. /**
  569. * Defines the overall luminance of sky in interval ]0, 1[.
  570. */
  571. luminance: number;
  572. /**
  573. * Defines the amount (scattering) of haze as opposed to molecules in atmosphere.
  574. */
  575. turbidity: number;
  576. /**
  577. * Defines the sky appearance (light intensity).
  578. */
  579. rayleigh: number;
  580. /**
  581. * Defines the mieCoefficient in interval [0, 0.1] which affects the property .mieDirectionalG.
  582. */
  583. mieCoefficient: number;
  584. /**
  585. * Defines the amount of haze particles following the Mie scattering theory.
  586. */
  587. mieDirectionalG: number;
  588. /**
  589. * Defines the distance of the sun according to the active scene camera.
  590. */
  591. distance: number;
  592. /**
  593. * Defines the sun inclination, in interval [-0.5, 0.5]. When the inclination is not 0, the sun is said
  594. * "inclined".
  595. */
  596. inclination: number;
  597. /**
  598. * Defines the solar azimuth in interval [0, 1]. The azimuth is the angle in the horizontal plan between
  599. * an object direction and a reference direction.
  600. */
  601. azimuth: number;
  602. /**
  603. * Defines the sun position in the sky on (x,y,z). If the property .useSunPosition is set to false, then
  604. * the property is overriden by the inclination and the azimuth and can be read at any moment.
  605. */
  606. sunPosition: BABYLON.Vector3;
  607. /**
  608. * Defines if the sun position should be computed (inclination and azimuth) according to the given
  609. * .sunPosition property.
  610. */
  611. useSunPosition: boolean;
  612. /**
  613. * Defines an offset vector used to get a horizon offset.
  614. * @example skyMaterial.cameraOffset.y = camera.globalPosition.y // Set horizon relative to 0 on the Y axis
  615. */
  616. cameraOffset: BABYLON.Vector3;
  617. private _cameraPosition;
  618. private _renderId;
  619. /**
  620. * Instantiates a new sky material.
  621. * This material allows to create dynamic and texture free
  622. * effects for skyboxes by taking care of the atmosphere state.
  623. * @see https://doc.babylonjs.com/extensions/sky
  624. * @param name Define the name of the material in the scene
  625. * @param scene Define the scene the material belong to
  626. */
  627. constructor(name: string, scene: BABYLON.Scene);
  628. /**
  629. * Specifies if the material will require alpha blending
  630. * @returns a boolean specifying if alpha blending is needed
  631. */
  632. needAlphaBlending(): boolean;
  633. /**
  634. * Specifies if this material should be rendered in alpha test mode
  635. * @returns false as the sky material doesn't need alpha testing.
  636. */
  637. needAlphaTesting(): boolean;
  638. /**
  639. * Get the texture used for alpha test purpose.
  640. * @returns null as the sky material has no texture.
  641. */
  642. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  643. /**
  644. * Get if the submesh is ready to be used and all its information available.
  645. * Child classes can use it to update shaders
  646. * @param mesh defines the mesh to check
  647. * @param subMesh defines which submesh to check
  648. * @param useInstances specifies that instances should be used
  649. * @returns a boolean indicating that the submesh is ready or not
  650. */
  651. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  652. /**
  653. * Binds the submesh to this material by preparing the effect and shader to draw
  654. * @param world defines the world transformation matrix
  655. * @param mesh defines the mesh containing the submesh
  656. * @param subMesh defines the submesh to bind the material to
  657. */
  658. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  659. /**
  660. * Get the list of animatables in the material.
  661. * @returns the list of animatables object used in the material
  662. */
  663. getAnimatables(): BABYLON.IAnimatable[];
  664. /**
  665. * Disposes the material
  666. * @param forceDisposeEffect specifies if effects should be forcefully disposed
  667. */
  668. dispose(forceDisposeEffect?: boolean): void;
  669. /**
  670. * Makes a duplicate of the material, and gives it a new name
  671. * @param name defines the new name for the duplicated material
  672. * @returns the cloned material
  673. */
  674. clone(name: string): SkyMaterial;
  675. /**
  676. * Serializes this material in a JSON representation
  677. * @returns the serialized material object
  678. */
  679. serialize(): any;
  680. /**
  681. * Gets the current class name of the material e.g. "SkyMaterial"
  682. * Mainly use in serialization.
  683. * @returns the class name
  684. */
  685. getClassName(): string;
  686. /**
  687. * Creates a sky material from parsed material data
  688. * @param source defines the JSON representation of the material
  689. * @param scene defines the hosting scene
  690. * @param rootUrl defines the root URL to use to load textures and relative dependencies
  691. * @returns a new sky material
  692. */
  693. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): SkyMaterial;
  694. }
  695. }
  696. declare module BABYLON {
  697. /** @hidden */
  698. export var terrainPixelShader: {
  699. name: string;
  700. shader: string;
  701. };
  702. }
  703. declare module BABYLON {
  704. /** @hidden */
  705. export var terrainVertexShader: {
  706. name: string;
  707. shader: string;
  708. };
  709. }
  710. declare module BABYLON {
  711. export class TerrainMaterial extends BABYLON.PushMaterial {
  712. private _mixTexture;
  713. mixTexture: BABYLON.BaseTexture;
  714. private _diffuseTexture1;
  715. diffuseTexture1: BABYLON.Texture;
  716. private _diffuseTexture2;
  717. diffuseTexture2: BABYLON.Texture;
  718. private _diffuseTexture3;
  719. diffuseTexture3: BABYLON.Texture;
  720. private _bumpTexture1;
  721. bumpTexture1: BABYLON.Texture;
  722. private _bumpTexture2;
  723. bumpTexture2: BABYLON.Texture;
  724. private _bumpTexture3;
  725. bumpTexture3: BABYLON.Texture;
  726. diffuseColor: BABYLON.Color3;
  727. specularColor: BABYLON.Color3;
  728. specularPower: number;
  729. private _disableLighting;
  730. disableLighting: boolean;
  731. private _maxSimultaneousLights;
  732. maxSimultaneousLights: number;
  733. private _renderId;
  734. constructor(name: string, scene: BABYLON.Scene);
  735. needAlphaBlending(): boolean;
  736. needAlphaTesting(): boolean;
  737. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  738. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  739. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  740. getAnimatables(): BABYLON.IAnimatable[];
  741. getActiveTextures(): BABYLON.BaseTexture[];
  742. hasTexture(texture: BABYLON.BaseTexture): boolean;
  743. dispose(forceDisposeEffect?: boolean): void;
  744. clone(name: string): TerrainMaterial;
  745. serialize(): any;
  746. getClassName(): string;
  747. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): TerrainMaterial;
  748. }
  749. }
  750. declare module BABYLON {
  751. /** @hidden */
  752. export var triplanarPixelShader: {
  753. name: string;
  754. shader: string;
  755. };
  756. }
  757. declare module BABYLON {
  758. /** @hidden */
  759. export var triplanarVertexShader: {
  760. name: string;
  761. shader: string;
  762. };
  763. }
  764. declare module BABYLON {
  765. export class TriPlanarMaterial extends BABYLON.PushMaterial {
  766. mixTexture: BABYLON.BaseTexture;
  767. private _diffuseTextureX;
  768. diffuseTextureX: BABYLON.BaseTexture;
  769. private _diffuseTextureY;
  770. diffuseTextureY: BABYLON.BaseTexture;
  771. private _diffuseTextureZ;
  772. diffuseTextureZ: BABYLON.BaseTexture;
  773. private _normalTextureX;
  774. normalTextureX: BABYLON.BaseTexture;
  775. private _normalTextureY;
  776. normalTextureY: BABYLON.BaseTexture;
  777. private _normalTextureZ;
  778. normalTextureZ: BABYLON.BaseTexture;
  779. tileSize: number;
  780. diffuseColor: BABYLON.Color3;
  781. specularColor: BABYLON.Color3;
  782. specularPower: number;
  783. private _disableLighting;
  784. disableLighting: boolean;
  785. private _maxSimultaneousLights;
  786. maxSimultaneousLights: number;
  787. private _renderId;
  788. constructor(name: string, scene: BABYLON.Scene);
  789. needAlphaBlending(): boolean;
  790. needAlphaTesting(): boolean;
  791. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  792. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  793. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  794. getAnimatables(): BABYLON.IAnimatable[];
  795. getActiveTextures(): BABYLON.BaseTexture[];
  796. hasTexture(texture: BABYLON.BaseTexture): boolean;
  797. dispose(forceDisposeEffect?: boolean): void;
  798. clone(name: string): TriPlanarMaterial;
  799. serialize(): any;
  800. getClassName(): string;
  801. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): TriPlanarMaterial;
  802. }
  803. }
  804. declare module BABYLON {
  805. /** @hidden */
  806. export var waterPixelShader: {
  807. name: string;
  808. shader: string;
  809. };
  810. }
  811. declare module BABYLON {
  812. /** @hidden */
  813. export var waterVertexShader: {
  814. name: string;
  815. shader: string;
  816. };
  817. }
  818. declare module BABYLON {
  819. export class WaterMaterial extends BABYLON.PushMaterial {
  820. renderTargetSize: BABYLON.Vector2;
  821. private _bumpTexture;
  822. bumpTexture: BABYLON.BaseTexture;
  823. diffuseColor: BABYLON.Color3;
  824. specularColor: BABYLON.Color3;
  825. specularPower: number;
  826. private _disableLighting;
  827. disableLighting: boolean;
  828. private _maxSimultaneousLights;
  829. maxSimultaneousLights: number;
  830. /**
  831. * @param {number}: Represents the wind force
  832. */
  833. windForce: number;
  834. /**
  835. * @param {Vector2}: The direction of the wind in the plane (X, Z)
  836. */
  837. windDirection: BABYLON.Vector2;
  838. /**
  839. * @param {number}: Wave height, represents the height of the waves
  840. */
  841. waveHeight: number;
  842. /**
  843. * @param {number}: Bump height, represents the bump height related to the bump map
  844. */
  845. bumpHeight: number;
  846. /**
  847. * @param {boolean}: Add a smaller moving bump to less steady waves.
  848. */
  849. private _bumpSuperimpose;
  850. bumpSuperimpose: boolean;
  851. /**
  852. * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
  853. */
  854. private _fresnelSeparate;
  855. fresnelSeparate: boolean;
  856. /**
  857. * @param {boolean}: bump Waves modify the reflection.
  858. */
  859. private _bumpAffectsReflection;
  860. bumpAffectsReflection: boolean;
  861. /**
  862. * @param {number}: The water color blended with the refraction (near)
  863. */
  864. waterColor: BABYLON.Color3;
  865. /**
  866. * @param {number}: The blend factor related to the water color
  867. */
  868. colorBlendFactor: number;
  869. /**
  870. * @param {number}: The water color blended with the reflection (far)
  871. */
  872. waterColor2: BABYLON.Color3;
  873. /**
  874. * @param {number}: The blend factor related to the water color (reflection, far)
  875. */
  876. colorBlendFactor2: number;
  877. /**
  878. * @param {number}: Represents the maximum length of a wave
  879. */
  880. waveLength: number;
  881. /**
  882. * @param {number}: Defines the waves speed
  883. */
  884. waveSpeed: number;
  885. protected _renderTargets: BABYLON.SmartArray<BABYLON.RenderTargetTexture>;
  886. private _mesh;
  887. private _refractionRTT;
  888. private _reflectionRTT;
  889. private _reflectionTransform;
  890. private _lastTime;
  891. private _lastDeltaTime;
  892. private _renderId;
  893. private _useLogarithmicDepth;
  894. private _waitingRenderList;
  895. /**
  896. * Gets a boolean indicating that current material needs to register RTT
  897. */
  898. readonly hasRenderTargetTextures: boolean;
  899. /**
  900. * Constructor
  901. */
  902. constructor(name: string, scene: BABYLON.Scene, renderTargetSize?: BABYLON.Vector2);
  903. useLogarithmicDepth: boolean;
  904. readonly refractionTexture: BABYLON.Nullable<BABYLON.RenderTargetTexture>;
  905. readonly reflectionTexture: BABYLON.Nullable<BABYLON.RenderTargetTexture>;
  906. addToRenderList(node: any): void;
  907. enableRenderTargets(enable: boolean): void;
  908. getRenderList(): BABYLON.Nullable<BABYLON.AbstractMesh[]>;
  909. readonly renderTargetsEnabled: boolean;
  910. needAlphaBlending(): boolean;
  911. needAlphaTesting(): boolean;
  912. getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
  913. isReadyForSubMesh(mesh: BABYLON.AbstractMesh, subMesh: BABYLON.SubMesh, useInstances?: boolean): boolean;
  914. bindForSubMesh(world: BABYLON.Matrix, mesh: BABYLON.Mesh, subMesh: BABYLON.SubMesh): void;
  915. private _createRenderTargets;
  916. getAnimatables(): BABYLON.IAnimatable[];
  917. getActiveTextures(): BABYLON.BaseTexture[];
  918. hasTexture(texture: BABYLON.BaseTexture): boolean;
  919. dispose(forceDisposeEffect?: boolean): void;
  920. clone(name: string): WaterMaterial;
  921. serialize(): any;
  922. getClassName(): string;
  923. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): WaterMaterial;
  924. static CreateDefaultMesh(name: string, scene: BABYLON.Scene): BABYLON.Mesh;
  925. }
  926. }