babylonjs.postProcess.d.ts 7.5 KB

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