babylonjs.materials.d.ts 38 KB

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