babylonjs.postProcess.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. var BABYLON = BABYLON || (typeof require !== 'undefined' && require("babylonjs"));
  2. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  3. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  4. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  5. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  6. return c > 3 && r && Object.defineProperty(target, key, r), r;
  7. };
  8. var __extends = (this && this.__extends) || (function () {
  9. var extendStatics = Object.setPrototypeOf ||
  10. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  11. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. var BABYLON;
  19. (function (BABYLON) {
  20. /**
  21. * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
  22. *
  23. * It basically takes care rendering the font front the given font size to a texture.
  24. * This is used later on in the postprocess.
  25. */
  26. var AsciiArtFontTexture = (function (_super) {
  27. __extends(AsciiArtFontTexture, _super);
  28. /**
  29. * Create a new instance of the Ascii Art FontTexture class
  30. * @param name the name of the texture
  31. * @param font the font to use, use the W3C CSS notation
  32. * @param text the caracter set to use in the rendering.
  33. * @param scene the scene that owns the texture
  34. */
  35. function AsciiArtFontTexture(name, font, text, scene) {
  36. var _this = _super.call(this, scene) || this;
  37. _this.name = name;
  38. _this._text == text;
  39. _this._font == font;
  40. _this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
  41. _this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
  42. //this.anisotropicFilteringLevel = 1;
  43. // Get the font specific info.
  44. var maxCharHeight = _this.getFontHeight(font);
  45. var maxCharWidth = _this.getFontWidth(font);
  46. _this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
  47. // This is an approximate size, but should always be able to fit at least the maxCharCount.
  48. var textureWidth = Math.ceil(_this._charSize * text.length);
  49. var textureHeight = _this._charSize;
  50. // Create the texture that will store the font characters.
  51. _this._texture = scene.getEngine().createDynamicTexture(textureWidth, textureHeight, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
  52. //scene.getEngine().setclamp
  53. var textureSize = _this.getSize();
  54. // Create a canvas with the final size: the one matching the texture.
  55. var canvas = document.createElement("canvas");
  56. canvas.width = textureSize.width;
  57. canvas.height = textureSize.height;
  58. var context = canvas.getContext("2d");
  59. context.textBaseline = "top";
  60. context.font = font;
  61. context.fillStyle = "white";
  62. context.imageSmoothingEnabled = false;
  63. // Sets the text in the texture.
  64. for (var i = 0; i < text.length; i++) {
  65. context.fillText(text[i], i * _this._charSize, -maxCharHeight.offset);
  66. }
  67. // Flush the text in the dynamic texture.
  68. _this.getScene().getEngine().updateDynamicTexture(_this._texture, canvas, false, true);
  69. return _this;
  70. }
  71. Object.defineProperty(AsciiArtFontTexture.prototype, "charSize", {
  72. /**
  73. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  74. */
  75. get: function () {
  76. return this._charSize;
  77. },
  78. enumerable: true,
  79. configurable: true
  80. });
  81. /**
  82. * Gets the max char width of a font.
  83. * @param font the font to use, use the W3C CSS notation
  84. * @return the max char width
  85. */
  86. AsciiArtFontTexture.prototype.getFontWidth = function (font) {
  87. var fontDraw = document.createElement("canvas");
  88. var ctx = fontDraw.getContext('2d');
  89. ctx.fillStyle = 'white';
  90. ctx.font = font;
  91. return ctx.measureText("W").width;
  92. };
  93. // More info here: https://videlais.com/2014/03/16/the-many-and-varied-problems-with-measuring-font-height-for-html5-canvas/
  94. /**
  95. * Gets the max char height of a font.
  96. * @param font the font to use, use the W3C CSS notation
  97. * @return the max char height
  98. */
  99. AsciiArtFontTexture.prototype.getFontHeight = function (font) {
  100. var fontDraw = document.createElement("canvas");
  101. var ctx = fontDraw.getContext('2d');
  102. ctx.fillRect(0, 0, fontDraw.width, fontDraw.height);
  103. ctx.textBaseline = 'top';
  104. ctx.fillStyle = 'white';
  105. ctx.font = font;
  106. ctx.fillText('jH|', 0, 0);
  107. var pixels = ctx.getImageData(0, 0, fontDraw.width, fontDraw.height).data;
  108. var start = -1;
  109. var end = -1;
  110. for (var row = 0; row < fontDraw.height; row++) {
  111. for (var column = 0; column < fontDraw.width; column++) {
  112. var index = (row * fontDraw.width + column) * 4;
  113. if (pixels[index] === 0) {
  114. if (column === fontDraw.width - 1 && start !== -1) {
  115. end = row;
  116. row = fontDraw.height;
  117. break;
  118. }
  119. continue;
  120. }
  121. else {
  122. if (start === -1) {
  123. start = row;
  124. }
  125. break;
  126. }
  127. }
  128. }
  129. return { height: (end - start) + 1, offset: start - 1 };
  130. };
  131. /**
  132. * Clones the current AsciiArtTexture.
  133. * @return the clone of the texture.
  134. */
  135. AsciiArtFontTexture.prototype.clone = function () {
  136. return new AsciiArtFontTexture(this.name, this._font, this._text, this.getScene());
  137. };
  138. /**
  139. * Parses a json object representing the texture and returns an instance of it.
  140. * @param source the source JSON representation
  141. * @param scene the scene to create the texture for
  142. * @return the parsed texture
  143. */
  144. AsciiArtFontTexture.Parse = function (source, scene) {
  145. var texture = BABYLON.SerializationHelper.Parse(function () { return new AsciiArtFontTexture(source.name, source.font, source.text, scene); }, source, scene, null);
  146. return texture;
  147. };
  148. return AsciiArtFontTexture;
  149. }(BABYLON.BaseTexture));
  150. __decorate([
  151. BABYLON.serialize("font")
  152. ], AsciiArtFontTexture.prototype, "_font", void 0);
  153. __decorate([
  154. BABYLON.serialize("text")
  155. ], AsciiArtFontTexture.prototype, "_text", void 0);
  156. BABYLON.AsciiArtFontTexture = AsciiArtFontTexture;
  157. /**
  158. * AsciiArtPostProcess helps rendering everithing in Ascii Art.
  159. *
  160. * Simmply add it to your scene and let the nerd that lives in you have fun.
  161. * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
  162. */
  163. var AsciiArtPostProcess = (function (_super) {
  164. __extends(AsciiArtPostProcess, _super);
  165. /**
  166. * Instantiates a new Ascii Art Post Process.
  167. * @param name the name to give to the postprocess
  168. * @camera the camera to apply the post process to.
  169. * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
  170. */
  171. function AsciiArtPostProcess(name, camera, options) {
  172. var _this = _super.call(this, name, 'asciiart', ['asciiArtFontInfos', 'asciiArtOptions'], ['asciiArtFont'], {
  173. width: camera.getEngine().getRenderWidth(),
  174. height: camera.getEngine().getRenderHeight()
  175. }, camera, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, camera.getEngine(), true) || this;
  176. /**
  177. * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
  178. * This number is defined between 0 and 1;
  179. */
  180. _this.mixToTile = 0;
  181. /**
  182. * This defines the amount you want to mix the normal rendering pass in the ascii art.
  183. * This number is defined between 0 and 1;
  184. */
  185. _this.mixToNormal = 0;
  186. // Default values.
  187. var font = "40px Monospace";
  188. var characterSet = " `-.'_:,\"=^;<+!*?/cL\\zrs7TivJtC{3F)Il(xZfY5S2eajo14[nuyE]P6V9kXpKwGhqAUbOd8#HRDB0$mgMW&Q%N@";
  189. // Use options.
  190. if (options) {
  191. if (typeof (options) === "string") {
  192. font = options;
  193. }
  194. else {
  195. font = options.font || font;
  196. characterSet = options.characterSet || characterSet;
  197. _this.mixToTile = options.mixToTile || _this.mixToTile;
  198. _this.mixToNormal = options.mixToNormal || _this.mixToNormal;
  199. }
  200. }
  201. _this._asciiArtFontTexture = new AsciiArtFontTexture(name, font, characterSet, camera.getScene());
  202. var textureSize = _this._asciiArtFontTexture.getSize();
  203. _this.onApply = function (effect) {
  204. effect.setTexture("asciiArtFont", _this._asciiArtFontTexture);
  205. effect.setFloat4("asciiArtFontInfos", _this._asciiArtFontTexture.charSize, characterSet.length, textureSize.width, textureSize.height);
  206. effect.setFloat4("asciiArtOptions", _this.width, _this.height, _this.mixToNormal, _this.mixToTile);
  207. };
  208. return _this;
  209. }
  210. return AsciiArtPostProcess;
  211. }(BABYLON.PostProcess));
  212. BABYLON.AsciiArtPostProcess = AsciiArtPostProcess;
  213. })(BABYLON || (BABYLON = {}));
  214. //# sourceMappingURL=babylon.asciiArtPostProcess.js.map
  215. BABYLON.Effect.ShadersStore['asciiartPixelShader'] = "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D asciiArtFont;\n\nuniform vec4 asciiArtFontInfos;\nuniform vec4 asciiArtOptions;\n\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,vec3(0.2126,0.7152,0.0722)),0.,1.);\n}\n\nvoid main(void) \n{\nfloat caracterSize=asciiArtFontInfos.x;\nfloat numChar=asciiArtFontInfos.y-1.0;\nfloat fontx=asciiArtFontInfos.z;\nfloat fonty=asciiArtFontInfos.w;\nfloat screenx=asciiArtOptions.x;\nfloat screeny=asciiArtOptions.y;\nfloat tileX=float(floor((gl_FragCoord.x)/caracterSize))*caracterSize/screenx;\nfloat tileY=float(floor((gl_FragCoord.y)/caracterSize))*caracterSize/screeny;\nvec2 tileUV=vec2(tileX,tileY);\nvec4 tileColor=texture2D(textureSampler,tileUV);\nvec4 baseColor=texture2D(textureSampler,vUV);\nfloat tileLuminance=getLuminance(tileColor.rgb);\nfloat offsetx=(float(floor(tileLuminance*numChar)))*caracterSize/fontx;\nfloat offsety=0.0;\nfloat x=float(mod(gl_FragCoord.x,caracterSize))/fontx;\nfloat y=float(mod(gl_FragCoord.y,caracterSize))/fonty;\nvec4 finalColor=texture2D(asciiArtFont,vec2(offsetx+x,offsety+(caracterSize/fonty-y)));\nfinalColor.rgb*=tileColor.rgb;\nfinalColor.a=1.0;\nfinalColor=mix(finalColor,tileColor,asciiArtOptions.w);\nfinalColor=mix(finalColor,baseColor,asciiArtOptions.z);\ngl_FragColor=finalColor;\n}";
  216. var BABYLON;
  217. (function (BABYLON) {
  218. /**
  219. * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
  220. *
  221. * It basically takes care rendering the font front the given font size to a texture.
  222. * This is used later on in the postprocess.
  223. */
  224. var DigitalRainFontTexture = (function (_super) {
  225. __extends(DigitalRainFontTexture, _super);
  226. /**
  227. * Create a new instance of the Digital Rain FontTexture class
  228. * @param name the name of the texture
  229. * @param font the font to use, use the W3C CSS notation
  230. * @param text the caracter set to use in the rendering.
  231. * @param scene the scene that owns the texture
  232. */
  233. function DigitalRainFontTexture(name, font, text, scene) {
  234. var _this = _super.call(this, scene) || this;
  235. _this.name = name;
  236. _this._text == text;
  237. _this._font == font;
  238. _this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
  239. _this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
  240. //this.anisotropicFilteringLevel = 1;
  241. // Get the font specific info.
  242. var maxCharHeight = _this.getFontHeight(font);
  243. var maxCharWidth = _this.getFontWidth(font);
  244. _this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
  245. // This is an approximate size, but should always be able to fit at least the maxCharCount.
  246. var textureWidth = _this._charSize;
  247. var textureHeight = Math.ceil(_this._charSize * text.length);
  248. // Create the texture that will store the font characters.
  249. _this._texture = scene.getEngine().createDynamicTexture(textureWidth, textureHeight, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
  250. //scene.getEngine().setclamp
  251. var textureSize = _this.getSize();
  252. // Create a canvas with the final size: the one matching the texture.
  253. var canvas = document.createElement("canvas");
  254. canvas.width = textureSize.width;
  255. canvas.height = textureSize.height;
  256. var context = canvas.getContext("2d");
  257. context.textBaseline = "top";
  258. context.font = font;
  259. context.fillStyle = "white";
  260. context.imageSmoothingEnabled = false;
  261. // Sets the text in the texture.
  262. for (var i = 0; i < text.length; i++) {
  263. context.fillText(text[i], 0, i * _this._charSize - maxCharHeight.offset);
  264. }
  265. // Flush the text in the dynamic texture.
  266. _this.getScene().getEngine().updateDynamicTexture(_this._texture, canvas, false, true);
  267. return _this;
  268. }
  269. Object.defineProperty(DigitalRainFontTexture.prototype, "charSize", {
  270. /**
  271. * Gets the size of one char in the texture (each char fits in size * size space in the texture).
  272. */
  273. get: function () {
  274. return this._charSize;
  275. },
  276. enumerable: true,
  277. configurable: true
  278. });
  279. /**
  280. * Gets the max char width of a font.
  281. * @param font the font to use, use the W3C CSS notation
  282. * @return the max char width
  283. */
  284. DigitalRainFontTexture.prototype.getFontWidth = function (font) {
  285. var fontDraw = document.createElement("canvas");
  286. var ctx = fontDraw.getContext('2d');
  287. ctx.fillStyle = 'white';
  288. ctx.font = font;
  289. return ctx.measureText("W").width;
  290. };
  291. // More info here: https://videlais.com/2014/03/16/the-many-and-varied-problems-with-measuring-font-height-for-html5-canvas/
  292. /**
  293. * Gets the max char height of a font.
  294. * @param font the font to use, use the W3C CSS notation
  295. * @return the max char height
  296. */
  297. DigitalRainFontTexture.prototype.getFontHeight = function (font) {
  298. var fontDraw = document.createElement("canvas");
  299. var ctx = fontDraw.getContext('2d');
  300. ctx.fillRect(0, 0, fontDraw.width, fontDraw.height);
  301. ctx.textBaseline = 'top';
  302. ctx.fillStyle = 'white';
  303. ctx.font = font;
  304. ctx.fillText('jH|', 0, 0);
  305. var pixels = ctx.getImageData(0, 0, fontDraw.width, fontDraw.height).data;
  306. var start = -1;
  307. var end = -1;
  308. for (var row = 0; row < fontDraw.height; row++) {
  309. for (var column = 0; column < fontDraw.width; column++) {
  310. var index = (row * fontDraw.width + column) * 4;
  311. if (pixels[index] === 0) {
  312. if (column === fontDraw.width - 1 && start !== -1) {
  313. end = row;
  314. row = fontDraw.height;
  315. break;
  316. }
  317. continue;
  318. }
  319. else {
  320. if (start === -1) {
  321. start = row;
  322. }
  323. break;
  324. }
  325. }
  326. }
  327. return { height: (end - start) + 1, offset: start - 1 };
  328. };
  329. /**
  330. * Clones the current DigitalRainFontTexture.
  331. * @return the clone of the texture.
  332. */
  333. DigitalRainFontTexture.prototype.clone = function () {
  334. return new DigitalRainFontTexture(this.name, this._font, this._text, this.getScene());
  335. };
  336. /**
  337. * Parses a json object representing the texture and returns an instance of it.
  338. * @param source the source JSON representation
  339. * @param scene the scene to create the texture for
  340. * @return the parsed texture
  341. */
  342. DigitalRainFontTexture.Parse = function (source, scene) {
  343. var texture = BABYLON.SerializationHelper.Parse(function () { return new DigitalRainFontTexture(source.name, source.font, source.text, scene); }, source, scene, null);
  344. return texture;
  345. };
  346. return DigitalRainFontTexture;
  347. }(BABYLON.BaseTexture));
  348. __decorate([
  349. BABYLON.serialize("font")
  350. ], DigitalRainFontTexture.prototype, "_font", void 0);
  351. __decorate([
  352. BABYLON.serialize("text")
  353. ], DigitalRainFontTexture.prototype, "_text", void 0);
  354. BABYLON.DigitalRainFontTexture = DigitalRainFontTexture;
  355. /**
  356. * DigitalRainPostProcess helps rendering everithing in digital rain.
  357. *
  358. * Simmply add it to your scene and let the nerd that lives in you have fun.
  359. * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
  360. */
  361. var DigitalRainPostProcess = (function (_super) {
  362. __extends(DigitalRainPostProcess, _super);
  363. /**
  364. * Instantiates a new Digital Rain Post Process.
  365. * @param name the name to give to the postprocess
  366. * @camera the camera to apply the post process to.
  367. * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
  368. */
  369. function DigitalRainPostProcess(name, camera, options) {
  370. var _this = _super.call(this, name, 'digitalrain', ['digitalRainFontInfos', 'digitalRainOptions', 'cosTimeZeroOne', 'matrixSpeed'], ['digitalRainFont'], {
  371. width: camera.getEngine().getRenderWidth(),
  372. height: camera.getEngine().getRenderHeight()
  373. }, camera, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, camera.getEngine(), true) || this;
  374. /**
  375. * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
  376. * This number is defined between 0 and 1;
  377. */
  378. _this.mixToTile = 0;
  379. /**
  380. * This defines the amount you want to mix the normal rendering pass in the digital rain.
  381. * This number is defined between 0 and 1;
  382. */
  383. _this.mixToNormal = 0;
  384. // Default values.
  385. var font = "15px Monospace";
  386. var characterSet = "古池や蛙飛び込む水の音ふるいけやかわずとびこむみずのおと初しぐれ猿も小蓑をほしげ也はつしぐれさるもこみのをほしげなり江戸の雨何石呑んだ時鳥えどのあめなんごくのんだほととぎす";
  387. // Use options.
  388. if (options) {
  389. if (typeof (options) === "string") {
  390. font = options;
  391. }
  392. else {
  393. font = options.font || font;
  394. _this.mixToTile = options.mixToTile || _this.mixToTile;
  395. _this.mixToNormal = options.mixToNormal || _this.mixToNormal;
  396. }
  397. }
  398. _this._digitalRainFontTexture = new DigitalRainFontTexture(name, font, characterSet, camera.getScene());
  399. var textureSize = _this._digitalRainFontTexture.getSize();
  400. var alpha = 0.0;
  401. var cosTimeZeroOne = 0.0;
  402. var matrix = new BABYLON.Matrix();
  403. for (var i = 0; i < 16; i++) {
  404. matrix.m[i] = Math.random();
  405. }
  406. _this.onApply = function (effect) {
  407. effect.setTexture("digitalRainFont", _this._digitalRainFontTexture);
  408. effect.setFloat4("digitalRainFontInfos", _this._digitalRainFontTexture.charSize, characterSet.length, textureSize.width, textureSize.height);
  409. effect.setFloat4("digitalRainOptions", _this.width, _this.height, _this.mixToNormal, _this.mixToTile);
  410. effect.setMatrix("matrixSpeed", matrix);
  411. alpha += 0.003;
  412. cosTimeZeroOne = alpha;
  413. effect.setFloat('cosTimeZeroOne', cosTimeZeroOne);
  414. };
  415. return _this;
  416. }
  417. return DigitalRainPostProcess;
  418. }(BABYLON.PostProcess));
  419. BABYLON.DigitalRainPostProcess = DigitalRainPostProcess;
  420. })(BABYLON || (BABYLON = {}));
  421. //# sourceMappingURL=babylon.digitalRainPostProcess.js.map
  422. BABYLON.Effect.ShadersStore['digitalrainPixelShader'] = "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D digitalRainFont;\n\nuniform vec4 digitalRainFontInfos;\nuniform vec4 digitalRainOptions;\nuniform mat4 matrixSpeed;\nuniform float cosTimeZeroOne;\n\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,vec3(0.2126,0.7152,0.0722)),0.,1.);\n}\n\nvoid main(void) \n{\nfloat caracterSize=digitalRainFontInfos.x;\nfloat numChar=digitalRainFontInfos.y-1.0;\nfloat fontx=digitalRainFontInfos.z;\nfloat fonty=digitalRainFontInfos.w;\nfloat screenx=digitalRainOptions.x;\nfloat screeny=digitalRainOptions.y;\nfloat ratio=screeny/fonty;\nfloat columnx=float(floor((gl_FragCoord.x)/caracterSize));\nfloat tileX=float(floor((gl_FragCoord.x)/caracterSize))*caracterSize/screenx;\nfloat tileY=float(floor((gl_FragCoord.y)/caracterSize))*caracterSize/screeny;\nvec2 tileUV=vec2(tileX,tileY);\nvec4 tileColor=texture2D(textureSampler,tileUV);\nvec4 baseColor=texture2D(textureSampler,vUV);\nfloat tileLuminance=getLuminance(tileColor.rgb);\nint st=int(mod(columnx,4.0));\nfloat speed=cosTimeZeroOne*(sin(tileX*314.5)*0.5+0.6); \nfloat x=float(mod(gl_FragCoord.x,caracterSize))/fontx;\nfloat y=float(mod(speed+gl_FragCoord.y/screeny,1.0));\ny*=ratio;\nvec4 finalColor=texture2D(digitalRainFont,vec2(x,1.0-y));\nvec3 high=finalColor.rgb*(vec3(1.2,1.2,1.2)*pow(1.0-y,30.0));\nfinalColor.rgb*=vec3(pow(tileLuminance,5.0),pow(tileLuminance,1.5),pow(tileLuminance,3.0));\nfinalColor.rgb+=high;\nfinalColor.rgb=clamp(finalColor.rgb,0.,1.);\nfinalColor.a=1.0;\nfinalColor=mix(finalColor,tileColor,digitalRainOptions.w);\nfinalColor=mix(finalColor,baseColor,digitalRainOptions.z);\ngl_FragColor=finalColor;\n}";
  423. (function universalModuleDefinition(root, factory) {
  424. if (root && root["BABYLON"]) {
  425. return;
  426. }
  427. if(typeof exports === 'object' && typeof module === 'object')
  428. module.exports = factory();
  429. else if(typeof define === 'function' && define.amd)
  430. define([], factory);
  431. else if(typeof exports === 'object')
  432. exports["BJSPostProcess"] = factory();
  433. else {
  434. root["BABYLON"] = factory();
  435. }
  436. })(this, function() {
  437. return BABYLON;
  438. });