@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.
- package/LICENSE +10 -1
- package/README.md +2 -2
- package/dist/dist.dev.js +3458 -0
- package/dist/dist.min.js +18 -30
- package/dist/index.cjs +1724 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/passes/postprocessing/fxaa/fxaa.d.ts +15 -0
- package/dist/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -0
- package/{src/shader-modules → dist/passes/postprocessing}/fxaa/fxaa.js +18 -14
- package/dist/passes/postprocessing/fxaa/fxaa.js.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts +43 -0
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +68 -0
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/denoise.d.ts +43 -0
- package/dist/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/denoise.js +74 -0
- package/dist/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts +46 -0
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.js +101 -0
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/noise.d.ts +33 -0
- package/dist/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/noise.js +58 -0
- package/dist/passes/postprocessing/image-adjust-filters/noise.js.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/sepia.d.ts +29 -0
- package/dist/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/sepia.js +44 -0
- package/dist/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts +29 -0
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.js +35 -0
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/vignette.d.ts +44 -0
- package/dist/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-adjust-filters/vignette.js +39 -0
- package/dist/passes/postprocessing/image-adjust-filters/vignette.js.map +1 -0
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts +79 -0
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.js +111 -0
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.js.map +1 -0
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts +56 -0
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.js +65 -0
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.js.map +1 -0
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts +42 -0
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.js +59 -0
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.js.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts +52 -0
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.js +64 -0
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.js.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts +50 -0
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.js +50 -0
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.js.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts +54 -0
- package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/edgework.js +101 -0
- package/dist/passes/postprocessing/image-fun-filters/edgework.js.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +43 -0
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.js +68 -0
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.js.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/ink.d.ts +40 -0
- package/dist/passes/postprocessing/image-fun-filters/ink.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/ink.js +52 -0
- package/dist/passes/postprocessing/image-fun-filters/ink.js.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts +45 -0
- package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-fun-filters/magnify.js +49 -0
- package/dist/passes/postprocessing/image-fun-filters/magnify.js.map +1 -0
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts +49 -0
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.js +56 -0
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.js.map +1 -0
- package/dist/passes/postprocessing/image-warp-filters/swirl.d.ts +50 -0
- package/dist/passes/postprocessing/image-warp-filters/swirl.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-warp-filters/swirl.js +57 -0
- package/dist/passes/postprocessing/image-warp-filters/swirl.js.map +1 -0
- package/dist/passes/postprocessing/image-warp-filters/warp.d.ts +8 -0
- package/dist/passes/postprocessing/image-warp-filters/warp.d.ts.map +1 -0
- package/dist/passes/postprocessing/image-warp-filters/warp.js +21 -0
- package/dist/passes/postprocessing/image-warp-filters/warp.js.map +1 -0
- package/package.json +37 -13
- package/src/index.ts +99 -0
- package/src/passes/postprocessing/fxaa/fxaa.ts +694 -0
- package/src/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +81 -0
- package/src/passes/postprocessing/image-adjust-filters/denoise.ts +97 -0
- package/src/passes/postprocessing/image-adjust-filters/huesaturation.ts +120 -0
- package/src/passes/postprocessing/image-adjust-filters/noise.ts +73 -0
- package/src/passes/postprocessing/image-adjust-filters/sepia.ts +54 -0
- package/src/passes/postprocessing/image-adjust-filters/vibrance.ts +48 -0
- package/src/passes/postprocessing/image-adjust-filters/vignette.ts +58 -0
- package/src/passes/postprocessing/image-blur-filters/tiltshift.ts +135 -0
- package/src/passes/postprocessing/image-blur-filters/triangleblur.ts +84 -0
- package/src/passes/postprocessing/image-blur-filters/zoomblur.ts +75 -0
- package/src/passes/postprocessing/image-fun-filters/colorhalftone.ts +85 -0
- package/src/passes/postprocessing/image-fun-filters/dotscreen.ts +70 -0
- package/src/passes/postprocessing/image-fun-filters/edgework.ts +120 -0
- package/src/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts +86 -0
- package/src/passes/postprocessing/image-fun-filters/ink.ts +73 -0
- package/src/passes/postprocessing/image-fun-filters/magnify.ts +70 -0
- package/src/passes/postprocessing/image-warp-filters/bulgepinch.ts +72 -0
- package/src/passes/postprocessing/image-warp-filters/swirl.ts +77 -0
- package/src/passes/postprocessing/image-warp-filters/warp.ts +28 -0
- package/dist/dist.js +0 -3621
- package/dist/es5/experimental/passes/outline-pass.js +0 -125
- package/dist/es5/experimental/passes/outline-pass.js.map +0 -1
- package/dist/es5/experimental/passes/ssao-pass.js +0 -133
- package/dist/es5/experimental/passes/ssao-pass.js.map +0 -1
- package/dist/es5/experimental/shader-modules/convolution.js +0 -46
- package/dist/es5/experimental/shader-modules/convolution.js.map +0 -1
- package/dist/es5/experimental/shader-modules/depth.js +0 -27
- package/dist/es5/experimental/shader-modules/depth.js.map +0 -1
- package/dist/es5/experimental/shader-modules/pack.js +0 -19
- package/dist/es5/experimental/shader-modules/pack.js.map +0 -1
- package/dist/es5/experimental/shader-modules/ssao.js +0 -32
- package/dist/es5/experimental/shader-modules/ssao.js.map +0 -1
- package/dist/es5/index.js +0 -184
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/shader-modules/adjust-filters/brightnesscontrast.js +0 -29
- package/dist/es5/shader-modules/adjust-filters/brightnesscontrast.js.map +0 -1
- package/dist/es5/shader-modules/adjust-filters/denoise.js +0 -29
- package/dist/es5/shader-modules/adjust-filters/denoise.js.map +0 -1
- package/dist/es5/shader-modules/adjust-filters/huesaturation.js +0 -29
- package/dist/es5/shader-modules/adjust-filters/huesaturation.js.map +0 -1
- package/dist/es5/shader-modules/adjust-filters/noise.js +0 -24
- package/dist/es5/shader-modules/adjust-filters/noise.js.map +0 -1
- package/dist/es5/shader-modules/adjust-filters/sepia.js +0 -24
- package/dist/es5/shader-modules/adjust-filters/sepia.js.map +0 -1
- package/dist/es5/shader-modules/adjust-filters/vibrance.js +0 -24
- package/dist/es5/shader-modules/adjust-filters/vibrance.js.map +0 -1
- package/dist/es5/shader-modules/adjust-filters/vignette.js +0 -29
- package/dist/es5/shader-modules/adjust-filters/vignette.js.map +0 -1
- package/dist/es5/shader-modules/blur-filters/tiltshift.js +0 -49
- package/dist/es5/shader-modules/blur-filters/tiltshift.js.map +0 -1
- package/dist/es5/shader-modules/blur-filters/triangleblur.js +0 -42
- package/dist/es5/shader-modules/blur-filters/triangleblur.js.map +0 -1
- package/dist/es5/shader-modules/blur-filters/zoomblur.js +0 -31
- package/dist/es5/shader-modules/blur-filters/zoomblur.js.map +0 -1
- package/dist/es5/shader-modules/fun-filters/colorhalftone.js +0 -31
- package/dist/es5/shader-modules/fun-filters/colorhalftone.js.map +0 -1
- package/dist/es5/shader-modules/fun-filters/dotscreen.js +0 -31
- package/dist/es5/shader-modules/fun-filters/dotscreen.js.map +0 -1
- package/dist/es5/shader-modules/fun-filters/edgework.js +0 -42
- package/dist/es5/shader-modules/fun-filters/edgework.js.map +0 -1
- package/dist/es5/shader-modules/fun-filters/hexagonalpixelate.js +0 -29
- package/dist/es5/shader-modules/fun-filters/hexagonalpixelate.js.map +0 -1
- package/dist/es5/shader-modules/fun-filters/ink.js +0 -24
- package/dist/es5/shader-modules/fun-filters/ink.js.map +0 -1
- package/dist/es5/shader-modules/fxaa/fxaa.js +0 -47
- package/dist/es5/shader-modules/fxaa/fxaa.js.map +0 -1
- package/dist/es5/shader-modules/utils/random.js +0 -13
- package/dist/es5/shader-modules/utils/random.js.map +0 -1
- package/dist/es5/shader-modules/warp-filters/bulgepinch.js +0 -36
- package/dist/es5/shader-modules/warp-filters/bulgepinch.js.map +0 -1
- package/dist/es5/shader-modules/warp-filters/swirl.js +0 -36
- package/dist/es5/shader-modules/warp-filters/swirl.js.map +0 -1
- package/dist/es5/shader-modules/warp-filters/warp.js +0 -13
- package/dist/es5/shader-modules/warp-filters/warp.js.map +0 -1
- package/dist/es6/experimental/passes/outline-pass.js +0 -48
- package/dist/es6/experimental/passes/outline-pass.js.map +0 -1
- package/dist/es6/experimental/passes/ssao-pass.js +0 -76
- package/dist/es6/experimental/passes/ssao-pass.js.map +0 -1
- package/dist/es6/experimental/shader-modules/convolution.js +0 -37
- package/dist/es6/experimental/shader-modules/convolution.js.map +0 -1
- package/dist/es6/experimental/shader-modules/depth.js +0 -13
- package/dist/es6/experimental/shader-modules/depth.js.map +0 -1
- package/dist/es6/experimental/shader-modules/pack.js +0 -10
- package/dist/es6/experimental/shader-modules/pack.js.map +0 -1
- package/dist/es6/experimental/shader-modules/ssao.js +0 -21
- package/dist/es6/experimental/shader-modules/ssao.js.map +0 -1
- package/dist/es6/index.js +0 -23
- package/dist/es6/index.js.map +0 -1
- package/dist/es6/shader-modules/adjust-filters/brightnesscontrast.js +0 -22
- package/dist/es6/shader-modules/adjust-filters/brightnesscontrast.js.map +0 -1
- package/dist/es6/shader-modules/adjust-filters/denoise.js +0 -20
- package/dist/es6/shader-modules/adjust-filters/denoise.js.map +0 -1
- package/dist/es6/shader-modules/adjust-filters/huesaturation.js +0 -22
- package/dist/es6/shader-modules/adjust-filters/huesaturation.js.map +0 -1
- package/dist/es6/shader-modules/adjust-filters/noise.js +0 -17
- package/dist/es6/shader-modules/adjust-filters/noise.js.map +0 -1
- package/dist/es6/shader-modules/adjust-filters/sepia.js +0 -17
- package/dist/es6/shader-modules/adjust-filters/sepia.js.map +0 -1
- package/dist/es6/shader-modules/adjust-filters/vibrance.js +0 -17
- package/dist/es6/shader-modules/adjust-filters/vibrance.js.map +0 -1
- package/dist/es6/shader-modules/adjust-filters/vignette.js +0 -22
- package/dist/es6/shader-modules/adjust-filters/vignette.js.map +0 -1
- package/dist/es6/shader-modules/blur-filters/tiltshift.js +0 -38
- package/dist/es6/shader-modules/blur-filters/tiltshift.js.map +0 -1
- package/dist/es6/shader-modules/blur-filters/triangleblur.js +0 -31
- package/dist/es6/shader-modules/blur-filters/triangleblur.js.map +0 -1
- package/dist/es6/shader-modules/blur-filters/zoomblur.js +0 -20
- package/dist/es6/shader-modules/blur-filters/zoomblur.js.map +0 -1
- package/dist/es6/shader-modules/fun-filters/colorhalftone.js +0 -24
- package/dist/es6/shader-modules/fun-filters/colorhalftone.js.map +0 -1
- package/dist/es6/shader-modules/fun-filters/dotscreen.js +0 -24
- package/dist/es6/shader-modules/fun-filters/dotscreen.js.map +0 -1
- package/dist/es6/shader-modules/fun-filters/edgework.js +0 -31
- package/dist/es6/shader-modules/fun-filters/edgework.js.map +0 -1
- package/dist/es6/shader-modules/fun-filters/hexagonalpixelate.js +0 -22
- package/dist/es6/shader-modules/fun-filters/hexagonalpixelate.js.map +0 -1
- package/dist/es6/shader-modules/fun-filters/ink.js +0 -17
- package/dist/es6/shader-modules/fun-filters/ink.js.map +0 -1
- package/dist/es6/shader-modules/fxaa/fxaa.js +0 -39
- package/dist/es6/shader-modules/fxaa/fxaa.js.map +0 -1
- package/dist/es6/shader-modules/utils/random.js +0 -6
- package/dist/es6/shader-modules/utils/random.js.map +0 -1
- package/dist/es6/shader-modules/warp-filters/bulgepinch.js +0 -25
- package/dist/es6/shader-modules/warp-filters/bulgepinch.js.map +0 -1
- package/dist/es6/shader-modules/warp-filters/swirl.js +0 -25
- package/dist/es6/shader-modules/warp-filters/swirl.js.map +0 -1
- package/dist/es6/shader-modules/warp-filters/warp.js +0 -6
- package/dist/es6/shader-modules/warp-filters/warp.js.map +0 -1
- package/dist/esm/experimental/passes/outline-pass.js +0 -114
- package/dist/esm/experimental/passes/outline-pass.js.map +0 -1
- package/dist/esm/experimental/passes/ssao-pass.js +0 -120
- package/dist/esm/experimental/passes/ssao-pass.js.map +0 -1
- package/dist/esm/experimental/shader-modules/convolution.js +0 -39
- package/dist/esm/experimental/shader-modules/convolution.js.map +0 -1
- package/dist/esm/experimental/shader-modules/depth.js +0 -16
- package/dist/esm/experimental/shader-modules/depth.js.map +0 -1
- package/dist/esm/experimental/shader-modules/pack.js +0 -12
- package/dist/esm/experimental/shader-modules/pack.js.map +0 -1
- package/dist/esm/experimental/shader-modules/ssao.js +0 -21
- package/dist/esm/experimental/shader-modules/ssao.js.map +0 -1
- package/dist/esm/index.js +0 -23
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/shader-modules/adjust-filters/brightnesscontrast.js +0 -22
- package/dist/esm/shader-modules/adjust-filters/brightnesscontrast.js.map +0 -1
- package/dist/esm/shader-modules/adjust-filters/denoise.js +0 -22
- package/dist/esm/shader-modules/adjust-filters/denoise.js.map +0 -1
- package/dist/esm/shader-modules/adjust-filters/huesaturation.js +0 -22
- package/dist/esm/shader-modules/adjust-filters/huesaturation.js.map +0 -1
- package/dist/esm/shader-modules/adjust-filters/noise.js +0 -17
- package/dist/esm/shader-modules/adjust-filters/noise.js.map +0 -1
- package/dist/esm/shader-modules/adjust-filters/sepia.js +0 -17
- package/dist/esm/shader-modules/adjust-filters/sepia.js.map +0 -1
- package/dist/esm/shader-modules/adjust-filters/vibrance.js +0 -17
- package/dist/esm/shader-modules/adjust-filters/vibrance.js.map +0 -1
- package/dist/esm/shader-modules/adjust-filters/vignette.js +0 -22
- package/dist/esm/shader-modules/adjust-filters/vignette.js.map +0 -1
- package/dist/esm/shader-modules/blur-filters/tiltshift.js +0 -38
- package/dist/esm/shader-modules/blur-filters/tiltshift.js.map +0 -1
- package/dist/esm/shader-modules/blur-filters/triangleblur.js +0 -31
- package/dist/esm/shader-modules/blur-filters/triangleblur.js.map +0 -1
- package/dist/esm/shader-modules/blur-filters/zoomblur.js +0 -20
- package/dist/esm/shader-modules/blur-filters/zoomblur.js.map +0 -1
- package/dist/esm/shader-modules/fun-filters/colorhalftone.js +0 -24
- package/dist/esm/shader-modules/fun-filters/colorhalftone.js.map +0 -1
- package/dist/esm/shader-modules/fun-filters/dotscreen.js +0 -24
- package/dist/esm/shader-modules/fun-filters/dotscreen.js.map +0 -1
- package/dist/esm/shader-modules/fun-filters/edgework.js +0 -31
- package/dist/esm/shader-modules/fun-filters/edgework.js.map +0 -1
- package/dist/esm/shader-modules/fun-filters/hexagonalpixelate.js +0 -22
- package/dist/esm/shader-modules/fun-filters/hexagonalpixelate.js.map +0 -1
- package/dist/esm/shader-modules/fun-filters/ink.js +0 -17
- package/dist/esm/shader-modules/fun-filters/ink.js.map +0 -1
- package/dist/esm/shader-modules/fxaa/fxaa.js +0 -39
- package/dist/esm/shader-modules/fxaa/fxaa.js.map +0 -1
- package/dist/esm/shader-modules/utils/random.js +0 -6
- package/dist/esm/shader-modules/utils/random.js.map +0 -1
- package/dist/esm/shader-modules/warp-filters/bulgepinch.js +0 -25
- package/dist/esm/shader-modules/warp-filters/bulgepinch.js.map +0 -1
- package/dist/esm/shader-modules/warp-filters/swirl.js +0 -25
- package/dist/esm/shader-modules/warp-filters/swirl.js.map +0 -1
- package/dist/esm/shader-modules/warp-filters/warp.js +0 -6
- package/dist/esm/shader-modules/warp-filters/warp.js.map +0 -1
- package/src/experimental/passes/outline-pass.js +0 -58
- package/src/experimental/passes/ssao-pass.js +0 -73
- package/src/experimental/passes/ssao-pass.md +0 -15
- package/src/experimental/shader-modules/convolution.js +0 -96
- package/src/experimental/shader-modules/convolution.md +0 -15
- package/src/experimental/shader-modules/depth.js +0 -84
- package/src/experimental/shader-modules/depth.md +0 -76
- package/src/experimental/shader-modules/pack.js +0 -32
- package/src/experimental/shader-modules/pack.md +0 -15
- package/src/experimental/shader-modules/ssao.js +0 -183
- package/src/experimental/shader-modules/ssao.md +0 -4
- package/src/index.js +0 -35
- package/src/shader-modules/adjust-filters/brightnesscontrast.js +0 -38
- package/src/shader-modules/adjust-filters/denoise.js +0 -49
- package/src/shader-modules/adjust-filters/huesaturation.js +0 -57
- package/src/shader-modules/adjust-filters/noise.js +0 -36
- package/src/shader-modules/adjust-filters/sepia.js +0 -37
- package/src/shader-modules/adjust-filters/vibrance.js +0 -32
- package/src/shader-modules/adjust-filters/vignette.js +0 -33
- package/src/shader-modules/blur-filters/tiltshift.js +0 -105
- package/src/shader-modules/blur-filters/triangleblur.js +0 -55
- package/src/shader-modules/blur-filters/zoomblur.js +0 -56
- package/src/shader-modules/fun-filters/colorhalftone.js +0 -60
- package/src/shader-modules/fun-filters/dotscreen.js +0 -45
- package/src/shader-modules/fun-filters/edgework.js +0 -84
- package/src/shader-modules/fun-filters/hexagonalpixelate.js +0 -63
- package/src/shader-modules/fun-filters/ink.js +0 -49
- package/src/shader-modules/utils/random.js +0 -12
- package/src/shader-modules/warp-filters/bulgepinch.js +0 -52
- package/src/shader-modules/warp-filters/swirl.js +0 -55
- package/src/shader-modules/warp-filters/warp.js +0 -19
package/dist/es5/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AAGA;;AAGA;;AACA;;AACA;;AACA","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,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
brightness: {
|
|
10
|
-
value: 0,
|
|
11
|
-
min: -1,
|
|
12
|
-
max: 1
|
|
13
|
-
},
|
|
14
|
-
contrast: {
|
|
15
|
-
value: 0,
|
|
16
|
-
min: -1,
|
|
17
|
-
max: 1
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var _default = {
|
|
21
|
-
name: 'brightnessContrast',
|
|
22
|
-
uniforms: uniforms,
|
|
23
|
-
fs: fs,
|
|
24
|
-
passes: [{
|
|
25
|
-
filter: true
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
exports["default"] = _default;
|
|
29
|
-
//# 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;eAKe;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,C","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,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
strength: {
|
|
10
|
-
value: 0.5,
|
|
11
|
-
min: 0,
|
|
12
|
-
max: 0.1,
|
|
13
|
-
adjust: function adjust(strength) {
|
|
14
|
-
return 0.53 + 200 * Math.pow(1 - strength, 4);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
var _default = {
|
|
19
|
-
name: 'denoise',
|
|
20
|
-
uniforms: uniforms,
|
|
21
|
-
fs: fs,
|
|
22
|
-
passes: [{
|
|
23
|
-
sampler: true
|
|
24
|
-
}, {
|
|
25
|
-
sampler: true
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
exports["default"] = _default;
|
|
29
|
-
//# 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;eASe;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,C","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,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
hue: {
|
|
10
|
-
value: 0,
|
|
11
|
-
min: -1,
|
|
12
|
-
max: 1
|
|
13
|
-
},
|
|
14
|
-
saturation: {
|
|
15
|
-
value: 0,
|
|
16
|
-
min: -1,
|
|
17
|
-
max: 1
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var _default = {
|
|
21
|
-
name: 'hueSaturation',
|
|
22
|
-
uniforms: uniforms,
|
|
23
|
-
fs: fs,
|
|
24
|
-
passes: [{
|
|
25
|
-
filter: true
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
exports["default"] = _default;
|
|
29
|
-
//# 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;eAKe;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,C","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,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
amount: {
|
|
10
|
-
value: 0.5,
|
|
11
|
-
min: 0,
|
|
12
|
-
max: 1
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var _default = {
|
|
16
|
-
name: 'noise',
|
|
17
|
-
uniforms: uniforms,
|
|
18
|
-
fs: fs,
|
|
19
|
-
passes: [{
|
|
20
|
-
filter: true
|
|
21
|
-
}]
|
|
22
|
-
};
|
|
23
|
-
exports["default"] = _default;
|
|
24
|
-
//# 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;eAIe;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,C","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,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
amount: {
|
|
10
|
-
value: 0.5,
|
|
11
|
-
min: 0,
|
|
12
|
-
max: 1
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var _default = {
|
|
16
|
-
name: 'sepia',
|
|
17
|
-
uniforms: uniforms,
|
|
18
|
-
fs: fs,
|
|
19
|
-
passes: [{
|
|
20
|
-
filter: true
|
|
21
|
-
}]
|
|
22
|
-
};
|
|
23
|
-
exports["default"] = _default;
|
|
24
|
-
//# 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;eAIe;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,C","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,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
amount: {
|
|
10
|
-
value: 0,
|
|
11
|
-
min: -1,
|
|
12
|
-
max: 1
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var _default = {
|
|
16
|
-
name: 'vibrance',
|
|
17
|
-
uniforms: uniforms,
|
|
18
|
-
fs: fs,
|
|
19
|
-
passes: [{
|
|
20
|
-
filter: true
|
|
21
|
-
}]
|
|
22
|
-
};
|
|
23
|
-
exports["default"] = _default;
|
|
24
|
-
//# 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;eAIe;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,C","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,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
radius: {
|
|
10
|
-
value: 0.5,
|
|
11
|
-
min: 0,
|
|
12
|
-
max: 1
|
|
13
|
-
},
|
|
14
|
-
amount: {
|
|
15
|
-
value: 0.5,
|
|
16
|
-
min: 0,
|
|
17
|
-
max: 1
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var _default = {
|
|
21
|
-
name: 'vignette',
|
|
22
|
-
fs: fs,
|
|
23
|
-
uniforms: uniforms,
|
|
24
|
-
passes: [{
|
|
25
|
-
filter: true
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
exports["default"] = _default;
|
|
29
|
-
//# 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;eAKe;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,C","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,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _random = _interopRequireDefault(require("../utils/random"));
|
|
11
|
-
|
|
12
|
-
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";
|
|
13
|
-
var uniforms = {
|
|
14
|
-
blurRadius: {
|
|
15
|
-
value: 15,
|
|
16
|
-
min: 0,
|
|
17
|
-
max: 50
|
|
18
|
-
},
|
|
19
|
-
gradientRadius: {
|
|
20
|
-
value: 200,
|
|
21
|
-
min: 0,
|
|
22
|
-
max: 400
|
|
23
|
-
},
|
|
24
|
-
start: [0, 0],
|
|
25
|
-
end: [1, 1],
|
|
26
|
-
invert: {
|
|
27
|
-
value: false,
|
|
28
|
-
"private": true
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var _default = {
|
|
32
|
-
name: 'tiltShift',
|
|
33
|
-
uniforms: uniforms,
|
|
34
|
-
fs: fs,
|
|
35
|
-
dependencies: [_random["default"]],
|
|
36
|
-
passes: [{
|
|
37
|
-
sampler: true,
|
|
38
|
-
uniforms: {
|
|
39
|
-
invert: false
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
sampler: true,
|
|
43
|
-
uniforms: {
|
|
44
|
-
invert: true
|
|
45
|
-
}
|
|
46
|
-
}]
|
|
47
|
-
};
|
|
48
|
-
exports["default"] = _default;
|
|
49
|
-
//# sourceMappingURL=tiltshift.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shader-modules/blur-filters/tiltshift.js"],"names":["fs","uniforms","blurRadius","value","min","max","gradientRadius","start","end","invert","name","dependencies","random","passes","sampler"],"mappings":";;;;;;;;;AAiBA;;AAEA,IAAMA,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;eAQe;AACbO,EAAAA,IAAI,EAAE,WADO;AAEbT,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbW,EAAAA,YAAY,EAAE,CAACC,kBAAD,CAJD;AAMbC,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE,IAAV;AAAgBb,IAAAA,QAAQ,EAAE;AAACQ,MAAAA,MAAM,EAAE;AAAT;AAA1B,GAAD,EAA6C;AAACK,IAAAA,OAAO,EAAE,IAAV;AAAgBb,IAAAA,QAAQ,EAAE;AAACQ,MAAAA,MAAM,EAAE;AAAT;AAA1B,GAA7C;AANK,C","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,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _random = _interopRequireDefault(require("../utils/random"));
|
|
11
|
-
|
|
12
|
-
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";
|
|
13
|
-
var uniforms = {
|
|
14
|
-
radius: {
|
|
15
|
-
value: 20,
|
|
16
|
-
min: 0,
|
|
17
|
-
softMax: 100
|
|
18
|
-
},
|
|
19
|
-
delta: {
|
|
20
|
-
value: [1, 0],
|
|
21
|
-
"private": true
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
var _default = {
|
|
25
|
-
name: 'triangleBlur',
|
|
26
|
-
uniforms: uniforms,
|
|
27
|
-
fs: fs,
|
|
28
|
-
dependencies: [_random["default"]],
|
|
29
|
-
passes: [{
|
|
30
|
-
sampler: true,
|
|
31
|
-
uniforms: {
|
|
32
|
-
delta: [1, 0]
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
sampler: true,
|
|
36
|
-
uniforms: {
|
|
37
|
-
delta: [0, 1]
|
|
38
|
-
}
|
|
39
|
-
}]
|
|
40
|
-
};
|
|
41
|
-
exports["default"] = _default;
|
|
42
|
-
//# sourceMappingURL=triangleblur.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shader-modules/blur-filters/triangleblur.js"],"names":["fs","uniforms","radius","value","min","softMax","delta","name","dependencies","random","passes","sampler"],"mappings":";;;;;;;;;AAOA;;AAEA,IAAMA,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;eAKe;AACbI,EAAAA,IAAI,EAAE,cADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbQ,EAAAA,YAAY,EAAE,CAACC,kBAAD,CAJD;AAKbC,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE,IAAV;AAAgBV,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAA1B,GAAD,EAA6C;AAACK,IAAAA,OAAO,EAAE,IAAV;AAAgBV,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAA1B,GAA7C;AALK,C","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,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _random = _interopRequireDefault(require("../utils/random"));
|
|
11
|
-
|
|
12
|
-
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";
|
|
13
|
-
var uniforms = {
|
|
14
|
-
center: [0.5, 0.5],
|
|
15
|
-
strength: {
|
|
16
|
-
value: 0.3,
|
|
17
|
-
min: 0,
|
|
18
|
-
softMax: 1
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
var _default = {
|
|
22
|
-
name: 'zoomBlur',
|
|
23
|
-
uniforms: uniforms,
|
|
24
|
-
fs: fs,
|
|
25
|
-
dependencies: [_random["default"]],
|
|
26
|
-
passes: [{
|
|
27
|
-
sampler: true
|
|
28
|
-
}]
|
|
29
|
-
};
|
|
30
|
-
exports["default"] = _default;
|
|
31
|
-
//# sourceMappingURL=zoomblur.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shader-modules/blur-filters/zoomblur.js"],"names":["fs","uniforms","center","strength","value","min","softMax","name","dependencies","random","passes","sampler"],"mappings":";;;;;;;;;AAQA;;AAEA,IAAMA,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;eAKe;AACbC,EAAAA,IAAI,EAAE,UADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbQ,EAAAA,YAAY,EAAE,CAACC,kBAAD,CAJD;AAMbC,EAAAA,MAAM,EAAE,CAAC;AAACC,IAAAA,OAAO,EAAE;AAAV,GAAD;AANK,C","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,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
center: [0.5, 0.5],
|
|
10
|
-
angle: {
|
|
11
|
-
value: 1.1,
|
|
12
|
-
softMin: 0,
|
|
13
|
-
softMax: Math.PI / 2
|
|
14
|
-
},
|
|
15
|
-
size: {
|
|
16
|
-
value: 4,
|
|
17
|
-
min: 1,
|
|
18
|
-
softMin: 3,
|
|
19
|
-
softMax: 20
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
var _default = {
|
|
23
|
-
name: 'colorHalftone',
|
|
24
|
-
uniforms: uniforms,
|
|
25
|
-
fs: fs,
|
|
26
|
-
passes: [{
|
|
27
|
-
filter: true
|
|
28
|
-
}]
|
|
29
|
-
};
|
|
30
|
-
exports["default"] = _default;
|
|
31
|
-
//# 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;eAMe;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,C","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,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
center: [0.5, 0.5],
|
|
10
|
-
angle: {
|
|
11
|
-
value: 1.1,
|
|
12
|
-
softMin: 0,
|
|
13
|
-
softMax: Math.PI / 2
|
|
14
|
-
},
|
|
15
|
-
size: {
|
|
16
|
-
value: 3,
|
|
17
|
-
min: 1,
|
|
18
|
-
softMin: 3,
|
|
19
|
-
softMax: 20
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
var _default = {
|
|
23
|
-
name: 'dotScreen',
|
|
24
|
-
uniforms: uniforms,
|
|
25
|
-
fs: fs,
|
|
26
|
-
passes: [{
|
|
27
|
-
filter: true
|
|
28
|
-
}]
|
|
29
|
-
};
|
|
30
|
-
exports["default"] = _default;
|
|
31
|
-
//# 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;eAMe;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,C","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,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _random = _interopRequireDefault(require("../utils/random"));
|
|
11
|
-
|
|
12
|
-
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";
|
|
13
|
-
var uniforms = {
|
|
14
|
-
radius: {
|
|
15
|
-
value: 2,
|
|
16
|
-
min: 1,
|
|
17
|
-
softMax: 50
|
|
18
|
-
},
|
|
19
|
-
delta: {
|
|
20
|
-
value: [1, 0],
|
|
21
|
-
"private": true
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
var _default = {
|
|
25
|
-
name: 'edgeWork',
|
|
26
|
-
uniforms: uniforms,
|
|
27
|
-
fs: fs,
|
|
28
|
-
dependencies: [_random["default"]],
|
|
29
|
-
passes: [{
|
|
30
|
-
sampler: 'edgeWork_sampleColor1',
|
|
31
|
-
uniforms: {
|
|
32
|
-
delta: [1, 0]
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
sampler: 'edgeWork_sampleColor2',
|
|
36
|
-
uniforms: {
|
|
37
|
-
delta: [0, 1]
|
|
38
|
-
}
|
|
39
|
-
}]
|
|
40
|
-
};
|
|
41
|
-
exports["default"] = _default;
|
|
42
|
-
//# sourceMappingURL=edgework.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/shader-modules/fun-filters/edgework.js"],"names":["fs","uniforms","radius","value","min","softMax","delta","name","dependencies","random","passes","sampler"],"mappings":";;;;;;;;;AAMA;;AAEA,IAAMA,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;eAKe;AACbI,EAAAA,IAAI,EAAE,UADO;AAEbN,EAAAA,QAAQ,EAARA,QAFa;AAGbD,EAAAA,EAAE,EAAFA,EAHa;AAIbQ,EAAAA,YAAY,EAAE,CAACC,kBAAD,CAJD;AAKbC,EAAAA,MAAM,EAAE,CACN;AACEC,IAAAA,OAAO,EAAE,uBADX;AAEEV,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAFZ,GADM,EAKN;AACEK,IAAAA,OAAO,EAAE,uBADX;AAEEV,IAAAA,QAAQ,EAAE;AAACK,MAAAA,KAAK,EAAE,CAAC,CAAD,EAAI,CAAJ;AAAR;AAFZ,GALM;AALK,C","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,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
center: {
|
|
10
|
-
value: [0.5, 0.5],
|
|
11
|
-
hint: 'screenspace'
|
|
12
|
-
},
|
|
13
|
-
scale: {
|
|
14
|
-
value: 10,
|
|
15
|
-
min: 1,
|
|
16
|
-
softMin: 5,
|
|
17
|
-
softMax: 50
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var _default = {
|
|
21
|
-
name: 'hexagonalPixelate',
|
|
22
|
-
uniforms: uniforms,
|
|
23
|
-
fs: fs,
|
|
24
|
-
passes: [{
|
|
25
|
-
sampler: true
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
|
-
exports["default"] = _default;
|
|
29
|
-
//# 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;eAKe;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,C","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,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
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";
|
|
8
|
-
var uniforms = {
|
|
9
|
-
strength: {
|
|
10
|
-
value: 0.25,
|
|
11
|
-
min: 0,
|
|
12
|
-
softMax: 1
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var _default = {
|
|
16
|
-
name: 'ink',
|
|
17
|
-
uniforms: uniforms,
|
|
18
|
-
fs: fs,
|
|
19
|
-
passes: [{
|
|
20
|
-
sampler: true
|
|
21
|
-
}]
|
|
22
|
-
};
|
|
23
|
-
exports["default"] = _default;
|
|
24
|
-
//# 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;eAIe;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,C","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"}
|