@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
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { EffectContext, EffectReadPixelsOpts } from "@vfx-js/core";
|
|
2
|
+
/**
|
|
3
|
+
* Which channel of the element is read as a shape: `"alpha"` (where it is
|
|
4
|
+
* opaque), `"luminance"` (where it is bright) or `"none"` (the whole
|
|
5
|
+
* element rect).
|
|
6
|
+
*/
|
|
7
|
+
export type SourceChannel = "alpha" | "luminance" | "none";
|
|
8
|
+
/** A {@link SourceChannel} param as given, with anything else read as `"alpha"`. */
|
|
9
|
+
export declare function sourceChannelOf(v: unknown): SourceChannel;
|
|
10
|
+
export declare const CAPTURE_DELAY = 3;
|
|
11
|
+
export declare const CAPTURE_RETRY_MAX = 120;
|
|
12
|
+
export declare const ASPECT_TOLERANCE = 0.01;
|
|
13
|
+
export declare const RESIZE_SETTLE = 5;
|
|
14
|
+
export declare const GROW_TOLERANCE = 1.25;
|
|
15
|
+
/** The pixels of one capture. */
|
|
16
|
+
export type SourceReadback = {
|
|
17
|
+
/** RGBA, premultiplied; rows bottom-up unless `read.flipY`. */
|
|
18
|
+
pixels: Uint8Array | Float32Array;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
/** Width / height of the element when it was captured. */
|
|
22
|
+
aspect: number;
|
|
23
|
+
};
|
|
24
|
+
export type SourceCaptureOptions = {
|
|
25
|
+
/** Long side of the read-back mask, in px. The short side follows the element's aspect. */
|
|
26
|
+
longSide: number;
|
|
27
|
+
/**
|
|
28
|
+
* When set, the long side follows the element's long side in device
|
|
29
|
+
* px, between this and `longSide`, so a small element reads a small
|
|
30
|
+
* mask. The element is read again when it grows well past it.
|
|
31
|
+
*/
|
|
32
|
+
minLongSide?: number;
|
|
33
|
+
/** Options for `ctx.readPixels`. */
|
|
34
|
+
read?: EffectReadPixelsOpts;
|
|
35
|
+
/**
|
|
36
|
+
* Called with the pixels of a capture that is still current. Return
|
|
37
|
+
* (or resolve to) false when they hold nothing usable yet: the
|
|
38
|
+
* capture is tried again later, less often each time. While a
|
|
39
|
+
* returned promise is pending the phase stays `"reading"`; a
|
|
40
|
+
* refresh, restore or reset in the meantime drops its result.
|
|
41
|
+
* `isCurrent` tells, once it resolves, whether the result is still
|
|
42
|
+
* wanted.
|
|
43
|
+
*/
|
|
44
|
+
onRead: (r: SourceReadback, isCurrent: () => boolean) => boolean | Promise<boolean>;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* - `"capture"`: waiting for the source to upload, then reading it.
|
|
48
|
+
* - `"reading"`: a readback is on its way.
|
|
49
|
+
* - `"idle"`: the last capture was used; watching the aspect ratio.
|
|
50
|
+
*/
|
|
51
|
+
export type SourceCapturePhase = "capture" | "reading" | "idle";
|
|
52
|
+
/**
|
|
53
|
+
* The capture loop: waits a few frames for the source to upload, reads
|
|
54
|
+
* the element's content back into a mask of `longSide` px, and hands the
|
|
55
|
+
* pixels to `onRead`. An empty read is retried with a growing gap. Once a
|
|
56
|
+
* read was used, the element's aspect ratio is watched, and a change is
|
|
57
|
+
* recaptured once the size settles. A readback that resolves after
|
|
58
|
+
* {@link refresh}, {@link contextRestored} or {@link reset} is dropped.
|
|
59
|
+
*
|
|
60
|
+
* Call {@link update} once a frame from `render()`.
|
|
61
|
+
*/
|
|
62
|
+
export declare class SourceCapture {
|
|
63
|
+
#private;
|
|
64
|
+
constructor(opts: SourceCaptureOptions);
|
|
65
|
+
get phase(): SourceCapturePhase;
|
|
66
|
+
/** Capture, or watch the aspect ratio, depending on the phase. */
|
|
67
|
+
update(ctx: EffectContext): void;
|
|
68
|
+
/**
|
|
69
|
+
* Start a new capture in CAPTURE_DELAY frames, dropping a readback in
|
|
70
|
+
* flight.
|
|
71
|
+
*/
|
|
72
|
+
refresh(): void;
|
|
73
|
+
/**
|
|
74
|
+
* For `ctx.onContextRestored`: a readback in flight was rejected;
|
|
75
|
+
* start it over.
|
|
76
|
+
*/
|
|
77
|
+
contextRestored(): void;
|
|
78
|
+
/** Start over like a new instance (for `dispose()`). */
|
|
79
|
+
reset(): void;
|
|
80
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourceCapture = exports.GROW_TOLERANCE = exports.RESIZE_SETTLE = exports.ASPECT_TOLERANCE = exports.CAPTURE_RETRY_MAX = exports.CAPTURE_DELAY = void 0;
|
|
4
|
+
exports.sourceChannelOf = sourceChannelOf;
|
|
5
|
+
const _capture_js_1 = require("./_capture.js");
|
|
6
|
+
/** A {@link SourceChannel} param as given, with anything else read as `"alpha"`. */
|
|
7
|
+
function sourceChannelOf(v) {
|
|
8
|
+
return v === "luminance" || v === "none" ? v : "alpha";
|
|
9
|
+
}
|
|
10
|
+
// Frames to wait before reading the element back, and the most frames
|
|
11
|
+
// between retries while it is empty (the gap doubles from the first).
|
|
12
|
+
exports.CAPTURE_DELAY = 3;
|
|
13
|
+
exports.CAPTURE_RETRY_MAX = 120;
|
|
14
|
+
// Recapture when the element's aspect ratio drifts this far (relative)
|
|
15
|
+
// from the one last captured, once the size has held still for
|
|
16
|
+
// RESIZE_SETTLE frames.
|
|
17
|
+
exports.ASPECT_TOLERANCE = 0.01;
|
|
18
|
+
exports.RESIZE_SETTLE = 5;
|
|
19
|
+
// With `minLongSide`, recapture when the element's long side grows this
|
|
20
|
+
// many times past the mask's.
|
|
21
|
+
exports.GROW_TOLERANCE = 1.25;
|
|
22
|
+
/**
|
|
23
|
+
* The capture loop: waits a few frames for the source to upload, reads
|
|
24
|
+
* the element's content back into a mask of `longSide` px, and hands the
|
|
25
|
+
* pixels to `onRead`. An empty read is retried with a growing gap. Once a
|
|
26
|
+
* read was used, the element's aspect ratio is watched, and a change is
|
|
27
|
+
* recaptured once the size settles. A readback that resolves after
|
|
28
|
+
* {@link refresh}, {@link contextRestored} or {@link reset} is dropped.
|
|
29
|
+
*
|
|
30
|
+
* Call {@link update} once a frame from `render()`.
|
|
31
|
+
*/
|
|
32
|
+
class SourceCapture {
|
|
33
|
+
#opts;
|
|
34
|
+
// Bumped by reset, context restore and a refresh during a read, so
|
|
35
|
+
// a readback started before them is dropped.
|
|
36
|
+
#token = 0;
|
|
37
|
+
#phase = "capture";
|
|
38
|
+
#srcFrames = 0;
|
|
39
|
+
// Frames to wait before the next capture; doubles while it's empty.
|
|
40
|
+
#gap = exports.CAPTURE_DELAY;
|
|
41
|
+
// Aspect and long side of the last capture used.
|
|
42
|
+
#aspect = 0;
|
|
43
|
+
#long = 0;
|
|
44
|
+
// Element size last frame, and frames it has held still.
|
|
45
|
+
#lastSize = [0, 0];
|
|
46
|
+
#settled = 0;
|
|
47
|
+
constructor(opts) {
|
|
48
|
+
this.#opts = opts;
|
|
49
|
+
}
|
|
50
|
+
get phase() {
|
|
51
|
+
return this.#phase;
|
|
52
|
+
}
|
|
53
|
+
/** Capture, or watch the aspect ratio, depending on the phase. */
|
|
54
|
+
update(ctx) {
|
|
55
|
+
if (this.#phase === "idle") {
|
|
56
|
+
this.#watchAspect(ctx);
|
|
57
|
+
}
|
|
58
|
+
if (this.#phase === "capture") {
|
|
59
|
+
this.#capture(ctx);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Start a new capture in CAPTURE_DELAY frames, dropping a readback in
|
|
64
|
+
* flight.
|
|
65
|
+
*/
|
|
66
|
+
refresh() {
|
|
67
|
+
if (this.#phase === "reading") {
|
|
68
|
+
this.#token++;
|
|
69
|
+
}
|
|
70
|
+
this.#phase = "capture";
|
|
71
|
+
this.#srcFrames = 0;
|
|
72
|
+
this.#gap = exports.CAPTURE_DELAY;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* For `ctx.onContextRestored`: a readback in flight was rejected;
|
|
76
|
+
* start it over.
|
|
77
|
+
*/
|
|
78
|
+
contextRestored() {
|
|
79
|
+
this.#token++;
|
|
80
|
+
if (this.#phase === "reading") {
|
|
81
|
+
this.#phase = "capture";
|
|
82
|
+
this.#srcFrames = 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Start over like a new instance (for `dispose()`). */
|
|
86
|
+
reset() {
|
|
87
|
+
this.#token++;
|
|
88
|
+
this.#phase = "capture";
|
|
89
|
+
this.#srcFrames = 0;
|
|
90
|
+
this.#gap = exports.CAPTURE_DELAY;
|
|
91
|
+
this.#aspect = 0;
|
|
92
|
+
this.#long = 0;
|
|
93
|
+
this.#lastSize[0] = 0;
|
|
94
|
+
this.#lastSize[1] = 0;
|
|
95
|
+
this.#settled = 0;
|
|
96
|
+
}
|
|
97
|
+
// Recapture once the element's aspect ratio has drifted from the
|
|
98
|
+
// captured one and its size has held still for RESIZE_SETTLE frames,
|
|
99
|
+
// so a resize animation reads back once, at the end.
|
|
100
|
+
#watchAspect(ctx) {
|
|
101
|
+
const [ew, eh] = ctx.dims.elementPixel;
|
|
102
|
+
if (!(ew >= 1 && eh >= 1)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const moved = ew !== this.#lastSize[0] || eh !== this.#lastSize[1];
|
|
106
|
+
this.#lastSize[0] = ew;
|
|
107
|
+
this.#lastSize[1] = eh;
|
|
108
|
+
this.#settled = moved ? 0 : this.#settled + 1;
|
|
109
|
+
if (this.#settled < exports.RESIZE_SETTLE) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (Math.abs(ew / eh / this.#aspect - 1) > exports.ASPECT_TOLERANCE ||
|
|
113
|
+
this.#longSide(ew, eh) > this.#long * exports.GROW_TOLERANCE) {
|
|
114
|
+
this.refresh();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// The mask's long side for an element of ew × eh device px.
|
|
118
|
+
#longSide(ew, eh) {
|
|
119
|
+
const { longSide, minLongSide } = this.#opts;
|
|
120
|
+
if (minLongSide === undefined) {
|
|
121
|
+
return longSide;
|
|
122
|
+
}
|
|
123
|
+
return Math.round(Math.min(Math.max(Math.max(ew, eh), minLongSide), longSide));
|
|
124
|
+
}
|
|
125
|
+
#capture(ctx) {
|
|
126
|
+
const [ew, eh] = ctx.dims.elementPixel;
|
|
127
|
+
if (ctx.src.width === 0 ||
|
|
128
|
+
ctx.src.height === 0 ||
|
|
129
|
+
!(ew >= 1 && eh >= 1)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
// Give the source a few frames to upload.
|
|
133
|
+
if (++this.#srcFrames < this.#gap) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const long = this.#longSide(ew, eh);
|
|
137
|
+
const aspect = ew / eh;
|
|
138
|
+
const width = Math.max(1, aspect >= 1 ? long : Math.round(long * aspect));
|
|
139
|
+
const height = Math.max(1, aspect >= 1 ? Math.round(long / aspect) : long);
|
|
140
|
+
const mask = ctx.createRenderTarget({ size: [width, height] });
|
|
141
|
+
(0, _capture_js_1.captureContent)(ctx, mask);
|
|
142
|
+
this.#phase = "reading";
|
|
143
|
+
const token = this.#token;
|
|
144
|
+
// The read copies the pixels now, so the mask can go.
|
|
145
|
+
const read = this.#opts.read
|
|
146
|
+
? ctx.readPixels(mask, this.#opts.read)
|
|
147
|
+
: ctx.readPixels(mask);
|
|
148
|
+
mask.dispose();
|
|
149
|
+
const retry = (backoff) => {
|
|
150
|
+
this.#srcFrames = 0;
|
|
151
|
+
if (backoff) {
|
|
152
|
+
this.#gap = Math.min(this.#gap * 2, exports.CAPTURE_RETRY_MAX);
|
|
153
|
+
}
|
|
154
|
+
this.#phase = "capture";
|
|
155
|
+
};
|
|
156
|
+
const isCurrent = () => token === this.#token;
|
|
157
|
+
read.then((pixels) => {
|
|
158
|
+
if (!isCurrent()) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const done = (ok) => {
|
|
162
|
+
if (!isCurrent()) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (ok) {
|
|
166
|
+
this.#aspect = aspect;
|
|
167
|
+
this.#long = long;
|
|
168
|
+
this.#phase = "idle";
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
// Nothing drawn yet: try again later, less often,
|
|
172
|
+
// in case it's a late-loading image.
|
|
173
|
+
retry(true);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const ok = this.#opts.onRead({ pixels, width, height, aspect }, isCurrent);
|
|
177
|
+
if (typeof ok === "boolean") {
|
|
178
|
+
done(ok);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
ok.then(done, () => done(false));
|
|
182
|
+
}
|
|
183
|
+
}, () => {
|
|
184
|
+
// Disposed or context lost.
|
|
185
|
+
if (isCurrent()) {
|
|
186
|
+
retry(false);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
exports.SourceCapture = SourceCapture;
|
|
192
|
+
//# sourceMappingURL=_source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_source.js","sourceRoot":"","sources":["../../src/_source.ts"],"names":[],"mappings":";;;AAcA,0CAEC;AAZD,+CAA+C;AAS/C,oFAAoF;AACpF,SAAgB,eAAe,CAAC,CAAU;IACtC,OAAO,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC3D,CAAC;AAED,sEAAsE;AACtE,sEAAsE;AACzD,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACrC,uEAAuE;AACvE,+DAA+D;AAC/D,wBAAwB;AACX,QAAA,gBAAgB,GAAG,IAAI,CAAC;AACxB,QAAA,aAAa,GAAG,CAAC,CAAC;AAC/B,wEAAwE;AACxE,8BAA8B;AACjB,QAAA,cAAc,GAAG,IAAI,CAAC;AA6CnC;;;;;;;;;GASG;AACH,MAAa,aAAa;IACb,KAAK,CAAuB;IACrC,mEAAmE;IACnE,6CAA6C;IAC7C,MAAM,GAAG,CAAC,CAAC;IACX,MAAM,GAAuB,SAAS,CAAC;IACvC,UAAU,GAAG,CAAC,CAAC;IACf,oEAAoE;IACpE,IAAI,GAAG,qBAAa,CAAC;IACrB,iDAAiD;IACjD,OAAO,GAA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AAE,CAAC;oBACL,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;oBACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;oBAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;gBACzB,CAAC;qBAAM,CAAC;oBACJ,kDAAkD;oBAClD,qCAAqC;oBACrC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChB,CAAC;YACL,CAAC,CAAC;YACF,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CACxB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EACjC,SAAS,CACZ,CAAC;YACF,IAAI,OAAO,EAAE,KAAK,SAAS,EAAE,CAAC;gBAC1B,IAAI,CAAC,EAAE,CAAC,CAAC;YACb,CAAC;iBAAM,CAAC;gBACJ,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACrC,CAAC;QACL,CAAC,EACD,GAAG,EAAE;YACD,4BAA4B;YAC5B,IAAI,SAAS,EAAE,EAAE,CAAC;gBACd,KAAK,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;QACL,CAAC,CACJ,CAAC;IACN,CAAC;CACJ;AAvLD,sCAuLC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** A sphere: centre and radius. */
|
|
2
|
+
export type FoamSphere = readonly [number, number, number, number];
|
|
3
|
+
/** A film along the ray. */
|
|
4
|
+
export type SphereFilm = {
|
|
5
|
+
t: number;
|
|
6
|
+
kind: "in" | "out";
|
|
7
|
+
sphere: number;
|
|
8
|
+
} | {
|
|
9
|
+
t: number;
|
|
10
|
+
kind: "wall";
|
|
11
|
+
from: number;
|
|
12
|
+
to: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The films a ray (origin `o`, unit direction `d`) crosses on [t0, t1],
|
|
16
|
+
* in order. `inside` is whether the ray is in the foam at t0 (the state
|
|
17
|
+
* carried from the previous segment); undefined works it out from t0.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sphereFilms(o: readonly [number, number, number], d: readonly [number, number, number], spheres: readonly FoamSphere[], t0: number, t1: number, inside?: boolean): {
|
|
20
|
+
films: SphereFilm[];
|
|
21
|
+
inside: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The distance from `q`, in the cell of sphere `own`, to the nearest wall
|
|
25
|
+
* of that cell, and the sphere across it (-1: none). Walls lie on
|
|
26
|
+
* radical planes, so the distance to the wall shared with sphere j is
|
|
27
|
+
* exact: (pow_j(q) - pow_own(q)) / (2 |c_j - c_own|). It is >= 0 inside
|
|
28
|
+
* the cell and 0 on the line where two bubbles' surfaces meet. As the
|
|
29
|
+
* shader's `borderDist`; the owner itself (same centre) is skipped.
|
|
30
|
+
*/
|
|
31
|
+
export declare function borderDist(q: readonly [number, number, number], own: number, spheres: readonly FoamSphere[]): {
|
|
32
|
+
e: number;
|
|
33
|
+
across: number;
|
|
34
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// BubbleEffect's "spheres" foam along one ray, in TypeScript: the same
|
|
3
|
+
// algorithm as the shader, so its maths can be tested. Pure module, for
|
|
4
|
+
// the tests only: tsconfig leaves it out of lib/.
|
|
5
|
+
//
|
|
6
|
+
// The foam is a power diagram of spheres: a point belongs to the sphere i
|
|
7
|
+
// with the least power |p - c_i|^2 - r_i^2, and is inside the foam when
|
|
8
|
+
// that power is <= 0. Overlapping spheres are cut by their radical plane
|
|
9
|
+
// and share one flat wall there; an exposed sphere's own surface is the
|
|
10
|
+
// outside film.
|
|
11
|
+
//
|
|
12
|
+
// Along a ray p = o + t d (|d| = 1) the power is t^2 + b_i t + k_i. The
|
|
13
|
+
// t^2 term is common, so the owner along the ray is the lower envelope
|
|
14
|
+
// of the lines b_i t + k_i, and the films are:
|
|
15
|
+
// - where t^2 + b t + k of the owner crosses 0 (in or out of the foam),
|
|
16
|
+
// - where the owner changes while inside (a wall, one film).
|
|
17
|
+
// They come out sorted by t.
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.sphereFilms = sphereFilms;
|
|
20
|
+
exports.borderDist = borderDist;
|
|
21
|
+
/**
|
|
22
|
+
* The films a ray (origin `o`, unit direction `d`) crosses on [t0, t1],
|
|
23
|
+
* in order. `inside` is whether the ray is in the foam at t0 (the state
|
|
24
|
+
* carried from the previous segment); undefined works it out from t0.
|
|
25
|
+
*/
|
|
26
|
+
function sphereFilms(o, d, spheres, t0, t1, inside) {
|
|
27
|
+
const films = [];
|
|
28
|
+
// The lines: power = t^2 + b t + k. Only spheres the ray passes
|
|
29
|
+
// through on [t0, t1] can own a point inside the foam there, so the
|
|
30
|
+
// others are left out (the shader does the same).
|
|
31
|
+
const b = [];
|
|
32
|
+
const k = [];
|
|
33
|
+
const ids = [];
|
|
34
|
+
spheres.forEach(([x, y, z, r], i) => {
|
|
35
|
+
const ox = o[0] - x;
|
|
36
|
+
const oy = o[1] - y;
|
|
37
|
+
const oz = o[2] - z;
|
|
38
|
+
const bi = 2 * (d[0] * ox + d[1] * oy + d[2] * oz);
|
|
39
|
+
const ki = ox * ox + oy * oy + oz * oz - r * r;
|
|
40
|
+
const disc = bi * bi - 4 * ki;
|
|
41
|
+
if (disc <= 0) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const h = Math.sqrt(disc);
|
|
45
|
+
if ((-bi - h) / 2 < t1 && (-bi + h) / 2 > t0) {
|
|
46
|
+
b.push(bi);
|
|
47
|
+
k.push(ki);
|
|
48
|
+
ids.push(i);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const m = ids.length;
|
|
52
|
+
if (m === 0) {
|
|
53
|
+
return { films, inside: false };
|
|
54
|
+
}
|
|
55
|
+
// The owner at t0: the lowest line, the steepest down on a tie.
|
|
56
|
+
let own = 0;
|
|
57
|
+
for (let i = 1; i < m; i++) {
|
|
58
|
+
const li = b[i] * t0 + k[i];
|
|
59
|
+
const lo = b[own] * t0 + k[own];
|
|
60
|
+
if (li < lo || (li === lo && b[i] < b[own])) {
|
|
61
|
+
own = i;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const power = (i, t) => t * t + b[i] * t + k[i];
|
|
65
|
+
let ins = inside ?? power(own, t0) < 0;
|
|
66
|
+
let ta = t0;
|
|
67
|
+
for (let guard = 0; guard <= m; guard++) {
|
|
68
|
+
// The next owner: of the lines falling below this one later, the
|
|
69
|
+
// first to cross it.
|
|
70
|
+
let ts = Infinity;
|
|
71
|
+
let next = -1;
|
|
72
|
+
for (let j = 0; j < m; j++) {
|
|
73
|
+
if (b[j] < b[own]) {
|
|
74
|
+
const tj = Math.max((k[j] - k[own]) / (b[own] - b[j]), ta);
|
|
75
|
+
if (tj < ts) {
|
|
76
|
+
ts = tj;
|
|
77
|
+
next = j;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const tb = Math.min(ts, t1);
|
|
82
|
+
// The owner's sphere surface, crossed in (ta, tb].
|
|
83
|
+
const disc = b[own] * b[own] - 4 * k[own];
|
|
84
|
+
if (disc > 0) {
|
|
85
|
+
const h = Math.sqrt(disc);
|
|
86
|
+
const tIn = (-b[own] - h) / 2;
|
|
87
|
+
const tOut = (-b[own] + h) / 2;
|
|
88
|
+
if (!ins && tIn > ta && tIn <= tb) {
|
|
89
|
+
films.push({ t: tIn, kind: "in", sphere: ids[own] });
|
|
90
|
+
ins = true;
|
|
91
|
+
}
|
|
92
|
+
if (ins && tOut > ta && tOut <= tb) {
|
|
93
|
+
films.push({ t: tOut, kind: "out", sphere: ids[own] });
|
|
94
|
+
ins = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (next < 0 || ts >= t1) {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (ins) {
|
|
101
|
+
films.push({ t: ts, kind: "wall", from: ids[own], to: ids[next] });
|
|
102
|
+
}
|
|
103
|
+
own = next;
|
|
104
|
+
ta = ts;
|
|
105
|
+
}
|
|
106
|
+
return { films, inside: ins };
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The distance from `q`, in the cell of sphere `own`, to the nearest wall
|
|
110
|
+
* of that cell, and the sphere across it (-1: none). Walls lie on
|
|
111
|
+
* radical planes, so the distance to the wall shared with sphere j is
|
|
112
|
+
* exact: (pow_j(q) - pow_own(q)) / (2 |c_j - c_own|). It is >= 0 inside
|
|
113
|
+
* the cell and 0 on the line where two bubbles' surfaces meet. As the
|
|
114
|
+
* shader's `borderDist`; the owner itself (same centre) is skipped.
|
|
115
|
+
*/
|
|
116
|
+
function borderDist(q, own, spheres) {
|
|
117
|
+
const pow = ([x, y, z, r]) => (q[0] - x) ** 2 + (q[1] - y) ** 2 + (q[2] - z) ** 2 - r * r;
|
|
118
|
+
const o = spheres[own];
|
|
119
|
+
const powI = pow(o);
|
|
120
|
+
let e = Infinity;
|
|
121
|
+
let across = -1;
|
|
122
|
+
spheres.forEach((s, j) => {
|
|
123
|
+
const d2 = (s[0] - o[0]) ** 2 + (s[1] - o[1]) ** 2 + (s[2] - o[2]) ** 2;
|
|
124
|
+
if (d2 < 1e-12) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const ej = (pow(s) - powI) / (2 * Math.sqrt(d2));
|
|
128
|
+
if (ej < e) {
|
|
129
|
+
e = ej;
|
|
130
|
+
across = j;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return { e: Math.max(e, 0), across };
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=_sphere-foam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_sphere-foam.js","sourceRoot":"","sources":["../../src/_sphere-foam.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,wEAAwE;AACxE,kDAAkD;AAClD,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE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AAE,MAAM,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Thickness at the LUT's right edge, in nm. */
|
|
2
|
+
export declare const THIN_FILM_THICKNESS_MAX = 1500;
|
|
3
|
+
/** LUT size: thickness along x, cos of the incident angle along y. */
|
|
4
|
+
export declare const THIN_FILM_LUT_W = 256;
|
|
5
|
+
export declare const THIN_FILM_LUT_H = 64;
|
|
6
|
+
/** Index of refraction of the soap film (water). */
|
|
7
|
+
export declare const THIN_FILM_IOR = 1.33;
|
|
8
|
+
/**
|
|
9
|
+
* The reflectance of an air / film / air layer, s and p averaged, at
|
|
10
|
+
* the incident cosine `cosI` and the film phase `delta` (4π n d cosθt / λ):
|
|
11
|
+
* the Airy sum of all the reflections inside the film. Both faces have
|
|
12
|
+
* the same Fresnel amplitude with opposite signs (the π shift), so a
|
|
13
|
+
* film that is much thinner than the light (delta → 0) is black.
|
|
14
|
+
*/
|
|
15
|
+
export declare function airyReflectance(cosI: number, delta: number, n?: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* The LUT, RGBA, `THIN_FILM_LUT_W` x `THIN_FILM_LUT_H`, rows bottom-up:
|
|
18
|
+
* texel (i, j) is the film of thickness `(i + 0.5) / W * THICKNESS_MAX`
|
|
19
|
+
* nm, seen at the incident cosine `(j + 0.5) / H`. rgb is linear sRGB
|
|
20
|
+
* reflectance under a white (equal energy, displayed as D65) light, so a
|
|
21
|
+
* perfect mirror would be (1, 1, 1); a is its luminance. Computed once
|
|
22
|
+
* and shared.
|
|
23
|
+
*/
|
|
24
|
+
export declare function thinFilmLut(): Float32Array;
|
|
25
|
+
/** The LUT, computed afresh (see {@link thinFilmLut}). */
|
|
26
|
+
export declare function bakeThinFilmLut(w?: number, h?: number, n?: number): Float32Array;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.THIN_FILM_IOR = exports.THIN_FILM_LUT_H = exports.THIN_FILM_LUT_W = exports.THIN_FILM_THICKNESS_MAX = void 0;
|
|
4
|
+
exports.airyReflectance = airyReflectance;
|
|
5
|
+
exports.thinFilmLut = thinFilmLut;
|
|
6
|
+
exports.bakeThinFilmLut = bakeThinFilmLut;
|
|
7
|
+
// Thin-film interference of a soap film, baked once on the CPU into a
|
|
8
|
+
// small LUT: linear sRGB reflectance by film thickness and by the cosine
|
|
9
|
+
// of the angle of incidence. Pure module: no GL, Node-testable.
|
|
10
|
+
const cmf_js_1 = require("./_holo/spectral/cmf.js");
|
|
11
|
+
/** Thickness at the LUT's right edge, in nm. */
|
|
12
|
+
exports.THIN_FILM_THICKNESS_MAX = 1500;
|
|
13
|
+
/** LUT size: thickness along x, cos of the incident angle along y. */
|
|
14
|
+
exports.THIN_FILM_LUT_W = 256;
|
|
15
|
+
exports.THIN_FILM_LUT_H = 64;
|
|
16
|
+
/** Index of refraction of the soap film (water). */
|
|
17
|
+
exports.THIN_FILM_IOR = 1.33;
|
|
18
|
+
// Wavelengths outside this range add nothing visible.
|
|
19
|
+
const LAMBDA_MIN = 380;
|
|
20
|
+
const LAMBDA_MAX = 780;
|
|
21
|
+
// Groups of this many quadrature nodes (0.5 nm each) are merged into
|
|
22
|
+
// one wavelength: 2 nm keeps the fringes of the thickest film resolved.
|
|
23
|
+
const LAMBDA_STRIDE = 4;
|
|
24
|
+
/**
|
|
25
|
+
* The reflectance of an air / film / air layer, s and p averaged, at
|
|
26
|
+
* the incident cosine `cosI` and the film phase `delta` (4π n d cosθt / λ):
|
|
27
|
+
* the Airy sum of all the reflections inside the film. Both faces have
|
|
28
|
+
* the same Fresnel amplitude with opposite signs (the π shift), so a
|
|
29
|
+
* film that is much thinner than the light (delta → 0) is black.
|
|
30
|
+
*/
|
|
31
|
+
function airyReflectance(cosI, delta, n = exports.THIN_FILM_IOR) {
|
|
32
|
+
const { rs2, rp2 } = fresnelAmplitudes(cosI, n);
|
|
33
|
+
const c = Math.cos(delta);
|
|
34
|
+
return 0.5 * (airy(rs2, c) + airy(rp2, c));
|
|
35
|
+
}
|
|
36
|
+
function airy(r2, cosDelta) {
|
|
37
|
+
return (2 * r2 * (1 - cosDelta)) / (1 + r2 * r2 - 2 * r2 * cosDelta);
|
|
38
|
+
}
|
|
39
|
+
// Squared Fresnel amplitudes from air into the film, and cosθt.
|
|
40
|
+
function fresnelAmplitudes(cosI, n) {
|
|
41
|
+
const c = Math.min(Math.max(cosI, 0), 1);
|
|
42
|
+
const sinT2 = (1 - c * c) / (n * n);
|
|
43
|
+
const cosT = Math.sqrt(1 - sinT2);
|
|
44
|
+
const rs = (c - n * cosT) / (c + n * cosT);
|
|
45
|
+
const rp = (n * c - cosT) / (n * c + cosT);
|
|
46
|
+
return { rs2: rs * rs, rp2: rp * rp, cosT };
|
|
47
|
+
}
|
|
48
|
+
let cached = null;
|
|
49
|
+
/**
|
|
50
|
+
* The LUT, RGBA, `THIN_FILM_LUT_W` x `THIN_FILM_LUT_H`, rows bottom-up:
|
|
51
|
+
* texel (i, j) is the film of thickness `(i + 0.5) / W * THICKNESS_MAX`
|
|
52
|
+
* nm, seen at the incident cosine `(j + 0.5) / H`. rgb is linear sRGB
|
|
53
|
+
* reflectance under a white (equal energy, displayed as D65) light, so a
|
|
54
|
+
* perfect mirror would be (1, 1, 1); a is its luminance. Computed once
|
|
55
|
+
* and shared.
|
|
56
|
+
*/
|
|
57
|
+
function thinFilmLut() {
|
|
58
|
+
if (!cached) {
|
|
59
|
+
cached = bakeThinFilmLut();
|
|
60
|
+
}
|
|
61
|
+
return cached;
|
|
62
|
+
}
|
|
63
|
+
/** The LUT, computed afresh (see {@link thinFilmLut}). */
|
|
64
|
+
function bakeThinFilmLut(w = exports.THIN_FILM_LUT_W, h = exports.THIN_FILM_LUT_H, n = exports.THIN_FILM_IOR) {
|
|
65
|
+
// The quadrature merged into groups: one wavelength each, with the
|
|
66
|
+
// summed weight of its nodes times the colour matching functions.
|
|
67
|
+
const lambdas = [];
|
|
68
|
+
const wr = [];
|
|
69
|
+
const wg = [];
|
|
70
|
+
const wb = [];
|
|
71
|
+
for (let i0 = 0; i0 < cmf_js_1.QUAD_N; i0 += LAMBDA_STRIDE) {
|
|
72
|
+
let sr = 0;
|
|
73
|
+
let sg = 0;
|
|
74
|
+
let sb = 0;
|
|
75
|
+
let sl = 0;
|
|
76
|
+
let sw = 0;
|
|
77
|
+
for (let i = i0; i < Math.min(i0 + LAMBDA_STRIDE, cmf_js_1.QUAD_N); i++) {
|
|
78
|
+
const l = cmf_js_1.QUAD_LAMBDA[i];
|
|
79
|
+
if (l < LAMBDA_MIN || l > LAMBDA_MAX) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const q = cmf_js_1.QUAD_WEIGHT[i];
|
|
83
|
+
sr += q * cmf_js_1.RGBCMF_QUAD[3 * i];
|
|
84
|
+
sg += q * cmf_js_1.RGBCMF_QUAD[3 * i + 1];
|
|
85
|
+
sb += q * cmf_js_1.RGBCMF_QUAD[3 * i + 2];
|
|
86
|
+
sl += q * l;
|
|
87
|
+
sw += q;
|
|
88
|
+
}
|
|
89
|
+
if (sw > 0) {
|
|
90
|
+
lambdas.push(sl / sw);
|
|
91
|
+
wr.push(sr);
|
|
92
|
+
wg.push(sg);
|
|
93
|
+
wb.push(sb);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// A flat spectrum of reflectance 1 shows as (1, 1, 1).
|
|
97
|
+
const norm = (a) => {
|
|
98
|
+
const s = a.reduce((x, y) => x + y, 0);
|
|
99
|
+
return a.map((x) => x / s);
|
|
100
|
+
};
|
|
101
|
+
const nr = norm(wr);
|
|
102
|
+
const ng = norm(wg);
|
|
103
|
+
const nb = norm(wb);
|
|
104
|
+
const out = new Float32Array(w * h * 4);
|
|
105
|
+
const acc = new Float64Array(w * 3);
|
|
106
|
+
const dStep = exports.THIN_FILM_THICKNESS_MAX / w;
|
|
107
|
+
for (let j = 0; j < h; j++) {
|
|
108
|
+
const cosI = (j + 0.5) / h;
|
|
109
|
+
const { rs2, rp2, cosT } = fresnelAmplitudes(cosI, n);
|
|
110
|
+
acc.fill(0);
|
|
111
|
+
for (let k = 0; k < lambdas.length; k++) {
|
|
112
|
+
// delta grows linearly with the thickness: step it by
|
|
113
|
+
// rotation instead of a cos per texel.
|
|
114
|
+
const k0 = (4 * Math.PI * n * cosT) / lambdas[k];
|
|
115
|
+
const d0 = k0 * 0.5 * dStep;
|
|
116
|
+
const dd = k0 * dStep;
|
|
117
|
+
const cd = Math.cos(dd);
|
|
118
|
+
const sd = Math.sin(dd);
|
|
119
|
+
let c = Math.cos(d0);
|
|
120
|
+
let s = Math.sin(d0);
|
|
121
|
+
for (let i = 0; i < w; i++) {
|
|
122
|
+
const r = 0.5 * (airy(rs2, c) + airy(rp2, c));
|
|
123
|
+
acc[i * 3] += nr[k] * r;
|
|
124
|
+
acc[i * 3 + 1] += ng[k] * r;
|
|
125
|
+
acc[i * 3 + 2] += nb[k] * r;
|
|
126
|
+
const c2 = c * cd - s * sd;
|
|
127
|
+
s = s * cd + c * sd;
|
|
128
|
+
c = c2;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
for (let i = 0; i < w; i++) {
|
|
132
|
+
const o = (j * w + i) * 4;
|
|
133
|
+
// The matching functions dip below 0; so can a saturated
|
|
134
|
+
// fringe, just out of gamut.
|
|
135
|
+
const r = Math.max(acc[i * 3], 0);
|
|
136
|
+
const g = Math.max(acc[i * 3 + 1], 0);
|
|
137
|
+
const b = Math.max(acc[i * 3 + 2], 0);
|
|
138
|
+
out[o] = r;
|
|
139
|
+
out[o + 1] = g;
|
|
140
|
+
out[o + 2] = b;
|
|
141
|
+
out[o + 3] = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=_thin-film.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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