babylonjs.postProcess.d.ts 6.9 KB

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