babylonjs.materials.d.ts 38 KB

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