@vfx-js/effects 1.4.4 → 1.5.0
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/README.md +4 -0
- package/THIRD_PARTY_NOTICES.md +61 -0
- package/lib/cjs/_bloom-common.d.ts +31 -0
- package/lib/cjs/_bloom-common.js +101 -0
- package/lib/cjs/_bloom-common.js.map +1 -0
- package/lib/cjs/_bubble-fill.d.ts +126 -0
- package/lib/cjs/_bubble-fill.js +1044 -0
- package/lib/cjs/_bubble-fill.js.map +1 -0
- package/lib/cjs/_bubble-kernel-source.d.ts +2 -0
- package/lib/cjs/_bubble-kernel-source.js +8 -0
- package/lib/cjs/_bubble-kernel-source.js.map +1 -0
- package/lib/cjs/_holo/data/kernels.d.ts +4 -0
- package/lib/cjs/_holo/data/kernels.js +10 -0
- package/lib/cjs/_holo/data/kernels.js.map +1 -0
- package/lib/cjs/_holo/data/looks.d.ts +2 -0
- package/lib/cjs/_holo/data/looks.js +595 -0
- package/lib/cjs/_holo/data/looks.js.map +1 -0
- package/lib/cjs/_holo/data/ltc.d.ts +2 -0
- package/lib/cjs/_holo/data/ltc.js +11 -0
- package/lib/cjs/_holo/data/ltc.js.map +1 -0
- package/lib/cjs/_holo/data/material-presets.d.ts +3 -0
- package/lib/cjs/_holo/data/material-presets.js +75 -0
- package/lib/cjs/_holo/data/material-presets.js.map +1 -0
- package/lib/cjs/_holo/data/not-ported.d.ts +5 -0
- package/lib/cjs/_holo/data/not-ported.js +190 -0
- package/lib/cjs/_holo/data/not-ported.js.map +1 -0
- package/lib/cjs/_holo/data/params.d.ts +4 -0
- package/lib/cjs/_holo/data/params.js +1641 -0
- package/lib/cjs/_holo/data/params.js.map +1 -0
- package/lib/cjs/_holo/data/starting-points.d.ts +199 -0
- package/lib/cjs/_holo/data/starting-points.js +193 -0
- package/lib/cjs/_holo/data/starting-points.js.map +1 -0
- package/lib/cjs/_holo/data/studio-presets.d.ts +2 -0
- package/lib/cjs/_holo/data/studio-presets.js +177 -0
- package/lib/cjs/_holo/data/studio-presets.js.map +1 -0
- package/lib/cjs/_holo/emboss-assets.d.ts +55 -0
- package/lib/cjs/_holo/emboss-assets.js +155 -0
- package/lib/cjs/_holo/emboss-assets.js.map +1 -0
- package/lib/cjs/_holo/glare.d.ts +15 -0
- package/lib/cjs/_holo/glare.js +125 -0
- package/lib/cjs/_holo/glare.js.map +1 -0
- package/lib/cjs/_holo/glsl/coat.d.ts +2 -0
- package/lib/cjs/_holo/glsl/coat.js +32 -0
- package/lib/cjs/_holo/glsl/coat.js.map +1 -0
- package/lib/cjs/_holo/glsl/common.d.ts +2 -0
- package/lib/cjs/_holo/glsl/common.js +141 -0
- package/lib/cjs/_holo/glsl/common.js.map +1 -0
- package/lib/cjs/_holo/glsl/emboss.d.ts +2 -0
- package/lib/cjs/_holo/glsl/emboss.js +246 -0
- package/lib/cjs/_holo/glsl/emboss.js.map +1 -0
- package/lib/cjs/_holo/glsl/env.d.ts +2 -0
- package/lib/cjs/_holo/glsl/env.js +52 -0
- package/lib/cjs/_holo/glsl/env.js.map +1 -0
- package/lib/cjs/_holo/glsl/glare-down.d.ts +2 -0
- package/lib/cjs/_holo/glsl/glare-down.js +65 -0
- package/lib/cjs/_holo/glsl/glare-down.js.map +1 -0
- package/lib/cjs/_holo/glsl/glare-up.d.ts +2 -0
- package/lib/cjs/_holo/glsl/glare-up.js +18 -0
- package/lib/cjs/_holo/glsl/glare-up.js.map +1 -0
- package/lib/cjs/_holo/glsl/glitter.d.ts +2 -0
- package/lib/cjs/_holo/glsl/glitter.js +325 -0
- package/lib/cjs/_holo/glsl/glitter.js.map +1 -0
- package/lib/cjs/_holo/glsl/grating.d.ts +2 -0
- package/lib/cjs/_holo/glsl/grating.js +240 -0
- package/lib/cjs/_holo/glsl/grating.js.map +1 -0
- package/lib/cjs/_holo/glsl/holo-emboss.d.ts +2 -0
- package/lib/cjs/_holo/glsl/holo-emboss.js +296 -0
- package/lib/cjs/_holo/glsl/holo-emboss.js.map +1 -0
- package/lib/cjs/_holo/glsl/holo-nebula.d.ts +2 -0
- package/lib/cjs/_holo/glsl/holo-nebula.js +186 -0
- package/lib/cjs/_holo/glsl/holo-nebula.js.map +1 -0
- package/lib/cjs/_holo/glsl/holo-prism.d.ts +2 -0
- package/lib/cjs/_holo/glsl/holo-prism.js +183 -0
- package/lib/cjs/_holo/glsl/holo-prism.js.map +1 -0
- package/lib/cjs/_holo/glsl/holo-shatter.d.ts +2 -0
- package/lib/cjs/_holo/glsl/holo-shatter.js +328 -0
- package/lib/cjs/_holo/glsl/holo-shatter.js.map +1 -0
- package/lib/cjs/_holo/glsl/holo-sparkle.d.ts +2 -0
- package/lib/cjs/_holo/glsl/holo-sparkle.js +235 -0
- package/lib/cjs/_holo/glsl/holo-sparkle.js.map +1 -0
- package/lib/cjs/_holo/glsl/holo-vortex.d.ts +2 -0
- package/lib/cjs/_holo/glsl/holo-vortex.js +201 -0
- package/lib/cjs/_holo/glsl/holo-vortex.js.map +1 -0
- package/lib/cjs/_holo/glsl/ibl.d.ts +2 -0
- package/lib/cjs/_holo/glsl/ibl.js +79 -0
- package/lib/cjs/_holo/glsl/ibl.js.map +1 -0
- package/lib/cjs/_holo/glsl/lights.d.ts +2 -0
- package/lib/cjs/_holo/glsl/lights.js +125 -0
- package/lib/cjs/_holo/glsl/lights.js.map +1 -0
- package/lib/cjs/_holo/glsl/ltc.d.ts +2 -0
- package/lib/cjs/_holo/glsl/ltc.js +66 -0
- package/lib/cjs/_holo/glsl/ltc.js.map +1 -0
- package/lib/cjs/_holo/glsl/output.d.ts +2 -0
- package/lib/cjs/_holo/glsl/output.js +113 -0
- package/lib/cjs/_holo/glsl/output.js.map +1 -0
- package/lib/cjs/_holo/glsl/paper.d.ts +2 -0
- package/lib/cjs/_holo/glsl/paper.js +165 -0
- package/lib/cjs/_holo/glsl/paper.js.map +1 -0
- package/lib/cjs/_holo/glsl/relief.d.ts +2 -0
- package/lib/cjs/_holo/glsl/relief.js +103 -0
- package/lib/cjs/_holo/glsl/relief.js.map +1 -0
- package/lib/cjs/_holo/glsl/sparkle.d.ts +2 -0
- package/lib/cjs/_holo/glsl/sparkle.js +279 -0
- package/lib/cjs/_holo/glsl/sparkle.js.map +1 -0
- package/lib/cjs/_holo/glsl/spectral.d.ts +2 -0
- package/lib/cjs/_holo/glsl/spectral.js +60 -0
- package/lib/cjs/_holo/glsl/spectral.js.map +1 -0
- package/lib/cjs/_holo/glsl/wear.d.ts +2 -0
- package/lib/cjs/_holo/glsl/wear.js +107 -0
- package/lib/cjs/_holo/glsl/wear.js.map +1 -0
- package/lib/cjs/_holo/ltc.d.ts +9 -0
- package/lib/cjs/_holo/ltc.js +56 -0
- package/lib/cjs/_holo/ltc.js.map +1 -0
- package/lib/cjs/_holo/materials/build.d.ts +32 -0
- package/lib/cjs/_holo/materials/build.js +36 -0
- package/lib/cjs/_holo/materials/build.js.map +1 -0
- package/lib/cjs/_holo/materials/emboss.d.ts +22 -0
- package/lib/cjs/_holo/materials/emboss.js +205 -0
- package/lib/cjs/_holo/materials/emboss.js.map +1 -0
- package/lib/cjs/_holo/materials/nebula.d.ts +4 -0
- package/lib/cjs/_holo/materials/nebula.js +105 -0
- package/lib/cjs/_holo/materials/nebula.js.map +1 -0
- package/lib/cjs/_holo/materials/prism.d.ts +2 -0
- package/lib/cjs/_holo/materials/prism.js +69 -0
- package/lib/cjs/_holo/materials/prism.js.map +1 -0
- package/lib/cjs/_holo/materials/registry.d.ts +11 -0
- package/lib/cjs/_holo/materials/registry.js +88 -0
- package/lib/cjs/_holo/materials/registry.js.map +1 -0
- package/lib/cjs/_holo/materials/shatter.d.ts +2 -0
- package/lib/cjs/_holo/materials/shatter.js +80 -0
- package/lib/cjs/_holo/materials/shatter.js.map +1 -0
- package/lib/cjs/_holo/materials/sparkle.d.ts +2 -0
- package/lib/cjs/_holo/materials/sparkle.js +108 -0
- package/lib/cjs/_holo/materials/sparkle.js.map +1 -0
- package/lib/cjs/_holo/materials/vortex.d.ts +2 -0
- package/lib/cjs/_holo/materials/vortex.js +85 -0
- package/lib/cjs/_holo/materials/vortex.js.map +1 -0
- package/lib/cjs/_holo/physics/emboss.d.ts +39 -0
- package/lib/cjs/_holo/physics/emboss.js +95 -0
- package/lib/cjs/_holo/physics/emboss.js.map +1 -0
- package/lib/cjs/_holo/physics/geometry.d.ts +109 -0
- package/lib/cjs/_holo/physics/geometry.js +252 -0
- package/lib/cjs/_holo/physics/geometry.js.map +1 -0
- package/lib/cjs/_holo/physics/grating.d.ts +86 -0
- package/lib/cjs/_holo/physics/grating.js +328 -0
- package/lib/cjs/_holo/physics/grating.js.map +1 -0
- package/lib/cjs/_holo/physics/sparkle.d.ts +143 -0
- package/lib/cjs/_holo/physics/sparkle.js +388 -0
- package/lib/cjs/_holo/physics/sparkle.js.map +1 -0
- package/lib/cjs/_holo/scene/env.d.ts +17 -0
- package/lib/cjs/_holo/scene/env.js +151 -0
- package/lib/cjs/_holo/scene/env.js.map +1 -0
- package/lib/cjs/_holo/scene/lights.d.ts +13 -0
- package/lib/cjs/_holo/scene/lights.js +211 -0
- package/lib/cjs/_holo/scene/lights.js.map +1 -0
- package/lib/cjs/_holo/scene/logo.d.ts +87 -0
- package/lib/cjs/_holo/scene/logo.js +655 -0
- package/lib/cjs/_holo/scene/logo.js.map +1 -0
- package/lib/cjs/_holo/scene/paper-maps.d.ts +26 -0
- package/lib/cjs/_holo/scene/paper-maps.js +391 -0
- package/lib/cjs/_holo/scene/paper-maps.js.map +1 -0
- package/lib/cjs/_holo/scene/pose.d.ts +31 -0
- package/lib/cjs/_holo/scene/pose.js +77 -0
- package/lib/cjs/_holo/scene/pose.js.map +1 -0
- package/lib/cjs/_holo/scene/relief.d.ts +24 -0
- package/lib/cjs/_holo/scene/relief.js +148 -0
- package/lib/cjs/_holo/scene/relief.js.map +1 -0
- package/lib/cjs/_holo/settings-types.d.ts +20 -0
- package/lib/cjs/_holo/settings-types.js +3 -0
- package/lib/cjs/_holo/settings-types.js.map +1 -0
- package/lib/cjs/_holo/settings.d.ts +83 -0
- package/lib/cjs/_holo/settings.js +375 -0
- package/lib/cjs/_holo/settings.js.map +1 -0
- package/lib/cjs/_holo/shader.d.ts +23 -0
- package/lib/cjs/_holo/shader.js +219 -0
- package/lib/cjs/_holo/shader.js.map +1 -0
- package/lib/cjs/_holo/spectral/atlas.d.ts +36 -0
- package/lib/cjs/_holo/spectral/atlas.js +114 -0
- package/lib/cjs/_holo/spectral/atlas.js.map +1 -0
- package/lib/cjs/_holo/spectral/cmf.d.ts +67 -0
- package/lib/cjs/_holo/spectral/cmf.js +244 -0
- package/lib/cjs/_holo/spectral/cmf.js.map +1 -0
- package/lib/cjs/_holo/spectral/float24.d.ts +8 -0
- package/lib/cjs/_holo/spectral/float24.js +70 -0
- package/lib/cjs/_holo/spectral/float24.js.map +1 -0
- package/lib/cjs/_holo/spectral/spd.d.ts +22 -0
- package/lib/cjs/_holo/spectral/spd.js +139 -0
- package/lib/cjs/_holo/spectral/spd.js.map +1 -0
- package/lib/cjs/_holo/spectral/tables.d.ts +62 -0
- package/lib/cjs/_holo/spectral/tables.js +386 -0
- package/lib/cjs/_holo/spectral/tables.js.map +1 -0
- package/lib/cjs/_holo/tier.d.ts +4 -0
- package/lib/cjs/_holo/tier.js +110 -0
- package/lib/cjs/_holo/tier.js.map +1 -0
- package/lib/cjs/_holo/types.d.ts +148 -0
- package/lib/cjs/_holo/types.js +14 -0
- package/lib/cjs/_holo/types.js.map +1 -0
- package/lib/cjs/_kernel-worker.d.ts +22 -0
- package/lib/cjs/_kernel-worker.js +174 -0
- package/lib/cjs/_kernel-worker.js.map +1 -0
- package/lib/cjs/_orbit-camera.d.ts +175 -0
- package/lib/cjs/_orbit-camera.js +366 -0
- package/lib/cjs/_orbit-camera.js.map +1 -0
- package/lib/cjs/_pad.d.ts +2 -0
- package/lib/cjs/_pad.js +11 -0
- package/lib/cjs/_pad.js.map +1 -1
- package/lib/cjs/_scene3d.d.ts +101 -0
- package/lib/cjs/_scene3d.js +794 -0
- package/lib/cjs/_scene3d.js.map +1 -0
- package/lib/cjs/_shape-kernel-source.d.ts +2 -0
- package/lib/cjs/_shape-kernel-source.js +8 -0
- package/lib/cjs/_shape-kernel-source.js.map +1 -0
- package/lib/cjs/_shape-worker.d.ts +8 -0
- package/lib/cjs/_shape-worker.js +27 -0
- package/lib/cjs/_shape-worker.js.map +1 -0
- package/lib/cjs/_silhouette.d.ts +88 -0
- package/lib/cjs/_silhouette.js +441 -0
- package/lib/cjs/_silhouette.js.map +1 -0
- package/lib/cjs/_simplex3.d.ts +2 -0
- package/lib/cjs/_simplex3.js +160 -0
- package/lib/cjs/_simplex3.js.map +1 -0
- package/lib/cjs/_source.d.ts +80 -0
- package/lib/cjs/_source.js +192 -0
- package/lib/cjs/_source.js.map +1 -0
- package/lib/cjs/_sphere-foam.d.ts +34 -0
- package/lib/cjs/_sphere-foam.js +135 -0
- package/lib/cjs/_sphere-foam.js.map +1 -0
- package/lib/cjs/_thin-film.d.ts +26 -0
- package/lib/cjs/_thin-film.js +146 -0
- package/lib/cjs/_thin-film.js.map +1 -0
- package/lib/cjs/bloom.js +40 -106
- package/lib/cjs/bloom.js.map +1 -1
- package/lib/cjs/bubble.d.ts +284 -0
- package/lib/cjs/bubble.js +1820 -0
- package/lib/cjs/bubble.js.map +1 -0
- package/lib/cjs/glass.d.ts +254 -0
- package/lib/cjs/glass.js +981 -0
- package/lib/cjs/glass.js.map +1 -0
- package/lib/cjs/holo-static.d.ts +3 -0
- package/lib/cjs/holo-static.js +29 -0
- package/lib/cjs/holo-static.js.map +1 -0
- package/lib/cjs/holo.d.ts +401 -0
- package/lib/cjs/holo.js +1613 -0
- package/lib/cjs/holo.js.map +1 -0
- package/lib/cjs/index.d.ts +18 -9
- package/lib/cjs/index.js +12 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/jpeg-glitch.js +32 -29
- package/lib/cjs/jpeg-glitch.js.map +1 -1
- package/lib/cjs/matrix.d.ts +1 -1
- package/lib/cjs/package.json +20 -5
- package/lib/cjs/swirl-particle.d.ts +257 -0
- package/lib/cjs/swirl-particle.js +2346 -0
- package/lib/cjs/swirl-particle.js.map +1 -0
- package/lib/cjs/voronoi.js +2 -75
- package/lib/cjs/voronoi.js.map +1 -1
- package/lib/esm/_bloom-common.d.ts +31 -0
- package/lib/esm/_bloom-common.js +95 -0
- package/lib/esm/_bloom-common.js.map +1 -0
- package/lib/esm/_bubble-fill.d.ts +126 -0
- package/lib/esm/_bubble-fill.js +1039 -0
- package/lib/esm/_bubble-fill.js.map +1 -0
- package/lib/esm/_bubble-kernel-source.d.ts +2 -0
- package/lib/esm/_bubble-kernel-source.js +5 -0
- package/lib/esm/_bubble-kernel-source.js.map +1 -0
- package/lib/esm/_holo/data/kernels.d.ts +4 -0
- package/lib/esm/_holo/data/kernels.js +7 -0
- package/lib/esm/_holo/data/kernels.js.map +1 -0
- package/lib/esm/_holo/data/looks.d.ts +2 -0
- package/lib/esm/_holo/data/looks.js +592 -0
- package/lib/esm/_holo/data/looks.js.map +1 -0
- package/lib/esm/_holo/data/ltc.d.ts +2 -0
- package/lib/esm/_holo/data/ltc.js +8 -0
- package/lib/esm/_holo/data/ltc.js.map +1 -0
- package/lib/esm/_holo/data/material-presets.d.ts +3 -0
- package/lib/esm/_holo/data/material-presets.js +72 -0
- package/lib/esm/_holo/data/material-presets.js.map +1 -0
- package/lib/esm/_holo/data/not-ported.d.ts +5 -0
- package/lib/esm/_holo/data/not-ported.js +187 -0
- package/lib/esm/_holo/data/not-ported.js.map +1 -0
- package/lib/esm/_holo/data/params.d.ts +4 -0
- package/lib/esm/_holo/data/params.js +1638 -0
- package/lib/esm/_holo/data/params.js.map +1 -0
- package/lib/esm/_holo/data/starting-points.d.ts +199 -0
- package/lib/esm/_holo/data/starting-points.js +190 -0
- package/lib/esm/_holo/data/starting-points.js.map +1 -0
- package/lib/esm/_holo/data/studio-presets.d.ts +2 -0
- package/lib/esm/_holo/data/studio-presets.js +174 -0
- package/lib/esm/_holo/data/studio-presets.js.map +1 -0
- package/lib/esm/_holo/emboss-assets.d.ts +55 -0
- package/lib/esm/_holo/emboss-assets.js +150 -0
- package/lib/esm/_holo/emboss-assets.js.map +1 -0
- package/lib/esm/_holo/glare.d.ts +15 -0
- package/lib/esm/_holo/glare.js +117 -0
- package/lib/esm/_holo/glare.js.map +1 -0
- package/lib/esm/_holo/glsl/coat.d.ts +2 -0
- package/lib/esm/_holo/glsl/coat.js +30 -0
- package/lib/esm/_holo/glsl/coat.js.map +1 -0
- package/lib/esm/_holo/glsl/common.d.ts +2 -0
- package/lib/esm/_holo/glsl/common.js +139 -0
- package/lib/esm/_holo/glsl/common.js.map +1 -0
- package/lib/esm/_holo/glsl/emboss.d.ts +2 -0
- package/lib/esm/_holo/glsl/emboss.js +244 -0
- package/lib/esm/_holo/glsl/emboss.js.map +1 -0
- package/lib/esm/_holo/glsl/env.d.ts +2 -0
- package/lib/esm/_holo/glsl/env.js +50 -0
- package/lib/esm/_holo/glsl/env.js.map +1 -0
- package/lib/esm/_holo/glsl/glare-down.d.ts +2 -0
- package/lib/esm/_holo/glsl/glare-down.js +63 -0
- package/lib/esm/_holo/glsl/glare-down.js.map +1 -0
- package/lib/esm/_holo/glsl/glare-up.d.ts +2 -0
- package/lib/esm/_holo/glsl/glare-up.js +16 -0
- package/lib/esm/_holo/glsl/glare-up.js.map +1 -0
- package/lib/esm/_holo/glsl/glitter.d.ts +2 -0
- package/lib/esm/_holo/glsl/glitter.js +323 -0
- package/lib/esm/_holo/glsl/glitter.js.map +1 -0
- package/lib/esm/_holo/glsl/grating.d.ts +2 -0
- package/lib/esm/_holo/glsl/grating.js +238 -0
- package/lib/esm/_holo/glsl/grating.js.map +1 -0
- package/lib/esm/_holo/glsl/holo-emboss.d.ts +2 -0
- package/lib/esm/_holo/glsl/holo-emboss.js +294 -0
- package/lib/esm/_holo/glsl/holo-emboss.js.map +1 -0
- package/lib/esm/_holo/glsl/holo-nebula.d.ts +2 -0
- package/lib/esm/_holo/glsl/holo-nebula.js +184 -0
- package/lib/esm/_holo/glsl/holo-nebula.js.map +1 -0
- package/lib/esm/_holo/glsl/holo-prism.d.ts +2 -0
- package/lib/esm/_holo/glsl/holo-prism.js +181 -0
- package/lib/esm/_holo/glsl/holo-prism.js.map +1 -0
- package/lib/esm/_holo/glsl/holo-shatter.d.ts +2 -0
- package/lib/esm/_holo/glsl/holo-shatter.js +326 -0
- package/lib/esm/_holo/glsl/holo-shatter.js.map +1 -0
- package/lib/esm/_holo/glsl/holo-sparkle.d.ts +2 -0
- package/lib/esm/_holo/glsl/holo-sparkle.js +233 -0
- package/lib/esm/_holo/glsl/holo-sparkle.js.map +1 -0
- package/lib/esm/_holo/glsl/holo-vortex.d.ts +2 -0
- package/lib/esm/_holo/glsl/holo-vortex.js +199 -0
- package/lib/esm/_holo/glsl/holo-vortex.js.map +1 -0
- package/lib/esm/_holo/glsl/ibl.d.ts +2 -0
- package/lib/esm/_holo/glsl/ibl.js +77 -0
- package/lib/esm/_holo/glsl/ibl.js.map +1 -0
- package/lib/esm/_holo/glsl/lights.d.ts +2 -0
- package/lib/esm/_holo/glsl/lights.js +123 -0
- package/lib/esm/_holo/glsl/lights.js.map +1 -0
- package/lib/esm/_holo/glsl/ltc.d.ts +2 -0
- package/lib/esm/_holo/glsl/ltc.js +64 -0
- package/lib/esm/_holo/glsl/ltc.js.map +1 -0
- package/lib/esm/_holo/glsl/output.d.ts +2 -0
- package/lib/esm/_holo/glsl/output.js +111 -0
- package/lib/esm/_holo/glsl/output.js.map +1 -0
- package/lib/esm/_holo/glsl/paper.d.ts +2 -0
- package/lib/esm/_holo/glsl/paper.js +163 -0
- package/lib/esm/_holo/glsl/paper.js.map +1 -0
- package/lib/esm/_holo/glsl/relief.d.ts +2 -0
- package/lib/esm/_holo/glsl/relief.js +101 -0
- package/lib/esm/_holo/glsl/relief.js.map +1 -0
- package/lib/esm/_holo/glsl/sparkle.d.ts +2 -0
- package/lib/esm/_holo/glsl/sparkle.js +277 -0
- package/lib/esm/_holo/glsl/sparkle.js.map +1 -0
- package/lib/esm/_holo/glsl/spectral.d.ts +2 -0
- package/lib/esm/_holo/glsl/spectral.js +58 -0
- package/lib/esm/_holo/glsl/spectral.js.map +1 -0
- package/lib/esm/_holo/glsl/wear.d.ts +2 -0
- package/lib/esm/_holo/glsl/wear.js +105 -0
- package/lib/esm/_holo/glsl/wear.js.map +1 -0
- package/lib/esm/_holo/ltc.d.ts +9 -0
- package/lib/esm/_holo/ltc.js +52 -0
- package/lib/esm/_holo/ltc.js.map +1 -0
- package/lib/esm/_holo/materials/build.d.ts +32 -0
- package/lib/esm/_holo/materials/build.js +30 -0
- package/lib/esm/_holo/materials/build.js.map +1 -0
- package/lib/esm/_holo/materials/emboss.d.ts +22 -0
- package/lib/esm/_holo/materials/emboss.js +198 -0
- package/lib/esm/_holo/materials/emboss.js.map +1 -0
- package/lib/esm/_holo/materials/nebula.d.ts +4 -0
- package/lib/esm/_holo/materials/nebula.js +98 -0
- package/lib/esm/_holo/materials/nebula.js.map +1 -0
- package/lib/esm/_holo/materials/prism.d.ts +2 -0
- package/lib/esm/_holo/materials/prism.js +63 -0
- package/lib/esm/_holo/materials/prism.js.map +1 -0
- package/lib/esm/_holo/materials/registry.d.ts +11 -0
- package/lib/esm/_holo/materials/registry.js +48 -0
- package/lib/esm/_holo/materials/registry.js.map +1 -0
- package/lib/esm/_holo/materials/shatter.d.ts +2 -0
- package/lib/esm/_holo/materials/shatter.js +74 -0
- package/lib/esm/_holo/materials/shatter.js.map +1 -0
- package/lib/esm/_holo/materials/sparkle.d.ts +2 -0
- package/lib/esm/_holo/materials/sparkle.js +102 -0
- package/lib/esm/_holo/materials/sparkle.js.map +1 -0
- package/lib/esm/_holo/materials/vortex.d.ts +2 -0
- package/lib/esm/_holo/materials/vortex.js +79 -0
- package/lib/esm/_holo/materials/vortex.js.map +1 -0
- package/lib/esm/_holo/physics/emboss.d.ts +39 -0
- package/lib/esm/_holo/physics/emboss.js +89 -0
- package/lib/esm/_holo/physics/emboss.js.map +1 -0
- package/lib/esm/_holo/physics/geometry.d.ts +109 -0
- package/lib/esm/_holo/physics/geometry.js +228 -0
- package/lib/esm/_holo/physics/geometry.js.map +1 -0
- package/lib/esm/_holo/physics/grating.d.ts +86 -0
- package/lib/esm/_holo/physics/grating.js +313 -0
- package/lib/esm/_holo/physics/grating.js.map +1 -0
- package/lib/esm/_holo/physics/sparkle.d.ts +143 -0
- package/lib/esm/_holo/physics/sparkle.js +360 -0
- package/lib/esm/_holo/physics/sparkle.js.map +1 -0
- package/lib/esm/_holo/scene/env.d.ts +17 -0
- package/lib/esm/_holo/scene/env.js +141 -0
- package/lib/esm/_holo/scene/env.js.map +1 -0
- package/lib/esm/_holo/scene/lights.d.ts +13 -0
- package/lib/esm/_holo/scene/lights.js +204 -0
- package/lib/esm/_holo/scene/lights.js.map +1 -0
- package/lib/esm/_holo/scene/logo.d.ts +87 -0
- package/lib/esm/_holo/scene/logo.js +645 -0
- package/lib/esm/_holo/scene/logo.js.map +1 -0
- package/lib/esm/_holo/scene/paper-maps.d.ts +26 -0
- package/lib/esm/_holo/scene/paper-maps.js +387 -0
- package/lib/esm/_holo/scene/paper-maps.js.map +1 -0
- package/lib/esm/_holo/scene/pose.d.ts +31 -0
- package/lib/esm/_holo/scene/pose.js +71 -0
- package/lib/esm/_holo/scene/pose.js.map +1 -0
- package/lib/esm/_holo/scene/relief.d.ts +24 -0
- package/lib/esm/_holo/scene/relief.js +142 -0
- package/lib/esm/_holo/scene/relief.js.map +1 -0
- package/lib/esm/_holo/settings-types.d.ts +20 -0
- package/lib/esm/_holo/settings-types.js +2 -0
- package/lib/esm/_holo/settings-types.js.map +1 -0
- package/lib/esm/_holo/settings.d.ts +83 -0
- package/lib/esm/_holo/settings.js +358 -0
- package/lib/esm/_holo/settings.js.map +1 -0
- package/lib/esm/_holo/shader.d.ts +23 -0
- package/lib/esm/_holo/shader.js +211 -0
- package/lib/esm/_holo/shader.js.map +1 -0
- package/lib/esm/_holo/spectral/atlas.d.ts +36 -0
- package/lib/esm/_holo/spectral/atlas.js +110 -0
- package/lib/esm/_holo/spectral/atlas.js.map +1 -0
- package/lib/esm/_holo/spectral/cmf.d.ts +67 -0
- package/lib/esm/_holo/spectral/cmf.js +230 -0
- package/lib/esm/_holo/spectral/cmf.js.map +1 -0
- package/lib/esm/_holo/spectral/float24.d.ts +8 -0
- package/lib/esm/_holo/spectral/float24.js +64 -0
- package/lib/esm/_holo/spectral/float24.js.map +1 -0
- package/lib/esm/_holo/spectral/spd.d.ts +22 -0
- package/lib/esm/_holo/spectral/spd.js +130 -0
- package/lib/esm/_holo/spectral/spd.js.map +1 -0
- package/lib/esm/_holo/spectral/tables.d.ts +62 -0
- package/lib/esm/_holo/spectral/tables.js +372 -0
- package/lib/esm/_holo/spectral/tables.js.map +1 -0
- package/lib/esm/_holo/tier.d.ts +4 -0
- package/lib/esm/_holo/tier.js +106 -0
- package/lib/esm/_holo/tier.js.map +1 -0
- package/lib/esm/_holo/types.d.ts +148 -0
- package/lib/esm/_holo/types.js +11 -0
- package/lib/esm/_holo/types.js.map +1 -0
- package/lib/esm/_kernel-worker.d.ts +22 -0
- package/lib/esm/_kernel-worker.js +169 -0
- package/lib/esm/_kernel-worker.js.map +1 -0
- package/lib/esm/_orbit-camera.d.ts +175 -0
- package/lib/esm/_orbit-camera.js +360 -0
- package/lib/esm/_orbit-camera.js.map +1 -0
- package/lib/esm/_pad.d.ts +2 -0
- package/lib/esm/_pad.js +10 -0
- package/lib/esm/_pad.js.map +1 -1
- package/lib/esm/_scene3d.d.ts +101 -0
- package/lib/esm/_scene3d.js +783 -0
- package/lib/esm/_scene3d.js.map +1 -0
- package/lib/esm/_shape-kernel-source.d.ts +2 -0
- package/lib/esm/_shape-kernel-source.js +5 -0
- package/lib/esm/_shape-kernel-source.js.map +1 -0
- package/lib/esm/_shape-worker.d.ts +8 -0
- package/lib/esm/_shape-worker.js +23 -0
- package/lib/esm/_shape-worker.js.map +1 -0
- package/lib/esm/_silhouette.d.ts +88 -0
- package/lib/esm/_silhouette.js +436 -0
- package/lib/esm/_silhouette.js.map +1 -0
- package/lib/esm/_simplex3.d.ts +2 -0
- package/lib/esm/_simplex3.js +157 -0
- package/lib/esm/_simplex3.js.map +1 -0
- package/lib/esm/_source.d.ts +80 -0
- package/lib/esm/_source.js +187 -0
- package/lib/esm/_source.js.map +1 -0
- package/lib/esm/_sphere-foam.d.ts +34 -0
- package/lib/esm/_sphere-foam.js +131 -0
- package/lib/esm/_sphere-foam.js.map +1 -0
- package/lib/esm/_thin-film.d.ts +26 -0
- package/lib/esm/_thin-film.js +140 -0
- package/lib/esm/_thin-film.js.map +1 -0
- package/lib/esm/bloom.js +40 -106
- package/lib/esm/bloom.js.map +1 -1
- package/lib/esm/bubble.d.ts +284 -0
- package/lib/esm/bubble.js +1816 -0
- package/lib/esm/bubble.js.map +1 -0
- package/lib/esm/glass.d.ts +254 -0
- package/lib/esm/glass.js +977 -0
- package/lib/esm/glass.js.map +1 -0
- package/lib/esm/holo-static.d.ts +3 -0
- package/lib/esm/holo-static.js +13 -0
- package/lib/esm/holo-static.js.map +1 -0
- package/lib/esm/holo.d.ts +401 -0
- package/lib/esm/holo.js +1606 -0
- package/lib/esm/holo.js.map +1 -0
- package/lib/esm/index.d.ts +18 -9
- package/lib/esm/index.js +7 -2
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/jpeg-glitch.js +32 -29
- package/lib/esm/jpeg-glitch.js.map +1 -1
- package/lib/esm/matrix.d.ts +1 -1
- package/lib/esm/package.json +20 -5
- package/lib/esm/swirl-particle.d.ts +257 -0
- package/lib/esm/swirl-particle.js +2342 -0
- package/lib/esm/swirl-particle.js.map +1 -0
- package/lib/esm/voronoi.js +2 -75
- package/lib/esm/voronoi.js.map +1 -1
- package/package.json +38 -11
package/lib/cjs/bloom.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BloomEffect = void 0;
|
|
4
|
+
const _bloom_common_js_1 = require("./_bloom-common.js");
|
|
4
5
|
const _pad_js_1 = require("./_pad.js");
|
|
5
6
|
// Threshold + sRGB→linear decode. Bloom math runs in linear space so
|
|
6
7
|
// downsample averages reflect light intensity (not perceptual levels)
|
|
@@ -22,7 +23,7 @@ uniform sampler2D src;
|
|
|
22
23
|
uniform float threshold;
|
|
23
24
|
uniform float softness;
|
|
24
25
|
uniform float edgeFade;
|
|
25
|
-
|
|
26
|
+
${_bloom_common_js_1.GLSL_BLOOM_KNEE}
|
|
26
27
|
void main() {
|
|
27
28
|
// Hard-gate sampling to uvSrc in [0,1]: a bare clamp would smear
|
|
28
29
|
// src's edge pixels into the pad (visible as a stretched image
|
|
@@ -44,10 +45,7 @@ void main() {
|
|
|
44
45
|
// so saturated primaries still trigger bloom where a Rec.709
|
|
45
46
|
// luma would have hidden them.
|
|
46
47
|
float br = max(max(lin.r, lin.g), lin.b);
|
|
47
|
-
float
|
|
48
|
-
float rq = clamp(br - threshold + knee, 0.0, 2.0 * knee);
|
|
49
|
-
rq = rq * rq / (4.0 * knee + 1e-4);
|
|
50
|
-
float contribution = max(rq, br - threshold) / max(br, 1e-4);
|
|
48
|
+
float contribution = bloomKnee(br, threshold, threshold * softness);
|
|
51
49
|
|
|
52
50
|
// Chebyshev distance outside the inner rect in uvContent units;
|
|
53
51
|
// 0 inside, positive in the pad region.
|
|
@@ -113,37 +111,6 @@ void main() {
|
|
|
113
111
|
outColor = color;
|
|
114
112
|
}
|
|
115
113
|
`;
|
|
116
|
-
// 3×3 tent upsample — COD:AW additive pyramid. Each level contributes
|
|
117
|
-
// `mipsDown[i] * weightLarge + tent(deeper) * weightSmall`; weights are
|
|
118
|
-
// driven from JS so scatter maps to halo radius linearly.
|
|
119
|
-
// (Unity HDRP's `mix(down, tent, scatter)` is geometric in radius —
|
|
120
|
-
// replaced here with a per-level linear gate.)
|
|
121
|
-
const FRAG_UPSAMPLE = `#version 300 es
|
|
122
|
-
precision highp float;
|
|
123
|
-
in vec2 uv;
|
|
124
|
-
out vec4 outColor;
|
|
125
|
-
uniform sampler2D srcSmall;
|
|
126
|
-
uniform sampler2D srcLarge;
|
|
127
|
-
uniform vec2 texelSize;
|
|
128
|
-
uniform float weightLarge;
|
|
129
|
-
uniform float weightSmall;
|
|
130
|
-
|
|
131
|
-
void main() {
|
|
132
|
-
vec2 t = texelSize;
|
|
133
|
-
vec4 sum = vec4(0.0);
|
|
134
|
-
sum += texture(srcSmall, uv + vec2(-t.x, -t.y)) * 1.0;
|
|
135
|
-
sum += texture(srcSmall, uv + vec2( 0.0, -t.y)) * 2.0;
|
|
136
|
-
sum += texture(srcSmall, uv + vec2( t.x, -t.y)) * 1.0;
|
|
137
|
-
sum += texture(srcSmall, uv + vec2(-t.x, 0.0)) * 2.0;
|
|
138
|
-
sum += texture(srcSmall, uv ) * 4.0;
|
|
139
|
-
sum += texture(srcSmall, uv + vec2( t.x, 0.0)) * 2.0;
|
|
140
|
-
sum += texture(srcSmall, uv + vec2(-t.x, t.y)) * 1.0;
|
|
141
|
-
sum += texture(srcSmall, uv + vec2( 0.0, t.y)) * 2.0;
|
|
142
|
-
sum += texture(srcSmall, uv + vec2( t.x, t.y)) * 1.0;
|
|
143
|
-
sum *= (1.0 / 16.0);
|
|
144
|
-
outColor = texture(srcLarge, uv) * weightLarge + sum * weightSmall;
|
|
145
|
-
}
|
|
146
|
-
`;
|
|
147
114
|
// Composite: 5×5 binomial-gaussian upsample of bloom from half-res →
|
|
148
115
|
// full-res, decode the sRGB src to linear, add the linear halo, then
|
|
149
116
|
// re-encode once. Doing the single pow at the end means dither can be
|
|
@@ -261,9 +228,7 @@ const TENT_FILTER = 0.5;
|
|
|
261
228
|
class BloomEffect {
|
|
262
229
|
params;
|
|
263
230
|
#bright = null;
|
|
264
|
-
#
|
|
265
|
-
#mipsUp = [];
|
|
266
|
-
#allocated = false;
|
|
231
|
+
#pyramid = null;
|
|
267
232
|
#lastBaseW = 0;
|
|
268
233
|
#lastBaseH = 0;
|
|
269
234
|
constructor(initial = {}) {
|
|
@@ -289,19 +254,25 @@ class BloomEffect {
|
|
|
289
254
|
// If `pad` changed (outputRect is re-queried every frame by
|
|
290
255
|
// the host), `bright` auto-resizes — rebuild the pyramid so
|
|
291
256
|
// mip dims keep matching the buffer.
|
|
292
|
-
if (this.#
|
|
257
|
+
if (!this.#pyramid ||
|
|
258
|
+
this.#bright.width !== this.#lastBaseW ||
|
|
293
259
|
this.#bright.height !== this.#lastBaseH) {
|
|
294
|
-
this.#
|
|
295
|
-
|
|
296
|
-
|
|
260
|
+
if (this.#pyramid) {
|
|
261
|
+
(0, _bloom_common_js_1.disposeBloomPyramid)(this.#pyramid);
|
|
262
|
+
}
|
|
263
|
+
// Auto-depth: halve until both axes hit 1 px, capped at 8
|
|
264
|
+
// levels. Going past the 13-tap stencil's "nice" size (4 px)
|
|
265
|
+
// is intentional — the deepest mips become degenerate box
|
|
266
|
+
// averages over the whole buffer, which is exactly what
|
|
267
|
+
// contributes the wide low-frequency halo tail that smears
|
|
268
|
+
// the 8-bit cutoff across enough pixels for dither to
|
|
269
|
+
// dissolve.
|
|
270
|
+
this.#pyramid = (0, _bloom_common_js_1.createBloomPyramid)(ctx, this.#bright.width, this.#bright.height, 8);
|
|
297
271
|
this.#lastBaseW = this.#bright.width;
|
|
298
272
|
this.#lastBaseH = this.#bright.height;
|
|
299
273
|
}
|
|
300
|
-
|
|
301
|
-
const n =
|
|
302
|
-
if (n === 0) {
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
274
|
+
const mipsDown = this.#pyramid.down;
|
|
275
|
+
const n = mipsDown.length;
|
|
305
276
|
ctx.draw({
|
|
306
277
|
frag: FRAG_THRESHOLD,
|
|
307
278
|
uniforms: { src: ctx.src, threshold, softness, edgeFade },
|
|
@@ -315,10 +286,10 @@ class BloomEffect {
|
|
|
315
286
|
texelSize: [1 / this.#bright.width, 1 / this.#bright.height],
|
|
316
287
|
karis: 1,
|
|
317
288
|
},
|
|
318
|
-
target:
|
|
289
|
+
target: mipsDown[0],
|
|
319
290
|
});
|
|
320
291
|
for (let i = 1; i < n; i++) {
|
|
321
|
-
const prev =
|
|
292
|
+
const prev = mipsDown[i - 1];
|
|
322
293
|
ctx.draw({
|
|
323
294
|
frag: FRAG_DOWNSAMPLE,
|
|
324
295
|
uniforms: {
|
|
@@ -326,7 +297,7 @@ class BloomEffect {
|
|
|
326
297
|
texelSize: [1 / prev.width, 1 / prev.height],
|
|
327
298
|
karis: 0,
|
|
328
299
|
},
|
|
329
|
-
target:
|
|
300
|
+
target: mipsDown[i],
|
|
330
301
|
});
|
|
331
302
|
}
|
|
332
303
|
// Additive pyramid upsample with per-level weights.
|
|
@@ -347,29 +318,21 @@ class BloomEffect {
|
|
|
347
318
|
const baseH = this.#bright.height;
|
|
348
319
|
const activeDepth = 1 + scatter * Math.max(0, n - 1);
|
|
349
320
|
const weightFor = (i) => Math.min(1, Math.max(0, activeDepth - i));
|
|
350
|
-
|
|
351
|
-
const small = i === n - 2 ? this.#mipsDown[n - 1] : this.#mipsUp[i + 1];
|
|
321
|
+
const bloomTex = (0, _bloom_common_js_1.upsampleBloomPyramid)(ctx, this.#pyramid, (i) => {
|
|
352
322
|
const levelScale = 2 ** (i + 2);
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
weightLarge: weightFor(i),
|
|
367
|
-
weightSmall: wSmall,
|
|
368
|
-
},
|
|
369
|
-
target: this.#mipsUp[i],
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
const bloomTex = n >= 2 ? this.#mipsUp[0] : this.#mipsDown[0];
|
|
323
|
+
return {
|
|
324
|
+
texelSize: [
|
|
325
|
+
(TENT_FILTER * levelScale) / baseW,
|
|
326
|
+
(TENT_FILTER * levelScale) / baseH,
|
|
327
|
+
],
|
|
328
|
+
weightLarge: weightFor(i),
|
|
329
|
+
// Bottom mip is raw downsample — its weight is applied
|
|
330
|
+
// here. Intermediate upsamples already carry per-level
|
|
331
|
+
// weights baked in from previous iterations, so
|
|
332
|
+
// pass-through = 1.
|
|
333
|
+
weightSmall: i === n - 2 ? weightFor(n - 1) : 1.0,
|
|
334
|
+
};
|
|
335
|
+
});
|
|
373
336
|
// Normalise by active depth so bloom amplitude stays roughly
|
|
374
337
|
// constant across scatter — fully-additive pyramid sums N
|
|
375
338
|
// levels, so raw amplitude scales with level count otherwise.
|
|
@@ -396,42 +359,13 @@ class BloomEffect {
|
|
|
396
359
|
}
|
|
397
360
|
dispose() {
|
|
398
361
|
this.#bright = null;
|
|
399
|
-
this.#
|
|
400
|
-
|
|
401
|
-
|
|
362
|
+
if (this.#pyramid) {
|
|
363
|
+
(0, _bloom_common_js_1.disposeBloomPyramid)(this.#pyramid);
|
|
364
|
+
}
|
|
365
|
+
this.#pyramid = null;
|
|
402
366
|
this.#lastBaseW = 0;
|
|
403
367
|
this.#lastBaseH = 0;
|
|
404
368
|
}
|
|
405
|
-
#allocateMips(ctx, baseW, baseH) {
|
|
406
|
-
if (this.#allocated) {
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
// Auto-depth: halve until both axes hit 1 px, capped at 8
|
|
410
|
-
// levels. Going past the 13-tap stencil's "nice" size (4 px)
|
|
411
|
-
// is intentional — the deepest mips become degenerate box
|
|
412
|
-
// averages over the whole buffer, which is exactly what
|
|
413
|
-
// contributes the wide low-frequency halo tail that smears
|
|
414
|
-
// the 8-bit cutoff across enough pixels for dither to dissolve.
|
|
415
|
-
let w = Math.max(1, Math.floor(baseW / 2));
|
|
416
|
-
let h = Math.max(1, Math.floor(baseH / 2));
|
|
417
|
-
for (let i = 0; i < 8; i++) {
|
|
418
|
-
this.#mipsDown.push(ctx.createRenderTarget({ size: [w, h], float: true }));
|
|
419
|
-
const nw = Math.max(1, Math.floor(w / 2));
|
|
420
|
-
const nh = Math.max(1, Math.floor(h / 2));
|
|
421
|
-
if (nw === w && nh === h) {
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
w = nw;
|
|
425
|
-
h = nh;
|
|
426
|
-
}
|
|
427
|
-
for (let i = 0; i < this.#mipsDown.length - 1; i++) {
|
|
428
|
-
this.#mipsUp.push(ctx.createRenderTarget({
|
|
429
|
-
size: [this.#mipsDown[i].width, this.#mipsDown[i].height],
|
|
430
|
-
float: true,
|
|
431
|
-
}));
|
|
432
|
-
}
|
|
433
|
-
this.#allocated = true;
|
|
434
|
-
}
|
|
435
369
|
}
|
|
436
370
|
exports.BloomEffect = BloomEffect;
|
|
437
371
|
//# sourceMappingURL=bloom.js.map
|
package/lib/cjs/bloom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bloom.js","sourceRoot":"","sources":["../../src/bloom.ts"],"names":[],"mappings":";;;AAYA,uCAA0C;AAE1C,qEAAqE;AACrE,sEAAsE;AACtE,mEAAmE;AACnE,gDAAgD;AAChD,EAAE;AACF,oEAAoE;AACpE,uEAAuE;AACvE,mEAAmE;AACnE,mEAAmE;AACnE,qEAAqE;AACrE,gCAAgC;AAChC,MAAM,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"bloom.js","sourceRoot":"","sources":["../../src/bloom.ts"],"names":[],"mappings":";;;AAYA,yDAM4B;AAC5B,uCAA0C;AAE1C,qEAAqE;AACrE,sEAAsE;AACtE,mEAAmE;AACnE,gDAAgD;AAChD,EAAE;AACF,oEAAoE;AACpE,uEAAuE;AACvE,mEAAmE;AACnE,mEAAmE;AACnE,qEAAqE;AACrE,gCAAgC;AAChC,MAAM,cAAc,GAAG;;;;;;;;;EASrB,kCAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiChB,CAAC;AAEF,sEAAsE;AACtE,iEAAiE;AACjE,kEAAkE;AAClE,qEAAqE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AAM,kBAAkB,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAChE,gDAAgD;QAChD,GAAG,CAAC,IAAI,CAAC;YACL,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE;gBACN,GAAG,EAAE,GAAG,CAAC,GAAG;gBACZ,KAAK,EAAE,QAAQ;gBACf,SAAS,EAAE;oBACP,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,KAAK;oBACzB,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,KAAK;iBAC5B;gBACD,SAAS,EAAE,kBAAkB;gBAC7B,MAAM;gBACN,QAAQ;aACX;YACD,MAAM,EAAE,GAAG,CAAC,MAAM;SACrB,CAAC,CAAC;IACP,CAAC;IAED,UAAU,CAAC,IAAgB;QACvB,OAAO,IAAA,uBAAa,EAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,OAAO;QACH,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAA,sCAAmB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACxB,CAAC;CACJ;AAhKD,kCAgKC"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import type { Effect, EffectContext, EffectDims } from "@vfx-js/core";
|
|
2
|
+
import { type OrbitCameraParams } from "./_orbit-camera.js";
|
|
3
|
+
import { type BackdropImageSource, type BackdropPaletteName, type BackdropPatternName } from "./_scene3d.js";
|
|
4
|
+
import { type SourceChannel } from "./_source.js";
|
|
5
|
+
/**
|
|
6
|
+
* A {@link BubbleParams.debug} view: texture lookups per pixel
|
|
7
|
+
* (`"cost"`), films shaded (`"layers"`), or each bubble in a flat colour
|
|
8
|
+
* where the ray first meets it (`"cells"`).
|
|
9
|
+
*/
|
|
10
|
+
export type BubbleDebugView = "off" | "cost" | "layers" | "cells";
|
|
11
|
+
/** What the pointer does to a {@link BubbleEffect}. */
|
|
12
|
+
export type BubblePointer = "none" | "tilt";
|
|
13
|
+
/**
|
|
14
|
+
* Params of {@link BubbleEffect}: the foam's own, and the camera's
|
|
15
|
+
* ({@link OrbitCameraParams}). All are read every frame. The placement
|
|
16
|
+
* params (`depth`, `bevel`, `cellSize`, `cellSizeRandomness`,
|
|
17
|
+
* `roundness`, `seed`, `minSize`) place the bubbles again on the CPU, in
|
|
18
|
+
* a worker, when they change: about 30 ms at the defaults on a desktop,
|
|
19
|
+
* and up to seconds for a deep shape (`depth` 1 or more) or a small
|
|
20
|
+
* `minSize`. `wobble` and `containment` rebuild the grid over them,
|
|
21
|
+
* which is quicker. The last foam is drawn until the new one is ready.
|
|
22
|
+
* Without workers (e.g. a CSP that blocks `blob:` URLs) the page stalls
|
|
23
|
+
* for that long.
|
|
24
|
+
*/
|
|
25
|
+
export type BubbleParams = OrbitCameraParams & {
|
|
26
|
+
/**
|
|
27
|
+
* Which channel of the element is read as the silhouette: `"alpha"`
|
|
28
|
+
* (where it is opaque; default), `"luminance"` (where it is bright,
|
|
29
|
+
* so the text or the light parts of an opaque image) or `"none"` (the
|
|
30
|
+
* whole element rect). A change reads the element back again, like
|
|
31
|
+
* {@link BubbleEffect.refresh | refresh()}.
|
|
32
|
+
*/
|
|
33
|
+
sourceChannel: SourceChannel;
|
|
34
|
+
/**
|
|
35
|
+
* Extrusion depth, relative to the long side of the element (= 2),
|
|
36
|
+
* up to 2. Placement param.
|
|
37
|
+
*/
|
|
38
|
+
depth: number;
|
|
39
|
+
/**
|
|
40
|
+
* Radius of the rounded edges of the extruded shape, in the same units
|
|
41
|
+
* as `depth`, up to half of it. The bubbles fill the rounded shape,
|
|
42
|
+
* and a container (`containment`) rounds them off along its edges.
|
|
43
|
+
* Placement param.
|
|
44
|
+
*/
|
|
45
|
+
bevel: number;
|
|
46
|
+
/**
|
|
47
|
+
* Size of the big bubbles: their radius is 0.86 of it, in the same
|
|
48
|
+
* units as `depth`. Smaller bubbles fill the gaps between
|
|
49
|
+
* them (see `minSize`). Placement param.
|
|
50
|
+
*/
|
|
51
|
+
cellSize: number;
|
|
52
|
+
/**
|
|
53
|
+
* How much the big bubbles' radii vary, 0 (all alike) to 1 (each
|
|
54
|
+
* shrunk by a random share, up to all of it). Placement param.
|
|
55
|
+
*/
|
|
56
|
+
cellSizeRandomness: number;
|
|
57
|
+
/**
|
|
58
|
+
* How round the bubbles are, 0 to 1, at the same size: how far apart
|
|
59
|
+
* the big bubbles sit. At 0 they overlap heavily (more of them, cut
|
|
60
|
+
* by flat walls into a polyhedral foam with shallow caps); at 1 their
|
|
61
|
+
* centres are a diameter apart, so they are whole spheres that just
|
|
62
|
+
* touch, with smaller bubbles in the gaps. The filling bubbles cut
|
|
63
|
+
* into their neighbours alike. Placement param.
|
|
64
|
+
*/
|
|
65
|
+
roundness: number;
|
|
66
|
+
/** Seed of the random placement. Placement param. */
|
|
67
|
+
seed: number;
|
|
68
|
+
/**
|
|
69
|
+
* The smallest bubbles, as a share of `cellSize`, 0.05 to 1: gaps
|
|
70
|
+
* between the big bubbles, and along the outline, are filled with
|
|
71
|
+
* smaller ones while an empty ball of this size fits. Smaller gives
|
|
72
|
+
* more, smaller bubbles; 1 turns the fill off. Placement param.
|
|
73
|
+
*/
|
|
74
|
+
minSize: number;
|
|
75
|
+
/**
|
|
76
|
+
* How much the shape acts as a container, 0 to 1. 0 lets the bubbles
|
|
77
|
+
* poke out of the silhouette (by 0.3 `cellSize` at most) and bulge out of its front
|
|
78
|
+
* and back. Above 0, what pokes out is squashed towards the shape,
|
|
79
|
+
* keeping its roundness: a cap that stood h above the shape stands
|
|
80
|
+
* (1 - containment) h. At 1 the bubbles are pressed flat against the
|
|
81
|
+
* shape, like a foam blown up inside a mould. They are also blown up
|
|
82
|
+
* a little, which closes the smallest gaps and leaves creases
|
|
83
|
+
* between them. Values between 0 and 1 cost a little more than
|
|
84
|
+
* either end.
|
|
85
|
+
*/
|
|
86
|
+
containment: number;
|
|
87
|
+
/**
|
|
88
|
+
* Amplitude of the bubbles' slow drift, relative to each bubble's
|
|
89
|
+
* radius, 0 to 0.15: the walls breathe. Changing it rebuilds the
|
|
90
|
+
* grid the shader walks (cheap).
|
|
91
|
+
*/
|
|
92
|
+
wobble: number;
|
|
93
|
+
/** Speed of the drift, in cycles per second. */
|
|
94
|
+
speed: number;
|
|
95
|
+
/**
|
|
96
|
+
* Films composited per pixel, front to back, 1 to 16. A ray through
|
|
97
|
+
* n bubbles crosses about n + 1.
|
|
98
|
+
*/
|
|
99
|
+
maxLayers: number;
|
|
100
|
+
/**
|
|
101
|
+
* Interference colour, 0 (colourless reflection) to 1 (the full
|
|
102
|
+
* thin-film colours).
|
|
103
|
+
*/
|
|
104
|
+
iridescence: number;
|
|
105
|
+
/** Mean thickness of the films, in nm. The colours cycle with it. */
|
|
106
|
+
thickness: number;
|
|
107
|
+
/** Swirls in the thickness, 0 to 1, as a share of `thickness`. */
|
|
108
|
+
thicknessVariation: number;
|
|
109
|
+
/**
|
|
110
|
+
* Drainage, 0 to 1: films are thinner at the top of each bubble and
|
|
111
|
+
* thicker at the bottom, by this share of `thickness`.
|
|
112
|
+
*/
|
|
113
|
+
drain: number;
|
|
114
|
+
/** Size of the swirls: noise frequency per cell size. */
|
|
115
|
+
swirlScale: number;
|
|
116
|
+
/** Speed at which the swirls flow down and change, per second. */
|
|
117
|
+
swirlSpeed: number;
|
|
118
|
+
/** Strength of the reflected light, without changing transparency. */
|
|
119
|
+
reflection: number;
|
|
120
|
+
/**
|
|
121
|
+
* The bright white rim of a bubble, 0 to 1. A film seen at a grazing
|
|
122
|
+
* angle reflects much more, in white. 1 is the real film; 0 keeps the
|
|
123
|
+
* interference colours all the way to the edge.
|
|
124
|
+
*/
|
|
125
|
+
rim: number;
|
|
126
|
+
/**
|
|
127
|
+
* Colour the soapy water gives the light it scatters (a CSS hex
|
|
128
|
+
* colour). Films seen at a grazing angle, and stacks of them, take it
|
|
129
|
+
* on: the depth cue of a foam.
|
|
130
|
+
*/
|
|
131
|
+
tint: string;
|
|
132
|
+
/** How much each film takes on `tint`, 0 to 1. */
|
|
133
|
+
tintStrength: number;
|
|
134
|
+
/**
|
|
135
|
+
* 0 to 1: the bubbles' first faces turn into a matte, softly lit body
|
|
136
|
+
* of `color`. 1 gives opaque balls.
|
|
137
|
+
*/
|
|
138
|
+
opacity: number;
|
|
139
|
+
/** Colour of the body that `opacity` blends in (a CSS hex colour). */
|
|
140
|
+
color: string;
|
|
141
|
+
/**
|
|
142
|
+
* Width of the borders on the foam's outside, where two bubbles meet,
|
|
143
|
+
* as a share of `cellSize`, 0 (off) to 0.5: the water gathered there.
|
|
144
|
+
* The film thickens over this width, by 100 nm per 0.01 at the
|
|
145
|
+
* border, so wider borders show more bands of colour. The white line
|
|
146
|
+
* (see `borderHighlight`) is a sharp core about half as wide in all.
|
|
147
|
+
* Walls inside the foam get no border.
|
|
148
|
+
*/
|
|
149
|
+
borderWidth: number;
|
|
150
|
+
/**
|
|
151
|
+
* Brightness of the white line along the borders: the light the water
|
|
152
|
+
* gathered there scatters, 0 (off) to 2.
|
|
153
|
+
*/
|
|
154
|
+
borderHighlight: number;
|
|
155
|
+
/**
|
|
156
|
+
* The backdrop: a pattern name, or an image (an element, an
|
|
157
|
+
* `ImageBitmap` or a URL). Films reflect it and, with
|
|
158
|
+
* `backdropVisible`, it is drawn behind the foam; otherwise the page
|
|
159
|
+
* shows through it.
|
|
160
|
+
*/
|
|
161
|
+
backdrop: BackdropPatternName | BackdropImageSource;
|
|
162
|
+
/** Draw the backdrop behind and around the foam. */
|
|
163
|
+
backdropVisible: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Reflect the backdrop all around, not only behind: the films facing
|
|
166
|
+
* the viewer reflect it too, in place of the even sky. The lights
|
|
167
|
+
* still add their highlights.
|
|
168
|
+
*/
|
|
169
|
+
backdropAround: boolean;
|
|
170
|
+
/** Size of the pattern's features, or of the image. */
|
|
171
|
+
backdropScale: number;
|
|
172
|
+
/** Distance of the backdrop plane behind the shape's centre. */
|
|
173
|
+
backdropDistance: number;
|
|
174
|
+
/** Speed of the pattern, in pattern periods per second. */
|
|
175
|
+
backdropSpeed: number;
|
|
176
|
+
/** The palette of a pattern, as `GlassParams.backdropColors`. */
|
|
177
|
+
backdropColors: BackdropPaletteName | readonly string[];
|
|
178
|
+
/** Share of the second colour of a two-colour palette, 0 to 1. */
|
|
179
|
+
backdropRatio: number;
|
|
180
|
+
/** Softness of the edges between the palette's colours, 0 to 1. */
|
|
181
|
+
backdropSoftness: number;
|
|
182
|
+
/**
|
|
183
|
+
* Brightness of the soft box lights around the shape, and of a dim
|
|
184
|
+
* sky over it, which the films reflect. 0 turns them off.
|
|
185
|
+
*/
|
|
186
|
+
lightIntensity: number;
|
|
187
|
+
/** Softness of the lights' edges, 0 to 1. */
|
|
188
|
+
lightSoftness: number;
|
|
189
|
+
/** Render scale, 0.25 to 2. Below 1 is cheaper and softer. */
|
|
190
|
+
resolution: number;
|
|
191
|
+
/** Smooth the remaining stair steps with FXAA. */
|
|
192
|
+
antialias: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* How the foam reacts to the pointer hovering over the page:
|
|
195
|
+
*
|
|
196
|
+
* - `"none"` (default): it doesn't.
|
|
197
|
+
* - `"tilt"`: hover parallax. The shape turns to face the pointer,
|
|
198
|
+
* up to 20° × {@link OrbitCameraParams.pointerStrength | pointerStrength}
|
|
199
|
+
* (capped at 90°), reached when the pointer is half a viewport
|
|
200
|
+
* away from the element's centre.
|
|
201
|
+
*
|
|
202
|
+
* Ignored by still frames. While `"tilt"`, it listens for pointer
|
|
203
|
+
* events on `window` to tell when the pointer leaves the page.
|
|
204
|
+
*/
|
|
205
|
+
pointer: BubblePointer;
|
|
206
|
+
/**
|
|
207
|
+
* Padding around the element, in CSS px, or `"fullscreen"` to draw on
|
|
208
|
+
* the whole canvas. Default 100. Use `"fullscreen"` with
|
|
209
|
+
* `cameraOrigin: "viewport"`, where an element off the centre leans out
|
|
210
|
+
* of its rect; it costs full-canvas passes per element.
|
|
211
|
+
*/
|
|
212
|
+
pad: number | "fullscreen";
|
|
213
|
+
/**
|
|
214
|
+
* Show a debug view instead of the foam: texture lookups per pixel
|
|
215
|
+
* (`"cost"`: black 0, blue 64, green 128, yellow 192, red 256, white
|
|
216
|
+
* 320 or more), films shaded (`"layers"`, 1.6 per colour step), or
|
|
217
|
+
* the bubbles in flat colours (`"cells"`).
|
|
218
|
+
*/
|
|
219
|
+
debug: BubbleDebugView;
|
|
220
|
+
};
|
|
221
|
+
export type BubbleEffectOptions = {
|
|
222
|
+
/** Freeze time, for deterministic screenshots. */
|
|
223
|
+
still?: boolean;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Fills the element's silhouette, extruded into 3D, with a foam of
|
|
227
|
+
* transparent soap bubbles in thin-film colours.
|
|
228
|
+
*
|
|
229
|
+
* ```ts
|
|
230
|
+
* vfx.add(img, { effect: new BubbleEffect({ roundness: 0.7 }) });
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* The volume is filled with big spheres spread at random but evenly
|
|
234
|
+
* (`cellSize`), and the gaps they leave, between them and along the
|
|
235
|
+
* outline, with smaller ones down to `minSize`. Where spheres overlap,
|
|
236
|
+
* they are cut by a flat wall they share (a power diagram); where they
|
|
237
|
+
* are exposed, they keep their round outside. `roundness` goes from a
|
|
238
|
+
* flat-walled foam to nearly separate spheres. The films are found
|
|
239
|
+
* exactly along each ray.
|
|
240
|
+
*
|
|
241
|
+
* The silhouette is the element's alpha (or the channel
|
|
242
|
+
* {@link BubbleParams.sourceChannel | sourceChannel} picks), read back
|
|
243
|
+
* when the effect starts and again when the element's aspect ratio
|
|
244
|
+
* changes. Call {@link BubbleEffect.refresh | refresh()} after its
|
|
245
|
+
* content changes. Films do not bend
|
|
246
|
+
* light, so the page shows through the foam, dimmed by what the films
|
|
247
|
+
* reflect; the output is premultiplied over it. With `backdropVisible`,
|
|
248
|
+
* a backdrop is drawn behind the foam instead.
|
|
249
|
+
*
|
|
250
|
+
* The camera ({@link OrbitCameraParams}: `yaw`, `pitch`,
|
|
251
|
+
* `orbitAnimation`, `fov`, …) works as in {@link GlassEffect}, with
|
|
252
|
+
* angles in degrees. Set `drag: true` to orbit it with pointer drags that
|
|
253
|
+
* start on the element, and `pointer: "tilt"` to turn it towards the
|
|
254
|
+
* pointer.
|
|
255
|
+
*
|
|
256
|
+
* All params are read every frame, so you can mutate `params` live. The
|
|
257
|
+
* bubbles are placed on the CPU, again whenever a placement param
|
|
258
|
+
* changes (see {@link BubbleParams}).
|
|
259
|
+
*/
|
|
260
|
+
export declare class BubbleEffect implements Effect {
|
|
261
|
+
#private;
|
|
262
|
+
params: BubbleParams;
|
|
263
|
+
constructor(initial?: Partial<BubbleParams>, opts?: BubbleEffectOptions);
|
|
264
|
+
setParams(updates: Partial<BubbleParams>): void;
|
|
265
|
+
init(ctx: EffectContext): void;
|
|
266
|
+
outputRect(dims: EffectDims): readonly [number, number, number, number];
|
|
267
|
+
render(ctx: EffectContext): void;
|
|
268
|
+
/**
|
|
269
|
+
* Capture the element's silhouette again, for when its content
|
|
270
|
+
* changed: an image's `src` swapped, a text edit. For an `<img>`,
|
|
271
|
+
* call it after `vfx.update(img)` has reloaded the image.
|
|
272
|
+
*
|
|
273
|
+
* The foam keeps the current shape until the new one has been read
|
|
274
|
+
* back (a few frames later), then switches to it and places its
|
|
275
|
+
* bubbles again. A change of the element's aspect ratio is
|
|
276
|
+
* recaptured automatically once its size settles; a change of size
|
|
277
|
+
* alone needs none.
|
|
278
|
+
*
|
|
279
|
+
* Safe to call at any time and any number of times; a call while a
|
|
280
|
+
* capture is pending restarts it, so the latest content wins.
|
|
281
|
+
*/
|
|
282
|
+
refresh(): void;
|
|
283
|
+
dispose(): void;
|
|
284
|
+
}
|