babylonjs.postProcess.module.d.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. declare module "babylonjs-post-process/asciiArt/asciiart.fragment" {
  2. /** @hidden */
  3. export var asciiartPixelShader: {
  4. name: string;
  5. shader: string;
  6. };
  7. }
  8. declare module "babylonjs-post-process/asciiArt/asciiArtPostProcess" {
  9. import { Nullable } from "babylonjs/types";
  10. import { Camera } from "babylonjs/Cameras/camera";
  11. import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
  12. import { PostProcess } from "babylonjs/PostProcesses/postProcess";
  13. import { Scene } from "babylonjs/scene";
  14. import "babylonjs-post-process/asciiArt/asciiart.fragment";
  15. /**
  16. * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
  17. *
  18. * It basically takes care rendering the font front the given font size to a texture.
  19. * This is used later on in the postprocess.
  20. */
  21. export class AsciiArtFontTexture extends BaseTexture {
  22. private _font;
  23. private _text;
  24. private _charSize;
  25. /**
  26. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  27. */
  28. get charSize(): number;
  29. /**
  30. * Create a new instance of the Ascii Art FontTexture class
  31. * @param name the name of the texture
  32. * @param font the font to use, use the W3C CSS notation
  33. * @param text the caracter set to use in the rendering.
  34. * @param scene the scene that owns the texture
  35. */
  36. constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
  37. /**
  38. * Gets the max char width of a font.
  39. * @param font the font to use, use the W3C CSS notation
  40. * @return the max char width
  41. */
  42. private getFontWidth;
  43. /**
  44. * Gets the max char height of a font.
  45. * @param font the font to use, use the W3C CSS notation
  46. * @return the max char height
  47. */
  48. private getFontHeight;
  49. /**
  50. * Clones the current AsciiArtTexture.
  51. * @return the clone of the texture.
  52. */
  53. clone(): AsciiArtFontTexture;
  54. /**
  55. * Parses a json object representing the texture and returns an instance of it.
  56. * @param source the source JSON representation
  57. * @param scene the scene to create the texture for
  58. * @return the parsed texture
  59. */
  60. static Parse(source: any, scene: Scene): AsciiArtFontTexture;
  61. }
  62. /**
  63. * Option available in the Ascii Art Post Process.
  64. */
  65. export interface IAsciiArtPostProcessOptions {
  66. /**
  67. * The font to use following the w3c font definition.
  68. */
  69. font?: string;
  70. /**
  71. * The character set to use in the postprocess.
  72. */
  73. characterSet?: string;
  74. /**
  75. * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
  76. * This number is defined between 0 and 1;
  77. */
  78. mixToTile?: number;
  79. /**
  80. * This defines the amount you want to mix the normal rendering pass in the ascii art.
  81. * This number is defined between 0 and 1;
  82. */
  83. mixToNormal?: number;
  84. }
  85. /**
  86. * AsciiArtPostProcess helps rendering everithing in Ascii Art.
  87. *
  88. * Simmply add it to your scene and let the nerd that lives in you have fun.
  89. * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
  90. */
  91. export class AsciiArtPostProcess extends PostProcess {
  92. /**
  93. * The font texture used to render the char in the post process.
  94. */
  95. private _asciiArtFontTexture;
  96. /**
  97. * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
  98. * This number is defined between 0 and 1;
  99. */
  100. mixToTile: number;
  101. /**
  102. * This defines the amount you want to mix the normal rendering pass in the ascii art.
  103. * This number is defined between 0 and 1;
  104. */
  105. mixToNormal: number;
  106. /**
  107. * Instantiates a new Ascii Art Post Process.
  108. * @param name the name to give to the postprocess
  109. * @camera the camera to apply the post process to.
  110. * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
  111. */
  112. constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
  113. }
  114. }
  115. declare module "babylonjs-post-process/asciiArt/index" {
  116. export * from "babylonjs-post-process/asciiArt/asciiArtPostProcess";
  117. }
  118. declare module "babylonjs-post-process/digitalRain/digitalrain.fragment" {
  119. /** @hidden */
  120. export var digitalrainPixelShader: {
  121. name: string;
  122. shader: string;
  123. };
  124. }
  125. declare module "babylonjs-post-process/digitalRain/digitalRainPostProcess" {
  126. import { Nullable } from "babylonjs/types";
  127. import { Camera } from "babylonjs/Cameras/camera";
  128. import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
  129. import { PostProcess } from "babylonjs/PostProcesses/postProcess";
  130. import { Scene } from "babylonjs/scene";
  131. import "babylonjs-post-process/digitalRain/digitalrain.fragment";
  132. /**
  133. * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
  134. *
  135. * It basically takes care rendering the font front the given font size to a texture.
  136. * This is used later on in the postprocess.
  137. */
  138. export class DigitalRainFontTexture extends BaseTexture {
  139. private _font;
  140. private _text;
  141. private _charSize;
  142. /**
  143. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  144. */
  145. get charSize(): number;
  146. /**
  147. * Create a new instance of the Digital Rain FontTexture class
  148. * @param name the name of the texture
  149. * @param font the font to use, use the W3C CSS notation
  150. * @param text the caracter set to use in the rendering.
  151. * @param scene the scene that owns the texture
  152. */
  153. constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
  154. /**
  155. * Gets the max char width of a font.
  156. * @param font the font to use, use the W3C CSS notation
  157. * @return the max char width
  158. */
  159. private getFontWidth;
  160. /**
  161. * Gets the max char height of a font.
  162. * @param font the font to use, use the W3C CSS notation
  163. * @return the max char height
  164. */
  165. private getFontHeight;
  166. /**
  167. * Clones the current DigitalRainFontTexture.
  168. * @return the clone of the texture.
  169. */
  170. clone(): DigitalRainFontTexture;
  171. /**
  172. * Parses a json object representing the texture and returns an instance of it.
  173. * @param source the source JSON representation
  174. * @param scene the scene to create the texture for
  175. * @return the parsed texture
  176. */
  177. static Parse(source: any, scene: Scene): DigitalRainFontTexture;
  178. }
  179. /**
  180. * Option available in the Digital Rain Post Process.
  181. */
  182. export interface IDigitalRainPostProcessOptions {
  183. /**
  184. * The font to use following the w3c font definition.
  185. */
  186. font?: string;
  187. /**
  188. * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
  189. * This number is defined between 0 and 1;
  190. */
  191. mixToTile?: number;
  192. /**
  193. * This defines the amount you want to mix the normal rendering pass in the digital rain.
  194. * This number is defined between 0 and 1;
  195. */
  196. mixToNormal?: number;
  197. }
  198. /**
  199. * DigitalRainPostProcess helps rendering everithing in digital rain.
  200. *
  201. * Simmply add it to your scene and let the nerd that lives in you have fun.
  202. * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
  203. */
  204. export class DigitalRainPostProcess extends PostProcess {
  205. /**
  206. * The font texture used to render the char in the post process.
  207. */
  208. private _digitalRainFontTexture;
  209. /**
  210. * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
  211. * This number is defined between 0 and 1;
  212. */
  213. mixToTile: number;
  214. /**
  215. * This defines the amount you want to mix the normal rendering pass in the digital rain.
  216. * This number is defined between 0 and 1;
  217. */
  218. mixToNormal: number;
  219. /**
  220. * Instantiates a new Digital Rain Post Process.
  221. * @param name the name to give to the postprocess
  222. * @camera the camera to apply the post process to.
  223. * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
  224. */
  225. constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
  226. }
  227. }
  228. declare module "babylonjs-post-process/digitalRain/index" {
  229. export * from "babylonjs-post-process/digitalRain/digitalRainPostProcess";
  230. }
  231. declare module "babylonjs-post-process/index" {
  232. export * from "babylonjs-post-process/asciiArt/index";
  233. export * from "babylonjs-post-process/digitalRain/index";
  234. }
  235. declare module "babylonjs-post-process/legacy/legacy-asciiArt" {
  236. export * from "babylonjs-post-process/asciiArt/index";
  237. }
  238. declare module "babylonjs-post-process/legacy/legacy-digitalRain" {
  239. export * from "babylonjs-post-process/digitalRain/index";
  240. }
  241. declare module "babylonjs-post-process/legacy/legacy" {
  242. export * from "babylonjs-post-process/index";
  243. }
  244. declare module "babylonjs-post-process" {
  245. export * from "babylonjs-post-process/legacy/legacy";
  246. }
  247. declare module BABYLON {
  248. /** @hidden */
  249. export var asciiartPixelShader: {
  250. name: string;
  251. shader: string;
  252. };
  253. }
  254. declare module BABYLON {
  255. /**
  256. * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
  257. *
  258. * It basically takes care rendering the font front the given font size to a texture.
  259. * This is used later on in the postprocess.
  260. */
  261. export class AsciiArtFontTexture extends BABYLON.BaseTexture {
  262. private _font;
  263. private _text;
  264. private _charSize;
  265. /**
  266. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  267. */
  268. get charSize(): number;
  269. /**
  270. * Create a new instance of the Ascii Art FontTexture class
  271. * @param name the name of the texture
  272. * @param font the font to use, use the W3C CSS notation
  273. * @param text the caracter set to use in the rendering.
  274. * @param scene the scene that owns the texture
  275. */
  276. constructor(name: string, font: string, text: string, scene?: BABYLON.Nullable<BABYLON.Scene>);
  277. /**
  278. * Gets the max char width of a font.
  279. * @param font the font to use, use the W3C CSS notation
  280. * @return the max char width
  281. */
  282. private getFontWidth;
  283. /**
  284. * Gets the max char height of a font.
  285. * @param font the font to use, use the W3C CSS notation
  286. * @return the max char height
  287. */
  288. private getFontHeight;
  289. /**
  290. * Clones the current AsciiArtTexture.
  291. * @return the clone of the texture.
  292. */
  293. clone(): AsciiArtFontTexture;
  294. /**
  295. * Parses a json object representing the texture and returns an instance of it.
  296. * @param source the source JSON representation
  297. * @param scene the scene to create the texture for
  298. * @return the parsed texture
  299. */
  300. static Parse(source: any, scene: BABYLON.Scene): AsciiArtFontTexture;
  301. }
  302. /**
  303. * Option available in the Ascii Art Post Process.
  304. */
  305. export interface IAsciiArtPostProcessOptions {
  306. /**
  307. * The font to use following the w3c font definition.
  308. */
  309. font?: string;
  310. /**
  311. * The character set to use in the postprocess.
  312. */
  313. characterSet?: string;
  314. /**
  315. * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
  316. * This number is defined between 0 and 1;
  317. */
  318. mixToTile?: number;
  319. /**
  320. * This defines the amount you want to mix the normal rendering pass in the ascii art.
  321. * This number is defined between 0 and 1;
  322. */
  323. mixToNormal?: number;
  324. }
  325. /**
  326. * AsciiArtPostProcess helps rendering everithing in Ascii Art.
  327. *
  328. * Simmply add it to your scene and let the nerd that lives in you have fun.
  329. * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
  330. */
  331. export class AsciiArtPostProcess extends BABYLON.PostProcess {
  332. /**
  333. * The font texture used to render the char in the post process.
  334. */
  335. private _asciiArtFontTexture;
  336. /**
  337. * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
  338. * This number is defined between 0 and 1;
  339. */
  340. mixToTile: number;
  341. /**
  342. * This defines the amount you want to mix the normal rendering pass in the ascii art.
  343. * This number is defined between 0 and 1;
  344. */
  345. mixToNormal: number;
  346. /**
  347. * Instantiates a new Ascii Art Post Process.
  348. * @param name the name to give to the postprocess
  349. * @camera the camera to apply the post process to.
  350. * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
  351. */
  352. constructor(name: string, camera: BABYLON.Camera, options?: string | IAsciiArtPostProcessOptions);
  353. }
  354. }
  355. declare module BABYLON {
  356. /** @hidden */
  357. export var digitalrainPixelShader: {
  358. name: string;
  359. shader: string;
  360. };
  361. }
  362. declare module BABYLON {
  363. /**
  364. * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
  365. *
  366. * It basically takes care rendering the font front the given font size to a texture.
  367. * This is used later on in the postprocess.
  368. */
  369. export class DigitalRainFontTexture extends BABYLON.BaseTexture {
  370. private _font;
  371. private _text;
  372. private _charSize;
  373. /**
  374. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  375. */
  376. get charSize(): number;
  377. /**
  378. * Create a new instance of the Digital Rain FontTexture class
  379. * @param name the name of the texture
  380. * @param font the font to use, use the W3C CSS notation
  381. * @param text the caracter set to use in the rendering.
  382. * @param scene the scene that owns the texture
  383. */
  384. constructor(name: string, font: string, text: string, scene?: BABYLON.Nullable<BABYLON.Scene>);
  385. /**
  386. * Gets the max char width of a font.
  387. * @param font the font to use, use the W3C CSS notation
  388. * @return the max char width
  389. */
  390. private getFontWidth;
  391. /**
  392. * Gets the max char height of a font.
  393. * @param font the font to use, use the W3C CSS notation
  394. * @return the max char height
  395. */
  396. private getFontHeight;
  397. /**
  398. * Clones the current DigitalRainFontTexture.
  399. * @return the clone of the texture.
  400. */
  401. clone(): DigitalRainFontTexture;
  402. /**
  403. * Parses a json object representing the texture and returns an instance of it.
  404. * @param source the source JSON representation
  405. * @param scene the scene to create the texture for
  406. * @return the parsed texture
  407. */
  408. static Parse(source: any, scene: BABYLON.Scene): DigitalRainFontTexture;
  409. }
  410. /**
  411. * Option available in the Digital Rain Post Process.
  412. */
  413. export interface IDigitalRainPostProcessOptions {
  414. /**
  415. * The font to use following the w3c font definition.
  416. */
  417. font?: string;
  418. /**
  419. * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
  420. * This number is defined between 0 and 1;
  421. */
  422. mixToTile?: number;
  423. /**
  424. * This defines the amount you want to mix the normal rendering pass in the digital rain.
  425. * This number is defined between 0 and 1;
  426. */
  427. mixToNormal?: number;
  428. }
  429. /**
  430. * DigitalRainPostProcess helps rendering everithing in digital rain.
  431. *
  432. * Simmply add it to your scene and let the nerd that lives in you have fun.
  433. * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
  434. */
  435. export class DigitalRainPostProcess extends BABYLON.PostProcess {
  436. /**
  437. * The font texture used to render the char in the post process.
  438. */
  439. private _digitalRainFontTexture;
  440. /**
  441. * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
  442. * This number is defined between 0 and 1;
  443. */
  444. mixToTile: number;
  445. /**
  446. * This defines the amount you want to mix the normal rendering pass in the digital rain.
  447. * This number is defined between 0 and 1;
  448. */
  449. mixToNormal: number;
  450. /**
  451. * Instantiates a new Digital Rain Post Process.
  452. * @param name the name to give to the postprocess
  453. * @camera the camera to apply the post process to.
  454. * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
  455. */
  456. constructor(name: string, camera: BABYLON.Camera, options?: string | IDigitalRainPostProcessOptions);
  457. }
  458. }