@nodetool-ai/gpu 0.8.1
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 +52 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/blend/blendModes.d.ts +67 -0
- package/dist/blend/blendModes.d.ts.map +1 -0
- package/dist/blend/blendModes.js +80 -0
- package/dist/blend/blendModes.js.map +1 -0
- package/dist/blend/index.d.ts +10 -0
- package/dist/blend/index.d.ts.map +1 -0
- package/dist/blend/index.js +10 -0
- package/dist/blend/index.js.map +1 -0
- package/dist/blend/wgsl.d.ts +16 -0
- package/dist/blend/wgsl.d.ts.map +1 -0
- package/dist/blend/wgsl.js +85 -0
- package/dist/blend/wgsl.js.map +1 -0
- package/dist/compositor/compositor.d.ts +112 -0
- package/dist/compositor/compositor.d.ts.map +1 -0
- package/dist/compositor/compositor.js +353 -0
- package/dist/compositor/compositor.js.map +1 -0
- package/dist/compositor/headless.d.ts +47 -0
- package/dist/compositor/headless.d.ts.map +1 -0
- package/dist/compositor/headless.js +158 -0
- package/dist/compositor/headless.js.map +1 -0
- package/dist/compositor/index.d.ts +8 -0
- package/dist/compositor/index.d.ts.map +1 -0
- package/dist/compositor/index.js +8 -0
- package/dist/compositor/index.js.map +1 -0
- package/dist/compositor/shaders.d.ts +24 -0
- package/dist/compositor/shaders.d.ts.map +1 -0
- package/dist/compositor/shaders.js +241 -0
- package/dist/compositor/shaders.js.map +1 -0
- package/dist/compositor/transform.d.ts +49 -0
- package/dist/compositor/transform.d.ts.map +1 -0
- package/dist/compositor/transform.js +74 -0
- package/dist/compositor/transform.js.map +1 -0
- package/dist/context.d.ts +108 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +205 -0
- package/dist/context.js.map +1 -0
- package/dist/debug/premulValidator.d.ts +85 -0
- package/dist/debug/premulValidator.d.ts.map +1 -0
- package/dist/debug/premulValidator.js +239 -0
- package/dist/debug/premulValidator.js.map +1 -0
- package/dist/executor.d.ts +74 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +413 -0
- package/dist/executor.js.map +1 -0
- package/dist/fullscreenQuad.d.ts +11 -0
- package/dist/fullscreenQuad.d.ts.map +1 -0
- package/dist/fullscreenQuad.js +31 -0
- package/dist/fullscreenQuad.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +162 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +100 -0
- package/dist/module.js.map +1 -0
- package/dist/node.d.ts +38 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +140 -0
- package/dist/node.js.map +1 -0
- package/dist/pool.d.ts +30 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js +33 -0
- package/dist/pool.js.map +1 -0
- package/dist/recipe.d.ts +148 -0
- package/dist/recipe.d.ts.map +1 -0
- package/dist/recipe.js +181 -0
- package/dist/recipe.js.map +1 -0
- package/dist/registry.d.ts +49 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +100 -0
- package/dist/registry.js.map +1 -0
- package/dist/shaders/_canary/passthrough/v1/module.d.ts +13 -0
- package/dist/shaders/_canary/passthrough/v1/module.d.ts.map +1 -0
- package/dist/shaders/_canary/passthrough/v1/module.js +71 -0
- package/dist/shaders/_canary/passthrough/v1/module.js.map +1 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.d.ts +16 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.d.ts.map +1 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.js +62 -0
- package/dist/shaders/alpha/premulToStraight/v1/module.js.map +1 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.d.ts +19 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.d.ts.map +1 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.js +61 -0
- package/dist/shaders/alpha/straightToPremul/v1/module.js.map +1 -0
- package/dist/shaders/color/brightnessContrast/v1/module.d.ts +17 -0
- package/dist/shaders/color/brightnessContrast/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/brightnessContrast/v1/module.js +84 -0
- package/dist/shaders/color/brightnessContrast/v1/module.js.map +1 -0
- package/dist/shaders/color/cdl/v1/module.d.ts +35 -0
- package/dist/shaders/color/cdl/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/cdl/v1/module.js +106 -0
- package/dist/shaders/color/cdl/v1/module.js.map +1 -0
- package/dist/shaders/color/channelMerge/v1/module.d.ts +22 -0
- package/dist/shaders/color/channelMerge/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelMerge/v1/module.js +101 -0
- package/dist/shaders/color/channelMerge/v1/module.js.map +1 -0
- package/dist/shaders/color/channelShuffle/v1/module.d.ts +29 -0
- package/dist/shaders/color/channelShuffle/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelShuffle/v1/module.js +94 -0
- package/dist/shaders/color/channelShuffle/v1/module.js.map +1 -0
- package/dist/shaders/color/channelSplit/v1/module.d.ts +18 -0
- package/dist/shaders/color/channelSplit/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/channelSplit/v1/module.js +90 -0
- package/dist/shaders/color/channelSplit/v1/module.js.map +1 -0
- package/dist/shaders/color/colorBalance/v1/module.d.ts +18 -0
- package/dist/shaders/color/colorBalance/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/colorBalance/v1/module.js +86 -0
- package/dist/shaders/color/colorBalance/v1/module.js.map +1 -0
- package/dist/shaders/color/cubeLut/v1/module.d.ts +14 -0
- package/dist/shaders/color/cubeLut/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/cubeLut/v1/module.js +78 -0
- package/dist/shaders/color/cubeLut/v1/module.js.map +1 -0
- package/dist/shaders/color/curves/v1/module.d.ts +31 -0
- package/dist/shaders/color/curves/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/curves/v1/module.js +102 -0
- package/dist/shaders/color/curves/v1/module.js.map +1 -0
- package/dist/shaders/color/exposure/v1/module.d.ts +15 -0
- package/dist/shaders/color/exposure/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/exposure/v1/module.js +78 -0
- package/dist/shaders/color/exposure/v1/module.js.map +1 -0
- package/dist/shaders/color/exposureTone/v1/module.d.ts +28 -0
- package/dist/shaders/color/exposureTone/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/exposureTone/v1/module.js +107 -0
- package/dist/shaders/color/exposureTone/v1/module.js.map +1 -0
- package/dist/shaders/color/filmLook/v1/module.d.ts +28 -0
- package/dist/shaders/color/filmLook/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/filmLook/v1/module.js +103 -0
- package/dist/shaders/color/filmLook/v1/module.js.map +1 -0
- package/dist/shaders/color/grade/v1/module.d.ts +35 -0
- package/dist/shaders/color/grade/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/grade/v1/module.js +182 -0
- package/dist/shaders/color/grade/v1/module.js.map +1 -0
- package/dist/shaders/color/grayscale/v1/module.d.ts +14 -0
- package/dist/shaders/color/grayscale/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/grayscale/v1/module.js +79 -0
- package/dist/shaders/color/grayscale/v1/module.js.map +1 -0
- package/dist/shaders/color/hsb/v1/module.d.ts +20 -0
- package/dist/shaders/color/hsb/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/hsb/v1/module.js +131 -0
- package/dist/shaders/color/hsb/v1/module.js.map +1 -0
- package/dist/shaders/color/hslAdjust/v1/module.d.ts +30 -0
- package/dist/shaders/color/hslAdjust/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/hslAdjust/v1/module.js +170 -0
- package/dist/shaders/color/hslAdjust/v1/module.js.map +1 -0
- package/dist/shaders/color/invert/v1/module.d.ts +15 -0
- package/dist/shaders/color/invert/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/invert/v1/module.js +85 -0
- package/dist/shaders/color/invert/v1/module.js.map +1 -0
- package/dist/shaders/color/levels/v1/module.d.ts +33 -0
- package/dist/shaders/color/levels/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/levels/v1/module.js +116 -0
- package/dist/shaders/color/levels/v1/module.js.map +1 -0
- package/dist/shaders/color/liftGammaGain/v1/module.d.ts +40 -0
- package/dist/shaders/color/liftGammaGain/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/liftGammaGain/v1/module.js +114 -0
- package/dist/shaders/color/liftGammaGain/v1/module.js.map +1 -0
- package/dist/shaders/color/posterize/v1/module.d.ts +16 -0
- package/dist/shaders/color/posterize/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/posterize/v1/module.js +80 -0
- package/dist/shaders/color/posterize/v1/module.js.map +1 -0
- package/dist/shaders/color/solarize/v1/module.d.ts +15 -0
- package/dist/shaders/color/solarize/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/solarize/v1/module.js +83 -0
- package/dist/shaders/color/solarize/v1/module.js.map +1 -0
- package/dist/shaders/color/splitToning/v1/module.d.ts +26 -0
- package/dist/shaders/color/splitToning/v1/module.d.ts.map +1 -0
- package/dist/shaders/color/splitToning/v1/module.js +95 -0
- package/dist/shaders/color/splitToning/v1/module.js.map +1 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.d.ts +23 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.js +110 -0
- package/dist/shaders/filters/blur/gaussian/v1/module.js.map +1 -0
- package/dist/shaders/filters/blur/separable/v1/module.d.ts +18 -0
- package/dist/shaders/filters/blur/separable/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/blur/separable/v1/module.js +64 -0
- package/dist/shaders/filters/blur/separable/v1/module.js.map +1 -0
- package/dist/shaders/filters/convolve3x3/v1/module.d.ts +23 -0
- package/dist/shaders/filters/convolve3x3/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/convolve3x3/v1/module.js +128 -0
- package/dist/shaders/filters/convolve3x3/v1/module.js.map +1 -0
- package/dist/shaders/filters/glow/v1/module.d.ts +26 -0
- package/dist/shaders/filters/glow/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/glow/v1/module.js +102 -0
- package/dist/shaders/filters/glow/v1/module.js.map +1 -0
- package/dist/shaders/filters/grain/v1/module.d.ts +38 -0
- package/dist/shaders/filters/grain/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/grain/v1/module.js +110 -0
- package/dist/shaders/filters/grain/v1/module.js.map +1 -0
- package/dist/shaders/filters/pixelate/v1/module.d.ts +14 -0
- package/dist/shaders/filters/pixelate/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/pixelate/v1/module.js +76 -0
- package/dist/shaders/filters/pixelate/v1/module.js.map +1 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts +17 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js +93 -0
- package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js.map +1 -0
- package/dist/shaders/filters/threshold/v1/module.d.ts +17 -0
- package/dist/shaders/filters/threshold/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/threshold/v1/module.js +71 -0
- package/dist/shaders/filters/threshold/v1/module.js.map +1 -0
- package/dist/shaders/filters/vignette/v1/module.d.ts +18 -0
- package/dist/shaders/filters/vignette/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/vignette/v1/module.js +78 -0
- package/dist/shaders/filters/vignette/v1/module.js.map +1 -0
- package/dist/shaders/filters/visualFx/v1/module.d.ts +24 -0
- package/dist/shaders/filters/visualFx/v1/module.d.ts.map +1 -0
- package/dist/shaders/filters/visualFx/v1/module.js +210 -0
- package/dist/shaders/filters/visualFx/v1/module.js.map +1 -0
- package/dist/shaders/index.d.ts +86 -0
- package/dist/shaders/index.d.ts.map +1 -0
- package/dist/shaders/index.js +161 -0
- package/dist/shaders/index.js.map +1 -0
- package/dist/shaders/keyer/chromaKey/v1/module.d.ts +25 -0
- package/dist/shaders/keyer/chromaKey/v1/module.d.ts.map +1 -0
- package/dist/shaders/keyer/chromaKey/v1/module.js +111 -0
- package/dist/shaders/keyer/chromaKey/v1/module.js.map +1 -0
- package/dist/shaders/keyer/lumaKey/v1/module.d.ts +22 -0
- package/dist/shaders/keyer/lumaKey/v1/module.d.ts.map +1 -0
- package/dist/shaders/keyer/lumaKey/v1/module.js +89 -0
- package/dist/shaders/keyer/lumaKey/v1/module.js.map +1 -0
- package/dist/shaders/mask/apply/v1/module.d.ts +16 -0
- package/dist/shaders/mask/apply/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/apply/v1/module.js +79 -0
- package/dist/shaders/mask/apply/v1/module.js.map +1 -0
- package/dist/shaders/mask/fromImage/v1/module.d.ts +18 -0
- package/dist/shaders/mask/fromImage/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/fromImage/v1/module.js +99 -0
- package/dist/shaders/mask/fromImage/v1/module.js.map +1 -0
- package/dist/shaders/mask/invert/v1/module.d.ts +12 -0
- package/dist/shaders/mask/invert/v1/module.d.ts.map +1 -0
- package/dist/shaders/mask/invert/v1/module.js +57 -0
- package/dist/shaders/mask/invert/v1/module.js.map +1 -0
- package/dist/shaders/mixer/add/v1/module.d.ts +17 -0
- package/dist/shaders/mixer/add/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/add/v1/module.js +73 -0
- package/dist/shaders/mixer/add/v1/module.js.map +1 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.d.ts +26 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.js +81 -0
- package/dist/shaders/mixer/colorOverlay/v1/module.js.map +1 -0
- package/dist/shaders/mixer/dropShadow/v1/module.d.ts +28 -0
- package/dist/shaders/mixer/dropShadow/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/dropShadow/v1/module.js +104 -0
- package/dist/shaders/mixer/dropShadow/v1/module.js.map +1 -0
- package/dist/shaders/mixer/outline/v1/module.d.ts +27 -0
- package/dist/shaders/mixer/outline/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/outline/v1/module.js +105 -0
- package/dist/shaders/mixer/outline/v1/module.js.map +1 -0
- package/dist/shaders/mixer/over/v1/module.d.ts +16 -0
- package/dist/shaders/mixer/over/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/over/v1/module.js +71 -0
- package/dist/shaders/mixer/over/v1/module.js.map +1 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.d.ts +26 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.d.ts.map +1 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.js +95 -0
- package/dist/shaders/mixer/shadowCompose/v1/module.js.map +1 -0
- package/dist/shaders/sources/angularGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/angularGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/angularGradient/v1/module.js +67 -0
- package/dist/shaders/sources/angularGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/checkerboard/v1/module.d.ts +19 -0
- package/dist/shaders/sources/checkerboard/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/checkerboard/v1/module.js +70 -0
- package/dist/shaders/sources/checkerboard/v1/module.js.map +1 -0
- package/dist/shaders/sources/diamondGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/diamondGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/diamondGradient/v1/module.js +61 -0
- package/dist/shaders/sources/diamondGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.d.ts +21 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.js +72 -0
- package/dist/shaders/sources/gaussianNoise/v1/module.js.map +1 -0
- package/dist/shaders/sources/linearGradient/v1/module.d.ts +21 -0
- package/dist/shaders/sources/linearGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/linearGradient/v1/module.js +72 -0
- package/dist/shaders/sources/linearGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/radialGradient/v1/module.d.ts +18 -0
- package/dist/shaders/sources/radialGradient/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/radialGradient/v1/module.js +60 -0
- package/dist/shaders/sources/radialGradient/v1/module.js.map +1 -0
- package/dist/shaders/sources/solid/v1/module.d.ts +17 -0
- package/dist/shaders/sources/solid/v1/module.d.ts.map +1 -0
- package/dist/shaders/sources/solid/v1/module.js +49 -0
- package/dist/shaders/sources/solid/v1/module.js.map +1 -0
- package/dist/shaders/transform/affine/v1/module.d.ts +36 -0
- package/dist/shaders/transform/affine/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/affine/v1/module.js +94 -0
- package/dist/shaders/transform/affine/v1/module.js.map +1 -0
- package/dist/shaders/transform/cornerPin/v1/module.d.ts +40 -0
- package/dist/shaders/transform/cornerPin/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/cornerPin/v1/module.js +109 -0
- package/dist/shaders/transform/cornerPin/v1/module.js.map +1 -0
- package/dist/shaders/transform/crop/v1/module.d.ts +26 -0
- package/dist/shaders/transform/crop/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/crop/v1/module.js +82 -0
- package/dist/shaders/transform/crop/v1/module.js.map +1 -0
- package/dist/shaders/transform/displace/v1/module.d.ts +23 -0
- package/dist/shaders/transform/displace/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/displace/v1/module.js +95 -0
- package/dist/shaders/transform/displace/v1/module.js.map +1 -0
- package/dist/shaders/transform/mirror/v1/module.d.ts +14 -0
- package/dist/shaders/transform/mirror/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/mirror/v1/module.js +73 -0
- package/dist/shaders/transform/mirror/v1/module.js.map +1 -0
- package/dist/shaders/transform/offset/v1/module.d.ts +21 -0
- package/dist/shaders/transform/offset/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/offset/v1/module.js +88 -0
- package/dist/shaders/transform/offset/v1/module.js.map +1 -0
- package/dist/shaders/transform/pad/v1/module.d.ts +26 -0
- package/dist/shaders/transform/pad/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/pad/v1/module.js +95 -0
- package/dist/shaders/transform/pad/v1/module.js.map +1 -0
- package/dist/shaders/transform/polarRemap/v1/module.d.ts +20 -0
- package/dist/shaders/transform/polarRemap/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/polarRemap/v1/module.js +95 -0
- package/dist/shaders/transform/polarRemap/v1/module.js.map +1 -0
- package/dist/shaders/transform/resize/v1/module.d.ts +20 -0
- package/dist/shaders/transform/resize/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/resize/v1/module.js +116 -0
- package/dist/shaders/transform/resize/v1/module.js.map +1 -0
- package/dist/shaders/transform/rotate90/v1/module.d.ts +25 -0
- package/dist/shaders/transform/rotate90/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/rotate90/v1/module.js +90 -0
- package/dist/shaders/transform/rotate90/v1/module.js.map +1 -0
- package/dist/shaders/transform/spherize/v1/module.d.ts +21 -0
- package/dist/shaders/transform/spherize/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/spherize/v1/module.js +94 -0
- package/dist/shaders/transform/spherize/v1/module.js.map +1 -0
- package/dist/shaders/transform/tile/v1/module.d.ts +22 -0
- package/dist/shaders/transform/tile/v1/module.d.ts.map +1 -0
- package/dist/shaders/transform/tile/v1/module.js +89 -0
- package/dist/shaders/transform/tile/v1/module.js.map +1 -0
- package/dist/shared/lumaWgsl.d.ts +14 -0
- package/dist/shared/lumaWgsl.d.ts.map +1 -0
- package/dist/shared/lumaWgsl.js +18 -0
- package/dist/shared/lumaWgsl.js.map +1 -0
- package/dist/shared/premulWgsl.d.ts +46 -0
- package/dist/shared/premulWgsl.d.ts.map +1 -0
- package/dist/shared/premulWgsl.js +90 -0
- package/dist/shared/premulWgsl.js.map +1 -0
- package/dist/texture.d.ts +54 -0
- package/dist/texture.d.ts.map +1 -0
- package/dist/texture.js +70 -0
- package/dist/texture.js.map +1 -0
- package/dist/types.d.ts +103 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/validate/wgslLinearity.d.ts +86 -0
- package/dist/validate/wgslLinearity.d.ts.map +1 -0
- package/dist/validate/wgslLinearity.js +298 -0
- package/dist/validate/wgslLinearity.js.map +1 -0
- package/dist/webgpu/index.d.ts +11 -0
- package/dist/webgpu/index.d.ts.map +1 -0
- package/dist/webgpu/index.js +11 -0
- package/dist/webgpu/index.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.exposure@1` — multiplicative exposure in stops (`rgb *= pow(2, stops)`).
|
|
3
|
+
*
|
|
4
|
+
* `0` stops is passthrough; `+1` doubles, `-1` halves. Clamps output to
|
|
5
|
+
* `[0, 1]` since the working format is SDR; HDR exposure ships with the
|
|
6
|
+
* separate HDR pipeline plan. Fragment, with the canonical mask slot.
|
|
7
|
+
*/
|
|
8
|
+
import tgpu from "typegpu";
|
|
9
|
+
import * as d from "typegpu/data";
|
|
10
|
+
import { defineModule } from "../../../../module.js";
|
|
11
|
+
export const ExposureParams = d.struct({
|
|
12
|
+
stops: d.f32
|
|
13
|
+
});
|
|
14
|
+
const layout = tgpu.bindGroupLayout({
|
|
15
|
+
params: { uniform: ExposureParams },
|
|
16
|
+
source: { texture: "float" },
|
|
17
|
+
mask: { texture: "float" },
|
|
18
|
+
samp: { sampler: "filtering" }
|
|
19
|
+
});
|
|
20
|
+
const samplerDescriptor = {
|
|
21
|
+
magFilter: "linear",
|
|
22
|
+
minFilter: "linear",
|
|
23
|
+
addressModeU: "clamp-to-edge",
|
|
24
|
+
addressModeV: "clamp-to-edge"
|
|
25
|
+
};
|
|
26
|
+
export const colorExposureV1 = defineModule({
|
|
27
|
+
id: "color.exposure",
|
|
28
|
+
version: 1,
|
|
29
|
+
surface: "internal",
|
|
30
|
+
category: "color",
|
|
31
|
+
linearity: "linear-in-rgb",
|
|
32
|
+
kind: "fragment",
|
|
33
|
+
params: ExposureParams,
|
|
34
|
+
paramDefaults: { stops: 0 },
|
|
35
|
+
paramUi: {
|
|
36
|
+
stops: { min: -4, max: 4, step: 0.1, label: "Exposure", notes: "stops (2^x)" }
|
|
37
|
+
},
|
|
38
|
+
layout,
|
|
39
|
+
samplers: { samp: samplerDescriptor },
|
|
40
|
+
wgsl: /* wgsl */ `
|
|
41
|
+
@fragment
|
|
42
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
43
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
44
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
45
|
+
let gain = pow(2.0, layout.$.params.stops);
|
|
46
|
+
// SDR clamp on the *straight* colour means clamping at alpha in premul
|
|
47
|
+
// space: straight C clamps at 1.0 ⇒ premul a*C clamps at a. Clamping at a
|
|
48
|
+
// literal 1.0 here let partial-alpha pixels escape with rgb > a (a 2×
|
|
49
|
+
// over-bright fringe once composited).
|
|
50
|
+
let processed = clamp(src.rgb * gain, vec3f(0.0), vec3f(src.a));
|
|
51
|
+
let mixed = mix(src.rgb, processed, coverage);
|
|
52
|
+
return vec4f(mixed, src.a);
|
|
53
|
+
}
|
|
54
|
+
`,
|
|
55
|
+
io: {
|
|
56
|
+
inputs: {
|
|
57
|
+
source: {
|
|
58
|
+
colorSpace: "linear",
|
|
59
|
+
alpha: "premultiplied",
|
|
60
|
+
bindingKinds: ["texture_2d"]
|
|
61
|
+
},
|
|
62
|
+
mask: {
|
|
63
|
+
colorSpace: "linear",
|
|
64
|
+
alpha: "premultiplied",
|
|
65
|
+
bindingKinds: ["texture_2d"],
|
|
66
|
+
optional: true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
output: {
|
|
70
|
+
colorSpace: "linear",
|
|
71
|
+
alpha: "premultiplied",
|
|
72
|
+
format: "rgba8unorm",
|
|
73
|
+
dimensions: "same-as:source"
|
|
74
|
+
},
|
|
75
|
+
rod: "same-as:source"
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/exposure/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,GAAG;CACb,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;IACnC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC1B,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAyB;IAC9C,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;IAC1C,EAAE,EAAE,gBAAgB;IACpB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,cAAc;IACtB,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;IAC3B,OAAO,EAAE;QACP,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE;KAC/E;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;;;;;;;;;;;;;;CAclB;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,QAAQ;gBACpB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,QAAQ;gBACpB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;gBAC5B,QAAQ,EAAE,IAAI;aACf;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.exposureTone@1` — Lightroom/Camera-Raw style tonal exposure.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from the CPU `lib.image.color_grading.Exposure` loop:
|
|
5
|
+
* multiplicative exposure in stops, luminance-weighted highlight/shadow
|
|
6
|
+
* recovery, white/black point push, and a final contrast pivot around
|
|
7
|
+
* mid-grey. With every tonal knob at its default (`0`) this collapses to the
|
|
8
|
+
* pure `rgb * 2^exposure` of the simpler `color.exposure` module. Fragment,
|
|
9
|
+
* with the canonical optional mask slot.
|
|
10
|
+
*/
|
|
11
|
+
import * as d from "typegpu/data";
|
|
12
|
+
export declare const ExposureToneParams: d.WgslStruct<{
|
|
13
|
+
exposure: d.F32;
|
|
14
|
+
contrast: d.F32;
|
|
15
|
+
highlights: d.F32;
|
|
16
|
+
shadows: d.F32;
|
|
17
|
+
whites: d.F32;
|
|
18
|
+
blacks: d.F32;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const colorExposureToneV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
21
|
+
exposure: d.F32;
|
|
22
|
+
contrast: d.F32;
|
|
23
|
+
highlights: d.F32;
|
|
24
|
+
shadows: d.F32;
|
|
25
|
+
whites: d.F32;
|
|
26
|
+
blacks: d.F32;
|
|
27
|
+
}>>;
|
|
28
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/exposureTone/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAIlC,eAAO,MAAM,kBAAkB;;;;;;;EAO7B,CAAC;AAgBH,eAAO,MAAM,mBAAmB;;;;;;;GAuE9B,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.exposureTone@1` — Lightroom/Camera-Raw style tonal exposure.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from the CPU `lib.image.color_grading.Exposure` loop:
|
|
5
|
+
* multiplicative exposure in stops, luminance-weighted highlight/shadow
|
|
6
|
+
* recovery, white/black point push, and a final contrast pivot around
|
|
7
|
+
* mid-grey. With every tonal knob at its default (`0`) this collapses to the
|
|
8
|
+
* pure `rgb * 2^exposure` of the simpler `color.exposure` module. Fragment,
|
|
9
|
+
* with the canonical optional mask slot.
|
|
10
|
+
*/
|
|
11
|
+
import tgpu from "typegpu";
|
|
12
|
+
import * as d from "typegpu/data";
|
|
13
|
+
import { defineModule } from "../../../../module.js";
|
|
14
|
+
import { WGSL_LUMA709 } from "../../../../shared/lumaWgsl.js";
|
|
15
|
+
export const ExposureToneParams = d.struct({
|
|
16
|
+
exposure: d.f32,
|
|
17
|
+
contrast: d.f32,
|
|
18
|
+
highlights: d.f32,
|
|
19
|
+
shadows: d.f32,
|
|
20
|
+
whites: d.f32,
|
|
21
|
+
blacks: d.f32
|
|
22
|
+
});
|
|
23
|
+
const layout = tgpu.bindGroupLayout({
|
|
24
|
+
params: { uniform: ExposureToneParams },
|
|
25
|
+
source: { texture: "float" },
|
|
26
|
+
mask: { texture: "float" },
|
|
27
|
+
samp: { sampler: "filtering" }
|
|
28
|
+
});
|
|
29
|
+
const samplerDescriptor = {
|
|
30
|
+
magFilter: "linear",
|
|
31
|
+
minFilter: "linear",
|
|
32
|
+
addressModeU: "clamp-to-edge",
|
|
33
|
+
addressModeV: "clamp-to-edge"
|
|
34
|
+
};
|
|
35
|
+
export const colorExposureToneV1 = defineModule({
|
|
36
|
+
id: "color.exposureTone",
|
|
37
|
+
version: 1,
|
|
38
|
+
surface: "internal",
|
|
39
|
+
category: "color",
|
|
40
|
+
linearity: "nonlinear-in-rgb",
|
|
41
|
+
kind: "fragment",
|
|
42
|
+
params: ExposureToneParams,
|
|
43
|
+
paramDefaults: {
|
|
44
|
+
exposure: 0,
|
|
45
|
+
contrast: 0,
|
|
46
|
+
highlights: 0,
|
|
47
|
+
shadows: 0,
|
|
48
|
+
whites: 0,
|
|
49
|
+
blacks: 0
|
|
50
|
+
},
|
|
51
|
+
paramUi: {
|
|
52
|
+
exposure: { min: -5, max: 5, step: 0.1, label: "Exposure", notes: "stops (2^x)" },
|
|
53
|
+
contrast: { min: -1, max: 1, step: 0.01, label: "Contrast" },
|
|
54
|
+
highlights: { min: -1, max: 1, step: 0.01, label: "Highlights" },
|
|
55
|
+
shadows: { min: -1, max: 1, step: 0.01, label: "Shadows" },
|
|
56
|
+
whites: { min: -1, max: 1, step: 0.01, label: "Whites" },
|
|
57
|
+
blacks: { min: -1, max: 1, step: 0.01, label: "Blacks" }
|
|
58
|
+
},
|
|
59
|
+
layout,
|
|
60
|
+
samplers: { samp: samplerDescriptor },
|
|
61
|
+
wgsl: /* wgsl */ `
|
|
62
|
+
${WGSL_LUMA709}
|
|
63
|
+
|
|
64
|
+
@fragment
|
|
65
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
66
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
67
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
68
|
+
let p = layout.$.params;
|
|
69
|
+
let safeA = max(src.a, 1.0 / 255.0);
|
|
70
|
+
let straight = src.rgb / safeA;
|
|
71
|
+
let expMul = pow(2.0, p.exposure);
|
|
72
|
+
var rgb = straight * expMul;
|
|
73
|
+
let lum = luma709(rgb);
|
|
74
|
+
let hlMask = clamp((lum - 0.5) * 2.0, 0.0, 1.0);
|
|
75
|
+
let shMask = clamp((0.5 - lum) * 2.0, 0.0, 1.0);
|
|
76
|
+
rgb = rgb - vec3f(hlMask * p.highlights * 0.5) + vec3f(shMask * p.shadows * 0.5);
|
|
77
|
+
rgb = rgb + p.whites * 0.2 * rgb;
|
|
78
|
+
rgb = rgb + p.blacks * 0.2 * (vec3f(1.0) - rgb);
|
|
79
|
+
rgb = vec3f(0.5) + (rgb - vec3f(0.5)) * (1.0 + p.contrast);
|
|
80
|
+
let mixed = mix(straight, rgb, coverage);
|
|
81
|
+
return vec4f(clamp(mixed, vec3f(0.0), vec3f(1.0)) * src.a, src.a);
|
|
82
|
+
}
|
|
83
|
+
`,
|
|
84
|
+
io: {
|
|
85
|
+
inputs: {
|
|
86
|
+
source: {
|
|
87
|
+
colorSpace: "srgb",
|
|
88
|
+
alpha: "premultiplied",
|
|
89
|
+
bindingKinds: ["texture_2d"]
|
|
90
|
+
},
|
|
91
|
+
mask: {
|
|
92
|
+
colorSpace: "srgb",
|
|
93
|
+
alpha: "premultiplied",
|
|
94
|
+
bindingKinds: ["texture_2d"],
|
|
95
|
+
optional: true
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
output: {
|
|
99
|
+
colorSpace: "srgb",
|
|
100
|
+
alpha: "premultiplied",
|
|
101
|
+
format: "rgba8unorm",
|
|
102
|
+
dimensions: "same-as:source"
|
|
103
|
+
},
|
|
104
|
+
rod: "same-as:source"
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/exposureTone/v1/module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.filmLook@1` — cinematic film-emulation grade with adjustable
|
|
3
|
+
* intensity.
|
|
4
|
+
*
|
|
5
|
+
* Ported verbatim from the CPU `lib.image.color_grading.FilmLook` loop. The
|
|
6
|
+
* host resolves a named preset (teal/orange, noir, …) to its shadow/highlight
|
|
7
|
+
* tint colours plus contrast, saturation, and fade scalars, and passes them
|
|
8
|
+
* as params. The shader applies the look on straight RGB then lerps from the
|
|
9
|
+
* original by `intensity`. Fragment, with the canonical optional mask slot.
|
|
10
|
+
*/
|
|
11
|
+
import * as d from "typegpu/data";
|
|
12
|
+
export declare const FilmLookParams: d.WgslStruct<{
|
|
13
|
+
shadow: d.Vec3f;
|
|
14
|
+
contrast: d.F32;
|
|
15
|
+
highlight: d.Vec3f;
|
|
16
|
+
saturation: d.F32;
|
|
17
|
+
fade: d.F32;
|
|
18
|
+
intensity: d.F32;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const colorFilmLookV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
21
|
+
shadow: d.Vec3f;
|
|
22
|
+
contrast: d.F32;
|
|
23
|
+
highlight: d.Vec3f;
|
|
24
|
+
saturation: d.F32;
|
|
25
|
+
fade: d.F32;
|
|
26
|
+
intensity: d.F32;
|
|
27
|
+
}>>;
|
|
28
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/filmLook/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAIlC,eAAO,MAAM,cAAc;;;;;;;EAOzB,CAAC;AAgBH,eAAO,MAAM,eAAe;;;;;;;GAmE1B,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.filmLook@1` — cinematic film-emulation grade with adjustable
|
|
3
|
+
* intensity.
|
|
4
|
+
*
|
|
5
|
+
* Ported verbatim from the CPU `lib.image.color_grading.FilmLook` loop. The
|
|
6
|
+
* host resolves a named preset (teal/orange, noir, …) to its shadow/highlight
|
|
7
|
+
* tint colours plus contrast, saturation, and fade scalars, and passes them
|
|
8
|
+
* as params. The shader applies the look on straight RGB then lerps from the
|
|
9
|
+
* original by `intensity`. Fragment, with the canonical optional mask slot.
|
|
10
|
+
*/
|
|
11
|
+
import tgpu from "typegpu";
|
|
12
|
+
import * as d from "typegpu/data";
|
|
13
|
+
import { defineModule } from "../../../../module.js";
|
|
14
|
+
import { WGSL_LUMA709 } from "../../../../shared/lumaWgsl.js";
|
|
15
|
+
export const FilmLookParams = d.struct({
|
|
16
|
+
shadow: d.vec3f,
|
|
17
|
+
contrast: d.f32,
|
|
18
|
+
highlight: d.vec3f,
|
|
19
|
+
saturation: d.f32,
|
|
20
|
+
fade: d.f32,
|
|
21
|
+
intensity: d.f32
|
|
22
|
+
});
|
|
23
|
+
const layout = tgpu.bindGroupLayout({
|
|
24
|
+
params: { uniform: FilmLookParams },
|
|
25
|
+
source: { texture: "float" },
|
|
26
|
+
mask: { texture: "float" },
|
|
27
|
+
samp: { sampler: "filtering" }
|
|
28
|
+
});
|
|
29
|
+
const samplerDescriptor = {
|
|
30
|
+
magFilter: "linear",
|
|
31
|
+
minFilter: "linear",
|
|
32
|
+
addressModeU: "clamp-to-edge",
|
|
33
|
+
addressModeV: "clamp-to-edge"
|
|
34
|
+
};
|
|
35
|
+
export const colorFilmLookV1 = defineModule({
|
|
36
|
+
id: "color.filmLook",
|
|
37
|
+
version: 1,
|
|
38
|
+
surface: "internal",
|
|
39
|
+
category: "color",
|
|
40
|
+
linearity: "nonlinear-in-rgb",
|
|
41
|
+
kind: "fragment",
|
|
42
|
+
params: FilmLookParams,
|
|
43
|
+
paramDefaults: {
|
|
44
|
+
shadow: d.vec3f(0.5, 0.5, 0.5),
|
|
45
|
+
contrast: 1,
|
|
46
|
+
highlight: d.vec3f(0.5, 0.5, 0.5),
|
|
47
|
+
saturation: 1,
|
|
48
|
+
fade: 0,
|
|
49
|
+
intensity: 0
|
|
50
|
+
},
|
|
51
|
+
layout,
|
|
52
|
+
samplers: { samp: samplerDescriptor },
|
|
53
|
+
wgsl: /* wgsl */ `
|
|
54
|
+
${WGSL_LUMA709}
|
|
55
|
+
|
|
56
|
+
@fragment
|
|
57
|
+
fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
|
58
|
+
let src = textureSample(layout.$.source, layout.$.samp, uv);
|
|
59
|
+
let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
|
|
60
|
+
let p = layout.$.params;
|
|
61
|
+
let safeA = max(src.a, 1.0 / 255.0);
|
|
62
|
+
let straight = src.rgb / safeA;
|
|
63
|
+
var rgb = straight;
|
|
64
|
+
let lum = luma709(rgb);
|
|
65
|
+
let shMask = clamp(1.0 - lum * 2.0, 0.0, 1.0);
|
|
66
|
+
let hlMask = clamp(lum * 2.0 - 1.0, 0.0, 1.0);
|
|
67
|
+
rgb = rgb
|
|
68
|
+
+ shMask * (p.shadow - vec3f(0.5)) * 0.3
|
|
69
|
+
+ hlMask * (p.highlight - vec3f(0.5)) * 0.3;
|
|
70
|
+
rgb = (rgb - vec3f(0.5)) * p.contrast + vec3f(0.5);
|
|
71
|
+
let lum2 = luma709(rgb);
|
|
72
|
+
rgb = vec3f(lum2) + (rgb - vec3f(lum2)) * p.saturation;
|
|
73
|
+
// fade = 0 leaves rgb unchanged, so the CPU's "if (fade > 0)" guard is moot.
|
|
74
|
+
rgb = rgb * (1.0 - p.fade) + vec3f(p.fade * 0.15);
|
|
75
|
+
rgb = straight + (rgb - straight) * p.intensity;
|
|
76
|
+
let mixed = mix(straight, rgb, coverage);
|
|
77
|
+
return vec4f(clamp(mixed, vec3f(0.0), vec3f(1.0)) * src.a, src.a);
|
|
78
|
+
}
|
|
79
|
+
`,
|
|
80
|
+
io: {
|
|
81
|
+
inputs: {
|
|
82
|
+
source: {
|
|
83
|
+
colorSpace: "srgb",
|
|
84
|
+
alpha: "premultiplied",
|
|
85
|
+
bindingKinds: ["texture_2d"]
|
|
86
|
+
},
|
|
87
|
+
mask: {
|
|
88
|
+
colorSpace: "srgb",
|
|
89
|
+
alpha: "premultiplied",
|
|
90
|
+
bindingKinds: ["texture_2d"],
|
|
91
|
+
optional: true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
output: {
|
|
95
|
+
colorSpace: "srgb",
|
|
96
|
+
alpha: "premultiplied",
|
|
97
|
+
format: "rgba8unorm",
|
|
98
|
+
dimensions: "same-as:source"
|
|
99
|
+
},
|
|
100
|
+
rod: "same-as:source"
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/filmLook/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK;IACf,QAAQ,EAAE,CAAC,CAAC,GAAG;IACf,SAAS,EAAE,CAAC,CAAC,KAAK;IAClB,UAAU,EAAE,CAAC,CAAC,GAAG;IACjB,IAAI,EAAE,CAAC,CAAC,GAAG;IACX,SAAS,EAAE,CAAC,CAAC,GAAG;CACjB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;IACnC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC1B,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAyB;IAC9C,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;IAC1C,EAAE,EAAE,gBAAgB;IACpB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,kBAAkB;IAC7B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,cAAc;IACtB,aAAa,EAAE;QACb,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;QAC9B,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;QACjC,UAAU,EAAE,CAAC;QACb,IAAI,EAAE,CAAC;QACP,SAAS,EAAE,CAAC;KACb;IACD,MAAM;IACN,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACrC,IAAI,EAAE,UAAU,CAAC;EACjB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;CAyBb;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;gBAC5B,QAAQ,EAAE,IAAI;aACf;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.grade@1` — per-pixel color grading (brightness, contrast,
|
|
3
|
+
* saturation, hue, temperature, tint, shadows/highlights).
|
|
4
|
+
*
|
|
5
|
+
* Migrated verbatim from the timeline preview's `effectsComputeShader`
|
|
6
|
+
* (`web/src/components/timeline/preview/gpu/shaders.ts`). The hand-packed
|
|
7
|
+
* 8×f32 uniform `Float32Array` is replaced by the TypeGPU `ColorGradeParams`
|
|
8
|
+
* schema; the effect math is unchanged. Stays `surface: "internal"` until the
|
|
9
|
+
* parameter schema is reviewed for promotion (Phase 3).
|
|
10
|
+
*
|
|
11
|
+
* `compute` kind is a migration accident — the timeline shader was authored as
|
|
12
|
+
* a compute pass. New image-in/image-out modules default to `fragment`.
|
|
13
|
+
*/
|
|
14
|
+
import * as d from "typegpu/data";
|
|
15
|
+
export declare const ColorGradeParams: d.WgslStruct<{
|
|
16
|
+
brightness: d.F32;
|
|
17
|
+
contrast: d.F32;
|
|
18
|
+
saturation: d.F32;
|
|
19
|
+
hue: d.F32;
|
|
20
|
+
temperature: d.F32;
|
|
21
|
+
tint: d.F32;
|
|
22
|
+
shadows: d.F32;
|
|
23
|
+
highlights: d.F32;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const colorGradeV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
26
|
+
brightness: d.F32;
|
|
27
|
+
contrast: d.F32;
|
|
28
|
+
saturation: d.F32;
|
|
29
|
+
hue: d.F32;
|
|
30
|
+
temperature: d.F32;
|
|
31
|
+
tint: d.F32;
|
|
32
|
+
shadows: d.F32;
|
|
33
|
+
highlights: d.F32;
|
|
34
|
+
}>>;
|
|
35
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/grade/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,gBAAgB;;;;;;;;;EAS3B,CAAC;AAQH,eAAO,MAAM,YAAY;;;;;;;;;GAqJvB,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.grade@1` — per-pixel color grading (brightness, contrast,
|
|
3
|
+
* saturation, hue, temperature, tint, shadows/highlights).
|
|
4
|
+
*
|
|
5
|
+
* Migrated verbatim from the timeline preview's `effectsComputeShader`
|
|
6
|
+
* (`web/src/components/timeline/preview/gpu/shaders.ts`). The hand-packed
|
|
7
|
+
* 8×f32 uniform `Float32Array` is replaced by the TypeGPU `ColorGradeParams`
|
|
8
|
+
* schema; the effect math is unchanged. Stays `surface: "internal"` until the
|
|
9
|
+
* parameter schema is reviewed for promotion (Phase 3).
|
|
10
|
+
*
|
|
11
|
+
* `compute` kind is a migration accident — the timeline shader was authored as
|
|
12
|
+
* a compute pass. New image-in/image-out modules default to `fragment`.
|
|
13
|
+
*/
|
|
14
|
+
import tgpu from "typegpu";
|
|
15
|
+
import * as d from "typegpu/data";
|
|
16
|
+
import { defineModule } from "../../../../module.js";
|
|
17
|
+
export const ColorGradeParams = d.struct({
|
|
18
|
+
brightness: d.f32,
|
|
19
|
+
contrast: d.f32,
|
|
20
|
+
saturation: d.f32,
|
|
21
|
+
hue: d.f32,
|
|
22
|
+
temperature: d.f32,
|
|
23
|
+
tint: d.f32,
|
|
24
|
+
shadows: d.f32,
|
|
25
|
+
highlights: d.f32
|
|
26
|
+
});
|
|
27
|
+
const layout = tgpu.bindGroupLayout({
|
|
28
|
+
source: { texture: "float" },
|
|
29
|
+
outputTexture: { storageTexture: "rgba8unorm" },
|
|
30
|
+
params: { uniform: ColorGradeParams }
|
|
31
|
+
});
|
|
32
|
+
export const colorGradeV1 = defineModule({
|
|
33
|
+
id: "color.grade",
|
|
34
|
+
version: 1,
|
|
35
|
+
// Promoted in Phase 3: param schema is stable across Phase 2 + Batch 1
|
|
36
|
+
// and is the most-used per-clip color effect in the timeline.
|
|
37
|
+
surface: "published",
|
|
38
|
+
category: "color",
|
|
39
|
+
linearity: "nonlinear-in-rgb",
|
|
40
|
+
kind: "compute",
|
|
41
|
+
params: ColorGradeParams,
|
|
42
|
+
paramDefaults: {
|
|
43
|
+
brightness: 0,
|
|
44
|
+
contrast: 1,
|
|
45
|
+
saturation: 1,
|
|
46
|
+
hue: 0,
|
|
47
|
+
temperature: 0,
|
|
48
|
+
tint: 0,
|
|
49
|
+
shadows: 0,
|
|
50
|
+
highlights: 0
|
|
51
|
+
},
|
|
52
|
+
paramUi: {
|
|
53
|
+
brightness: { min: -1, max: 1, step: 0.01, label: "Brightness" },
|
|
54
|
+
contrast: { min: 0, max: 4, step: 0.01, label: "Contrast" },
|
|
55
|
+
saturation: { min: 0, max: 4, step: 0.01, label: "Saturation" },
|
|
56
|
+
hue: { min: -180, max: 180, step: 1, label: "Hue", notes: "degrees" },
|
|
57
|
+
temperature: { min: -1, max: 1, step: 0.01, label: "Temperature" },
|
|
58
|
+
tint: { min: -1, max: 1, step: 0.01, label: "Tint" },
|
|
59
|
+
shadows: { min: -1, max: 1, step: 0.01, label: "Shadows" },
|
|
60
|
+
highlights: { min: -1, max: 1, step: 0.01, label: "Highlights" }
|
|
61
|
+
},
|
|
62
|
+
layout,
|
|
63
|
+
workgroupSize: [16, 16, 1],
|
|
64
|
+
wgsl: /* wgsl */ `
|
|
65
|
+
fn rgb2hsv(rgb: vec3<f32>) -> vec3<f32> {
|
|
66
|
+
let maxC = max(max(rgb.r, rgb.g), rgb.b);
|
|
67
|
+
let minC = min(min(rgb.r, rgb.g), rgb.b);
|
|
68
|
+
let delta = maxC - minC;
|
|
69
|
+
var h: f32 = 0.0;
|
|
70
|
+
var s: f32 = 0.0;
|
|
71
|
+
let v: f32 = maxC;
|
|
72
|
+
if (delta > 0.00001) {
|
|
73
|
+
s = delta / maxC;
|
|
74
|
+
if (maxC == rgb.r) {
|
|
75
|
+
h = (rgb.g - rgb.b) / delta;
|
|
76
|
+
if (rgb.g < rgb.b) { h = h + 6.0; }
|
|
77
|
+
} else if (maxC == rgb.g) {
|
|
78
|
+
h = 2.0 + (rgb.b - rgb.r) / delta;
|
|
79
|
+
} else {
|
|
80
|
+
h = 4.0 + (rgb.r - rgb.g) / delta;
|
|
81
|
+
}
|
|
82
|
+
h = h / 6.0;
|
|
83
|
+
}
|
|
84
|
+
return vec3<f32>(h, s, v);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
fn hsv2rgb(hsv: vec3<f32>) -> vec3<f32> {
|
|
88
|
+
let h = hsv.x * 6.0;
|
|
89
|
+
let s = hsv.y;
|
|
90
|
+
let v = hsv.z;
|
|
91
|
+
let i = floor(h);
|
|
92
|
+
let f = h - i;
|
|
93
|
+
let p = v * (1.0 - s);
|
|
94
|
+
let q = v * (1.0 - s * f);
|
|
95
|
+
let t = v * (1.0 - s * (1.0 - f));
|
|
96
|
+
let idx = i32(i) % 6;
|
|
97
|
+
if (idx == 0) { return vec3<f32>(v, t, p); }
|
|
98
|
+
if (idx == 1) { return vec3<f32>(q, v, p); }
|
|
99
|
+
if (idx == 2) { return vec3<f32>(p, v, t); }
|
|
100
|
+
if (idx == 3) { return vec3<f32>(p, q, v); }
|
|
101
|
+
if (idx == 4) { return vec3<f32>(t, p, v); }
|
|
102
|
+
return vec3<f32>(v, p, q);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
fn smoothstepCustom(e0: f32, e1: f32, x: f32) -> f32 {
|
|
106
|
+
let t = clamp((x - e0) / (e1 - e0), 0.0, 1.0);
|
|
107
|
+
return t * t * (3.0 - 2.0 * t);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@compute @workgroup_size(16, 16, 1)
|
|
111
|
+
fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
|
|
112
|
+
let dims = textureDimensions(layout.$.source);
|
|
113
|
+
if (gid.x >= dims.x || gid.y >= dims.y) { return; }
|
|
114
|
+
let coords = vec2<i32>(i32(gid.x), i32(gid.y));
|
|
115
|
+
let effects = layout.$.params;
|
|
116
|
+
var color = textureLoad(layout.$.source, coords, 0);
|
|
117
|
+
// Input is premultiplied (rgb = a*C); the additive brightness / tint /
|
|
118
|
+
// shadows-highlights stages assume straight color. Un-premultiply first,
|
|
119
|
+
// run the full effect chain on straight RGB, then re-premultiply on store.
|
|
120
|
+
let safeA = max(color.a, 1.0 / 255.0);
|
|
121
|
+
var rgb = color.rgb / safeA;
|
|
122
|
+
|
|
123
|
+
if (abs(effects.brightness) > 0.001) {
|
|
124
|
+
rgb = clamp(rgb + vec3<f32>(effects.brightness), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
125
|
+
}
|
|
126
|
+
if (abs(effects.contrast - 1.0) > 0.001) {
|
|
127
|
+
rgb = clamp((rgb - 0.5) * effects.contrast + 0.5, vec3<f32>(0.0), vec3<f32>(1.0));
|
|
128
|
+
}
|
|
129
|
+
if (abs(effects.saturation - 1.0) > 0.001) {
|
|
130
|
+
let lum = dot(rgb, vec3<f32>(0.299, 0.587, 0.114));
|
|
131
|
+
rgb = clamp(mix(vec3<f32>(lum), rgb, effects.saturation), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
132
|
+
}
|
|
133
|
+
if (abs(effects.hue) > 0.001) {
|
|
134
|
+
var hsv = rgb2hsv(rgb);
|
|
135
|
+
hsv.x = fract(hsv.x + effects.hue / 360.0);
|
|
136
|
+
rgb = hsv2rgb(hsv);
|
|
137
|
+
}
|
|
138
|
+
if (abs(effects.temperature) > 0.001) {
|
|
139
|
+
if (effects.temperature > 0.0) {
|
|
140
|
+
rgb.r = min(1.0, rgb.r + effects.temperature * 0.2);
|
|
141
|
+
rgb.g = min(1.0, rgb.g + effects.temperature * 0.1);
|
|
142
|
+
rgb.b = max(0.0, rgb.b - effects.temperature * 0.2);
|
|
143
|
+
} else {
|
|
144
|
+
rgb.r = max(0.0, rgb.r + effects.temperature * 0.2);
|
|
145
|
+
rgb.g = max(0.0, rgb.g + effects.temperature * 0.05);
|
|
146
|
+
rgb.b = min(1.0, rgb.b - effects.temperature * 0.2);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (abs(effects.tint) > 0.001) {
|
|
150
|
+
rgb.r = clamp(rgb.r + effects.tint * 0.1, 0.0, 1.0);
|
|
151
|
+
rgb.g = clamp(rgb.g - effects.tint * 0.2, 0.0, 1.0);
|
|
152
|
+
rgb.b = clamp(rgb.b + effects.tint * 0.1, 0.0, 1.0);
|
|
153
|
+
}
|
|
154
|
+
if (abs(effects.shadows) > 0.001 || abs(effects.highlights) > 0.001) {
|
|
155
|
+
let lum = dot(rgb, vec3<f32>(0.299, 0.587, 0.114));
|
|
156
|
+
let shadowW = 1.0 - smoothstepCustom(0.0, 0.33, lum);
|
|
157
|
+
let highlightW = smoothstepCustom(0.66, 1.0, lum);
|
|
158
|
+
let adj = effects.shadows * shadowW * 0.3 + effects.highlights * highlightW * 0.3;
|
|
159
|
+
rgb = clamp(rgb + vec3<f32>(adj), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
textureStore(layout.$.outputTexture, coords, vec4<f32>(rgb * color.a, color.a));
|
|
163
|
+
}
|
|
164
|
+
`,
|
|
165
|
+
io: {
|
|
166
|
+
inputs: {
|
|
167
|
+
source: {
|
|
168
|
+
colorSpace: "srgb",
|
|
169
|
+
alpha: "premultiplied",
|
|
170
|
+
bindingKinds: ["texture_2d"]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
output: {
|
|
174
|
+
colorSpace: "srgb",
|
|
175
|
+
alpha: "premultiplied",
|
|
176
|
+
format: "rgba8unorm",
|
|
177
|
+
dimensions: "same-as:source"
|
|
178
|
+
},
|
|
179
|
+
rod: "same-as:source"
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/color/grade/v1/module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `color.grayscale@1` — collapse RGB to luminance.
|
|
3
|
+
*
|
|
4
|
+
* `output.rgb = vec3(luma709(rgb))`. Alpha preserved. Honours the canonical
|
|
5
|
+
* mask slot so workflows can grayscale a region while the rest stays colored.
|
|
6
|
+
*/
|
|
7
|
+
import * as d from "typegpu/data";
|
|
8
|
+
export declare const GrayscaleParams: d.WgslStruct<{
|
|
9
|
+
amount: d.F32;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const colorGrayscaleV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
|
|
12
|
+
amount: d.F32;
|
|
13
|
+
}>>;
|
|
14
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/color/grayscale/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAIlC,eAAO,MAAM,eAAe;;EAE1B,CAAC;AAgBH,eAAO,MAAM,gBAAgB;;GAoD3B,CAAC"}
|