@luma.gl/effects 7.4.0-alpha.2 → 9.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/LICENSE +10 -1
  2. package/README.md +2 -2
  3. package/dist/dist.dev.js +3458 -0
  4. package/dist/dist.min.js +18 -30
  5. package/dist/index.cjs +1724 -0
  6. package/dist/index.cjs.map +7 -0
  7. package/dist/index.d.ts +40 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +26 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/passes/postprocessing/fxaa/fxaa.d.ts +15 -0
  12. package/dist/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -0
  13. package/{src/shader-modules → dist/passes/postprocessing}/fxaa/fxaa.js +18 -14
  14. package/dist/passes/postprocessing/fxaa/fxaa.js.map +1 -0
  15. package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts +43 -0
  16. package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -0
  17. package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +68 -0
  18. package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -0
  19. package/dist/passes/postprocessing/image-adjust-filters/denoise.d.ts +43 -0
  20. package/dist/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -0
  21. package/dist/passes/postprocessing/image-adjust-filters/denoise.js +74 -0
  22. package/dist/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -0
  23. package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts +46 -0
  24. package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -0
  25. package/dist/passes/postprocessing/image-adjust-filters/huesaturation.js +101 -0
  26. package/dist/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -0
  27. package/dist/passes/postprocessing/image-adjust-filters/noise.d.ts +33 -0
  28. package/dist/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -0
  29. package/dist/passes/postprocessing/image-adjust-filters/noise.js +58 -0
  30. package/dist/passes/postprocessing/image-adjust-filters/noise.js.map +1 -0
  31. package/dist/passes/postprocessing/image-adjust-filters/sepia.d.ts +29 -0
  32. package/dist/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -0
  33. package/dist/passes/postprocessing/image-adjust-filters/sepia.js +44 -0
  34. package/dist/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -0
  35. package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts +29 -0
  36. package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -0
  37. package/dist/passes/postprocessing/image-adjust-filters/vibrance.js +35 -0
  38. package/dist/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -0
  39. package/dist/passes/postprocessing/image-adjust-filters/vignette.d.ts +44 -0
  40. package/dist/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -0
  41. package/dist/passes/postprocessing/image-adjust-filters/vignette.js +39 -0
  42. package/dist/passes/postprocessing/image-adjust-filters/vignette.js.map +1 -0
  43. package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts +79 -0
  44. package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -0
  45. package/dist/passes/postprocessing/image-blur-filters/tiltshift.js +111 -0
  46. package/dist/passes/postprocessing/image-blur-filters/tiltshift.js.map +1 -0
  47. package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts +56 -0
  48. package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -0
  49. package/dist/passes/postprocessing/image-blur-filters/triangleblur.js +65 -0
  50. package/dist/passes/postprocessing/image-blur-filters/triangleblur.js.map +1 -0
  51. package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts +42 -0
  52. package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -0
  53. package/dist/passes/postprocessing/image-blur-filters/zoomblur.js +59 -0
  54. package/dist/passes/postprocessing/image-blur-filters/zoomblur.js.map +1 -0
  55. package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts +52 -0
  56. package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -0
  57. package/dist/passes/postprocessing/image-fun-filters/colorhalftone.js +64 -0
  58. package/dist/passes/postprocessing/image-fun-filters/colorhalftone.js.map +1 -0
  59. package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts +50 -0
  60. package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -0
  61. package/dist/passes/postprocessing/image-fun-filters/dotscreen.js +50 -0
  62. package/dist/passes/postprocessing/image-fun-filters/dotscreen.js.map +1 -0
  63. package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts +54 -0
  64. package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts.map +1 -0
  65. package/dist/passes/postprocessing/image-fun-filters/edgework.js +101 -0
  66. package/dist/passes/postprocessing/image-fun-filters/edgework.js.map +1 -0
  67. package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +43 -0
  68. package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -0
  69. package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.js +68 -0
  70. package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.js.map +1 -0
  71. package/dist/passes/postprocessing/image-fun-filters/ink.d.ts +40 -0
  72. package/dist/passes/postprocessing/image-fun-filters/ink.d.ts.map +1 -0
  73. package/dist/passes/postprocessing/image-fun-filters/ink.js +52 -0
  74. package/dist/passes/postprocessing/image-fun-filters/ink.js.map +1 -0
  75. package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts +45 -0
  76. package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts.map +1 -0
  77. package/dist/passes/postprocessing/image-fun-filters/magnify.js +49 -0
  78. package/dist/passes/postprocessing/image-fun-filters/magnify.js.map +1 -0
  79. package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts +49 -0
  80. package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -0
  81. package/dist/passes/postprocessing/image-warp-filters/bulgepinch.js +56 -0
  82. package/dist/passes/postprocessing/image-warp-filters/bulgepinch.js.map +1 -0
  83. package/dist/passes/postprocessing/image-warp-filters/swirl.d.ts +50 -0
  84. package/dist/passes/postprocessing/image-warp-filters/swirl.d.ts.map +1 -0
  85. package/dist/passes/postprocessing/image-warp-filters/swirl.js +57 -0
  86. package/dist/passes/postprocessing/image-warp-filters/swirl.js.map +1 -0
  87. package/dist/passes/postprocessing/image-warp-filters/warp.d.ts +8 -0
  88. package/dist/passes/postprocessing/image-warp-filters/warp.d.ts.map +1 -0
  89. package/dist/passes/postprocessing/image-warp-filters/warp.js +21 -0
  90. package/dist/passes/postprocessing/image-warp-filters/warp.js.map +1 -0
  91. package/package.json +37 -13
  92. package/src/index.ts +99 -0
  93. package/src/passes/postprocessing/fxaa/fxaa.ts +694 -0
  94. package/src/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +81 -0
  95. package/src/passes/postprocessing/image-adjust-filters/denoise.ts +97 -0
  96. package/src/passes/postprocessing/image-adjust-filters/huesaturation.ts +120 -0
  97. package/src/passes/postprocessing/image-adjust-filters/noise.ts +73 -0
  98. package/src/passes/postprocessing/image-adjust-filters/sepia.ts +54 -0
  99. package/src/passes/postprocessing/image-adjust-filters/vibrance.ts +48 -0
  100. package/src/passes/postprocessing/image-adjust-filters/vignette.ts +58 -0
  101. package/src/passes/postprocessing/image-blur-filters/tiltshift.ts +135 -0
  102. package/src/passes/postprocessing/image-blur-filters/triangleblur.ts +84 -0
  103. package/src/passes/postprocessing/image-blur-filters/zoomblur.ts +75 -0
  104. package/src/passes/postprocessing/image-fun-filters/colorhalftone.ts +85 -0
  105. package/src/passes/postprocessing/image-fun-filters/dotscreen.ts +70 -0
  106. package/src/passes/postprocessing/image-fun-filters/edgework.ts +120 -0
  107. package/src/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts +86 -0
  108. package/src/passes/postprocessing/image-fun-filters/ink.ts +73 -0
  109. package/src/passes/postprocessing/image-fun-filters/magnify.ts +70 -0
  110. package/src/passes/postprocessing/image-warp-filters/bulgepinch.ts +72 -0
  111. package/src/passes/postprocessing/image-warp-filters/swirl.ts +77 -0
  112. package/src/passes/postprocessing/image-warp-filters/warp.ts +28 -0
  113. package/dist/dist.js +0 -3621
  114. package/dist/es5/experimental/passes/outline-pass.js +0 -125
  115. package/dist/es5/experimental/passes/outline-pass.js.map +0 -1
  116. package/dist/es5/experimental/passes/ssao-pass.js +0 -133
  117. package/dist/es5/experimental/passes/ssao-pass.js.map +0 -1
  118. package/dist/es5/experimental/shader-modules/convolution.js +0 -46
  119. package/dist/es5/experimental/shader-modules/convolution.js.map +0 -1
  120. package/dist/es5/experimental/shader-modules/depth.js +0 -27
  121. package/dist/es5/experimental/shader-modules/depth.js.map +0 -1
  122. package/dist/es5/experimental/shader-modules/pack.js +0 -19
  123. package/dist/es5/experimental/shader-modules/pack.js.map +0 -1
  124. package/dist/es5/experimental/shader-modules/ssao.js +0 -32
  125. package/dist/es5/experimental/shader-modules/ssao.js.map +0 -1
  126. package/dist/es5/index.js +0 -184
  127. package/dist/es5/index.js.map +0 -1
  128. package/dist/es5/shader-modules/adjust-filters/brightnesscontrast.js +0 -29
  129. package/dist/es5/shader-modules/adjust-filters/brightnesscontrast.js.map +0 -1
  130. package/dist/es5/shader-modules/adjust-filters/denoise.js +0 -29
  131. package/dist/es5/shader-modules/adjust-filters/denoise.js.map +0 -1
  132. package/dist/es5/shader-modules/adjust-filters/huesaturation.js +0 -29
  133. package/dist/es5/shader-modules/adjust-filters/huesaturation.js.map +0 -1
  134. package/dist/es5/shader-modules/adjust-filters/noise.js +0 -24
  135. package/dist/es5/shader-modules/adjust-filters/noise.js.map +0 -1
  136. package/dist/es5/shader-modules/adjust-filters/sepia.js +0 -24
  137. package/dist/es5/shader-modules/adjust-filters/sepia.js.map +0 -1
  138. package/dist/es5/shader-modules/adjust-filters/vibrance.js +0 -24
  139. package/dist/es5/shader-modules/adjust-filters/vibrance.js.map +0 -1
  140. package/dist/es5/shader-modules/adjust-filters/vignette.js +0 -29
  141. package/dist/es5/shader-modules/adjust-filters/vignette.js.map +0 -1
  142. package/dist/es5/shader-modules/blur-filters/tiltshift.js +0 -49
  143. package/dist/es5/shader-modules/blur-filters/tiltshift.js.map +0 -1
  144. package/dist/es5/shader-modules/blur-filters/triangleblur.js +0 -42
  145. package/dist/es5/shader-modules/blur-filters/triangleblur.js.map +0 -1
  146. package/dist/es5/shader-modules/blur-filters/zoomblur.js +0 -31
  147. package/dist/es5/shader-modules/blur-filters/zoomblur.js.map +0 -1
  148. package/dist/es5/shader-modules/fun-filters/colorhalftone.js +0 -31
  149. package/dist/es5/shader-modules/fun-filters/colorhalftone.js.map +0 -1
  150. package/dist/es5/shader-modules/fun-filters/dotscreen.js +0 -31
  151. package/dist/es5/shader-modules/fun-filters/dotscreen.js.map +0 -1
  152. package/dist/es5/shader-modules/fun-filters/edgework.js +0 -42
  153. package/dist/es5/shader-modules/fun-filters/edgework.js.map +0 -1
  154. package/dist/es5/shader-modules/fun-filters/hexagonalpixelate.js +0 -29
  155. package/dist/es5/shader-modules/fun-filters/hexagonalpixelate.js.map +0 -1
  156. package/dist/es5/shader-modules/fun-filters/ink.js +0 -24
  157. package/dist/es5/shader-modules/fun-filters/ink.js.map +0 -1
  158. package/dist/es5/shader-modules/fxaa/fxaa.js +0 -47
  159. package/dist/es5/shader-modules/fxaa/fxaa.js.map +0 -1
  160. package/dist/es5/shader-modules/utils/random.js +0 -13
  161. package/dist/es5/shader-modules/utils/random.js.map +0 -1
  162. package/dist/es5/shader-modules/warp-filters/bulgepinch.js +0 -36
  163. package/dist/es5/shader-modules/warp-filters/bulgepinch.js.map +0 -1
  164. package/dist/es5/shader-modules/warp-filters/swirl.js +0 -36
  165. package/dist/es5/shader-modules/warp-filters/swirl.js.map +0 -1
  166. package/dist/es5/shader-modules/warp-filters/warp.js +0 -13
  167. package/dist/es5/shader-modules/warp-filters/warp.js.map +0 -1
  168. package/dist/es6/experimental/passes/outline-pass.js +0 -48
  169. package/dist/es6/experimental/passes/outline-pass.js.map +0 -1
  170. package/dist/es6/experimental/passes/ssao-pass.js +0 -76
  171. package/dist/es6/experimental/passes/ssao-pass.js.map +0 -1
  172. package/dist/es6/experimental/shader-modules/convolution.js +0 -37
  173. package/dist/es6/experimental/shader-modules/convolution.js.map +0 -1
  174. package/dist/es6/experimental/shader-modules/depth.js +0 -13
  175. package/dist/es6/experimental/shader-modules/depth.js.map +0 -1
  176. package/dist/es6/experimental/shader-modules/pack.js +0 -10
  177. package/dist/es6/experimental/shader-modules/pack.js.map +0 -1
  178. package/dist/es6/experimental/shader-modules/ssao.js +0 -21
  179. package/dist/es6/experimental/shader-modules/ssao.js.map +0 -1
  180. package/dist/es6/index.js +0 -23
  181. package/dist/es6/index.js.map +0 -1
  182. package/dist/es6/shader-modules/adjust-filters/brightnesscontrast.js +0 -22
  183. package/dist/es6/shader-modules/adjust-filters/brightnesscontrast.js.map +0 -1
  184. package/dist/es6/shader-modules/adjust-filters/denoise.js +0 -20
  185. package/dist/es6/shader-modules/adjust-filters/denoise.js.map +0 -1
  186. package/dist/es6/shader-modules/adjust-filters/huesaturation.js +0 -22
  187. package/dist/es6/shader-modules/adjust-filters/huesaturation.js.map +0 -1
  188. package/dist/es6/shader-modules/adjust-filters/noise.js +0 -17
  189. package/dist/es6/shader-modules/adjust-filters/noise.js.map +0 -1
  190. package/dist/es6/shader-modules/adjust-filters/sepia.js +0 -17
  191. package/dist/es6/shader-modules/adjust-filters/sepia.js.map +0 -1
  192. package/dist/es6/shader-modules/adjust-filters/vibrance.js +0 -17
  193. package/dist/es6/shader-modules/adjust-filters/vibrance.js.map +0 -1
  194. package/dist/es6/shader-modules/adjust-filters/vignette.js +0 -22
  195. package/dist/es6/shader-modules/adjust-filters/vignette.js.map +0 -1
  196. package/dist/es6/shader-modules/blur-filters/tiltshift.js +0 -38
  197. package/dist/es6/shader-modules/blur-filters/tiltshift.js.map +0 -1
  198. package/dist/es6/shader-modules/blur-filters/triangleblur.js +0 -31
  199. package/dist/es6/shader-modules/blur-filters/triangleblur.js.map +0 -1
  200. package/dist/es6/shader-modules/blur-filters/zoomblur.js +0 -20
  201. package/dist/es6/shader-modules/blur-filters/zoomblur.js.map +0 -1
  202. package/dist/es6/shader-modules/fun-filters/colorhalftone.js +0 -24
  203. package/dist/es6/shader-modules/fun-filters/colorhalftone.js.map +0 -1
  204. package/dist/es6/shader-modules/fun-filters/dotscreen.js +0 -24
  205. package/dist/es6/shader-modules/fun-filters/dotscreen.js.map +0 -1
  206. package/dist/es6/shader-modules/fun-filters/edgework.js +0 -31
  207. package/dist/es6/shader-modules/fun-filters/edgework.js.map +0 -1
  208. package/dist/es6/shader-modules/fun-filters/hexagonalpixelate.js +0 -22
  209. package/dist/es6/shader-modules/fun-filters/hexagonalpixelate.js.map +0 -1
  210. package/dist/es6/shader-modules/fun-filters/ink.js +0 -17
  211. package/dist/es6/shader-modules/fun-filters/ink.js.map +0 -1
  212. package/dist/es6/shader-modules/fxaa/fxaa.js +0 -39
  213. package/dist/es6/shader-modules/fxaa/fxaa.js.map +0 -1
  214. package/dist/es6/shader-modules/utils/random.js +0 -6
  215. package/dist/es6/shader-modules/utils/random.js.map +0 -1
  216. package/dist/es6/shader-modules/warp-filters/bulgepinch.js +0 -25
  217. package/dist/es6/shader-modules/warp-filters/bulgepinch.js.map +0 -1
  218. package/dist/es6/shader-modules/warp-filters/swirl.js +0 -25
  219. package/dist/es6/shader-modules/warp-filters/swirl.js.map +0 -1
  220. package/dist/es6/shader-modules/warp-filters/warp.js +0 -6
  221. package/dist/es6/shader-modules/warp-filters/warp.js.map +0 -1
  222. package/dist/esm/experimental/passes/outline-pass.js +0 -114
  223. package/dist/esm/experimental/passes/outline-pass.js.map +0 -1
  224. package/dist/esm/experimental/passes/ssao-pass.js +0 -120
  225. package/dist/esm/experimental/passes/ssao-pass.js.map +0 -1
  226. package/dist/esm/experimental/shader-modules/convolution.js +0 -39
  227. package/dist/esm/experimental/shader-modules/convolution.js.map +0 -1
  228. package/dist/esm/experimental/shader-modules/depth.js +0 -16
  229. package/dist/esm/experimental/shader-modules/depth.js.map +0 -1
  230. package/dist/esm/experimental/shader-modules/pack.js +0 -12
  231. package/dist/esm/experimental/shader-modules/pack.js.map +0 -1
  232. package/dist/esm/experimental/shader-modules/ssao.js +0 -21
  233. package/dist/esm/experimental/shader-modules/ssao.js.map +0 -1
  234. package/dist/esm/index.js +0 -23
  235. package/dist/esm/index.js.map +0 -1
  236. package/dist/esm/shader-modules/adjust-filters/brightnesscontrast.js +0 -22
  237. package/dist/esm/shader-modules/adjust-filters/brightnesscontrast.js.map +0 -1
  238. package/dist/esm/shader-modules/adjust-filters/denoise.js +0 -22
  239. package/dist/esm/shader-modules/adjust-filters/denoise.js.map +0 -1
  240. package/dist/esm/shader-modules/adjust-filters/huesaturation.js +0 -22
  241. package/dist/esm/shader-modules/adjust-filters/huesaturation.js.map +0 -1
  242. package/dist/esm/shader-modules/adjust-filters/noise.js +0 -17
  243. package/dist/esm/shader-modules/adjust-filters/noise.js.map +0 -1
  244. package/dist/esm/shader-modules/adjust-filters/sepia.js +0 -17
  245. package/dist/esm/shader-modules/adjust-filters/sepia.js.map +0 -1
  246. package/dist/esm/shader-modules/adjust-filters/vibrance.js +0 -17
  247. package/dist/esm/shader-modules/adjust-filters/vibrance.js.map +0 -1
  248. package/dist/esm/shader-modules/adjust-filters/vignette.js +0 -22
  249. package/dist/esm/shader-modules/adjust-filters/vignette.js.map +0 -1
  250. package/dist/esm/shader-modules/blur-filters/tiltshift.js +0 -38
  251. package/dist/esm/shader-modules/blur-filters/tiltshift.js.map +0 -1
  252. package/dist/esm/shader-modules/blur-filters/triangleblur.js +0 -31
  253. package/dist/esm/shader-modules/blur-filters/triangleblur.js.map +0 -1
  254. package/dist/esm/shader-modules/blur-filters/zoomblur.js +0 -20
  255. package/dist/esm/shader-modules/blur-filters/zoomblur.js.map +0 -1
  256. package/dist/esm/shader-modules/fun-filters/colorhalftone.js +0 -24
  257. package/dist/esm/shader-modules/fun-filters/colorhalftone.js.map +0 -1
  258. package/dist/esm/shader-modules/fun-filters/dotscreen.js +0 -24
  259. package/dist/esm/shader-modules/fun-filters/dotscreen.js.map +0 -1
  260. package/dist/esm/shader-modules/fun-filters/edgework.js +0 -31
  261. package/dist/esm/shader-modules/fun-filters/edgework.js.map +0 -1
  262. package/dist/esm/shader-modules/fun-filters/hexagonalpixelate.js +0 -22
  263. package/dist/esm/shader-modules/fun-filters/hexagonalpixelate.js.map +0 -1
  264. package/dist/esm/shader-modules/fun-filters/ink.js +0 -17
  265. package/dist/esm/shader-modules/fun-filters/ink.js.map +0 -1
  266. package/dist/esm/shader-modules/fxaa/fxaa.js +0 -39
  267. package/dist/esm/shader-modules/fxaa/fxaa.js.map +0 -1
  268. package/dist/esm/shader-modules/utils/random.js +0 -6
  269. package/dist/esm/shader-modules/utils/random.js.map +0 -1
  270. package/dist/esm/shader-modules/warp-filters/bulgepinch.js +0 -25
  271. package/dist/esm/shader-modules/warp-filters/bulgepinch.js.map +0 -1
  272. package/dist/esm/shader-modules/warp-filters/swirl.js +0 -25
  273. package/dist/esm/shader-modules/warp-filters/swirl.js.map +0 -1
  274. package/dist/esm/shader-modules/warp-filters/warp.js +0 -6
  275. package/dist/esm/shader-modules/warp-filters/warp.js.map +0 -1
  276. package/src/experimental/passes/outline-pass.js +0 -58
  277. package/src/experimental/passes/ssao-pass.js +0 -73
  278. package/src/experimental/passes/ssao-pass.md +0 -15
  279. package/src/experimental/shader-modules/convolution.js +0 -96
  280. package/src/experimental/shader-modules/convolution.md +0 -15
  281. package/src/experimental/shader-modules/depth.js +0 -84
  282. package/src/experimental/shader-modules/depth.md +0 -76
  283. package/src/experimental/shader-modules/pack.js +0 -32
  284. package/src/experimental/shader-modules/pack.md +0 -15
  285. package/src/experimental/shader-modules/ssao.js +0 -183
  286. package/src/experimental/shader-modules/ssao.md +0 -4
  287. package/src/index.js +0 -35
  288. package/src/shader-modules/adjust-filters/brightnesscontrast.js +0 -38
  289. package/src/shader-modules/adjust-filters/denoise.js +0 -49
  290. package/src/shader-modules/adjust-filters/huesaturation.js +0 -57
  291. package/src/shader-modules/adjust-filters/noise.js +0 -36
  292. package/src/shader-modules/adjust-filters/sepia.js +0 -37
  293. package/src/shader-modules/adjust-filters/vibrance.js +0 -32
  294. package/src/shader-modules/adjust-filters/vignette.js +0 -33
  295. package/src/shader-modules/blur-filters/tiltshift.js +0 -105
  296. package/src/shader-modules/blur-filters/triangleblur.js +0 -55
  297. package/src/shader-modules/blur-filters/zoomblur.js +0 -56
  298. package/src/shader-modules/fun-filters/colorhalftone.js +0 -60
  299. package/src/shader-modules/fun-filters/dotscreen.js +0 -45
  300. package/src/shader-modules/fun-filters/edgework.js +0 -84
  301. package/src/shader-modules/fun-filters/hexagonalpixelate.js +0 -63
  302. package/src/shader-modules/fun-filters/ink.js +0 -49
  303. package/src/shader-modules/utils/random.js +0 -12
  304. package/src/shader-modules/warp-filters/bulgepinch.js +0 -52
  305. package/src/shader-modules/warp-filters/swirl.js +0 -55
  306. package/src/shader-modules/warp-filters/warp.js +0 -19
@@ -1,12 +0,0 @@
1
- var fs = "const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\n\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 pack_floatToRGBA8( const in float v ) {\n vec4 r = vec4( fract( v * PackFactors ), v );\n r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n return r * PackUpscale;\n}\n\nfloat pack_RGBA8ToFloat( const in vec4 v ) {\n return dot(v, UnpackFactors);\n}\n";
2
- var DEFAULT_PROPS = {};
3
- export default {
4
- name: 'pack',
5
- fs: fs,
6
- vs: fs,
7
- DEFAULT_PROPS: DEFAULT_PROPS,
8
- getUniforms: function getUniforms(props) {
9
- return props;
10
- }
11
- };
12
- //# sourceMappingURL=pack.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/experimental/shader-modules/pack.js"],"names":["fs","DEFAULT_PROPS","name","vs","getUniforms","props"],"mappings":"AAGA,IAAMA,EAAE,6lBAAR;AAoBA,IAAMC,aAAa,GAAG,EAAtB;AAEA,eAAe;AACbC,EAAAA,IAAI,EAAE,MADO;AAEbF,EAAAA,EAAE,EAAFA,EAFa;AAGbG,EAAAA,EAAE,EAAEH,EAHS;AAIbC,EAAAA,aAAa,EAAbA,aAJa;AAKbG,EAAAA,WAAW,EAAE,qBAAAC,KAAK;AAAA,WAAIA,KAAJ;AAAA;AALL,CAAf","sourcesContent":["// Packing of floats into RGBA8\n/* eslint-disable camelcase */\n\nconst fs = `\\\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\n\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 pack_floatToRGBA8( const in float v ) {\n vec4 r = vec4( fract( v * PackFactors ), v );\n r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n return r * PackUpscale;\n}\n\nfloat pack_RGBA8ToFloat( const in vec4 v ) {\n return dot(v, UnpackFactors);\n}\n`;\n\nconst DEFAULT_PROPS = {};\n\nexport default {\n name: 'pack',\n fs,\n vs: fs,\n DEFAULT_PROPS,\n getUniforms: props => props\n};\n"],"file":"pack.js"}
@@ -1,21 +0,0 @@
1
- import depth from './depth';
2
- var DEFAULT_PROPS = {
3
- ssao_uEnabled: true,
4
- tDiffuse: null,
5
- tDepth: null,
6
- size: [512, 512],
7
- cameraNear: 1,
8
- cameraFar: 100,
9
- radius: 32,
10
- onlyAO: false,
11
- aoClamp: 0.25,
12
- lumInfluence: 0.7
13
- };
14
- var fsSSAO = "// Inputs\nuniform sampler2D tDiffuse;\nuniform sampler2D tDepth;\nuniform vec2 size; // texture width, height\n\n// TODO - move to 'camera' module?\nuniform float cameraNear;\nuniform float cameraFar;\n\n// SSAO\nuniform bool ssao_uEnabled;\nuniform float radius; // ao radius\nuniform float aoClamp; // depth clamp - reduces haloing at screen edges\nuniform float lumInfluence; // how much luminance affects occlusion\n\nuniform bool onlyAO; // use only ambient occlusion pass?\n\n#define DL 2.399963229728653 // PI * ( 3.0 - sqrt( 5.0 ) )\n#define EULER 2.718281828459045\n\nconst int samples = 64; // ao sample count\nconst bool useNoise = true; // use noise instead of pattern for sample dithering\nconst float noiseAmount = 0.0004; // dithering amount\nconst float diffArea = 0.4; // self-shadowing reduction\nconst float gDisplace = 0.4; // gauss bell center\n\n// Random noise generating: pattern texture for dithering\nvec2 rand( const vec2 coord ) {\n vec2 noise;\n\n if ( useNoise ) {\n float nx = dot ( coord, vec2( 12.9898, 78.233 ) );\n float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );\n noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );\n } else {\n float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );\n float gg = fract( coord.t * ( size.y / 2.0 ) );\n noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;\n }\n\n return ( noise * 2.0 - 1.0 ) * noiseAmount;\n}\n\n// RGBA depth\n\nfloat readDepth( const in vec2 coord ) {\n float z = depth_getDepth(tDepth, coord);\n\n float cameraFarPlusNear = cameraFar + cameraNear;\n float cameraFarMinusNear = cameraFar - cameraNear;\n float cameraCoef = 2.0 * cameraNear;\n return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );\n}\n\nfloat compareDepths( const in float depth1, const in float depth2, inout int far ) {\n float garea = 8.0; // gauss bell width\n float diff = ( depth1 - depth2 ) * 100.0; // depth difference (0-100)\n\n // reduce left bell width to avoid self-shadowing\n\n if ( diff < gDisplace ) {\n garea = diffArea;\n } else {\n far = 1;\n }\n\n float dd = diff - gDisplace;\n float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );\n return gauss;\n}\n\nfloat calcAO( float depth, float dw, float dh, vec2 uv ) {\n vec2 vv = vec2( dw, dh );\n\n vec2 coord1 = uv + radius * vv;\n vec2 coord2 = uv - radius * vv;\n\n float temp1 = 0.0;\n float temp2 = 0.0;\n\n int far = 0;\n temp1 = compareDepths( depth, readDepth( coord1 ), far );\n\n // DEPTH EXTRAPOLATION\n if ( far > 0 ) {\n temp2 = compareDepths( readDepth( coord2 ), depth, far );\n temp1 += ( 1.0 - temp1 ) * temp2;\n }\n\n return temp1;\n}\n\nvec4 ssao_filterColor(vec4 color4, vec2 uv) {\n\n vec2 noise = rand( uv );\n float depth = readDepth( uv );\n\n float tt = clamp( depth, aoClamp, 1.0 );\n\n float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );\n float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );\n\n float ao = 0.0;\n\n float dz = 1.0 / float( samples );\n float l = 0.0;\n float z = 1.0 - dz / 2.0;\n\n for ( int i = 0; i <= samples; i ++ ) {\n float r = sqrt( 1.0 - z );\n\n float pw = cos( l ) * r;\n float ph = sin( l ) * r;\n ao += calcAO( depth, pw * w, ph * h, uv );\n z = z - dz;\n l = l + DL;\n }\n\n ao /= float( samples );\n ao = 1.0 - ao;\n\n vec3 color = color4.rgb;\n\n vec3 final = color;\n\n vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );\n float lum = dot( color.rgb, lumcoeff );\n vec3 luminance = vec3( lum );\n\n // mix( color * ao, white, luminance )\n final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\n\n if ( onlyAO ) {\n // ambient occlusion only\n final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\n }\n\n return vec4( final, 1.0 );\n}\n\nvec4 ssao_getColor(vec2 uv) {\n vec4 color = texture2D( tDiffuse, uv );\n return ssao_uEnabled ? ssao_filterColor(color, uv) : color;\n}\n";
15
- export default {
16
- name: 'ssao',
17
- dependencies: [depth],
18
- DEFAULT_PROPS: DEFAULT_PROPS,
19
- fs: fsSSAO
20
- };
21
- //# sourceMappingURL=ssao.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/experimental/shader-modules/ssao.js"],"names":["depth","DEFAULT_PROPS","ssao_uEnabled","tDiffuse","tDepth","size","cameraNear","cameraFar","radius","onlyAO","aoClamp","lumInfluence","fsSSAO","name","dependencies","fs"],"mappings":"AAeA,OAAOA,KAAP,MAAkB,SAAlB;AAEA,IAAMC,aAAa,GAAG;AACpBC,EAAAA,aAAa,EAAE,IADK;AAEpBC,EAAAA,QAAQ,EAAE,IAFU;AAGpBC,EAAAA,MAAM,EAAE,IAHY;AAIpBC,EAAAA,IAAI,EAAE,CAAC,GAAD,EAAM,GAAN,CAJc;AAKpBC,EAAAA,UAAU,EAAE,CALQ;AAMpBC,EAAAA,SAAS,EAAE,GANS;AAOpBC,EAAAA,MAAM,EAAE,EAPY;AAQpBC,EAAAA,MAAM,EAAE,KARY;AASpBC,EAAAA,OAAO,EAAE,IATW;AAUpBC,EAAAA,YAAY,EAAE;AAVM,CAAtB;AAaA,IAAMC,MAAM,6/HAAZ;AAmJA,eAAe;AACbC,EAAAA,IAAI,EAAE,MADO;AAEbC,EAAAA,YAAY,EAAE,CAACd,KAAD,CAFD;AAGbC,EAAAA,aAAa,EAAbA,aAHa;AAIbc,EAAAA,EAAE,EAAEH;AAJS,CAAf","sourcesContent":["/**\n * Screen-space ambient occlusion shader\n *\n * Ported to luma.gl from THREE.js\n *\n * Attributions: (per comments in original THREE.js files)\n * - ported to THREE.js from SSAO GLSL shader v1.2 by alteredq / http://alteredqualia.com/\n * assembled by Martins Upitis (martinsh) (http://devlog-martinsh.blogspot.com)\n * - original technique by ArKano22 http://www.gamedev.net/topic/550699-ssao-no-halo-artifacts/\n * - modifications\n * - modified to use RGBA packed depth texture (use clear color 1,1,1,1 for depth pass)\n * - refactoring and optimizations\n */\n\n/* eslint-disable camelcase */\nimport depth from './depth';\n\nconst DEFAULT_PROPS = {\n ssao_uEnabled: true,\n tDiffuse: null,\n tDepth: null,\n size: [512, 512],\n cameraNear: 1,\n cameraFar: 100,\n radius: 32, // 4\n onlyAO: false,\n aoClamp: 0.25,\n lumInfluence: 0.7\n};\n\nconst fsSSAO = `\\\n// Inputs\nuniform sampler2D tDiffuse;\nuniform sampler2D tDepth;\nuniform vec2 size; // texture width, height\n\n// TODO - move to 'camera' module?\nuniform float cameraNear;\nuniform float cameraFar;\n\n// SSAO\nuniform bool ssao_uEnabled;\nuniform float radius; // ao radius\nuniform float aoClamp; // depth clamp - reduces haloing at screen edges\nuniform float lumInfluence; // how much luminance affects occlusion\n\nuniform bool onlyAO; // use only ambient occlusion pass?\n\n#define DL 2.399963229728653 // PI * ( 3.0 - sqrt( 5.0 ) )\n#define EULER 2.718281828459045\n\nconst int samples = 64; // ao sample count\nconst bool useNoise = true; // use noise instead of pattern for sample dithering\nconst float noiseAmount = 0.0004; // dithering amount\nconst float diffArea = 0.4; // self-shadowing reduction\nconst float gDisplace = 0.4; // gauss bell center\n\n// Random noise generating: pattern texture for dithering\nvec2 rand( const vec2 coord ) {\n vec2 noise;\n\n if ( useNoise ) {\n float nx = dot ( coord, vec2( 12.9898, 78.233 ) );\n float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );\n noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );\n } else {\n float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );\n float gg = fract( coord.t * ( size.y / 2.0 ) );\n noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;\n }\n\n return ( noise * 2.0 - 1.0 ) * noiseAmount;\n}\n\n// RGBA depth\n\nfloat readDepth( const in vec2 coord ) {\n float z = depth_getDepth(tDepth, coord);\n\n float cameraFarPlusNear = cameraFar + cameraNear;\n float cameraFarMinusNear = cameraFar - cameraNear;\n float cameraCoef = 2.0 * cameraNear;\n return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );\n}\n\nfloat compareDepths( const in float depth1, const in float depth2, inout int far ) {\n float garea = 8.0; // gauss bell width\n float diff = ( depth1 - depth2 ) * 100.0; // depth difference (0-100)\n\n // reduce left bell width to avoid self-shadowing\n\n if ( diff < gDisplace ) {\n garea = diffArea;\n } else {\n far = 1;\n }\n\n float dd = diff - gDisplace;\n float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );\n return gauss;\n}\n\nfloat calcAO( float depth, float dw, float dh, vec2 uv ) {\n vec2 vv = vec2( dw, dh );\n\n vec2 coord1 = uv + radius * vv;\n vec2 coord2 = uv - radius * vv;\n\n float temp1 = 0.0;\n float temp2 = 0.0;\n\n int far = 0;\n temp1 = compareDepths( depth, readDepth( coord1 ), far );\n\n // DEPTH EXTRAPOLATION\n if ( far > 0 ) {\n temp2 = compareDepths( readDepth( coord2 ), depth, far );\n temp1 += ( 1.0 - temp1 ) * temp2;\n }\n\n return temp1;\n}\n\nvec4 ssao_filterColor(vec4 color4, vec2 uv) {\n\n vec2 noise = rand( uv );\n float depth = readDepth( uv );\n\n float tt = clamp( depth, aoClamp, 1.0 );\n\n float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );\n float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );\n\n float ao = 0.0;\n\n float dz = 1.0 / float( samples );\n float l = 0.0;\n float z = 1.0 - dz / 2.0;\n\n for ( int i = 0; i <= samples; i ++ ) {\n float r = sqrt( 1.0 - z );\n\n float pw = cos( l ) * r;\n float ph = sin( l ) * r;\n ao += calcAO( depth, pw * w, ph * h, uv );\n z = z - dz;\n l = l + DL;\n }\n\n ao /= float( samples );\n ao = 1.0 - ao;\n\n vec3 color = color4.rgb;\n\n vec3 final = color;\n\n vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );\n float lum = dot( color.rgb, lumcoeff );\n vec3 luminance = vec3( lum );\n\n // mix( color * ao, white, luminance )\n final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\n\n if ( onlyAO ) {\n // ambient occlusion only\n final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\n }\n\n return vec4( final, 1.0 );\n}\n\nvec4 ssao_getColor(vec2 uv) {\n vec4 color = texture2D( tDiffuse, uv );\n return ssao_uEnabled ? ssao_filterColor(color, uv) : color;\n}\n`;\n\nexport default {\n name: 'ssao',\n dependencies: [depth],\n DEFAULT_PROPS,\n fs: fsSSAO\n};\n"],"file":"ssao.js"}
package/dist/esm/index.js DELETED
@@ -1,23 +0,0 @@
1
- export { default as brightnessContrast } from './shader-modules/adjust-filters/brightnesscontrast';
2
- export { default as denoise } from './shader-modules/adjust-filters/denoise';
3
- export { default as hueSaturation } from './shader-modules/adjust-filters/huesaturation';
4
- export { default as noise } from './shader-modules/adjust-filters/noise';
5
- export { default as sepia } from './shader-modules/adjust-filters/sepia';
6
- export { default as vibrance } from './shader-modules/adjust-filters/vibrance';
7
- export { default as vignette } from './shader-modules/adjust-filters/vignette';
8
- export { default as tiltShift } from './shader-modules/blur-filters/tiltshift';
9
- export { default as triangleBlur } from './shader-modules/blur-filters/triangleblur';
10
- export { default as zoomBlur } from './shader-modules/blur-filters/zoomblur';
11
- export { default as colorHalftone } from './shader-modules/fun-filters/colorhalftone';
12
- export { default as dotScreen } from './shader-modules/fun-filters/dotscreen';
13
- export { default as edgeWork } from './shader-modules/fun-filters/edgework';
14
- export { default as hexagonalPixelate } from './shader-modules/fun-filters/hexagonalpixelate';
15
- export { default as ink } from './shader-modules/fun-filters/ink';
16
- export { default as bulgePinch } from './shader-modules/warp-filters/bulgepinch';
17
- export { default as swirl } from './shader-modules/warp-filters/swirl';
18
- export { default as fxaa } from './shader-modules/fxaa/fxaa';
19
- export { default as _depth } from './experimental/shader-modules/depth';
20
- export { default as _convolution } from './experimental/shader-modules/convolution';
21
- export { default as _OutlinePass } from './experimental/passes/outline-pass';
22
- export { default as _SSAOPass } from './experimental/passes/ssao-pass';
23
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.js"],"names":["default","brightnessContrast","denoise","hueSaturation","noise","sepia","vibrance","vignette","tiltShift","triangleBlur","zoomBlur","colorHalftone","dotScreen","edgeWork","hexagonalPixelate","ink","bulgePinch","swirl","fxaa","_depth","_convolution","_OutlinePass","_SSAOPass"],"mappings":"AAGA,SAAQA,OAAO,IAAIC,kBAAnB,QAA4C,oDAA5C;AACA,SAAQD,OAAO,IAAIE,OAAnB,QAAiC,yCAAjC;AACA,SAAQF,OAAO,IAAIG,aAAnB,QAAuC,+CAAvC;AACA,SAAQH,OAAO,IAAII,KAAnB,QAA+B,uCAA/B;AACA,SAAQJ,OAAO,IAAIK,KAAnB,QAA+B,uCAA/B;AACA,SAAQL,OAAO,IAAIM,QAAnB,QAAkC,0CAAlC;AACA,SAAQN,OAAO,IAAIO,QAAnB,QAAkC,0CAAlC;AAGA,SAAQP,OAAO,IAAIQ,SAAnB,QAAmC,yCAAnC;AACA,SAAQR,OAAO,IAAIS,YAAnB,QAAsC,4CAAtC;AACA,SAAQT,OAAO,IAAIU,QAAnB,QAAkC,wCAAlC;AAGA,SAAQV,OAAO,IAAIW,aAAnB,QAAuC,4CAAvC;AACA,SAAQX,OAAO,IAAIY,SAAnB,QAAmC,wCAAnC;AACA,SAAQZ,OAAO,IAAIa,QAAnB,QAAkC,uCAAlC;AACA,SAAQb,OAAO,IAAIc,iBAAnB,QAA2C,gDAA3C;AACA,SAAQd,OAAO,IAAIe,GAAnB,QAA6B,kCAA7B;AAGA,SAAQf,OAAO,IAAIgB,UAAnB,QAAoC,0CAApC;AACA,SAAQhB,OAAO,IAAIiB,KAAnB,QAA+B,qCAA/B;AAGA,SAAQjB,OAAO,IAAIkB,IAAnB,QAA8B,4BAA9B;AAGA,SAAQlB,OAAO,IAAImB,MAAnB,QAAgC,qCAAhC;AACA,SAAQnB,OAAO,IAAIoB,YAAnB,QAAsC,2CAAtC;AACA,SAAQpB,OAAO,IAAIqB,YAAnB,QAAsC,oCAAtC;AACA,SAAQrB,OAAO,IAAIsB,SAAnB,QAAmC,iCAAnC","sourcesContent":["// Shader modules\n\n// glfx ADJUST shader modules\nexport {default as brightnessContrast} from './shader-modules/adjust-filters/brightnesscontrast';\nexport {default as denoise} from './shader-modules/adjust-filters/denoise';\nexport {default as hueSaturation} from './shader-modules/adjust-filters/huesaturation';\nexport {default as noise} from './shader-modules/adjust-filters/noise';\nexport {default as sepia} from './shader-modules/adjust-filters/sepia';\nexport {default as vibrance} from './shader-modules/adjust-filters/vibrance';\nexport {default as vignette} from './shader-modules/adjust-filters/vignette';\n\n// glfx BLUR shader modules\nexport {default as tiltShift} from './shader-modules/blur-filters/tiltshift';\nexport {default as triangleBlur} from './shader-modules/blur-filters/triangleblur';\nexport {default as zoomBlur} from './shader-modules/blur-filters/zoomblur';\n\n// glfx FUN shader modules\nexport {default as colorHalftone} from './shader-modules/fun-filters/colorhalftone';\nexport {default as dotScreen} from './shader-modules/fun-filters/dotscreen';\nexport {default as edgeWork} from './shader-modules/fun-filters/edgework';\nexport {default as hexagonalPixelate} from './shader-modules/fun-filters/hexagonalpixelate';\nexport {default as ink} from './shader-modules/fun-filters/ink';\n\n// glfx WARP shader modules\nexport {default as bulgePinch} from './shader-modules/warp-filters/bulgepinch';\nexport {default as swirl} from './shader-modules/warp-filters/swirl';\n\n// Postprocessing\nexport {default as fxaa} from './shader-modules/fxaa/fxaa';\n\n// experimental shader modules and passes\nexport {default as _depth} from './experimental/shader-modules/depth';\nexport {default as _convolution} from './experimental/shader-modules/convolution';\nexport {default as _OutlinePass} from './experimental/passes/outline-pass';\nexport {default as _SSAOPass} from './experimental/passes/ssao-pass';\n"],"file":"index.js"}
@@ -1,22 +0,0 @@
1
- var fs = "uniform float brightness;\nuniform float contrast;\n\nvec4 brightnessContrast_filterColor(vec4 color) {\n color.rgb += brightness;\n if (contrast > 0.0) {\n color.rgb = (color.rgb - 0.5) / (1.0 - contrast) + 0.5;\n } else {\n color.rgb = (color.rgb - 0.5) * (1.0 + contrast) + 0.5;\n }\n return color;\n}\n\nvec4 brightnessContrast_filterColor(vec4 color, vec2 texSize, vec2 texCoords) {\n return brightnessContrast_filterColor(color);\n}\n";
2
- var uniforms = {
3
- brightness: {
4
- value: 0,
5
- min: -1,
6
- max: 1
7
- },
8
- contrast: {
9
- value: 0,
10
- min: -1,
11
- max: 1
12
- }
13
- };
14
- export default {
15
- name: 'brightnessContrast',
16
- uniforms: uniforms,
17
- fs: fs,
18
- passes: [{
19
- filter: true
20
- }]
21
- };
22
- //# sourceMappingURL=brightnesscontrast.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/adjust-filters/brightnesscontrast.js"],"names":["fs","uniforms","brightness","value","min","max","contrast","name","passes","filter"],"mappings":"AAOA,IAAMA,EAAE,ycAAR;AAmBA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,UAAU,EAAE;AAACC,IAAAA,KAAK,EAAE,CAAR;AAAWC,IAAAA,GAAG,EAAE,CAAC,CAAjB;AAAoBC,IAAAA,GAAG,EAAE;AAAzB,GADG;AAEfC,EAAAA,QAAQ,EAAE;AAACH,IAAAA,KAAK,EAAE,CAAR;AAAWC,IAAAA,GAAG,EAAE,CAAC,CAAjB;AAAoBC,IAAAA,GAAG,EAAE;AAAzB;AAFK,CAAjB;AAKA,eAAe;AACbE,EAAAA,IAAI,EAAE,oBADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbQ,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Brightness / Contrast\n * @description Provides additive brightness and multiplicative contrast control.\n * @param brightness -1 to 1 (-1 is solid black, 0 is no change, and 1 is solid white)\n * @param contrast -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)\n */\n\nconst fs = `\\\nuniform float brightness;\nuniform float contrast;\n\nvec4 brightnessContrast_filterColor(vec4 color) {\n color.rgb += brightness;\n if (contrast > 0.0) {\n color.rgb = (color.rgb - 0.5) / (1.0 - contrast) + 0.5;\n } else {\n color.rgb = (color.rgb - 0.5) * (1.0 + contrast) + 0.5;\n }\n return color;\n}\n\nvec4 brightnessContrast_filterColor(vec4 color, vec2 texSize, vec2 texCoords) {\n return brightnessContrast_filterColor(color);\n}\n`;\n\nconst uniforms = {\n brightness: {value: 0, min: -1, max: 1},\n contrast: {value: 0, min: -1, max: 1}\n};\n\nexport default {\n name: 'brightnessContrast',\n uniforms,\n fs,\n\n passes: [{filter: true}]\n};\n"],"file":"brightnesscontrast.js"}
@@ -1,22 +0,0 @@
1
- var fs = "uniform float strength;\n\nvec4 denoise_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n float adjustedExponent = 3. + 200. * pow(1. - strength, 4.);\n\n vec4 center = texture2D(texture, texCoord);\n vec4 color = vec4(0.0);\n float total = 0.0;\n for (float x = -4.0; x <= 4.0; x += 1.0) {\n for (float y = -4.0; y <= 4.0; y += 1.0) {\n vec4 sample = texture2D(texture, texCoord + vec2(x, y) / texSize);\n float weight = 1.0 - abs(dot(sample.rgb - center.rgb, vec3(0.25)));\n weight = pow(weight, adjustedExponent);\n color += sample * weight;\n total += weight;\n }\n }\n\n return color / total;\n}\n";
2
- var uniforms = {
3
- strength: {
4
- value: 0.5,
5
- min: 0,
6
- max: 0.1,
7
- adjust: function adjust(strength) {
8
- return 0.53 + 200 * Math.pow(1 - strength, 4);
9
- }
10
- }
11
- };
12
- export default {
13
- name: 'denoise',
14
- uniforms: uniforms,
15
- fs: fs,
16
- passes: [{
17
- sampler: true
18
- }, {
19
- sampler: true
20
- }]
21
- };
22
- //# sourceMappingURL=denoise.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/adjust-filters/denoise.js"],"names":["fs","uniforms","strength","value","min","max","adjust","Math","pow","name","passes","sampler"],"mappings":"AAUA,IAAMA,EAAE,mpBAAR;AAuBA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,QAAQ,EAAE;AACRC,IAAAA,KAAK,EAAE,GADC;AAERC,IAAAA,GAAG,EAAE,CAFG;AAGRC,IAAAA,GAAG,EAAE,GAHG;AAIRC,IAAAA,MAAM,EAAE,gBAAAJ,QAAQ;AAAA,aAAI,OAAO,MAAMK,IAAI,CAACC,GAAL,CAAS,IAAIN,QAAb,EAAuB,CAAvB,CAAjB;AAAA;AAJR;AADK,CAAjB;AASA,eAAe;AACbO,EAAAA,IAAI,EAAE,SADO;AAEbR,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbU,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE;AAAV,GAAD,EAAkB;AAACA,IAAAA,OAAO,EAAE;AAAV,GAAlB;AALK,CAAf","sourcesContent":["/**\n * @filter Denoise\n * @description Smooths over grainy noise in dark images using an 9x9 box filter\n * weighted by color intensity, similar to a bilateral filter.\n * @param exponent The exponent of the color intensity difference, should be greater\n * than zero. A value of zero just gives an 9x9 box blur and high values\n * give the original image, but ideal values are usually around 10-20.\n */\n\n// Do a 9x9 bilateral box filter\nconst fs = `\\\nuniform float strength;\n\nvec4 denoise_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n float adjustedExponent = 3. + 200. * pow(1. - strength, 4.);\n\n vec4 center = texture2D(texture, texCoord);\n vec4 color = vec4(0.0);\n float total = 0.0;\n for (float x = -4.0; x <= 4.0; x += 1.0) {\n for (float y = -4.0; y <= 4.0; y += 1.0) {\n vec4 sample = texture2D(texture, texCoord + vec2(x, y) / texSize);\n float weight = 1.0 - abs(dot(sample.rgb - center.rgb, vec3(0.25)));\n weight = pow(weight, adjustedExponent);\n color += sample * weight;\n total += weight;\n }\n }\n\n return color / total;\n}\n`;\n\nconst uniforms = {\n strength: {\n value: 0.5,\n min: 0,\n max: 0.1,\n adjust: strength => 0.53 + 200 * Math.pow(1 - strength, 4) // TODO - JS preprocessing\n }\n};\n\nexport default {\n name: 'denoise',\n uniforms,\n fs,\n\n passes: [{sampler: true}, {sampler: true}]\n};\n"],"file":"denoise.js"}
@@ -1,22 +0,0 @@
1
- var fs = "uniform float hue;\nuniform float saturation;\n\nvec4 hueSaturation_filterColor(vec4 color) {\n // hue adjustment, wolfram alpha: RotationTransform[angle, {1, 1, 1}][{x, y, z}]\n float angle = hue * 3.14159265;\n float s = sin(angle), c = cos(angle);\n vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\n float len = length(color.rgb);\n color.rgb = vec3(\n dot(color.rgb, weights.xyz),\n dot(color.rgb, weights.zxy),\n dot(color.rgb, weights.yzx)\n );\n\n // saturation adjustment\n float average = (color.r + color.g + color.b) / 3.0;\n if (saturation > 0.0) {\n color.rgb += (average - color.rgb) * (1.0 - 1.0 / (1.001 - saturation));\n } else {\n color.rgb += (average - color.rgb) * (-saturation);\n }\n\n return color;\n}\n\nvec4 hueSaturation_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return hueSaturation_filterColor(color);\n}\n";
2
- var uniforms = {
3
- hue: {
4
- value: 0,
5
- min: -1,
6
- max: 1
7
- },
8
- saturation: {
9
- value: 0,
10
- min: -1,
11
- max: 1
12
- }
13
- };
14
- export default {
15
- name: 'hueSaturation',
16
- uniforms: uniforms,
17
- fs: fs,
18
- passes: [{
19
- filter: true
20
- }]
21
- };
22
- //# sourceMappingURL=huesaturation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/adjust-filters/huesaturation.js"],"names":["fs","uniforms","hue","value","min","max","saturation","name","passes","filter"],"mappings":"AAaA,IAAMA,EAAE,u5BAAR;AAgCA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,GAAG,EAAE;AAACC,IAAAA,KAAK,EAAE,CAAR;AAAWC,IAAAA,GAAG,EAAE,CAAC,CAAjB;AAAoBC,IAAAA,GAAG,EAAE;AAAzB,GADU;AAEfC,EAAAA,UAAU,EAAE;AAACH,IAAAA,KAAK,EAAE,CAAR;AAAWC,IAAAA,GAAG,EAAE,CAAC,CAAjB;AAAoBC,IAAAA,GAAG,EAAE;AAAzB;AAFG,CAAjB;AAKA,eAAe;AACbE,EAAAA,IAAI,EAAE,eADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbQ,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Hue / Saturation\n * @description Provides rotational hue and multiplicative saturation control. RGB color space\n * can be imagined as a cube where the axes are the red, green, and blue color\n * values. Hue changing works by rotating the color vector around the grayscale\n * line, which is the straight line from black (0, 0, 0) to white (1, 1, 1).\n * Saturation is implemented by scaling all color channel values either toward\n * or away from the average color channel value.\n * @param hue -1 to 1 (-1 is 180 degree rotation in the negative direction, 0 is no change,\n * and 1 is 180 degree rotation in the positive direction)\n * @param saturation -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)\n */\n\nconst fs = `\\\nuniform float hue;\nuniform float saturation;\n\nvec4 hueSaturation_filterColor(vec4 color) {\n // hue adjustment, wolfram alpha: RotationTransform[angle, {1, 1, 1}][{x, y, z}]\n float angle = hue * 3.14159265;\n float s = sin(angle), c = cos(angle);\n vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\n float len = length(color.rgb);\n color.rgb = vec3(\n dot(color.rgb, weights.xyz),\n dot(color.rgb, weights.zxy),\n dot(color.rgb, weights.yzx)\n );\n\n // saturation adjustment\n float average = (color.r + color.g + color.b) / 3.0;\n if (saturation > 0.0) {\n color.rgb += (average - color.rgb) * (1.0 - 1.0 / (1.001 - saturation));\n } else {\n color.rgb += (average - color.rgb) * (-saturation);\n }\n\n return color;\n}\n\nvec4 hueSaturation_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return hueSaturation_filterColor(color);\n}\n`;\n\nconst uniforms = {\n hue: {value: 0, min: -1, max: 1},\n saturation: {value: 0, min: -1, max: 1}\n};\n\nexport default {\n name: 'hueSaturation',\n uniforms,\n fs,\n\n passes: [{filter: true}]\n};\n"],"file":"huesaturation.js"}
@@ -1,17 +0,0 @@
1
- var fs = "uniform float amount;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 noise_filterColor(vec4 color, vec2 texCoord) {\n float diff = (rand(texCoord) - 0.5) * amount;\n color.r += diff;\n color.g += diff;\n color.b += diff;\n return color;\n}\n\nvec4 noise_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return noise_filterColor(color, texCoord);\n}\n";
2
- var uniforms = {
3
- amount: {
4
- value: 0.5,
5
- min: 0,
6
- max: 1
7
- }
8
- };
9
- export default {
10
- name: 'noise',
11
- uniforms: uniforms,
12
- fs: fs,
13
- passes: [{
14
- filter: true
15
- }]
16
- };
17
- //# sourceMappingURL=noise.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/adjust-filters/noise.js"],"names":["fs","uniforms","amount","value","min","max","name","passes","filter"],"mappings":"AAKA,IAAMA,EAAE,2aAAR;AAoBA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE;AAACC,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,GAAG,EAAE,CAAlB;AAAqBC,IAAAA,GAAG,EAAE;AAA1B;AADO,CAAjB;AAIA,eAAe;AACbC,EAAAA,IAAI,EAAE,OADO;AAEbL,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbO,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Noise\n * @description Adds black and white noise to the image.\n * @param amount 0 to 1 (0 for no effect, 1 for maximum noise)\n */\nconst fs = `\\\nuniform float amount;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 noise_filterColor(vec4 color, vec2 texCoord) {\n float diff = (rand(texCoord) - 0.5) * amount;\n color.r += diff;\n color.g += diff;\n color.b += diff;\n return color;\n}\n\nvec4 noise_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return noise_filterColor(color, texCoord);\n}\n`;\n\nconst uniforms = {\n amount: {value: 0.5, min: 0, max: 1}\n};\n\nexport default {\n name: 'noise',\n uniforms,\n fs,\n\n passes: [{filter: true}]\n};\n"],"file":"noise.js"}
@@ -1,17 +0,0 @@
1
- var fs = "uniform float amount;\n\nvec4 sepia_filterColor(vec4 color) {\n float r = color.r;\n float g = color.g;\n float b = color.b;\n\n color.r =\n min(1.0, (r * (1.0 - (0.607 * amount))) + (g * (0.769 * amount)) + (b * (0.189 * amount)));\n color.g = min(1.0, (r * 0.349 * amount) + (g * (1.0 - (0.314 * amount))) + (b * 0.168 * amount));\n color.b = min(1.0, (r * 0.272 * amount) + (g * 0.534 * amount) + (b * (1.0 - (0.869 * amount))));\n\n return color;\n}\n\nvec4 sepia_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return sepia_filterColor(color);\n}\n";
2
- var uniforms = {
3
- amount: {
4
- value: 0.5,
5
- min: 0,
6
- max: 1
7
- }
8
- };
9
- export default {
10
- name: 'sepia',
11
- uniforms: uniforms,
12
- fs: fs,
13
- passes: [{
14
- filter: true
15
- }]
16
- };
17
- //# sourceMappingURL=sepia.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/adjust-filters/sepia.js"],"names":["fs","uniforms","amount","value","min","max","name","passes","filter"],"mappings":"AAKA,IAAMA,EAAE,kkBAAR;AAqBA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE;AAACC,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,GAAG,EAAE,CAAlB;AAAqBC,IAAAA,GAAG,EAAE;AAA1B;AADO,CAAjB;AAIA,eAAe;AACbC,EAAAA,IAAI,EAAE,OADO;AAEbL,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbO,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Sepia\n * @description Gives the image a reddish-brown monochrome tint that imitates an old photograph.\n * @param amount 0 to 1 (0 for no effect, 1 for full sepia coloring)\n */\nconst fs = `\\\nuniform float amount;\n\nvec4 sepia_filterColor(vec4 color) {\n float r = color.r;\n float g = color.g;\n float b = color.b;\n\n color.r =\n min(1.0, (r * (1.0 - (0.607 * amount))) + (g * (0.769 * amount)) + (b * (0.189 * amount)));\n color.g = min(1.0, (r * 0.349 * amount) + (g * (1.0 - (0.314 * amount))) + (b * 0.168 * amount));\n color.b = min(1.0, (r * 0.272 * amount) + (g * 0.534 * amount) + (b * (1.0 - (0.869 * amount))));\n\n return color;\n}\n\nvec4 sepia_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return sepia_filterColor(color);\n}\n`;\n\nconst uniforms = {\n amount: {value: 0.5, min: 0, max: 1}\n};\n\nexport default {\n name: 'sepia',\n uniforms,\n fs,\n\n passes: [{filter: true}]\n};\n"],"file":"sepia.js"}
@@ -1,17 +0,0 @@
1
- var fs = "uniform float amount;\n\nvec4 vibrance_filterColor(vec4 color) {\n float average = (color.r + color.g + color.b) / 3.0;\n float mx = max(color.r, max(color.g, color.b));\n float amt = (mx - average) * (-amount * 3.0);\n color.rgb = mix(color.rgb, vec3(mx), amt);\n return color;\n}\n\nvec4 vibrance_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return vibrance_filterColor(color);\n}\n";
2
- var uniforms = {
3
- amount: {
4
- value: 0,
5
- min: -1,
6
- max: 1
7
- }
8
- };
9
- export default {
10
- name: 'vibrance',
11
- uniforms: uniforms,
12
- fs: fs,
13
- passes: [{
14
- filter: true
15
- }]
16
- };
17
- //# sourceMappingURL=vibrance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/adjust-filters/vibrance.js"],"names":["fs","uniforms","amount","value","min","max","name","passes","filter"],"mappings":"AAKA,IAAMA,EAAE,uZAAR;AAgBA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE;AAACC,IAAAA,KAAK,EAAE,CAAR;AAAWC,IAAAA,GAAG,EAAE,CAAC,CAAjB;AAAoBC,IAAAA,GAAG,EAAE;AAAzB;AADO,CAAjB;AAIA,eAAe;AACbC,EAAAA,IAAI,EAAE,UADO;AAEbL,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbO,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Vibrance\n * @description Modifies the saturation of desaturated colors, leaving saturated colors unmodified.\n * @param amount -1 to 1 (-1 is minimum vibrance, 0 is no change, and 1 is maximum vibrance)\n */\nconst fs = `\\\nuniform float amount;\n\nvec4 vibrance_filterColor(vec4 color) {\n float average = (color.r + color.g + color.b) / 3.0;\n float mx = max(color.r, max(color.g, color.b));\n float amt = (mx - average) * (-amount * 3.0);\n color.rgb = mix(color.rgb, vec3(mx), amt);\n return color;\n}\n\nvec4 vibrance_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return vibrance_filterColor(color);\n}\n`;\n\nconst uniforms = {\n amount: {value: 0, min: -1, max: 1}\n};\n\nexport default {\n name: 'vibrance',\n uniforms,\n fs,\n\n passes: [{filter: true}]\n};\n"],"file":"vibrance.js"}
@@ -1,22 +0,0 @@
1
- var fs = "uniform float radius;\nuniform float amount;\n\nvec4 vignette_filterColor(vec4 color, vec2 texCoord) {\n float dist = distance(texCoord, vec2(0.5, 0.5));\n float ratio = smoothstep(0.8, radius * 0.799, dist * (amount + radius));\n return color.rgba * ratio + (1.0 - ratio)*vec4(0.0, 0.0, 0.0, 1.0);\n}\n\nvec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return vignette_filterColor(color, texCoord);\n}\n";
2
- var uniforms = {
3
- radius: {
4
- value: 0.5,
5
- min: 0,
6
- max: 1
7
- },
8
- amount: {
9
- value: 0.5,
10
- min: 0,
11
- max: 1
12
- }
13
- };
14
- export default {
15
- name: 'vignette',
16
- fs: fs,
17
- uniforms: uniforms,
18
- passes: [{
19
- filter: true
20
- }]
21
- };
22
- //# sourceMappingURL=vignette.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/adjust-filters/vignette.js"],"names":["fs","uniforms","radius","value","min","max","amount","name","passes","filter"],"mappings":"AAMA,IAAMA,EAAE,mbAAR;AAeA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE;AAACC,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,GAAG,EAAE,CAAlB;AAAqBC,IAAAA,GAAG,EAAE;AAA1B,GADO;AAEfC,EAAAA,MAAM,EAAE;AAACH,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,GAAG,EAAE,CAAlB;AAAqBC,IAAAA,GAAG,EAAE;AAA1B;AAFO,CAAjB;AAKA,eAAe;AACbE,EAAAA,IAAI,EAAE,UADO;AAEbP,EAAAA,EAAE,EAAFA,EAFa;AAGbC,EAAAA,QAAQ,EAARA,QAHa;AAKbO,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Vignette\n * @description Adds a simulated lens edge darkening effect.\n * @param radius 0 to 1 (0 for center of frame, 1 for edge of frame)\n * @param amount 0 to 1 (0 for no effect, 1 for maximum lens darkening)\n */\nconst fs = `\\\nuniform float radius;\nuniform float amount;\n\nvec4 vignette_filterColor(vec4 color, vec2 texCoord) {\n float dist = distance(texCoord, vec2(0.5, 0.5));\n float ratio = smoothstep(0.8, radius * 0.799, dist * (amount + radius));\n return color.rgba * ratio + (1.0 - ratio)*vec4(0.0, 0.0, 0.0, 1.0);\n}\n\nvec4 vignette_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n return vignette_filterColor(color, texCoord);\n}\n`;\n\nconst uniforms = {\n radius: {value: 0.5, min: 0, max: 1},\n amount: {value: 0.5, min: 0, max: 1}\n};\n\nexport default {\n name: 'vignette',\n fs,\n uniforms,\n\n passes: [{filter: true}]\n};\n"],"file":"vignette.js"}
@@ -1,38 +0,0 @@
1
- import random from '../utils/random';
2
- var fs = "uniform float blurRadius;\nuniform float gradientRadius;\nuniform vec2 start;\nuniform vec2 end;\nuniform bool invert;\n\nvec2 tiltShift_getDelta(vec2 texSize) {\n vec2 vector = normalize((end - start) * texSize);\n return invert ? vec2(-vector.y, vector.x) : vector;\n}\n\nvec4 tiltShift_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n vec2 normal = normalize(vec2((start.y - end.y) * texSize.y, (end.x - start.x) * texSize.x));\n float radius = smoothstep(0.0, 1.0,\n abs(dot(texCoord * texSize - start * texSize, normal)) / gradientRadius) * blurRadius;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(texture, texCoord + tiltShift_getDelta(texSize) / texSize * percent * radius);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n }\n\n color = color / total;\n\n /* switch back from pre-multiplied alpha */\n color.rgb /= color.a + 0.00001;\n\n return color;\n}\n";
3
- var uniforms = {
4
- blurRadius: {
5
- value: 15,
6
- min: 0,
7
- max: 50
8
- },
9
- gradientRadius: {
10
- value: 200,
11
- min: 0,
12
- max: 400
13
- },
14
- start: [0, 0],
15
- end: [1, 1],
16
- invert: {
17
- value: false,
18
- "private": true
19
- }
20
- };
21
- export default {
22
- name: 'tiltShift',
23
- uniforms: uniforms,
24
- fs: fs,
25
- dependencies: [random],
26
- passes: [{
27
- sampler: true,
28
- uniforms: {
29
- invert: false
30
- }
31
- }, {
32
- sampler: true,
33
- uniforms: {
34
- invert: true
35
- }
36
- }]
37
- };
38
- //# sourceMappingURL=tiltshift.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/blur-filters/tiltshift.js"],"names":["random","fs","uniforms","blurRadius","value","min","max","gradientRadius","start","end","invert","name","dependencies","passes","sampler"],"mappings":"AAiBA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,IAAMC,EAAE,yyCAAR;AA4CA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,UAAU,EAAE;AAACC,IAAAA,KAAK,EAAE,EAAR;AAAYC,IAAAA,GAAG,EAAE,CAAjB;AAAoBC,IAAAA,GAAG,EAAE;AAAzB,GADG;AAEfC,EAAAA,cAAc,EAAE;AAACH,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,GAAG,EAAE,CAAlB;AAAqBC,IAAAA,GAAG,EAAE;AAA1B,GAFD;AAGfE,EAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ,CAHQ;AAIfC,EAAAA,GAAG,EAAE,CAAC,CAAD,EAAI,CAAJ,CAJU;AAKfC,EAAAA,MAAM,EAAE;AAACN,IAAAA,KAAK,EAAE,KAAR;AAAe,eAAS;AAAxB;AALO,CAAjB;AAQA,eAAe;AACbO,EAAAA,IAAI,EAAE,WADO;AAEbT,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbW,EAAAA,YAAY,EAAE,CAACZ,MAAD,CAJD;AAMba,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE,IAAV;AAAgBZ,IAAAA,QAAQ,EAAE;AAACQ,MAAAA,MAAM,EAAE;AAAT;AAA1B,GAAD,EAA6C;AAACI,IAAAA,OAAO,EAAE,IAAV;AAAgBZ,IAAAA,QAAQ,EAAE;AAACQ,MAAAA,MAAM,EAAE;AAAT;AAA1B,GAA7C;AANK,CAAf","sourcesContent":["/**\n * @filter Tilt Shift\n * @description Simulates the shallow depth of field normally encountered in close-up\n * photography, which makes the scene seem much smaller than it actually\n * is. This filter assumes the scene is relatively planar, in which case\n * the part of the scene that is completely in focus can be described by\n * a line (the intersection of the focal plane and the scene). An example\n * of a planar scene might be looking at a road from above at a downward\n * angle. The image is then blurred with a blur radius that starts at zero\n * on the line and increases further from the line.\n * @param startX The x coordinate of the start of the line segment.\n * @param startY The y coordinate of the start of the line segment.\n * @param endX The x coordinate of the end of the line segment.\n * @param endY The y coordinate of the end of the line segment.\n * @param blurRadius The maximum radius of the pyramid blur.\n * @param gradientRadius The distance from the line at which the maximum blur radius is reached.\n */\nimport random from '../utils/random';\n\nconst fs = `\\\nuniform float blurRadius;\nuniform float gradientRadius;\nuniform vec2 start;\nuniform vec2 end;\nuniform bool invert;\n\nvec2 tiltShift_getDelta(vec2 texSize) {\n vec2 vector = normalize((end - start) * texSize);\n return invert ? vec2(-vector.y, vector.x) : vector;\n}\n\nvec4 tiltShift_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n vec2 normal = normalize(vec2((start.y - end.y) * texSize.y, (end.x - start.x) * texSize.x));\n float radius = smoothstep(0.0, 1.0,\n abs(dot(texCoord * texSize - start * texSize, normal)) / gradientRadius) * blurRadius;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(texture, texCoord + tiltShift_getDelta(texSize) / texSize * percent * radius);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n }\n\n color = color / total;\n\n /* switch back from pre-multiplied alpha */\n color.rgb /= color.a + 0.00001;\n\n return color;\n}\n`;\n\nconst uniforms = {\n blurRadius: {value: 15, min: 0, max: 50},\n gradientRadius: {value: 200, min: 0, max: 400},\n start: [0, 0],\n end: [1, 1],\n invert: {value: false, private: true}\n};\n\nexport default {\n name: 'tiltShift',\n uniforms,\n fs,\n dependencies: [random],\n\n passes: [{sampler: true, uniforms: {invert: false}}, {sampler: true, uniforms: {invert: true}}]\n};\n\n/*\nfunction tiltShift(startX, startY, endX, endY, blurRadius, gradientRadius) {\n var dx = endX - startX;\n var dy = endY - startY;\n var d = Math.sqrt(dx * dx + dy * dy);\n simpleShader.call(this, gl.tiltShift, {\n blurRadius: blurRadius,\n gradientRadius: gradientRadius,\n start: [startX, startY],\n end: [endX, endY],\n delta: [dx / d, dy / d],\n texSize: [this.width, this.height]\n });\n simpleShader.call(this, gl.tiltShift, {\n blurRadius: blurRadius,\n gradientRadius: gradientRadius,\n start: [startX, startY],\n end: [endX, endY],\n delta: [-dy / d, dx / d],\n texSize: [this.width, this.height]\n });\n\n return this;\n}\n*/\n"],"file":"tiltshift.js"}
@@ -1,31 +0,0 @@
1
- import random from '../utils/random';
2
- var fs = "uniform float radius;\nuniform vec2 delta;\n\nvec4 triangleBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 adjustedDelta = delta * radius / texSize;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(texture, texCoord + adjustedDelta * percent);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n }\n\n color = color / total;\n\n /* switch back from pre-multiplied alpha */\n color.rgb /= color.a + 0.00001;\n\n return color;\n}\n";
3
- var uniforms = {
4
- radius: {
5
- value: 20,
6
- min: 0,
7
- softMax: 100
8
- },
9
- delta: {
10
- value: [1, 0],
11
- "private": true
12
- }
13
- };
14
- export default {
15
- name: 'triangleBlur',
16
- uniforms: uniforms,
17
- fs: fs,
18
- dependencies: [random],
19
- passes: [{
20
- sampler: true,
21
- uniforms: {
22
- delta: [1, 0]
23
- }
24
- }, {
25
- sampler: true,
26
- uniforms: {
27
- delta: [0, 1]
28
- }
29
- }]
30
- };
31
- //# sourceMappingURL=triangleblur.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/blur-filters/triangleblur.js"],"names":["random","fs","uniforms","radius","value","min","softMax","delta","name","dependencies","passes","sampler"],"mappings":"AAOA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,IAAMC,EAAE,o3BAAR;AAkCA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE;AAACC,IAAAA,KAAK,EAAE,EAAR;AAAYC,IAAAA,GAAG,EAAE,CAAjB;AAAoBC,IAAAA,OAAO,EAAE;AAA7B,GADO;AAEfC,EAAAA,KAAK,EAAE;AAACH,IAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ,CAAR;AAAgB,eAAS;AAAzB;AAFQ,CAAjB;AAKA,eAAe;AACbI,EAAAA,IAAI,EAAE,cADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbQ,EAAAA,YAAY,EAAE,CAACT,MAAD,CAJD;AAKbU,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE,IAAV;AAAgBT,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAA1B,GAAD,EAA6C;AAACI,IAAAA,OAAO,EAAE,IAAV;AAAgBT,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAA1B,GAA7C;AALK,CAAf","sourcesContent":["/**\n * @filter Triangle Blur\n * @description This is the most basic blur filter, which convolves the image with a\n * pyramid filter. The pyramid filter is separable and is applied as two\n * perpendicular triangle filters.\n * @param radius The radius of the pyramid convolved with the image.\n */\nimport random from '../utils/random';\n\nconst fs = `\\\nuniform float radius;\nuniform vec2 delta;\n\nvec4 triangleBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 adjustedDelta = delta * radius / texSize;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(texture, texCoord + adjustedDelta * percent);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n }\n\n color = color / total;\n\n /* switch back from pre-multiplied alpha */\n color.rgb /= color.a + 0.00001;\n\n return color;\n}\n`;\n\nconst uniforms = {\n radius: {value: 20, min: 0, softMax: 100},\n delta: {value: [1, 0], private: true}\n};\n\nexport default {\n name: 'triangleBlur',\n uniforms,\n fs,\n dependencies: [random],\n passes: [{sampler: true, uniforms: {delta: [1, 0]}}, {sampler: true, uniforms: {delta: [0, 1]}}]\n};\n"],"file":"triangleblur.js"}
@@ -1,20 +0,0 @@
1
- import random from '../utils/random';
2
- var fs = "\nuniform vec2 center;\nuniform float strength;\n\nvec4 zoomBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec4 color = vec4(0.0);\n float total = 0.0;\n vec2 toCenter = center * texSize - texCoord * texSize;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = 0.0; t <= 40.0; t++) {\n float percent = (t + offset) / 40.0;\n float weight = 4.0 * (percent - percent * percent);\n vec4 sample = texture2D(texture, texCoord + toCenter * percent * strength / texSize);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n }\n\n color = color / total;\n\n /* switch back from pre-multiplied alpha */\n color.rgb /= color.a + 0.00001;\n\n return color;\n}\n";
3
- var uniforms = {
4
- center: [0.5, 0.5],
5
- strength: {
6
- value: 0.3,
7
- min: 0,
8
- softMax: 1
9
- }
10
- };
11
- export default {
12
- name: 'zoomBlur',
13
- uniforms: uniforms,
14
- fs: fs,
15
- dependencies: [random],
16
- passes: [{
17
- sampler: true
18
- }]
19
- };
20
- //# sourceMappingURL=zoomblur.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/blur-filters/zoomblur.js"],"names":["random","fs","uniforms","center","strength","value","min","softMax","name","dependencies","passes","sampler"],"mappings":"AAQA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,IAAMC,EAAE,o5BAAR;AAiCA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE,CAAC,GAAD,EAAM,GAAN,CADO;AAEfC,EAAAA,QAAQ,EAAE;AAACC,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,GAAG,EAAE,CAAlB;AAAqBC,IAAAA,OAAO,EAAE;AAA9B;AAFK,CAAjB;AAKA,eAAe;AACbC,EAAAA,IAAI,EAAE,UADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbQ,EAAAA,YAAY,EAAE,CAACT,MAAD,CAJD;AAMbU,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE;AAAV,GAAD;AANK,CAAf","sourcesContent":["/**\n * @filter Zoom Blur\n * @description Blurs the image away from a certain point, which looks like radial motion blur.\n * @param centerX The x coordinate of the blur origin.\n * @param centerY The y coordinate of the blur origin.\n * @param strength The strength of the blur. Values in the range 0 to 1 are usually sufficient,\n * where 0 doesn't change the image and 1 creates a highly blurred image.\n */\nimport random from '../utils/random';\n\nconst fs = `\nuniform vec2 center;\nuniform float strength;\n\nvec4 zoomBlur_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec4 color = vec4(0.0);\n float total = 0.0;\n vec2 toCenter = center * texSize - texCoord * texSize;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = 0.0; t <= 40.0; t++) {\n float percent = (t + offset) / 40.0;\n float weight = 4.0 * (percent - percent * percent);\n vec4 sample = texture2D(texture, texCoord + toCenter * percent * strength / texSize);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n }\n\n color = color / total;\n\n /* switch back from pre-multiplied alpha */\n color.rgb /= color.a + 0.00001;\n\n return color;\n}\n`;\n\nconst uniforms = {\n center: [0.5, 0.5],\n strength: {value: 0.3, min: 0, softMax: 1}\n};\n\nexport default {\n name: 'zoomBlur',\n uniforms,\n fs,\n dependencies: [random],\n\n passes: [{sampler: true}]\n};\n"],"file":"zoomblur.js"}
@@ -1,24 +0,0 @@
1
- var fs = "uniform vec2 center;\nuniform float angle;\nuniform float size;\n\nfloat scale = 3.1514 / size;\n\nfloat pattern(float angle, vec2 texSize, vec2 texCoord) {\n float s = sin(angle), c = cos(angle);\n vec2 tex = texCoord * texSize - center * texSize;\n vec2 point = vec2(\n\tc * tex.x - s * tex.y,\n\ts * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n vec3 cmy = 1.0 - color.rgb;\n float k = min(cmy.x, min(cmy.y, cmy.z));\n cmy = (cmy - k) / (1.0 - k);\n cmy = clamp(\n\tcmy * 10.0 - 3.0 + vec3(\n pattern(angle + 0.26179, texSize, texCoord),\n\t pattern(angle + 1.30899, texSize, texCoord),\n pattern(angle, texSize, texCoord)\n ),\n\t0.0,\n\t1.0\n );\n k = clamp(k * 10.0 - 5.0 + pattern(angle + 0.78539, texSize, texCoord), 0.0, 1.0);\n return vec4(1.0 - cmy - k, color.a);\n}\n";
2
- var uniforms = {
3
- center: [0.5, 0.5],
4
- angle: {
5
- value: 1.1,
6
- softMin: 0,
7
- softMax: Math.PI / 2
8
- },
9
- size: {
10
- value: 4,
11
- min: 1,
12
- softMin: 3,
13
- softMax: 20
14
- }
15
- };
16
- export default {
17
- name: 'colorHalftone',
18
- uniforms: uniforms,
19
- fs: fs,
20
- passes: [{
21
- filter: true
22
- }]
23
- };
24
- //# sourceMappingURL=colorhalftone.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/fun-filters/colorhalftone.js"],"names":["fs","uniforms","center","angle","value","softMin","softMax","Math","PI","size","min","name","passes","filter"],"mappings":"AAYA,IAAMA,EAAE,q5BAAR;AAmCA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE,CAAC,GAAD,EAAM,GAAN,CADO;AAEfC,EAAAA,KAAK,EAAE;AAACC,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,OAAO,EAAE,CAAtB;AAAyBC,IAAAA,OAAO,EAAEC,IAAI,CAACC,EAAL,GAAU;AAA5C,GAFQ;AAGfC,EAAAA,IAAI,EAAE;AAACL,IAAAA,KAAK,EAAE,CAAR;AAAWM,IAAAA,GAAG,EAAE,CAAhB;AAAmBL,IAAAA,OAAO,EAAE,CAA5B;AAA+BC,IAAAA,OAAO,EAAE;AAAxC;AAHS,CAAjB;AAMA,eAAe;AACbK,EAAAA,IAAI,EAAE,eADO;AAEbV,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbY,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Color Halftone\n * @description Simulates a CMYK halftone rendering of the image by multiplying pixel values\n * with a four rotated 2D sine wave patterns, one each for cyan, magenta, yellow,\n * and black.\n * @param centerX The x coordinate of the pattern origin.\n * @param centerY The y coordinate of the pattern origin.\n * @param angle The rotation of the pattern in radians.\n * @param size The diameter of a dot in pixels.\n */\n\n// TODO pass texCoord to angle\nconst fs = `\\\nuniform vec2 center;\nuniform float angle;\nuniform float size;\n\nfloat scale = 3.1514 / size;\n\nfloat pattern(float angle, vec2 texSize, vec2 texCoord) {\n float s = sin(angle), c = cos(angle);\n vec2 tex = texCoord * texSize - center * texSize;\n vec2 point = vec2(\n\tc * tex.x - s * tex.y,\n\ts * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n vec3 cmy = 1.0 - color.rgb;\n float k = min(cmy.x, min(cmy.y, cmy.z));\n cmy = (cmy - k) / (1.0 - k);\n cmy = clamp(\n\tcmy * 10.0 - 3.0 + vec3(\n pattern(angle + 0.26179, texSize, texCoord),\n\t pattern(angle + 1.30899, texSize, texCoord),\n pattern(angle, texSize, texCoord)\n ),\n\t0.0,\n\t1.0\n );\n k = clamp(k * 10.0 - 5.0 + pattern(angle + 0.78539, texSize, texCoord), 0.0, 1.0);\n return vec4(1.0 - cmy - k, color.a);\n}\n`;\n\nconst uniforms = {\n center: [0.5, 0.5],\n angle: {value: 1.1, softMin: 0, softMax: Math.PI / 2},\n size: {value: 4, min: 1, softMin: 3, softMax: 20}\n};\n\nexport default {\n name: 'colorHalftone',\n uniforms,\n fs,\n\n passes: [{filter: true}]\n};\n"],"file":"colorhalftone.js"}
@@ -1,24 +0,0 @@
1
- var fs = "uniform vec2 center;\nuniform float angle;\nuniform float size;\n\nfloat pattern(vec2 texSize, vec2 texCoord) {\n float scale = 3.1415 / size;\n\n float s = sin(angle), c = cos(angle);\n vec2 tex = texCoord * texSize - center * texSize;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvec4 dotScreen_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n float average = (color.r + color.g + color.b) / 3.0;\n return vec4(vec3(average * 10.0 - 5.0 + pattern(texSize, texCoord)), color.a);\n}\n";
2
- var uniforms = {
3
- center: [0.5, 0.5],
4
- angle: {
5
- value: 1.1,
6
- softMin: 0,
7
- softMax: Math.PI / 2
8
- },
9
- size: {
10
- value: 3,
11
- min: 1,
12
- softMin: 3,
13
- softMax: 20
14
- }
15
- };
16
- export default {
17
- name: 'dotScreen',
18
- uniforms: uniforms,
19
- fs: fs,
20
- passes: [{
21
- filter: true
22
- }]
23
- };
24
- //# sourceMappingURL=dotscreen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/fun-filters/dotscreen.js"],"names":["fs","uniforms","center","angle","value","softMin","softMax","Math","PI","size","min","name","passes","filter"],"mappings":"AASA,IAAMA,EAAE,ylBAAR;AAuBA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE,CAAC,GAAD,EAAM,GAAN,CADO;AAEfC,EAAAA,KAAK,EAAE;AAACC,IAAAA,KAAK,EAAE,GAAR;AAAaC,IAAAA,OAAO,EAAE,CAAtB;AAAyBC,IAAAA,OAAO,EAAEC,IAAI,CAACC,EAAL,GAAU;AAA5C,GAFQ;AAGfC,EAAAA,IAAI,EAAE;AAACL,IAAAA,KAAK,EAAE,CAAR;AAAWM,IAAAA,GAAG,EAAE,CAAhB;AAAmBL,IAAAA,OAAO,EAAE,CAA5B;AAA+BC,IAAAA,OAAO,EAAE;AAAxC;AAHS,CAAjB;AAMA,eAAe;AACbK,EAAAA,IAAI,EAAE,WADO;AAEbV,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbY,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,MAAM,EAAE;AAAT,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Dot Screen\n * @description Simulates a black and white halftone rendering of the image by multiplying\n * pixel values with a rotated 2D sine wave pattern.\n * @param centerX The x coordinate of the pattern origin.\n * @param centerY The y coordinate of the pattern origin.\n * @param angle The rotation of the pattern in radians.\n * @param size The diameter of a dot in pixels.\n */\nconst fs = `\\\nuniform vec2 center;\nuniform float angle;\nuniform float size;\n\nfloat pattern(vec2 texSize, vec2 texCoord) {\n float scale = 3.1415 / size;\n\n float s = sin(angle), c = cos(angle);\n vec2 tex = texCoord * texSize - center * texSize;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvec4 dotScreen_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {\n float average = (color.r + color.g + color.b) / 3.0;\n return vec4(vec3(average * 10.0 - 5.0 + pattern(texSize, texCoord)), color.a);\n}\n`;\n\nconst uniforms = {\n center: [0.5, 0.5],\n angle: {value: 1.1, softMin: 0, softMax: Math.PI / 2},\n size: {value: 3, min: 1, softMin: 3, softMax: 20}\n};\n\nexport default {\n name: 'dotScreen',\n uniforms,\n fs,\n\n passes: [{filter: true}]\n};\n"],"file":"dotscreen.js"}
@@ -1,31 +0,0 @@
1
- import random from '../utils/random';
2
- var fs = "uniform float radius;\nuniform vec2 delta;\n\nvec4 edgeWork_sampleColor1(sampler2D source, vec2 texSize, vec2 texCoord) {\n vec2 relativeDelta = radius * delta / texSize;\n\n vec2 color = vec2(0.0);\n vec2 total = vec2(0.0);\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec3 sampleColor = texture2D(source, texCoord + relativeDelta * percent).rgb;\n float average = (sampleColor.r + sampleColor.g + sampleColor.b) / 3.0;\n color.x += average * weight;\n total.x += weight;\n if (abs(t) < 15.0) {\n weight = weight * 2.0 - 1.0;\n color.y += average * weight;\n total.y += weight;\n }\n }\n return vec4(color / total, 0.0, 1.0);\n}\n\nvec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {\n vec2 relativeDelta = radius * delta / texSize;\n\n vec2 color = vec2(0.0);\n vec2 total = vec2(0.0);\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec2 sampleColor = texture2D(source, texCoord + relativeDelta * percent).xy;\n color.x += sampleColor.x * weight;\n total.x += weight;\n if (abs(t) < 15.0) {\n weight = weight * 2.0 - 1.0;\n color.y += sampleColor.y * weight;\n total.y += weight;\n }\n }\n float c = clamp(10000.0 * (color.y / total.y - color.x / total.x) + 0.5, 0.0, 1.0);\n return vec4(c, c, c, 1.0);\n}\n";
3
- var uniforms = {
4
- radius: {
5
- value: 2,
6
- min: 1,
7
- softMax: 50
8
- },
9
- delta: {
10
- value: [1, 0],
11
- "private": true
12
- }
13
- };
14
- export default {
15
- name: 'edgeWork',
16
- uniforms: uniforms,
17
- fs: fs,
18
- dependencies: [random],
19
- passes: [{
20
- sampler: 'edgeWork_sampleColor1',
21
- uniforms: {
22
- delta: [1, 0]
23
- }
24
- }, {
25
- sampler: 'edgeWork_sampleColor2',
26
- uniforms: {
27
- delta: [0, 1]
28
- }
29
- }]
30
- };
31
- //# sourceMappingURL=edgework.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/fun-filters/edgework.js"],"names":["random","fs","uniforms","radius","value","min","softMax","delta","name","dependencies","passes","sampler"],"mappings":"AAMA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,IAAMC,EAAE,wuDAAR;AAuDA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE;AAACC,IAAAA,KAAK,EAAE,CAAR;AAAWC,IAAAA,GAAG,EAAE,CAAhB;AAAmBC,IAAAA,OAAO,EAAE;AAA5B,GADO;AAEfC,EAAAA,KAAK,EAAE;AAACH,IAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ,CAAR;AAAgB,eAAS;AAAzB;AAFQ,CAAjB;AAKA,eAAe;AACbI,EAAAA,IAAI,EAAE,UADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbQ,EAAAA,YAAY,EAAE,CAACT,MAAD,CAJD;AAKbU,EAAAA,MAAM,EAAE,CACN;AACEC,IAAAA,OAAO,EAAE,uBADX;AAEET,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAFZ,GADM,EAKN;AACEI,IAAAA,OAAO,EAAE,uBADX;AAEET,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAFZ,GALM;AALK,CAAf","sourcesContent":["/**\n * @filter Edge Work\n * @description Picks out different frequencies in the image by subtracting two\n * copies of the image blurred with different radii.\n * @param radius The radius of the effect in pixels.\n */\nimport random from '../utils/random';\n\nconst fs = `\\\nuniform float radius;\nuniform vec2 delta;\n\nvec4 edgeWork_sampleColor1(sampler2D source, vec2 texSize, vec2 texCoord) {\n vec2 relativeDelta = radius * delta / texSize;\n\n vec2 color = vec2(0.0);\n vec2 total = vec2(0.0);\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec3 sampleColor = texture2D(source, texCoord + relativeDelta * percent).rgb;\n float average = (sampleColor.r + sampleColor.g + sampleColor.b) / 3.0;\n color.x += average * weight;\n total.x += weight;\n if (abs(t) < 15.0) {\n weight = weight * 2.0 - 1.0;\n color.y += average * weight;\n total.y += weight;\n }\n }\n return vec4(color / total, 0.0, 1.0);\n}\n\nvec4 edgeWork_sampleColor2(sampler2D source, vec2 texSize, vec2 texCoord) {\n vec2 relativeDelta = radius * delta / texSize;\n\n vec2 color = vec2(0.0);\n vec2 total = vec2(0.0);\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec2 sampleColor = texture2D(source, texCoord + relativeDelta * percent).xy;\n color.x += sampleColor.x * weight;\n total.x += weight;\n if (abs(t) < 15.0) {\n weight = weight * 2.0 - 1.0;\n color.y += sampleColor.y * weight;\n total.y += weight;\n }\n }\n float c = clamp(10000.0 * (color.y / total.y - color.x / total.x) + 0.5, 0.0, 1.0);\n return vec4(c, c, c, 1.0);\n}\n`;\n\nconst uniforms = {\n radius: {value: 2, min: 1, softMax: 50},\n delta: {value: [1, 0], private: true}\n};\n\nexport default {\n name: 'edgeWork',\n uniforms,\n fs,\n dependencies: [random],\n passes: [\n {\n sampler: 'edgeWork_sampleColor1',\n uniforms: {delta: [1, 0]}\n },\n {\n sampler: 'edgeWork_sampleColor2',\n uniforms: {delta: [0, 1]}\n }\n ]\n};\n"],"file":"edgework.js"}
@@ -1,22 +0,0 @@
1
- var fs = "uniform vec2 center;\nuniform float scale;\n\nvec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 tex = (texCoord * texSize - center * texSize) / scale;\n tex.y /= 0.866025404;\n tex.x -= tex.y * 0.5;\n\n vec2 a;\n if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {\n a = vec2(floor(tex.x), floor(tex.y));\n }\n else a = vec2(ceil(tex.x), ceil(tex.y));\n vec2 b = vec2(ceil(tex.x), floor(tex.y));\n vec2 c = vec2(floor(tex.x), ceil(tex.y));\n\n vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);\n vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);\n vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);\n vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);\n\n float alen = length(TEX - A);\n float blen = length(TEX - B);\n float clen = length(TEX - C);\n\n vec2 choice;\n if (alen < blen) {\n if (alen < clen) choice = a;\n else choice = c;\n } else {\n if (blen < clen) choice = b;\n else choice = c;\n }\n\n choice.x += choice.y * 0.5;\n choice.y *= 0.866025404;\n choice *= scale / texSize;\n\n return texture2D(texture, choice + center);\n}\n";
2
- var uniforms = {
3
- center: {
4
- value: [0.5, 0.5],
5
- hint: 'screenspace'
6
- },
7
- scale: {
8
- value: 10,
9
- min: 1,
10
- softMin: 5,
11
- softMax: 50
12
- }
13
- };
14
- export default {
15
- name: 'hexagonalPixelate',
16
- uniforms: uniforms,
17
- fs: fs,
18
- passes: [{
19
- sampler: true
20
- }]
21
- };
22
- //# sourceMappingURL=hexagonalpixelate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/fun-filters/hexagonalpixelate.js"],"names":["fs","uniforms","center","value","hint","scale","min","softMin","softMax","name","passes","sampler"],"mappings":"AAQA,IAAMA,EAAE,slCAAR;AA2CA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,MAAM,EAAE;AAACC,IAAAA,KAAK,EAAE,CAAC,GAAD,EAAM,GAAN,CAAR;AAAoBC,IAAAA,IAAI,EAAE;AAA1B,GADO;AAEfC,EAAAA,KAAK,EAAE;AAACF,IAAAA,KAAK,EAAE,EAAR;AAAYG,IAAAA,GAAG,EAAE,CAAjB;AAAoBC,IAAAA,OAAO,EAAE,CAA7B;AAAgCC,IAAAA,OAAO,EAAE;AAAzC;AAFQ,CAAjB;AAKA,eAAe;AACbC,EAAAA,IAAI,EAAE,mBADO;AAEbR,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbU,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE;AAAV,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Hexagonal Pixelate\n * @description Renders the image using a pattern of hexagonal tiles. Tile colors\n * are nearest-neighbor sampled from the centers of the tiles.\n * @param centerX The x coordinate of the pattern center.\n * @param centerY The y coordinate of the pattern center.\n * @param scale The width of an individual tile, in pixels.\n */\nconst fs = `\\\nuniform vec2 center;\nuniform float scale;\n\nvec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 tex = (texCoord * texSize - center * texSize) / scale;\n tex.y /= 0.866025404;\n tex.x -= tex.y * 0.5;\n\n vec2 a;\n if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {\n a = vec2(floor(tex.x), floor(tex.y));\n }\n else a = vec2(ceil(tex.x), ceil(tex.y));\n vec2 b = vec2(ceil(tex.x), floor(tex.y));\n vec2 c = vec2(floor(tex.x), ceil(tex.y));\n\n vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);\n vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);\n vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);\n vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);\n\n float alen = length(TEX - A);\n float blen = length(TEX - B);\n float clen = length(TEX - C);\n\n vec2 choice;\n if (alen < blen) {\n if (alen < clen) choice = a;\n else choice = c;\n } else {\n if (blen < clen) choice = b;\n else choice = c;\n }\n\n choice.x += choice.y * 0.5;\n choice.y *= 0.866025404;\n choice *= scale / texSize;\n\n return texture2D(texture, choice + center);\n}\n`;\n\nconst uniforms = {\n center: {value: [0.5, 0.5], hint: 'screenspace'},\n scale: {value: 10, min: 1, softMin: 5, softMax: 50}\n};\n\nexport default {\n name: 'hexagonalPixelate',\n uniforms,\n fs,\n\n passes: [{sampler: true}]\n};\n"],"file":"hexagonalpixelate.js"}
@@ -1,17 +0,0 @@
1
- var fs = "uniform float strength;\n\nvec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 dx = vec2(1.0 / texSize.x, 0.0);\n vec2 dy = vec2(0.0, 1.0 / texSize.y);\n vec4 color = texture2D(texture, texCoord);\n float bigTotal = 0.0;\n float smallTotal = 0.0;\n vec3 bigAverage = vec3(0.0);\n vec3 smallAverage = vec3(0.0);\n for (float x = -2.0; x <= 2.0; x += 1.0) {\n for (float y = -2.0; y <= 2.0; y += 1.0) {\n vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;\n bigAverage += sample;\n bigTotal += 1.0;\n if (abs(x) + abs(y) < 2.0) {\n smallAverage += sample;\n smallTotal += 1.0;\n }\n }\n }\n vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);\n float power = strength * strength * strength * strength * strength;\n return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);\n}\n";
2
- var uniforms = {
3
- strength: {
4
- value: 0.25,
5
- min: 0,
6
- softMax: 1
7
- }
8
- };
9
- export default {
10
- name: 'ink',
11
- uniforms: uniforms,
12
- fs: fs,
13
- passes: [{
14
- sampler: true
15
- }]
16
- };
17
- //# sourceMappingURL=ink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/shader-modules/fun-filters/ink.js"],"names":["fs","uniforms","strength","value","min","softMax","name","passes","sampler"],"mappings":"AAUA,IAAMA,EAAE,q5BAAR;AA4BA,IAAMC,QAAQ,GAAG;AACfC,EAAAA,QAAQ,EAAE;AAACC,IAAAA,KAAK,EAAE,IAAR;AAAcC,IAAAA,GAAG,EAAE,CAAnB;AAAsBC,IAAAA,OAAO,EAAE;AAA/B;AADK,CAAjB;AAIA,eAAe;AACbC,EAAAA,IAAI,EAAE,KADO;AAEbL,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAKbO,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE;AAAV,GAAD;AALK,CAAf","sourcesContent":["/**\n * @filter Ink\n * @description Simulates outlining the image in ink by darkening edges stronger than a\n * certain threshold. The edge detection value is the difference of two\n * copies of the image, each blurred using a blur of a different radius.\n * @param strength The multiplicative scale of the ink edges. Values in the range 0 to 1\n * are usually sufficient, where 0 doesn't change the image and 1 adds lots\n * of black edges. Negative strength values will create white ink edges\n * instead of black ones.\n */\nconst fs = `\\\nuniform float strength;\n\nvec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {\n vec2 dx = vec2(1.0 / texSize.x, 0.0);\n vec2 dy = vec2(0.0, 1.0 / texSize.y);\n vec4 color = texture2D(texture, texCoord);\n float bigTotal = 0.0;\n float smallTotal = 0.0;\n vec3 bigAverage = vec3(0.0);\n vec3 smallAverage = vec3(0.0);\n for (float x = -2.0; x <= 2.0; x += 1.0) {\n for (float y = -2.0; y <= 2.0; y += 1.0) {\n vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;\n bigAverage += sample;\n bigTotal += 1.0;\n if (abs(x) + abs(y) < 2.0) {\n smallAverage += sample;\n smallTotal += 1.0;\n }\n }\n }\n vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);\n float power = strength * strength * strength * strength * strength;\n return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);\n}\n`;\n\nconst uniforms = {\n strength: {value: 0.25, min: 0, softMax: 1}\n};\n\nexport default {\n name: 'ink',\n uniforms,\n fs,\n\n passes: [{sampler: true}]\n};\n"],"file":"ink.js"}