babylonjs.materials.module.d.ts 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  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. private _waitingRenderList;
  212. /**
  213. * Constructor
  214. */
  215. constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
  216. useLogarithmicDepth: boolean;
  217. readonly refractionTexture: Nullable<RenderTargetTexture>;
  218. readonly reflectionTexture: Nullable<RenderTargetTexture>;
  219. addToRenderList(node: any): void;
  220. enableRenderTargets(enable: boolean): void;
  221. getRenderList(): Nullable<AbstractMesh[]>;
  222. readonly renderTargetsEnabled: boolean;
  223. needAlphaBlending(): boolean;
  224. needAlphaTesting(): boolean;
  225. getAlphaTestTexture(): Nullable<BaseTexture>;
  226. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  227. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  228. private _createRenderTargets(scene, renderTargetSize);
  229. getAnimatables(): IAnimatable[];
  230. getActiveTextures(): BaseTexture[];
  231. hasTexture(texture: BaseTexture): boolean;
  232. dispose(forceDisposeEffect?: boolean): void;
  233. clone(name: string): WaterMaterial;
  234. serialize(): any;
  235. getClassName(): string;
  236. static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
  237. static CreateDefaultMesh(name: string, scene: Scene): Mesh;
  238. }
  239. }
  240. declare module BABYLON {
  241. class FireMaterial extends PushMaterial {
  242. private _diffuseTexture;
  243. diffuseTexture: Nullable<BaseTexture>;
  244. private _distortionTexture;
  245. distortionTexture: Nullable<BaseTexture>;
  246. private _opacityTexture;
  247. opacityTexture: Nullable<BaseTexture>;
  248. diffuseColor: Color3;
  249. speed: number;
  250. private _scaledDiffuse;
  251. private _renderId;
  252. private _lastTime;
  253. constructor(name: string, scene: Scene);
  254. needAlphaBlending(): boolean;
  255. needAlphaTesting(): boolean;
  256. getAlphaTestTexture(): Nullable<BaseTexture>;
  257. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  258. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  259. getAnimatables(): IAnimatable[];
  260. getActiveTextures(): BaseTexture[];
  261. hasTexture(texture: BaseTexture): boolean;
  262. getClassName(): string;
  263. dispose(forceDisposeEffect?: boolean): void;
  264. clone(name: string): FireMaterial;
  265. serialize(): any;
  266. static Parse(source: any, scene: Scene, rootUrl: string): FireMaterial;
  267. }
  268. }
  269. declare module BABYLON {
  270. class FurMaterial extends PushMaterial {
  271. private _diffuseTexture;
  272. diffuseTexture: BaseTexture;
  273. private _heightTexture;
  274. heightTexture: BaseTexture;
  275. diffuseColor: Color3;
  276. furLength: number;
  277. furAngle: number;
  278. furColor: Color3;
  279. furOffset: number;
  280. furSpacing: number;
  281. furGravity: Vector3;
  282. furSpeed: number;
  283. furDensity: number;
  284. furTexture: DynamicTexture;
  285. private _disableLighting;
  286. disableLighting: boolean;
  287. private _maxSimultaneousLights;
  288. maxSimultaneousLights: number;
  289. highLevelFur: boolean;
  290. _meshes: AbstractMesh[];
  291. private _renderId;
  292. private _furTime;
  293. constructor(name: string, scene: Scene);
  294. furTime: number;
  295. needAlphaBlending(): boolean;
  296. needAlphaTesting(): boolean;
  297. getAlphaTestTexture(): Nullable<BaseTexture>;
  298. updateFur(): void;
  299. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  300. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  301. getAnimatables(): IAnimatable[];
  302. getActiveTextures(): BaseTexture[];
  303. hasTexture(texture: BaseTexture): boolean;
  304. dispose(forceDisposeEffect?: boolean): void;
  305. clone(name: string): FurMaterial;
  306. serialize(): any;
  307. getClassName(): string;
  308. static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
  309. static GenerateTexture(name: string, scene: Scene): DynamicTexture;
  310. static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];
  311. }
  312. }
  313. declare module BABYLON {
  314. class TerrainMaterial extends PushMaterial {
  315. private _mixTexture;
  316. mixTexture: BaseTexture;
  317. private _diffuseTexture1;
  318. diffuseTexture1: Texture;
  319. private _diffuseTexture2;
  320. diffuseTexture2: Texture;
  321. private _diffuseTexture3;
  322. diffuseTexture3: Texture;
  323. private _bumpTexture1;
  324. bumpTexture1: Texture;
  325. private _bumpTexture2;
  326. bumpTexture2: Texture;
  327. private _bumpTexture3;
  328. bumpTexture3: Texture;
  329. diffuseColor: Color3;
  330. specularColor: Color3;
  331. specularPower: number;
  332. private _disableLighting;
  333. disableLighting: boolean;
  334. private _maxSimultaneousLights;
  335. maxSimultaneousLights: number;
  336. private _renderId;
  337. constructor(name: string, scene: Scene);
  338. needAlphaBlending(): boolean;
  339. needAlphaTesting(): boolean;
  340. getAlphaTestTexture(): Nullable<BaseTexture>;
  341. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  342. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  343. getAnimatables(): IAnimatable[];
  344. getActiveTextures(): BaseTexture[];
  345. hasTexture(texture: BaseTexture): boolean;
  346. dispose(forceDisposeEffect?: boolean): void;
  347. clone(name: string): TerrainMaterial;
  348. serialize(): any;
  349. getClassName(): string;
  350. static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
  351. }
  352. }
  353. declare module BABYLON {
  354. class TriPlanarMaterial extends PushMaterial {
  355. mixTexture: BaseTexture;
  356. private _diffuseTextureX;
  357. diffuseTextureX: BaseTexture;
  358. private _diffuseTextureY;
  359. diffuseTextureY: BaseTexture;
  360. private _diffuseTextureZ;
  361. diffuseTextureZ: BaseTexture;
  362. private _normalTextureX;
  363. normalTextureX: BaseTexture;
  364. private _normalTextureY;
  365. normalTextureY: BaseTexture;
  366. private _normalTextureZ;
  367. normalTextureZ: BaseTexture;
  368. tileSize: number;
  369. diffuseColor: Color3;
  370. specularColor: Color3;
  371. specularPower: number;
  372. private _disableLighting;
  373. disableLighting: boolean;
  374. private _maxSimultaneousLights;
  375. maxSimultaneousLights: number;
  376. private _renderId;
  377. constructor(name: string, scene: Scene);
  378. needAlphaBlending(): boolean;
  379. needAlphaTesting(): boolean;
  380. getAlphaTestTexture(): Nullable<BaseTexture>;
  381. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  382. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  383. getAnimatables(): IAnimatable[];
  384. getActiveTextures(): BaseTexture[];
  385. hasTexture(texture: BaseTexture): boolean;
  386. dispose(forceDisposeEffect?: boolean): void;
  387. clone(name: string): TriPlanarMaterial;
  388. serialize(): any;
  389. getClassName(): string;
  390. static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
  391. }
  392. }
  393. declare module BABYLON {
  394. class SkyMaterial extends PushMaterial {
  395. luminance: number;
  396. turbidity: number;
  397. rayleigh: number;
  398. mieCoefficient: number;
  399. mieDirectionalG: number;
  400. distance: number;
  401. inclination: number;
  402. azimuth: number;
  403. sunPosition: Vector3;
  404. useSunPosition: boolean;
  405. private _cameraPosition;
  406. private _renderId;
  407. constructor(name: string, scene: Scene);
  408. needAlphaBlending(): boolean;
  409. needAlphaTesting(): boolean;
  410. getAlphaTestTexture(): Nullable<BaseTexture>;
  411. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  412. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  413. getAnimatables(): IAnimatable[];
  414. dispose(forceDisposeEffect?: boolean): void;
  415. clone(name: string): SkyMaterial;
  416. serialize(): any;
  417. getClassName(): string;
  418. static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
  419. }
  420. }
  421. declare module BABYLON {
  422. /**
  423. * The grid materials allows you to wrap any shape with a grid.
  424. * Colors are customizable.
  425. */
  426. class GridMaterial extends BABYLON.PushMaterial {
  427. /**
  428. * Main color of the grid (e.g. between lines)
  429. */
  430. mainColor: Color3;
  431. /**
  432. * Color of the grid lines.
  433. */
  434. lineColor: Color3;
  435. /**
  436. * The scale of the grid compared to unit.
  437. */
  438. gridRatio: number;
  439. /**
  440. * Allows setting an offset for the grid lines.
  441. */
  442. gridOffset: Vector3;
  443. /**
  444. * The frequency of thicker lines.
  445. */
  446. majorUnitFrequency: number;
  447. /**
  448. * The visibility of minor units in the grid.
  449. */
  450. minorUnitVisibility: number;
  451. /**
  452. * The grid opacity outside of the lines.
  453. */
  454. opacity: number;
  455. /**
  456. * Determine RBG output is premultiplied by alpha value.
  457. */
  458. preMultiplyAlpha: boolean;
  459. private _gridControl;
  460. private _renderId;
  461. /**
  462. * constructor
  463. * @param name The name given to the material in order to identify it afterwards.
  464. * @param scene The scene the material is used in.
  465. */
  466. constructor(name: string, scene: Scene);
  467. /**
  468. * Returns wehter or not the grid requires alpha blending.
  469. */
  470. needAlphaBlending(): boolean;
  471. needAlphaBlendingForMesh(mesh: AbstractMesh): boolean;
  472. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  473. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  474. dispose(forceDisposeEffect?: boolean): void;
  475. clone(name: string): GridMaterial;
  476. serialize(): any;
  477. getClassName(): string;
  478. static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
  479. }
  480. }
  481. declare module BABYLON {
  482. class StandardMaterialDefines_OldVer extends MaterialDefines implements IImageProcessingConfigurationDefines {
  483. DIFFUSE: boolean;
  484. AMBIENT: boolean;
  485. OPACITY: boolean;
  486. OPACITYRGB: boolean;
  487. REFLECTION: boolean;
  488. EMISSIVE: boolean;
  489. SPECULAR: boolean;
  490. BUMP: boolean;
  491. PARALLAX: boolean;
  492. PARALLAXOCCLUSION: boolean;
  493. SPECULAROVERALPHA: boolean;
  494. CLIPPLANE: boolean;
  495. ALPHATEST: boolean;
  496. ALPHAFROMDIFFUSE: boolean;
  497. POINTSIZE: boolean;
  498. FOG: boolean;
  499. SPECULARTERM: boolean;
  500. DIFFUSEFRESNEL: boolean;
  501. OPACITYFRESNEL: boolean;
  502. REFLECTIONFRESNEL: boolean;
  503. REFRACTIONFRESNEL: boolean;
  504. EMISSIVEFRESNEL: boolean;
  505. FRESNEL: boolean;
  506. NORMAL: boolean;
  507. UV1: boolean;
  508. UV2: boolean;
  509. VERTEXCOLOR: boolean;
  510. VERTEXALPHA: boolean;
  511. NUM_BONE_INFLUENCERS: number;
  512. BonesPerMesh: number;
  513. INSTANCES: boolean;
  514. GLOSSINESS: boolean;
  515. ROUGHNESS: boolean;
  516. EMISSIVEASILLUMINATION: boolean;
  517. LINKEMISSIVEWITHDIFFUSE: boolean;
  518. REFLECTIONFRESNELFROMSPECULAR: boolean;
  519. LIGHTMAP: boolean;
  520. USELIGHTMAPASSHADOWMAP: boolean;
  521. REFLECTIONMAP_3D: boolean;
  522. REFLECTIONMAP_SPHERICAL: boolean;
  523. REFLECTIONMAP_PLANAR: boolean;
  524. REFLECTIONMAP_CUBIC: boolean;
  525. REFLECTIONMAP_PROJECTION: boolean;
  526. REFLECTIONMAP_SKYBOX: boolean;
  527. REFLECTIONMAP_EXPLICIT: boolean;
  528. REFLECTIONMAP_EQUIRECTANGULAR: boolean;
  529. REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
  530. REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
  531. INVERTCUBICMAP: boolean;
  532. LOGARITHMICDEPTH: boolean;
  533. REFRACTION: boolean;
  534. REFRACTIONMAP_3D: boolean;
  535. REFLECTIONOVERALPHA: boolean;
  536. TWOSIDEDLIGHTING: boolean;
  537. SHADOWFLOAT: boolean;
  538. MORPHTARGETS: boolean;
  539. MORPHTARGETS_NORMAL: boolean;
  540. MORPHTARGETS_TANGENT: boolean;
  541. NUM_MORPH_INFLUENCERS: number;
  542. IMAGEPROCESSING: boolean;
  543. VIGNETTE: boolean;
  544. VIGNETTEBLENDMODEMULTIPLY: boolean;
  545. VIGNETTEBLENDMODEOPAQUE: boolean;
  546. TONEMAPPING: boolean;
  547. CONTRAST: boolean;
  548. COLORCURVES: boolean;
  549. COLORGRADING: boolean;
  550. COLORGRADING3D: boolean;
  551. SAMPLER3DGREENDEPTH: boolean;
  552. SAMPLER3DBGRMAP: boolean;
  553. IMAGEPROCESSINGPOSTPROCESS: boolean;
  554. EXPOSURE: boolean;
  555. constructor();
  556. setReflectionMode(modeToEnable: string): void;
  557. }
  558. class StandardMaterial_OldVer extends PushMaterial {
  559. private _diffuseTexture;
  560. diffuseTexture: BaseTexture;
  561. private _ambientTexture;
  562. ambientTexture: BaseTexture;
  563. private _opacityTexture;
  564. opacityTexture: BaseTexture;
  565. private _reflectionTexture;
  566. reflectionTexture: BaseTexture;
  567. private _emissiveTexture;
  568. emissiveTexture: BaseTexture;
  569. private _specularTexture;
  570. specularTexture: BaseTexture;
  571. private _bumpTexture;
  572. bumpTexture: BaseTexture;
  573. private _lightmapTexture;
  574. lightmapTexture: BaseTexture;
  575. private _refractionTexture;
  576. refractionTexture: BaseTexture;
  577. ambientColor: Color3;
  578. diffuseColor: Color3;
  579. specularColor: Color3;
  580. emissiveColor: Color3;
  581. specularPower: number;
  582. private _useAlphaFromDiffuseTexture;
  583. useAlphaFromDiffuseTexture: boolean;
  584. private _useEmissiveAsIllumination;
  585. useEmissiveAsIllumination: boolean;
  586. private _linkEmissiveWithDiffuse;
  587. linkEmissiveWithDiffuse: boolean;
  588. private _useSpecularOverAlpha;
  589. useSpecularOverAlpha: boolean;
  590. private _useReflectionOverAlpha;
  591. useReflectionOverAlpha: boolean;
  592. private _disableLighting;
  593. disableLighting: boolean;
  594. private _useParallax;
  595. useParallax: boolean;
  596. private _useParallaxOcclusion;
  597. useParallaxOcclusion: boolean;
  598. parallaxScaleBias: number;
  599. private _roughness;
  600. roughness: number;
  601. indexOfRefraction: number;
  602. invertRefractionY: boolean;
  603. private _useLightmapAsShadowmap;
  604. useLightmapAsShadowmap: boolean;
  605. private _diffuseFresnelParameters;
  606. diffuseFresnelParameters: FresnelParameters;
  607. private _opacityFresnelParameters;
  608. opacityFresnelParameters: FresnelParameters;
  609. private _reflectionFresnelParameters;
  610. reflectionFresnelParameters: FresnelParameters;
  611. private _refractionFresnelParameters;
  612. refractionFresnelParameters: FresnelParameters;
  613. private _emissiveFresnelParameters;
  614. emissiveFresnelParameters: FresnelParameters;
  615. private _useReflectionFresnelFromSpecular;
  616. useReflectionFresnelFromSpecular: boolean;
  617. private _useGlossinessFromSpecularMapAlpha;
  618. useGlossinessFromSpecularMapAlpha: boolean;
  619. private _maxSimultaneousLights;
  620. maxSimultaneousLights: number;
  621. /**
  622. * If sets to true, x component of normal map value will invert (x = 1.0 - x).
  623. */
  624. private _invertNormalMapX;
  625. invertNormalMapX: boolean;
  626. /**
  627. * If sets to true, y component of normal map value will invert (y = 1.0 - y).
  628. */
  629. private _invertNormalMapY;
  630. invertNormalMapY: boolean;
  631. /**
  632. * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
  633. */
  634. private _twoSidedLighting;
  635. twoSidedLighting: boolean;
  636. /**
  637. * Default configuration related to image processing available in the standard Material.
  638. */
  639. protected _imageProcessingConfiguration: ImageProcessingConfiguration;
  640. /**
  641. * Gets the image processing configuration used either in this material.
  642. */
  643. /**
  644. * Sets the Default image processing configuration used either in the this material.
  645. *
  646. * If sets to null, the scene one is in use.
  647. */
  648. imageProcessingConfiguration: ImageProcessingConfiguration;
  649. /**
  650. * Keep track of the image processing observer to allow dispose and replace.
  651. */
  652. private _imageProcessingObserver;
  653. /**
  654. * Attaches a new image processing configuration to the Standard Material.
  655. * @param configuration
  656. */
  657. protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
  658. /**
  659. * Gets wether the color curves effect is enabled.
  660. */
  661. /**
  662. * Sets wether the color curves effect is enabled.
  663. */
  664. cameraColorCurvesEnabled: boolean;
  665. /**
  666. * Gets wether the color grading effect is enabled.
  667. */
  668. /**
  669. * Gets wether the color grading effect is enabled.
  670. */
  671. cameraColorGradingEnabled: boolean;
  672. /**
  673. * Gets wether tonemapping is enabled or not.
  674. */
  675. /**
  676. * Sets wether tonemapping is enabled or not
  677. */
  678. cameraToneMappingEnabled: boolean;
  679. /**
  680. * The camera exposure used on this material.
  681. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  682. * This corresponds to a photographic exposure.
  683. */
  684. /**
  685. * The camera exposure used on this material.
  686. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  687. * This corresponds to a photographic exposure.
  688. */
  689. cameraExposure: number;
  690. /**
  691. * Gets The camera contrast used on this material.
  692. */
  693. /**
  694. * Sets The camera contrast used on this material.
  695. */
  696. cameraContrast: number;
  697. /**
  698. * Gets the Color Grading 2D Lookup Texture.
  699. */
  700. /**
  701. * Sets the Color Grading 2D Lookup Texture.
  702. */
  703. cameraColorGradingTexture: Nullable<BaseTexture>;
  704. customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer) => string;
  705. protected _renderTargets: SmartArray<RenderTargetTexture>;
  706. protected _worldViewProjectionMatrix: Matrix;
  707. protected _globalAmbientColor: Color3;
  708. protected _useLogarithmicDepth: boolean;
  709. constructor(name: string, scene: Scene);
  710. getClassName(): string;
  711. useLogarithmicDepth: boolean;
  712. needAlphaBlending(): boolean;
  713. needAlphaTesting(): boolean;
  714. protected _shouldUseAlphaFromDiffuseTexture(): boolean;
  715. getAlphaTestTexture(): BaseTexture;
  716. /**
  717. * Child classes can use it to update shaders
  718. */
  719. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  720. buildUniformLayout(): void;
  721. unbind(): void;
  722. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  723. getAnimatables(): IAnimatable[];
  724. getActiveTextures(): BaseTexture[];
  725. dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
  726. clone(name: string): StandardMaterial_OldVer;
  727. serialize(): any;
  728. static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial_OldVer;
  729. static _DiffuseTextureEnabled: boolean;
  730. static DiffuseTextureEnabled: boolean;
  731. static _AmbientTextureEnabled: boolean;
  732. static AmbientTextureEnabled: boolean;
  733. static _OpacityTextureEnabled: boolean;
  734. static OpacityTextureEnabled: boolean;
  735. static _ReflectionTextureEnabled: boolean;
  736. static ReflectionTextureEnabled: boolean;
  737. static _EmissiveTextureEnabled: boolean;
  738. static EmissiveTextureEnabled: boolean;
  739. static _SpecularTextureEnabled: boolean;
  740. static SpecularTextureEnabled: boolean;
  741. static _BumpTextureEnabled: boolean;
  742. static BumpTextureEnabled: boolean;
  743. static _LightmapTextureEnabled: boolean;
  744. static LightmapTextureEnabled: boolean;
  745. static _RefractionTextureEnabled: boolean;
  746. static RefractionTextureEnabled: boolean;
  747. static _ColorGradingTextureEnabled: boolean;
  748. static ColorGradingTextureEnabled: boolean;
  749. static _FresnelEnabled: boolean;
  750. static FresnelEnabled: boolean;
  751. }
  752. class CustomShaderStructure {
  753. FragmentStore: string;
  754. VertexStore: string;
  755. constructor();
  756. }
  757. class ShaderSpecialParts {
  758. constructor();
  759. Fragment_Begin: string;
  760. Fragment_Definitions: string;
  761. Fragment_MainBegin: string;
  762. Fragment_Custom_Diffuse: string;
  763. Fragment_Custom_Alpha: string;
  764. Fragment_Before_FragColor: string;
  765. Vertex_Begin: string;
  766. Vertex_Definitions: string;
  767. Vertex_MainBegin: string;
  768. Vertex_Before_PositionUpdated: string;
  769. Vertex_Before_NormalUpdated: string;
  770. }
  771. class ShaderForVer3_0 extends CustomShaderStructure {
  772. constructor();
  773. }
  774. class StandardShaderVersions {
  775. static Ver3_0: string;
  776. }
  777. class CustomMaterial extends StandardMaterial_OldVer {
  778. static ShaderIndexer: number;
  779. CustomParts: ShaderSpecialParts;
  780. ShaderVersion: CustomShaderStructure;
  781. _isCreatedShader: boolean;
  782. _createdShaderName: string;
  783. _customUniform: string[];
  784. _newUniforms: string[];
  785. _newUniformInstances: any[];
  786. _newSamplerInstances: Texture[];
  787. AttachAfterBind(mesh: Mesh, effect: Effect): void;
  788. ReviewUniform(name: string, arr: string[]): string[];
  789. Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer): string;
  790. SelectVersion(ver: string): void;
  791. constructor(name: string, scene: Scene);
  792. AddUniform(name: string, kind: string, param: any): CustomMaterial;
  793. Fragment_Begin(shaderPart: string): CustomMaterial;
  794. Fragment_Definitions(shaderPart: string): CustomMaterial;
  795. Fragment_MainBegin(shaderPart: string): CustomMaterial;
  796. Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial;
  797. Fragment_Custom_Alpha(shaderPart: string): CustomMaterial;
  798. Fragment_Before_FragColor(shaderPart: string): CustomMaterial;
  799. Vertex_Begin(shaderPart: string): CustomMaterial;
  800. Vertex_Definitions(shaderPart: string): CustomMaterial;
  801. Vertex_MainBegin(shaderPart: string): CustomMaterial;
  802. Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial;
  803. Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial;
  804. }
  805. }
  806. declare module BABYLON {
  807. class CellMaterial extends PushMaterial {
  808. private _diffuseTexture;
  809. diffuseTexture: BaseTexture;
  810. diffuseColor: Color3;
  811. _computeHighLevel: boolean;
  812. computeHighLevel: boolean;
  813. private _disableLighting;
  814. disableLighting: boolean;
  815. private _maxSimultaneousLights;
  816. maxSimultaneousLights: number;
  817. private _renderId;
  818. constructor(name: string, scene: Scene);
  819. needAlphaBlending(): boolean;
  820. needAlphaTesting(): boolean;
  821. getAlphaTestTexture(): Nullable<BaseTexture>;
  822. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  823. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  824. getAnimatables(): IAnimatable[];
  825. getActiveTextures(): BaseTexture[];
  826. hasTexture(texture: BaseTexture): boolean;
  827. dispose(forceDisposeEffect?: boolean): void;
  828. getClassName(): string;
  829. clone(name: string): CellMaterial;
  830. serialize(): any;
  831. static Parse(source: any, scene: Scene, rootUrl: string): CellMaterial;
  832. }
  833. }