babylon.postProcesses.d.ts 7.6 KB

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