babylonjs.materials.module.d.ts 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  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. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  471. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  472. dispose(forceDisposeEffect?: boolean): void;
  473. clone(name: string): GridMaterial;
  474. serialize(): any;
  475. getClassName(): string;
  476. static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
  477. }
  478. }
  479. declare module BABYLON {
  480. class StandardMaterialDefines_OldVer extends MaterialDefines implements IImageProcessingConfigurationDefines {
  481. DIFFUSE: boolean;
  482. AMBIENT: boolean;
  483. OPACITY: boolean;
  484. OPACITYRGB: boolean;
  485. REFLECTION: boolean;
  486. EMISSIVE: boolean;
  487. SPECULAR: boolean;
  488. BUMP: boolean;
  489. PARALLAX: boolean;
  490. PARALLAXOCCLUSION: boolean;
  491. SPECULAROVERALPHA: boolean;
  492. CLIPPLANE: boolean;
  493. ALPHATEST: boolean;
  494. ALPHAFROMDIFFUSE: boolean;
  495. POINTSIZE: boolean;
  496. FOG: boolean;
  497. SPECULARTERM: boolean;
  498. DIFFUSEFRESNEL: boolean;
  499. OPACITYFRESNEL: boolean;
  500. REFLECTIONFRESNEL: boolean;
  501. REFRACTIONFRESNEL: boolean;
  502. EMISSIVEFRESNEL: boolean;
  503. FRESNEL: boolean;
  504. NORMAL: boolean;
  505. UV1: boolean;
  506. UV2: boolean;
  507. VERTEXCOLOR: boolean;
  508. VERTEXALPHA: boolean;
  509. NUM_BONE_INFLUENCERS: number;
  510. BonesPerMesh: number;
  511. INSTANCES: boolean;
  512. GLOSSINESS: boolean;
  513. ROUGHNESS: boolean;
  514. EMISSIVEASILLUMINATION: boolean;
  515. LINKEMISSIVEWITHDIFFUSE: boolean;
  516. REFLECTIONFRESNELFROMSPECULAR: boolean;
  517. LIGHTMAP: boolean;
  518. USELIGHTMAPASSHADOWMAP: boolean;
  519. REFLECTIONMAP_3D: boolean;
  520. REFLECTIONMAP_SPHERICAL: boolean;
  521. REFLECTIONMAP_PLANAR: boolean;
  522. REFLECTIONMAP_CUBIC: boolean;
  523. REFLECTIONMAP_PROJECTION: boolean;
  524. REFLECTIONMAP_SKYBOX: boolean;
  525. REFLECTIONMAP_EXPLICIT: boolean;
  526. REFLECTIONMAP_EQUIRECTANGULAR: boolean;
  527. REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
  528. REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
  529. INVERTCUBICMAP: boolean;
  530. LOGARITHMICDEPTH: boolean;
  531. REFRACTION: boolean;
  532. REFRACTIONMAP_3D: boolean;
  533. REFLECTIONOVERALPHA: boolean;
  534. TWOSIDEDLIGHTING: boolean;
  535. SHADOWFLOAT: boolean;
  536. MORPHTARGETS: boolean;
  537. MORPHTARGETS_NORMAL: boolean;
  538. MORPHTARGETS_TANGENT: boolean;
  539. NUM_MORPH_INFLUENCERS: number;
  540. IMAGEPROCESSING: boolean;
  541. VIGNETTE: boolean;
  542. VIGNETTEBLENDMODEMULTIPLY: boolean;
  543. VIGNETTEBLENDMODEOPAQUE: boolean;
  544. TONEMAPPING: boolean;
  545. CONTRAST: boolean;
  546. COLORCURVES: boolean;
  547. COLORGRADING: boolean;
  548. COLORGRADING3D: boolean;
  549. SAMPLER3DGREENDEPTH: boolean;
  550. SAMPLER3DBGRMAP: boolean;
  551. IMAGEPROCESSINGPOSTPROCESS: boolean;
  552. EXPOSURE: boolean;
  553. constructor();
  554. setReflectionMode(modeToEnable: string): void;
  555. }
  556. class StandardMaterial_OldVer extends PushMaterial {
  557. private _diffuseTexture;
  558. diffuseTexture: BaseTexture;
  559. private _ambientTexture;
  560. ambientTexture: BaseTexture;
  561. private _opacityTexture;
  562. opacityTexture: BaseTexture;
  563. private _reflectionTexture;
  564. reflectionTexture: BaseTexture;
  565. private _emissiveTexture;
  566. emissiveTexture: BaseTexture;
  567. private _specularTexture;
  568. specularTexture: BaseTexture;
  569. private _bumpTexture;
  570. bumpTexture: BaseTexture;
  571. private _lightmapTexture;
  572. lightmapTexture: BaseTexture;
  573. private _refractionTexture;
  574. refractionTexture: BaseTexture;
  575. ambientColor: Color3;
  576. diffuseColor: Color3;
  577. specularColor: Color3;
  578. emissiveColor: Color3;
  579. specularPower: number;
  580. private _useAlphaFromDiffuseTexture;
  581. useAlphaFromDiffuseTexture: boolean;
  582. private _useEmissiveAsIllumination;
  583. useEmissiveAsIllumination: boolean;
  584. private _linkEmissiveWithDiffuse;
  585. linkEmissiveWithDiffuse: boolean;
  586. private _useSpecularOverAlpha;
  587. useSpecularOverAlpha: boolean;
  588. private _useReflectionOverAlpha;
  589. useReflectionOverAlpha: boolean;
  590. private _disableLighting;
  591. disableLighting: boolean;
  592. private _useParallax;
  593. useParallax: boolean;
  594. private _useParallaxOcclusion;
  595. useParallaxOcclusion: boolean;
  596. parallaxScaleBias: number;
  597. private _roughness;
  598. roughness: number;
  599. indexOfRefraction: number;
  600. invertRefractionY: boolean;
  601. private _useLightmapAsShadowmap;
  602. useLightmapAsShadowmap: boolean;
  603. private _diffuseFresnelParameters;
  604. diffuseFresnelParameters: FresnelParameters;
  605. private _opacityFresnelParameters;
  606. opacityFresnelParameters: FresnelParameters;
  607. private _reflectionFresnelParameters;
  608. reflectionFresnelParameters: FresnelParameters;
  609. private _refractionFresnelParameters;
  610. refractionFresnelParameters: FresnelParameters;
  611. private _emissiveFresnelParameters;
  612. emissiveFresnelParameters: FresnelParameters;
  613. private _useReflectionFresnelFromSpecular;
  614. useReflectionFresnelFromSpecular: boolean;
  615. private _useGlossinessFromSpecularMapAlpha;
  616. useGlossinessFromSpecularMapAlpha: boolean;
  617. private _maxSimultaneousLights;
  618. maxSimultaneousLights: number;
  619. /**
  620. * If sets to true, x component of normal map value will invert (x = 1.0 - x).
  621. */
  622. private _invertNormalMapX;
  623. invertNormalMapX: boolean;
  624. /**
  625. * If sets to true, y component of normal map value will invert (y = 1.0 - y).
  626. */
  627. private _invertNormalMapY;
  628. invertNormalMapY: boolean;
  629. /**
  630. * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
  631. */
  632. private _twoSidedLighting;
  633. twoSidedLighting: boolean;
  634. /**
  635. * Default configuration related to image processing available in the standard Material.
  636. */
  637. protected _imageProcessingConfiguration: ImageProcessingConfiguration;
  638. /**
  639. * Gets the image processing configuration used either in this material.
  640. */
  641. /**
  642. * Sets the Default image processing configuration used either in the this material.
  643. *
  644. * If sets to null, the scene one is in use.
  645. */
  646. imageProcessingConfiguration: ImageProcessingConfiguration;
  647. /**
  648. * Keep track of the image processing observer to allow dispose and replace.
  649. */
  650. private _imageProcessingObserver;
  651. /**
  652. * Attaches a new image processing configuration to the Standard Material.
  653. * @param configuration
  654. */
  655. protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
  656. /**
  657. * Gets wether the color curves effect is enabled.
  658. */
  659. /**
  660. * Sets wether the color curves effect is enabled.
  661. */
  662. cameraColorCurvesEnabled: boolean;
  663. /**
  664. * Gets wether the color grading effect is enabled.
  665. */
  666. /**
  667. * Gets wether the color grading effect is enabled.
  668. */
  669. cameraColorGradingEnabled: boolean;
  670. /**
  671. * Gets wether tonemapping is enabled or not.
  672. */
  673. /**
  674. * Sets wether tonemapping is enabled or not
  675. */
  676. cameraToneMappingEnabled: boolean;
  677. /**
  678. * The camera exposure used on this material.
  679. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  680. * This corresponds to a photographic exposure.
  681. */
  682. /**
  683. * The camera exposure used on this material.
  684. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  685. * This corresponds to a photographic exposure.
  686. */
  687. cameraExposure: number;
  688. /**
  689. * Gets The camera contrast used on this material.
  690. */
  691. /**
  692. * Sets The camera contrast used on this material.
  693. */
  694. cameraContrast: number;
  695. /**
  696. * Gets the Color Grading 2D Lookup Texture.
  697. */
  698. /**
  699. * Sets the Color Grading 2D Lookup Texture.
  700. */
  701. cameraColorGradingTexture: Nullable<BaseTexture>;
  702. customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer) => string;
  703. protected _renderTargets: SmartArray<RenderTargetTexture>;
  704. protected _worldViewProjectionMatrix: Matrix;
  705. protected _globalAmbientColor: Color3;
  706. protected _useLogarithmicDepth: boolean;
  707. constructor(name: string, scene: Scene);
  708. getClassName(): string;
  709. useLogarithmicDepth: boolean;
  710. needAlphaBlending(): boolean;
  711. needAlphaTesting(): boolean;
  712. protected _shouldUseAlphaFromDiffuseTexture(): boolean;
  713. getAlphaTestTexture(): BaseTexture;
  714. /**
  715. * Child classes can use it to update shaders
  716. */
  717. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  718. buildUniformLayout(): void;
  719. unbind(): void;
  720. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  721. getAnimatables(): IAnimatable[];
  722. getActiveTextures(): BaseTexture[];
  723. dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
  724. clone(name: string): StandardMaterial_OldVer;
  725. serialize(): any;
  726. static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial_OldVer;
  727. static _DiffuseTextureEnabled: boolean;
  728. static DiffuseTextureEnabled: boolean;
  729. static _AmbientTextureEnabled: boolean;
  730. static AmbientTextureEnabled: boolean;
  731. static _OpacityTextureEnabled: boolean;
  732. static OpacityTextureEnabled: boolean;
  733. static _ReflectionTextureEnabled: boolean;
  734. static ReflectionTextureEnabled: boolean;
  735. static _EmissiveTextureEnabled: boolean;
  736. static EmissiveTextureEnabled: boolean;
  737. static _SpecularTextureEnabled: boolean;
  738. static SpecularTextureEnabled: boolean;
  739. static _BumpTextureEnabled: boolean;
  740. static BumpTextureEnabled: boolean;
  741. static _LightmapTextureEnabled: boolean;
  742. static LightmapTextureEnabled: boolean;
  743. static _RefractionTextureEnabled: boolean;
  744. static RefractionTextureEnabled: boolean;
  745. static _ColorGradingTextureEnabled: boolean;
  746. static ColorGradingTextureEnabled: boolean;
  747. static _FresnelEnabled: boolean;
  748. static FresnelEnabled: boolean;
  749. }
  750. class CustomShaderStructure {
  751. FragmentStore: string;
  752. VertexStore: string;
  753. constructor();
  754. }
  755. class ShaderSpecialParts {
  756. constructor();
  757. Fragment_Begin: string;
  758. Fragment_Definitions: string;
  759. Fragment_MainBegin: string;
  760. Fragment_Custom_Diffuse: string;
  761. Fragment_Custom_Alpha: string;
  762. Fragment_Before_FragColor: string;
  763. Vertex_Begin: string;
  764. Vertex_Definitions: string;
  765. Vertex_MainBegin: string;
  766. Vertex_Before_PositionUpdated: string;
  767. Vertex_Before_NormalUpdated: string;
  768. }
  769. class ShaderForVer3_0 extends CustomShaderStructure {
  770. constructor();
  771. }
  772. class StandardShaderVersions {
  773. static Ver3_0: string;
  774. }
  775. class CustomMaterial extends StandardMaterial_OldVer {
  776. static ShaderIndexer: number;
  777. CustomParts: ShaderSpecialParts;
  778. ShaderVersion: CustomShaderStructure;
  779. _isCreatedShader: boolean;
  780. _createdShaderName: string;
  781. _customUniform: string[];
  782. _newUniforms: string[];
  783. _newUniformInstances: any[];
  784. _newSamplerInstances: Texture[];
  785. AttachAfterBind(mesh: Mesh, effect: Effect): void;
  786. ReviewUniform(name: string, arr: string[]): string[];
  787. Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer): string;
  788. SelectVersion(ver: string): void;
  789. constructor(name: string, scene: Scene);
  790. AddUniform(name: string, kind: string, param: any): CustomMaterial;
  791. Fragment_Begin(shaderPart: string): CustomMaterial;
  792. Fragment_Definitions(shaderPart: string): CustomMaterial;
  793. Fragment_MainBegin(shaderPart: string): CustomMaterial;
  794. Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial;
  795. Fragment_Custom_Alpha(shaderPart: string): CustomMaterial;
  796. Fragment_Before_FragColor(shaderPart: string): CustomMaterial;
  797. Vertex_Begin(shaderPart: string): CustomMaterial;
  798. Vertex_Definitions(shaderPart: string): CustomMaterial;
  799. Vertex_MainBegin(shaderPart: string): CustomMaterial;
  800. Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial;
  801. Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial;
  802. }
  803. }
  804. declare module BABYLON {
  805. class CellMaterial extends PushMaterial {
  806. private _diffuseTexture;
  807. diffuseTexture: BaseTexture;
  808. diffuseColor: Color3;
  809. _computeHighLevel: boolean;
  810. computeHighLevel: boolean;
  811. private _disableLighting;
  812. disableLighting: boolean;
  813. private _maxSimultaneousLights;
  814. maxSimultaneousLights: number;
  815. private _renderId;
  816. constructor(name: string, scene: Scene);
  817. needAlphaBlending(): boolean;
  818. needAlphaTesting(): boolean;
  819. getAlphaTestTexture(): Nullable<BaseTexture>;
  820. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  821. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  822. getAnimatables(): IAnimatable[];
  823. getActiveTextures(): BaseTexture[];
  824. hasTexture(texture: BaseTexture): boolean;
  825. dispose(forceDisposeEffect?: boolean): void;
  826. getClassName(): string;
  827. clone(name: string): CellMaterial;
  828. serialize(): any;
  829. static Parse(source: any, scene: Scene, rootUrl: string): CellMaterial;
  830. }
  831. }
  832. declare namespace BABYLON {
  833. /**
  834. * Background material
  835. */
  836. class BackgroundMaterial extends BABYLON.PushMaterial {
  837. /**
  838. * Key light Color (multiply against the R channel of the environement texture)
  839. */
  840. protected _primaryColor: Color3;
  841. primaryColor: Color3;
  842. /**
  843. * Key light Level (allowing HDR output of the background)
  844. */
  845. protected _primaryLevel: float;
  846. primaryLevel: float;
  847. /**
  848. * Secondary light Color (multiply against the G channel of the environement texture)
  849. */
  850. protected _secondaryColor: Color3;
  851. secondaryColor: Color3;
  852. /**
  853. * Secondary light Level (allowing HDR output of the background)
  854. */
  855. protected _secondaryLevel: float;
  856. secondaryLevel: float;
  857. /**
  858. * Tertiary light Color (multiply against the B channel of the environement texture)
  859. */
  860. protected _tertiaryColor: Color3;
  861. tertiaryColor: Color3;
  862. /**
  863. * Tertiary light Level (allowing HDR output of the background)
  864. */
  865. protected _tertiaryLevel: float;
  866. tertiaryLevel: float;
  867. /**
  868. * Reflection Texture used in the material.
  869. * Should be author in a specific way for the best result (refer to the documentation).
  870. */
  871. protected _reflectionTexture: Nullable<BaseTexture>;
  872. reflectionTexture: Nullable<BaseTexture>;
  873. /**
  874. * Reflection Texture level of blur.
  875. *
  876. * Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the
  877. * texture twice.
  878. */
  879. protected _reflectionBlur: float;
  880. reflectionBlur: float;
  881. /**
  882. * Diffuse Texture used in the material.
  883. * Should be author in a specific way for the best result (refer to the documentation).
  884. */
  885. protected _diffuseTexture: Nullable<BaseTexture>;
  886. diffuseTexture: Nullable<BaseTexture>;
  887. /**
  888. * Specify the list of lights casting shadow on the material.
  889. * All scene shadow lights will be included if null.
  890. */
  891. protected _shadowLights: Nullable<IShadowLight[]>;
  892. shadowLights: Nullable<IShadowLight[]>;
  893. /**
  894. * For the lights having a blurred shadow generator, this can add a second blur pass in order to reach
  895. * soft lighting on the background.
  896. */
  897. protected _shadowBlurScale: int;
  898. shadowBlurScale: int;
  899. /**
  900. * Helps adjusting the shadow to a softer level if required.
  901. * 0 means black shadows and 1 means no shadows.
  902. */
  903. protected _shadowLevel: float;
  904. shadowLevel: float;
  905. /**
  906. * In case of opacity Fresnel or reflection falloff, this is use as a scene center.
  907. * It is usually zero but might be interesting to modify according to your setup.
  908. */
  909. protected _sceneCenter: Vector3;
  910. sceneCenter: Vector3;
  911. /**
  912. * This helps specifying that the material is falling off to the sky box at grazing angle.
  913. * This helps ensuring a nice transition when the camera goes under the ground.
  914. */
  915. protected _opacityFresnel: boolean;
  916. opacityFresnel: boolean;
  917. /**
  918. * This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle.
  919. * This helps adding a mirror texture on the ground.
  920. */
  921. protected _reflectionFresnel: boolean;
  922. reflectionFresnel: boolean;
  923. /**
  924. * This helps specifying the falloff radius off the reflection texture from the sceneCenter.
  925. * This helps adding a nice falloff effect to the reflection if used as a mirror for instance.
  926. */
  927. protected _reflectionFalloffDistance: number;
  928. reflectionFalloffDistance: number;
  929. /**
  930. * This specifies the weight of the reflection against the background in case of reflection Fresnel.
  931. */
  932. protected _reflectionAmount: number;
  933. reflectionAmount: number;
  934. /**
  935. * This specifies the weight of the reflection at grazing angle.
  936. */
  937. protected _reflectionReflectance0: number;
  938. reflectionReflectance0: number;
  939. /**
  940. * This specifies the weight of the reflection at a perpendicular point of view.
  941. */
  942. protected _reflectionReflectance90: number;
  943. reflectionReflectance90: number;
  944. /**
  945. * Helps to directly use the maps channels instead of their level.
  946. */
  947. protected _useRGBColor: boolean;
  948. useRGBColor: boolean;
  949. /**
  950. * Number of Simultaneous lights allowed on the material.
  951. */
  952. private _maxSimultaneousLights;
  953. maxSimultaneousLights: int;
  954. /**
  955. * Default configuration related to image processing available in the Background Material.
  956. */
  957. protected _imageProcessingConfiguration: ImageProcessingConfiguration;
  958. /**
  959. * Keep track of the image processing observer to allow dispose and replace.
  960. */
  961. private _imageProcessingObserver;
  962. /**
  963. * Attaches a new image processing configuration to the PBR Material.
  964. * @param configuration (if null the scene configuration will be use)
  965. */
  966. protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
  967. /**
  968. * Gets the image processing configuration used either in this material.
  969. */
  970. /**
  971. * Sets the Default image processing configuration used either in the this material.
  972. *
  973. * If sets to null, the scene one is in use.
  974. */
  975. imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;
  976. /**
  977. * Gets wether the color curves effect is enabled.
  978. */
  979. /**
  980. * Sets wether the color curves effect is enabled.
  981. */
  982. cameraColorCurvesEnabled: boolean;
  983. /**
  984. * Gets wether the color grading effect is enabled.
  985. */
  986. /**
  987. * Gets wether the color grading effect is enabled.
  988. */
  989. cameraColorGradingEnabled: boolean;
  990. /**
  991. * Gets wether tonemapping is enabled or not.
  992. */
  993. /**
  994. * Sets wether tonemapping is enabled or not
  995. */
  996. cameraToneMappingEnabled: boolean;
  997. /**
  998. * The camera exposure used on this material.
  999. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  1000. * This corresponds to a photographic exposure.
  1001. */
  1002. /**
  1003. * The camera exposure used on this material.
  1004. * This property is here and not in the camera to allow controlling exposure without full screen post process.
  1005. * This corresponds to a photographic exposure.
  1006. */
  1007. cameraExposure: float;
  1008. /**
  1009. * Gets The camera contrast used on this material.
  1010. */
  1011. /**
  1012. * Sets The camera contrast used on this material.
  1013. */
  1014. cameraContrast: float;
  1015. /**
  1016. * Gets the Color Grading 2D Lookup Texture.
  1017. */
  1018. /**
  1019. * Sets the Color Grading 2D Lookup Texture.
  1020. */
  1021. cameraColorGradingTexture: Nullable<BaseTexture>;
  1022. /**
  1023. * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
  1024. * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
  1025. * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
  1026. * corresponding to low luminance, medium luminance, and high luminance areas respectively.
  1027. */
  1028. /**
  1029. * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
  1030. * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
  1031. * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
  1032. * corresponding to low luminance, medium luminance, and high luminance areas respectively.
  1033. */
  1034. cameraColorCurves: Nullable<ColorCurves>;
  1035. private _renderTargets;
  1036. private _reflectionControls;
  1037. /**
  1038. * constructor
  1039. * @param name The name of the material
  1040. * @param scene The scene to add the material to
  1041. */
  1042. constructor(name: string, scene: BABYLON.Scene);
  1043. /**
  1044. * The entire material has been created in order to prevent overdraw.
  1045. * @returns false
  1046. */
  1047. needAlphaTesting(): boolean;
  1048. /**
  1049. * The entire material has been created in order to prevent overdraw.
  1050. * @returns true if blending is enable
  1051. */
  1052. needAlphaBlending(): boolean;
  1053. /**
  1054. * Checks wether the material is ready to be rendered for a given mesh.
  1055. * @param mesh The mesh to render
  1056. * @param subMesh The submesh to check against
  1057. * @param useInstances Specify wether or not the material is used with instances
  1058. */
  1059. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  1060. /**
  1061. * Build the uniform buffer used in the material.
  1062. */
  1063. buildUniformLayout(): void;
  1064. /**
  1065. * Unbind the material.
  1066. */
  1067. unbind(): void;
  1068. /**
  1069. * Bind only the world matrix to the material.
  1070. * @param world The world matrix to bind.
  1071. */
  1072. bindOnlyWorldMatrix(world: Matrix): void;
  1073. /**
  1074. * Bind the material for a dedicated submeh (every used meshes will be considered opaque).
  1075. * @param world The world matrix to bind.
  1076. * @param subMesh The submesh to bind for.
  1077. */
  1078. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  1079. /**
  1080. * Dispose the material.
  1081. * @forceDisposeEffect Force disposal of the associated effect.
  1082. * @forceDisposeTextures Force disposal of the associated textures.
  1083. */
  1084. dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
  1085. /**
  1086. * Clones the material.
  1087. * @name The cloned name.
  1088. * @returns The cloned material.
  1089. */
  1090. clone(name: string): BackgroundMaterial;
  1091. /**
  1092. * Serializes the current material to its JSON representation.
  1093. * @returns The JSON representation.
  1094. */
  1095. serialize(): any;
  1096. /**
  1097. * Gets the class name of the material
  1098. * @returns "BackgroundMaterial"
  1099. */
  1100. getClassName(): string;
  1101. /**
  1102. * Parse a JSON input to create back a background material.
  1103. * @param source
  1104. * @param scene
  1105. * @param rootUrl
  1106. * @returns the instantiated BackgroundMaterial.
  1107. */
  1108. static Parse(source: any, scene: Scene, rootUrl: string): BackgroundMaterial;
  1109. }
  1110. }