babylonjs.materials.module.d.ts 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. /// <reference types="babylonjs"/>
  2. declare module 'babylonjs-materials' {
  3. export = BABYLON;
  4. }
  5. declare module BABYLON {
  6. class ShadowOnlyMaterial extends PushMaterial {
  7. private _renderId;
  8. private _activeLight;
  9. constructor(name: string, scene: Scene);
  10. needAlphaBlending(): boolean;
  11. needAlphaTesting(): boolean;
  12. getAlphaTestTexture(): Nullable<BaseTexture>;
  13. activeLight: IShadowLight;
  14. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  15. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  16. clone(name: string): ShadowOnlyMaterial;
  17. serialize(): any;
  18. getClassName(): string;
  19. static Parse(source: any, scene: Scene, rootUrl: string): ShadowOnlyMaterial;
  20. }
  21. }
  22. declare module BABYLON {
  23. class GradientMaterial extends PushMaterial {
  24. private _maxSimultaneousLights;
  25. maxSimultaneousLights: number;
  26. topColor: Color3;
  27. topColorAlpha: number;
  28. bottomColor: Color3;
  29. bottomColorAlpha: number;
  30. offset: number;
  31. smoothness: number;
  32. disableLighting: boolean;
  33. private _scaledDiffuse;
  34. private _renderId;
  35. constructor(name: string, scene: Scene);
  36. needAlphaBlending(): boolean;
  37. needAlphaTesting(): boolean;
  38. getAlphaTestTexture(): Nullable<BaseTexture>;
  39. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  40. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  41. getAnimatables(): IAnimatable[];
  42. dispose(forceDisposeEffect?: boolean): void;
  43. clone(name: string): GradientMaterial;
  44. serialize(): any;
  45. getClassName(): string;
  46. static Parse(source: any, scene: Scene, rootUrl: string): GradientMaterial;
  47. }
  48. }
  49. declare module BABYLON {
  50. class NormalMaterial extends PushMaterial {
  51. private _diffuseTexture;
  52. diffuseTexture: BaseTexture;
  53. diffuseColor: Color3;
  54. private _disableLighting;
  55. disableLighting: boolean;
  56. private _maxSimultaneousLights;
  57. maxSimultaneousLights: number;
  58. private _renderId;
  59. constructor(name: string, scene: Scene);
  60. needAlphaBlending(): boolean;
  61. needAlphaTesting(): boolean;
  62. getAlphaTestTexture(): Nullable<BaseTexture>;
  63. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  64. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  65. getAnimatables(): IAnimatable[];
  66. getActiveTextures(): BaseTexture[];
  67. hasTexture(texture: BaseTexture): boolean;
  68. dispose(forceDisposeEffect?: boolean): void;
  69. clone(name: string): NormalMaterial;
  70. serialize(): any;
  71. getClassName(): string;
  72. static Parse(source: any, scene: Scene, rootUrl: string): NormalMaterial;
  73. }
  74. }
  75. declare module BABYLON {
  76. class LavaMaterial extends PushMaterial {
  77. private _diffuseTexture;
  78. diffuseTexture: BaseTexture;
  79. noiseTexture: BaseTexture;
  80. fogColor: Color3;
  81. speed: number;
  82. movingSpeed: number;
  83. lowFrequencySpeed: number;
  84. fogDensity: number;
  85. private _lastTime;
  86. diffuseColor: Color3;
  87. private _disableLighting;
  88. disableLighting: boolean;
  89. private _maxSimultaneousLights;
  90. maxSimultaneousLights: number;
  91. private _scaledDiffuse;
  92. private _renderId;
  93. constructor(name: string, scene: Scene);
  94. needAlphaBlending(): boolean;
  95. needAlphaTesting(): boolean;
  96. getAlphaTestTexture(): Nullable<BaseTexture>;
  97. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  98. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  99. getAnimatables(): IAnimatable[];
  100. getActiveTextures(): BaseTexture[];
  101. hasTexture(texture: BaseTexture): boolean;
  102. dispose(forceDisposeEffect?: boolean): void;
  103. clone(name: string): LavaMaterial;
  104. serialize(): any;
  105. getClassName(): string;
  106. static Parse(source: any, scene: Scene, rootUrl: string): LavaMaterial;
  107. }
  108. }
  109. declare module BABYLON {
  110. class SimpleMaterial extends PushMaterial {
  111. private _diffuseTexture;
  112. diffuseTexture: BaseTexture;
  113. diffuseColor: Color3;
  114. private _disableLighting;
  115. disableLighting: boolean;
  116. private _maxSimultaneousLights;
  117. maxSimultaneousLights: number;
  118. private _renderId;
  119. constructor(name: string, scene: Scene);
  120. needAlphaBlending(): boolean;
  121. needAlphaTesting(): boolean;
  122. getAlphaTestTexture(): Nullable<BaseTexture>;
  123. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  124. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  125. getAnimatables(): IAnimatable[];
  126. getActiveTextures(): BaseTexture[];
  127. hasTexture(texture: BaseTexture): boolean;
  128. dispose(forceDisposeEffect?: boolean): void;
  129. clone(name: string): SimpleMaterial;
  130. serialize(): any;
  131. getClassName(): string;
  132. static Parse(source: any, scene: Scene, rootUrl: string): SimpleMaterial;
  133. }
  134. }
  135. declare module BABYLON {
  136. class WaterMaterial extends PushMaterial {
  137. renderTargetSize: Vector2;
  138. private _bumpTexture;
  139. bumpTexture: BaseTexture;
  140. diffuseColor: Color3;
  141. specularColor: Color3;
  142. specularPower: number;
  143. private _disableLighting;
  144. disableLighting: boolean;
  145. private _maxSimultaneousLights;
  146. maxSimultaneousLights: number;
  147. /**
  148. * @param {number}: Represents the wind force
  149. */
  150. windForce: number;
  151. /**
  152. * @param {Vector2}: The direction of the wind in the plane (X, Z)
  153. */
  154. windDirection: Vector2;
  155. /**
  156. * @param {number}: Wave height, represents the height of the waves
  157. */
  158. waveHeight: number;
  159. /**
  160. * @param {number}: Bump height, represents the bump height related to the bump map
  161. */
  162. bumpHeight: number;
  163. /**
  164. * @param {boolean}: Add a smaller moving bump to less steady waves.
  165. */
  166. private _bumpSuperimpose;
  167. bumpSuperimpose: boolean;
  168. /**
  169. * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
  170. */
  171. private _fresnelSeparate;
  172. fresnelSeparate: boolean;
  173. /**
  174. * @param {boolean}: bump Waves modify the reflection.
  175. */
  176. private _bumpAffectsReflection;
  177. bumpAffectsReflection: boolean;
  178. /**
  179. * @param {number}: The water color blended with the refraction (near)
  180. */
  181. waterColor: Color3;
  182. /**
  183. * @param {number}: The blend factor related to the water color
  184. */
  185. colorBlendFactor: number;
  186. /**
  187. * @param {number}: The water color blended with the reflection (far)
  188. */
  189. waterColor2: Color3;
  190. /**
  191. * @param {number}: The blend factor related to the water color (reflection, far)
  192. */
  193. colorBlendFactor2: number;
  194. /**
  195. * @param {number}: Represents the maximum length of a wave
  196. */
  197. waveLength: number;
  198. /**
  199. * @param {number}: Defines the waves speed
  200. */
  201. waveSpeed: number;
  202. protected _renderTargets: SmartArray<RenderTargetTexture>;
  203. private _mesh;
  204. private _refractionRTT;
  205. private _reflectionRTT;
  206. private _reflectionTransform;
  207. private _lastTime;
  208. private _lastDeltaTime;
  209. private _renderId;
  210. private _useLogarithmicDepth;
  211. /**
  212. * Constructor
  213. */
  214. constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
  215. useLogarithmicDepth: boolean;
  216. readonly refractionTexture: RenderTargetTexture;
  217. readonly reflectionTexture: RenderTargetTexture;
  218. addToRenderList(node: any): void;
  219. enableRenderTargets(enable: boolean): void;
  220. getRenderList(): Nullable<AbstractMesh[]>;
  221. readonly renderTargetsEnabled: boolean;
  222. needAlphaBlending(): boolean;
  223. needAlphaTesting(): boolean;
  224. getAlphaTestTexture(): Nullable<BaseTexture>;
  225. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  226. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  227. private _createRenderTargets(scene, renderTargetSize);
  228. getAnimatables(): IAnimatable[];
  229. getActiveTextures(): BaseTexture[];
  230. hasTexture(texture: BaseTexture): boolean;
  231. dispose(forceDisposeEffect?: boolean): void;
  232. clone(name: string): WaterMaterial;
  233. serialize(): any;
  234. getClassName(): string;
  235. static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
  236. static CreateDefaultMesh(name: string, scene: Scene): Mesh;
  237. }
  238. }
  239. declare module BABYLON {
  240. class FireMaterial extends PushMaterial {
  241. private _diffuseTexture;
  242. diffuseTexture: Nullable<BaseTexture>;
  243. private _distortionTexture;
  244. distortionTexture: Nullable<BaseTexture>;
  245. private _opacityTexture;
  246. opacityTexture: Nullable<BaseTexture>;
  247. diffuseColor: Color3;
  248. speed: number;
  249. private _scaledDiffuse;
  250. private _renderId;
  251. private _lastTime;
  252. constructor(name: string, scene: Scene);
  253. needAlphaBlending(): boolean;
  254. needAlphaTesting(): boolean;
  255. getAlphaTestTexture(): Nullable<BaseTexture>;
  256. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  257. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  258. getAnimatables(): IAnimatable[];
  259. getActiveTextures(): BaseTexture[];
  260. hasTexture(texture: BaseTexture): boolean;
  261. getClassName(): string;
  262. dispose(forceDisposeEffect?: boolean): void;
  263. clone(name: string): FireMaterial;
  264. serialize(): any;
  265. static Parse(source: any, scene: Scene, rootUrl: string): FireMaterial;
  266. }
  267. }
  268. declare module BABYLON {
  269. class FurMaterial extends PushMaterial {
  270. private _diffuseTexture;
  271. diffuseTexture: BaseTexture;
  272. private _heightTexture;
  273. heightTexture: BaseTexture;
  274. diffuseColor: Color3;
  275. furLength: number;
  276. furAngle: number;
  277. furColor: Color3;
  278. furOffset: number;
  279. furSpacing: number;
  280. furGravity: Vector3;
  281. furSpeed: number;
  282. furDensity: number;
  283. furTexture: DynamicTexture;
  284. private _disableLighting;
  285. disableLighting: boolean;
  286. private _maxSimultaneousLights;
  287. maxSimultaneousLights: number;
  288. highLevelFur: boolean;
  289. _meshes: AbstractMesh[];
  290. private _renderId;
  291. private _furTime;
  292. constructor(name: string, scene: Scene);
  293. furTime: number;
  294. needAlphaBlending(): boolean;
  295. needAlphaTesting(): boolean;
  296. getAlphaTestTexture(): Nullable<BaseTexture>;
  297. updateFur(): void;
  298. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  299. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  300. getAnimatables(): IAnimatable[];
  301. getActiveTextures(): BaseTexture[];
  302. hasTexture(texture: BaseTexture): boolean;
  303. dispose(forceDisposeEffect?: boolean): void;
  304. clone(name: string): FurMaterial;
  305. serialize(): any;
  306. getClassName(): string;
  307. static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
  308. static GenerateTexture(name: string, scene: Scene): DynamicTexture;
  309. static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];
  310. }
  311. }
  312. declare module BABYLON {
  313. class TerrainMaterial extends PushMaterial {
  314. private _mixTexture;
  315. mixTexture: BaseTexture;
  316. private _diffuseTexture1;
  317. diffuseTexture1: Texture;
  318. private _diffuseTexture2;
  319. diffuseTexture2: Texture;
  320. private _diffuseTexture3;
  321. diffuseTexture3: Texture;
  322. private _bumpTexture1;
  323. bumpTexture1: Texture;
  324. private _bumpTexture2;
  325. bumpTexture2: Texture;
  326. private _bumpTexture3;
  327. bumpTexture3: Texture;
  328. diffuseColor: Color3;
  329. specularColor: Color3;
  330. specularPower: number;
  331. private _disableLighting;
  332. disableLighting: boolean;
  333. private _maxSimultaneousLights;
  334. maxSimultaneousLights: number;
  335. private _renderId;
  336. constructor(name: string, scene: Scene);
  337. needAlphaBlending(): boolean;
  338. needAlphaTesting(): boolean;
  339. getAlphaTestTexture(): Nullable<BaseTexture>;
  340. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  341. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  342. getAnimatables(): IAnimatable[];
  343. getActiveTextures(): BaseTexture[];
  344. hasTexture(texture: BaseTexture): boolean;
  345. dispose(forceDisposeEffect?: boolean): void;
  346. clone(name: string): TerrainMaterial;
  347. serialize(): any;
  348. getClassName(): string;
  349. static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
  350. }
  351. }
  352. declare module BABYLON {
  353. class TriPlanarMaterial extends PushMaterial {
  354. mixTexture: BaseTexture;
  355. private _diffuseTextureX;
  356. diffuseTextureX: BaseTexture;
  357. private _diffuseTextureY;
  358. diffuseTextureY: BaseTexture;
  359. private _diffuseTextureZ;
  360. diffuseTextureZ: BaseTexture;
  361. private _normalTextureX;
  362. normalTextureX: BaseTexture;
  363. private _normalTextureY;
  364. normalTextureY: BaseTexture;
  365. private _normalTextureZ;
  366. normalTextureZ: BaseTexture;
  367. tileSize: number;
  368. diffuseColor: Color3;
  369. specularColor: Color3;
  370. specularPower: number;
  371. private _disableLighting;
  372. disableLighting: boolean;
  373. private _maxSimultaneousLights;
  374. maxSimultaneousLights: number;
  375. private _renderId;
  376. constructor(name: string, scene: Scene);
  377. needAlphaBlending(): boolean;
  378. needAlphaTesting(): boolean;
  379. getAlphaTestTexture(): Nullable<BaseTexture>;
  380. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  381. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  382. getAnimatables(): IAnimatable[];
  383. getActiveTextures(): BaseTexture[];
  384. hasTexture(texture: BaseTexture): boolean;
  385. dispose(forceDisposeEffect?: boolean): void;
  386. clone(name: string): TriPlanarMaterial;
  387. serialize(): any;
  388. getClassName(): string;
  389. static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
  390. }
  391. }
  392. declare module BABYLON {
  393. class SkyMaterial extends PushMaterial {
  394. luminance: number;
  395. turbidity: number;
  396. rayleigh: number;
  397. mieCoefficient: number;
  398. mieDirectionalG: number;
  399. distance: number;
  400. inclination: number;
  401. azimuth: number;
  402. sunPosition: Vector3;
  403. useSunPosition: boolean;
  404. private _cameraPosition;
  405. private _renderId;
  406. constructor(name: string, scene: Scene);
  407. needAlphaBlending(): boolean;
  408. needAlphaTesting(): boolean;
  409. getAlphaTestTexture(): Nullable<BaseTexture>;
  410. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  411. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  412. getAnimatables(): IAnimatable[];
  413. dispose(forceDisposeEffect?: boolean): void;
  414. clone(name: string): SkyMaterial;
  415. serialize(): any;
  416. getClassName(): string;
  417. static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
  418. }
  419. }
  420. declare module BABYLON {
  421. /**
  422. * The grid materials allows you to wrap any shape with a grid.
  423. * Colors are customizable.
  424. */
  425. class GridMaterial extends BABYLON.PushMaterial {
  426. /**
  427. * Main color of the grid (e.g. between lines)
  428. */
  429. mainColor: Color3;
  430. /**
  431. * Color of the grid lines.
  432. */
  433. lineColor: Color3;
  434. /**
  435. * The scale of the grid compared to unit.
  436. */
  437. gridRatio: number;
  438. /**
  439. * Allows setting an offset for the grid lines.
  440. */
  441. gridOffset: Vector3;
  442. /**
  443. * The frequency of thicker lines.
  444. */
  445. majorUnitFrequency: number;
  446. /**
  447. * The visibility of minor units in the grid.
  448. */
  449. minorUnitVisibility: number;
  450. /**
  451. * The grid opacity outside of the lines.
  452. */
  453. opacity: number;
  454. /**
  455. * Determine RBG output is premultiplied by alpha value.
  456. */
  457. preMultiplyAlpha: boolean;
  458. private _gridControl;
  459. private _renderId;
  460. /**
  461. * constructor
  462. * @param name The name given to the material in order to identify it afterwards.
  463. * @param scene The scene the material is used in.
  464. */
  465. constructor(name: string, scene: Scene);
  466. /**
  467. * Returns wehter or not the grid requires alpha blending.
  468. */
  469. needAlphaBlending(): boolean;
  470. needAlphaBlendingForMesh(mesh: AbstractMesh): boolean;
  471. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  472. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  473. dispose(forceDisposeEffect?: boolean): void;
  474. clone(name: string): GridMaterial;
  475. serialize(): any;
  476. getClassName(): string;
  477. static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
  478. }
  479. }
  480. declare module BABYLON {
  481. class StandardMaterialDefines_OldVer extends MaterialDefines implements IImageProcessingConfigurationDefines {
  482. DIFFUSE: boolean;
  483. AMBIENT: boolean;
  484. OPACITY: boolean;
  485. OPACITYRGB: boolean;
  486. REFLECTION: boolean;
  487. EMISSIVE: boolean;
  488. SPECULAR: boolean;
  489. BUMP: boolean;
  490. PARALLAX: boolean;
  491. PARALLAXOCCLUSION: boolean;
  492. SPECULAROVERALPHA: boolean;
  493. CLIPPLANE: boolean;
  494. ALPHATEST: boolean;
  495. ALPHAFROMDIFFUSE: boolean;
  496. POINTSIZE: boolean;
  497. FOG: boolean;
  498. SPECULARTERM: boolean;
  499. DIFFUSEFRESNEL: boolean;
  500. OPACITYFRESNEL: boolean;
  501. REFLECTIONFRESNEL: boolean;
  502. REFRACTIONFRESNEL: boolean;
  503. EMISSIVEFRESNEL: boolean;
  504. FRESNEL: boolean;
  505. NORMAL: boolean;
  506. UV1: boolean;
  507. UV2: boolean;
  508. VERTEXCOLOR: boolean;
  509. VERTEXALPHA: boolean;
  510. NUM_BONE_INFLUENCERS: number;
  511. BonesPerMesh: number;
  512. INSTANCES: boolean;
  513. GLOSSINESS: boolean;
  514. ROUGHNESS: boolean;
  515. EMISSIVEASILLUMINATION: boolean;
  516. LINKEMISSIVEWITHDIFFUSE: boolean;
  517. REFLECTIONFRESNELFROMSPECULAR: boolean;
  518. LIGHTMAP: boolean;
  519. USELIGHTMAPASSHADOWMAP: boolean;
  520. REFLECTIONMAP_3D: boolean;
  521. REFLECTIONMAP_SPHERICAL: boolean;
  522. REFLECTIONMAP_PLANAR: boolean;
  523. REFLECTIONMAP_CUBIC: boolean;
  524. REFLECTIONMAP_PROJECTION: boolean;
  525. REFLECTIONMAP_SKYBOX: boolean;
  526. REFLECTIONMAP_EXPLICIT: boolean;
  527. REFLECTIONMAP_EQUIRECTANGULAR: boolean;
  528. REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
  529. REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
  530. INVERTCUBICMAP: boolean;
  531. LOGARITHMICDEPTH: boolean;
  532. REFRACTION: boolean;
  533. REFRACTIONMAP_3D: boolean;
  534. REFLECTIONOVERALPHA: boolean;
  535. INVERTNORMALMAPX: boolean;
  536. INVERTNORMALMAPY: boolean;
  537. TWOSIDEDLIGHTING: boolean;
  538. SHADOWFLOAT: boolean;
  539. MORPHTARGETS: boolean;
  540. MORPHTARGETS_NORMAL: boolean;
  541. MORPHTARGETS_TANGENT: boolean;
  542. NUM_MORPH_INFLUENCERS: number;
  543. USERIGHTHANDEDSYSTEM: boolean;
  544. IMAGEPROCESSING: boolean;
  545. VIGNETTE: boolean;
  546. VIGNETTEBLENDMODEMULTIPLY: boolean;
  547. VIGNETTEBLENDMODEOPAQUE: boolean;
  548. TONEMAPPING: boolean;
  549. CONTRAST: boolean;
  550. COLORCURVES: boolean;
  551. COLORGRADING: boolean;
  552. SAMPLER3DGREENDEPTH: boolean;
  553. SAMPLER3DBGRMAP: boolean;
  554. IMAGEPROCESSINGPOSTPROCESS: boolean;
  555. EXPOSURE: boolean;
  556. constructor();
  557. setReflectionMode(modeToEnable: string): void;
  558. }
  559. class StandardMaterial_OldVer extends PushMaterial {
  560. private _diffuseTexture;
  561. diffuseTexture: BaseTexture;
  562. private _ambientTexture;
  563. ambientTexture: BaseTexture;
  564. private _opacityTexture;
  565. opacityTexture: BaseTexture;
  566. private _reflectionTexture;
  567. reflectionTexture: BaseTexture;
  568. private _emissiveTexture;
  569. emissiveTexture: BaseTexture;
  570. private _specularTexture;
  571. specularTexture: BaseTexture;
  572. private _bumpTexture;
  573. bumpTexture: BaseTexture;
  574. private _lightmapTexture;
  575. lightmapTexture: BaseTexture;
  576. private _refractionTexture;
  577. refractionTexture: BaseTexture;
  578. ambientColor: Color3;
  579. diffuseColor: Color3;
  580. specularColor: Color3;
  581. emissiveColor: Color3;
  582. specularPower: number;
  583. private _useAlphaFromDiffuseTexture;
  584. useAlphaFromDiffuseTexture: boolean;
  585. private _useEmissiveAsIllumination;
  586. useEmissiveAsIllumination: boolean;
  587. private _linkEmissiveWithDiffuse;
  588. linkEmissiveWithDiffuse: boolean;
  589. private _useSpecularOverAlpha;
  590. useSpecularOverAlpha: boolean;
  591. private _useReflectionOverAlpha;
  592. useReflectionOverAlpha: boolean;
  593. private _disableLighting;
  594. disableLighting: boolean;
  595. private _useParallax;
  596. useParallax: boolean;
  597. private _useParallaxOcclusion;
  598. useParallaxOcclusion: boolean;
  599. parallaxScaleBias: number;
  600. private _roughness;
  601. roughness: number;
  602. indexOfRefraction: number;
  603. invertRefractionY: boolean;
  604. private _useLightmapAsShadowmap;
  605. useLightmapAsShadowmap: boolean;
  606. private _diffuseFresnelParameters;
  607. diffuseFresnelParameters: FresnelParameters;
  608. private _opacityFresnelParameters;
  609. opacityFresnelParameters: FresnelParameters;
  610. private _reflectionFresnelParameters;
  611. reflectionFresnelParameters: FresnelParameters;
  612. private _refractionFresnelParameters;
  613. refractionFresnelParameters: FresnelParameters;
  614. private _emissiveFresnelParameters;
  615. emissiveFresnelParameters: FresnelParameters;
  616. private _useReflectionFresnelFromSpecular;
  617. useReflectionFresnelFromSpecular: boolean;
  618. private _useGlossinessFromSpecularMapAlpha;
  619. useGlossinessFromSpecularMapAlpha: boolean;
  620. private _maxSimultaneousLights;
  621. maxSimultaneousLights: number;
  622. /**
  623. * If sets to true, x component of normal map value will invert (x = 1.0 - x).
  624. */
  625. private _invertNormalMapX;
  626. invertNormalMapX: boolean;
  627. /**
  628. * If sets to true, y component of normal map value will invert (y = 1.0 - y).
  629. */
  630. private _invertNormalMapY;
  631. invertNormalMapY: boolean;
  632. /**
  633. * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
  634. */
  635. private _twoSidedLighting;
  636. twoSidedLighting: boolean;
  637. /**
  638. * Default configuration related to image processing available in the standard Material.
  639. */
  640. protected _imageProcessingConfiguration: ImageProcessingConfiguration;
  641. /**
  642. * Gets the image processing configuration used either in this material.
  643. */
  644. /**
  645. * Sets the Default image processing configuration used either in the this material.
  646. *
  647. * If sets to null, the scene one is in use.
  648. */
  649. imageProcessingConfiguration: ImageProcessingConfiguration;
  650. /**
  651. * Keep track of the image processing observer to allow dispose and replace.
  652. */
  653. private _imageProcessingObserver;
  654. /**
  655. * Attaches a new image processing configuration to the Standard Material.
  656. * @param configuration
  657. */
  658. protected _attachImageProcessingConfiguration(configuration: ImageProcessingConfiguration): void;
  659. /**
  660. * Gets wether the color curves effect is enabled.
  661. */
  662. /**
  663. * Sets wether the color curves effect is enabled.
  664. */
  665. cameraColorCurvesEnabled: boolean;
  666. /**
  667. * Gets wether the color grading effect is enabled.
  668. */
  669. /**
  670. * Gets wether the color grading effect is enabled.
  671. */
  672. cameraColorGradingEnabled: boolean;
  673. /**
  674. * Gets wether tonemapping is enabled or not.
  675. */
  676. /**
  677. * Sets wether tonemapping is enabled or not
  678. */
  679. cameraToneMappingEnabled: boolean;
  680. /**
  681. * The camera exposure used on this material.
  682. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  683. * This corresponds to a photographic exposure.
  684. */
  685. /**
  686. * The camera exposure used on this material.
  687. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  688. * This corresponds to a photographic exposure.
  689. */
  690. cameraExposure: number;
  691. /**
  692. * Gets The camera contrast used on this material.
  693. */
  694. /**
  695. * Sets The camera contrast used on this material.
  696. */
  697. cameraContrast: number;
  698. /**
  699. * Gets the Color Grading 2D Lookup Texture.
  700. */
  701. /**
  702. * Sets the Color Grading 2D Lookup Texture.
  703. */
  704. cameraColorGradingTexture: BaseTexture;
  705. customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer) => string;
  706. protected _renderTargets: SmartArray<RenderTargetTexture>;
  707. protected _worldViewProjectionMatrix: Matrix;
  708. protected _globalAmbientColor: Color3;
  709. protected _useLogarithmicDepth: boolean;
  710. constructor(name: string, scene: Scene);
  711. getClassName(): string;
  712. useLogarithmicDepth: boolean;
  713. needAlphaBlending(): boolean;
  714. needAlphaTesting(): boolean;
  715. protected _shouldUseAlphaFromDiffuseTexture(): boolean;
  716. getAlphaTestTexture(): BaseTexture;
  717. /**
  718. * Child classes can use it to update shaders
  719. */
  720. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  721. buildUniformLayout(): void;
  722. unbind(): void;
  723. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  724. getAnimatables(): IAnimatable[];
  725. getActiveTextures(): BaseTexture[];
  726. dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
  727. clone(name: string): StandardMaterial_OldVer;
  728. serialize(): any;
  729. static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial_OldVer;
  730. static _DiffuseTextureEnabled: boolean;
  731. static DiffuseTextureEnabled: boolean;
  732. static _AmbientTextureEnabled: boolean;
  733. static AmbientTextureEnabled: boolean;
  734. static _OpacityTextureEnabled: boolean;
  735. static OpacityTextureEnabled: boolean;
  736. static _ReflectionTextureEnabled: boolean;
  737. static ReflectionTextureEnabled: boolean;
  738. static _EmissiveTextureEnabled: boolean;
  739. static EmissiveTextureEnabled: boolean;
  740. static _SpecularTextureEnabled: boolean;
  741. static SpecularTextureEnabled: boolean;
  742. static _BumpTextureEnabled: boolean;
  743. static BumpTextureEnabled: boolean;
  744. static _LightmapTextureEnabled: boolean;
  745. static LightmapTextureEnabled: boolean;
  746. static _RefractionTextureEnabled: boolean;
  747. static RefractionTextureEnabled: boolean;
  748. static _ColorGradingTextureEnabled: boolean;
  749. static ColorGradingTextureEnabled: boolean;
  750. static _FresnelEnabled: boolean;
  751. static FresnelEnabled: boolean;
  752. }
  753. class CustomShaderStructure {
  754. FragmentStore: string;
  755. VertexStore: string;
  756. constructor();
  757. }
  758. class ShaderSpecialParts {
  759. constructor();
  760. Fragment_Begin: string;
  761. Fragment_Definitions: string;
  762. Fragment_MainBegin: string;
  763. Fragment_Custom_Diffuse: string;
  764. Fragment_Custom_Alpha: string;
  765. Fragment_Before_FragColor: string;
  766. Vertex_Begin: string;
  767. Vertex_Definitions: string;
  768. Vertex_MainBegin: string;
  769. Vertex_Before_PositionUpdated: string;
  770. Vertex_Before_NormalUpdated: string;
  771. }
  772. class ShaderForVer3_0 extends CustomShaderStructure {
  773. constructor();
  774. }
  775. class StandardShaderVersions {
  776. static Ver3_0: any;
  777. }
  778. class CustomMaterial extends StandardMaterial_OldVer {
  779. static ShaderIndexer: number;
  780. CustomParts: ShaderSpecialParts;
  781. ShaderVersion: CustomShaderStructure;
  782. _isCreatedShader: boolean;
  783. _createdShaderName: string;
  784. _customUniform: string[];
  785. _newUniforms: string[];
  786. _newUniformInstances: any[];
  787. _newSamplerInstances: Texture[];
  788. AttachAfterBind(mesh: Mesh, effect: Effect): void;
  789. ReviewUniform(name: string, arr: string[]): string[];
  790. Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer): string;
  791. SelectVersion(ver: string): void;
  792. constructor(name: string, scene: Scene);
  793. AddUniform(name: string, kind: string, param: any): CustomMaterial;
  794. Fragment_Begin(shaderPart: string): CustomMaterial;
  795. Fragment_Definitions(shaderPart: string): CustomMaterial;
  796. Fragment_MainBegin(shaderPart: string): CustomMaterial;
  797. Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial;
  798. Fragment_Custom_Alpha(shaderPart: string): CustomMaterial;
  799. Fragment_Before_FragColor(shaderPart: string): CustomMaterial;
  800. Vertex_Begin(shaderPart: string): CustomMaterial;
  801. Vertex_Definitions(shaderPart: string): CustomMaterial;
  802. Vertex_MainBegin(shaderPart: string): CustomMaterial;
  803. Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial;
  804. Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial;
  805. }
  806. }
  807. declare module BABYLON {
  808. class CellMaterial extends PushMaterial {
  809. private _diffuseTexture;
  810. diffuseTexture: BaseTexture;
  811. diffuseColor: Color3;
  812. _computeHighLevel: boolean;
  813. computeHighLevel: boolean;
  814. private _disableLighting;
  815. disableLighting: boolean;
  816. private _maxSimultaneousLights;
  817. maxSimultaneousLights: number;
  818. private _renderId;
  819. constructor(name: string, scene: Scene);
  820. needAlphaBlending(): boolean;
  821. needAlphaTesting(): boolean;
  822. getAlphaTestTexture(): Nullable<BaseTexture>;
  823. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  824. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  825. getAnimatables(): IAnimatable[];
  826. getActiveTextures(): BaseTexture[];
  827. hasTexture(texture: BaseTexture): boolean;
  828. dispose(forceDisposeEffect?: boolean): void;
  829. getClassName(): string;
  830. clone(name: string): CellMaterial;
  831. serialize(): any;
  832. static Parse(source: any, scene: Scene, rootUrl: string): CellMaterial;
  833. }
  834. }