babylon.postProcessLibrary.module.d.ts 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*BabylonJS Postprocess library*/
  2. // Dependencies for this module:
  3. // ../../../../tools/gulp/babylonjs
  4. export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/asciiArt";
  5. export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/digitalRain";
  6. export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/asciiArt/asciiArtPostProcess";
  7. export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/digitalRain/digitalRainPostProcess";
  8. import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
  9. /**
  10. * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
  11. *
  12. * It basically takes care rendering the font front the given font size to a texture.
  13. * This is used later on in the postprocess.
  14. */
  15. export declare class AsciiArtFontTexture extends BaseTexture {
  16. /**
  17. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  18. */
  19. readonly charSize: number;
  20. /**
  21. * Create a new instance of the Ascii Art FontTexture class
  22. * @param name the name of the texture
  23. * @param font the font to use, use the W3C CSS notation
  24. * @param text the caracter set to use in the rendering.
  25. * @param scene the scene that owns the texture
  26. */
  27. constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
  28. /**
  29. * Clones the current AsciiArtTexture.
  30. * @return the clone of the texture.
  31. */
  32. clone(): AsciiArtFontTexture;
  33. /**
  34. * Parses a json object representing the texture and returns an instance of it.
  35. * @param source the source JSON representation
  36. * @param scene the scene to create the texture for
  37. * @return the parsed texture
  38. */
  39. static Parse(source: any, scene: Scene): AsciiArtFontTexture;
  40. }
  41. /**
  42. * Option available in the Ascii Art Post Process.
  43. */
  44. export interface IAsciiArtPostProcessOptions {
  45. /**
  46. * The font to use following the w3c font definition.
  47. */
  48. font?: string;
  49. /**
  50. * The character set to use in the postprocess.
  51. */
  52. characterSet?: string;
  53. /**
  54. * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
  55. * This number is defined between 0 and 1;
  56. */
  57. mixToTile?: number;
  58. /**
  59. * This defines the amount you want to mix the normal rendering pass in the ascii art.
  60. * This number is defined between 0 and 1;
  61. */
  62. mixToNormal?: number;
  63. }
  64. /**
  65. * AsciiArtPostProcess helps rendering everithing in Ascii Art.
  66. *
  67. * Simmply add it to your scene and let the nerd that lives in you have fun.
  68. * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
  69. */
  70. export declare class AsciiArtPostProcess extends PostProcess {
  71. /**
  72. * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
  73. * This number is defined between 0 and 1;
  74. */
  75. mixToTile: number;
  76. /**
  77. * This defines the amount you want to mix the normal rendering pass in the ascii art.
  78. * This number is defined between 0 and 1;
  79. */
  80. mixToNormal: number;
  81. /**
  82. * Instantiates a new Ascii Art Post Process.
  83. * @param name the name to give to the postprocess
  84. * @camera the camera to apply the post process to.
  85. * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
  86. */
  87. constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
  88. }
  89. import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
  90. /**
  91. * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
  92. *
  93. * It basically takes care rendering the font front the given font size to a texture.
  94. * This is used later on in the postprocess.
  95. */
  96. export declare class DigitalRainFontTexture extends BaseTexture {
  97. /**
  98. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  99. */
  100. readonly charSize: number;
  101. /**
  102. * Create a new instance of the Digital Rain FontTexture class
  103. * @param name the name of the texture
  104. * @param font the font to use, use the W3C CSS notation
  105. * @param text the caracter set to use in the rendering.
  106. * @param scene the scene that owns the texture
  107. */
  108. constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
  109. /**
  110. * Clones the current DigitalRainFontTexture.
  111. * @return the clone of the texture.
  112. */
  113. clone(): DigitalRainFontTexture;
  114. /**
  115. * Parses a json object representing the texture and returns an instance of it.
  116. * @param source the source JSON representation
  117. * @param scene the scene to create the texture for
  118. * @return the parsed texture
  119. */
  120. static Parse(source: any, scene: Scene): DigitalRainFontTexture;
  121. }
  122. /**
  123. * Option available in the Digital Rain Post Process.
  124. */
  125. export interface IDigitalRainPostProcessOptions {
  126. /**
  127. * The font to use following the w3c font definition.
  128. */
  129. font?: string;
  130. /**
  131. * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
  132. * This number is defined between 0 and 1;
  133. */
  134. mixToTile?: number;
  135. /**
  136. * This defines the amount you want to mix the normal rendering pass in the digital rain.
  137. * This number is defined between 0 and 1;
  138. */
  139. mixToNormal?: number;
  140. }
  141. /**
  142. * DigitalRainPostProcess helps rendering everithing in digital rain.
  143. *
  144. * Simmply add it to your scene and let the nerd that lives in you have fun.
  145. * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
  146. */
  147. export declare class DigitalRainPostProcess extends PostProcess {
  148. /**
  149. * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
  150. * This number is defined between 0 and 1;
  151. */
  152. mixToTile: number;
  153. /**
  154. * This defines the amount you want to mix the normal rendering pass in the digital rain.
  155. * This number is defined between 0 and 1;
  156. */
  157. mixToNormal: number;
  158. /**
  159. * Instantiates a new Digital Rain Post Process.
  160. * @param name the name to give to the postprocess
  161. * @camera the camera to apply the post process to.
  162. * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
  163. */
  164. constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
  165. }