lygia 1.3.3 → 1.4.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/.github/workflows/ci.yml +39 -0
- package/README.md +5 -2
- package/README_WESL.md +40 -0
- package/README_WebGPU.md +203 -0
- package/animation/easing/backIn.wesl +11 -0
- package/animation/easing/backInOut.wesl +14 -0
- package/animation/easing/backOut.wesl +11 -0
- package/animation/easing/bounceIn.wesl +11 -0
- package/animation/easing/bounceInOut.wesl +17 -0
- package/animation/easing/bounceOut.wesl +33 -0
- package/animation/easing/circularIn.wesl +9 -0
- package/animation/easing/circularInOut.wesl +15 -0
- package/animation/easing/circularOut.wesl +9 -0
- package/animation/easing/cubicIn.wesl +9 -0
- package/animation/easing/cubicInOut.wesl +15 -0
- package/animation/easing/cubicOut.wesl +12 -0
- package/animation/easing/elasticIn.wesl +11 -0
- package/animation/easing/elasticInOut.wesl +17 -0
- package/animation/easing/elasticOut.wesl +11 -0
- package/animation/easing/exponentialIn.wesl +15 -0
- package/animation/easing/exponentialInOut.wesl +19 -0
- package/animation/easing/exponentialOut.wesl +15 -0
- package/animation/easing/linearIn.wesl +9 -0
- package/animation/easing/linearInOut.wesl +9 -0
- package/animation/easing/linearOut.wesl +9 -0
- package/animation/easing/quadraticIn.wesl +9 -0
- package/animation/easing/quadraticInOut.wesl +12 -0
- package/animation/easing/quadraticOut.wesl +9 -0
- package/animation/easing/quarticIn.wesl +9 -0
- package/animation/easing/quarticInOut.wesl +15 -0
- package/animation/easing/quarticOut.wesl +12 -0
- package/animation/easing/quinticIn.wesl +9 -0
- package/animation/easing/quinticInOut.wesl +15 -0
- package/animation/easing/quinticOut.wesl +9 -0
- package/animation/easing/sineIn.wesl +11 -0
- package/animation/easing/sineInOut.wesl +11 -0
- package/animation/easing/sineOut.wesl +11 -0
- package/animation/spriteLoop.wesl +15 -0
- package/color/blend/add.wesl +3 -3
- package/color/blend/color.wesl +4 -4
- package/color/blend/colorDodge.wesl +7 -7
- package/color/blend/darken.wesl +7 -7
- package/color/blend/difference.wesl +3 -3
- package/color/blend/glow.wesl +3 -3
- package/color/blend/hardLight.wesl +2 -2
- package/color/blend/hardMix.wesl +7 -7
- package/color/blend/hue.wesl +4 -4
- package/color/blend/lighten.wesl +7 -7
- package/color/blend/linearBurn.wesl +5 -5
- package/color/blend/linearDodge.wesl +5 -5
- package/color/blend/linearLight.wesl +8 -9
- package/color/blend/luminosity.wesl +4 -4
- package/color/blend/multiply.wesl +1 -1
- package/color/blend/negation.wesl +3 -3
- package/color/blend/overlay.wesl +3 -3
- package/color/blend/phoenix.wesl +4 -4
- package/color/blend/pinLight.wesl +8 -9
- package/color/blend/reflect.wesl +7 -7
- package/color/blend/saturation.wesl +4 -4
- package/color/blend/screen.wesl +5 -5
- package/color/blend/softLight.wesl +4 -4
- package/color/blend/subtract.wesl +3 -3
- package/color/blend/vividLight.wesl +8 -9
- package/color/brightnessContrast.wesl +1 -1
- package/color/brightnessMatrix.wesl +19 -0
- package/color/composite/compositeXor.wesl +23 -0
- package/color/composite/destinationAtop.wesl +23 -0
- package/color/composite/destinationIn.wesl +23 -0
- package/color/composite/destinationOut.wesl +23 -0
- package/color/composite/destinationOver.wesl +23 -0
- package/color/composite/sourceAtop.wesl +23 -0
- package/color/composite/sourceIn.wesl +23 -0
- package/color/composite/sourceOut.wesl +23 -0
- package/color/composite/sourceOver.wesl +23 -0
- package/color/contrast.wesl +20 -0
- package/color/contrastMatrix.wesl +20 -0
- package/color/desaturate.wesl +16 -0
- package/color/distance.wesl +21 -6
- package/color/dither/bayer.wesl +44 -23
- package/color/dither/blueNoise.wesl +52 -18
- package/color/dither/vlachos.wesl +44 -14
- package/color/exposure.wesl +11 -2
- package/color/hueShift.wesl +20 -5
- package/color/hueShiftRYB.wesl +10 -5
- package/color/layer/addSourceOver.wesl +25 -0
- package/color/layer/averageSourceOver.wesl +25 -0
- package/color/layer/colorBurnSourceOver.wesl +25 -0
- package/color/layer/colorDodgeSourceOver.wesl +25 -0
- package/color/layer/colorSourceOver.wesl +25 -0
- package/color/layer/darkenSourceOver.wesl +25 -0
- package/color/layer/differenceSourceOver.wesl +25 -0
- package/color/layer/exclusionSourceOver.wesl +25 -0
- package/color/layer/glowSourceOver.wesl +25 -0
- package/color/layer/hardLightSourceOver.glsl +1 -1
- package/color/layer/hardLightSourceOver.wesl +25 -0
- package/color/layer/hardMixSourceOver.wesl +25 -0
- package/color/layer/hueSourceOver.wesl +25 -0
- package/color/layer/lightenSourceOver.wesl +25 -0
- package/color/layer/linearBurnSourceOver.wesl +25 -0
- package/color/layer/linearDodgeSourceOver.wesl +25 -0
- package/color/layer/linearLightSourceOver.wesl +26 -0
- package/color/layer/luminositySourceOver.wesl +26 -0
- package/color/layer/multiplySourceOver.wesl +22 -0
- package/color/layer/negationSourceOver.wesl +26 -0
- package/color/layer/overlaySourceOver.wesl +26 -0
- package/color/layer/phoenixSourceOver.wesl +26 -0
- package/color/layer/pinLightSourceOver.wesl +26 -0
- package/color/layer/reflectSourceOver.glsl +1 -1
- package/color/layer/reflectSourceOver.wesl +26 -0
- package/color/layer/saturationSourceOver.wesl +26 -0
- package/color/layer/screenSourceOver.wesl +26 -0
- package/color/layer/softLightSourceOver.wesl +26 -0
- package/color/layer/subtractSourceOver.wesl +26 -0
- package/color/layer/vividLightSourceOver.wesl +26 -0
- package/color/levels/gamma.wesl +26 -0
- package/color/levels/inputRange.wesl +26 -0
- package/color/levels/outputRange.wesl +26 -0
- package/color/levels.wesl +30 -0
- package/color/luma.wesl +11 -3
- package/color/luminance.wesl +18 -0
- package/color/mixOklab.wesl +34 -12
- package/color/mixSpectral.glsl +3 -3
- package/color/mixSpectral.wesl +14 -10
- package/color/palette/heatmap.wesl +1 -1
- package/color/palette/hue.wesl +8 -4
- package/color/saturationMatrix.wesl +14 -7
- package/color/space/YCbCr2rgb.wesl +4 -0
- package/color/space/YPbPr2rgb.wesl +10 -7
- package/color/space/cmyk2rgb.wesl +3 -1
- package/color/space/gamma2linear.wesl +15 -3
- package/color/space/hcy2rgb.wesl +10 -7
- package/color/space/hsl2rgb.wesl +6 -3
- package/color/space/hsv2rgb.wesl +4 -1
- package/color/space/hsv2ryb.wesl +20 -1
- package/color/space/hue2rgb.wesl +3 -1
- package/color/space/k2rgb.wesl +4 -1
- package/color/space/lab2lch.wesl +5 -1
- package/color/space/lab2rgb.wesl +1 -0
- package/color/space/lab2srgb.wesl +1 -0
- package/color/space/lab2xyz.wesl +13 -1
- package/color/space/lch2lab.wesl +5 -1
- package/color/space/lch2rgb.wesl +1 -1
- package/color/space/lch2srgb.wesl +21 -0
- package/color/space/linear2gamma.wesl +16 -3
- package/color/space/lms2rgb.wesl +4 -0
- package/color/space/oklab2rgb.wesl +5 -1
- package/color/space/oklab2srgb.wesl +4 -0
- package/color/space/rgb2YCbCr.wesl +4 -0
- package/color/space/rgb2YPbPr.wesl +12 -8
- package/color/space/rgb2cmyk.wesl +1 -1
- package/color/space/rgb2hcv.wesl +9 -2
- package/color/space/rgb2hcy.wesl +4 -0
- package/color/space/rgb2heat.wesl +5 -0
- package/color/space/rgb2hsl.wesl +8 -2
- package/color/space/rgb2hsv.wesl +8 -3
- package/color/space/rgb2hue.wesl +10 -2
- package/color/space/rgb2lab.wesl +4 -1
- package/color/space/rgb2lch.wesl +4 -1
- package/color/space/rgb2lms.wesl +4 -0
- package/color/space/rgb2luma.wesl +5 -1
- package/color/space/rgb2oklab.wesl +5 -1
- package/color/space/rgb2ryb.wesl +60 -12
- package/color/space/rgb2srgb.wesl +14 -4
- package/color/space/rgb2xyY.wesl +5 -1
- package/color/space/rgb2xyz.wesl +16 -10
- package/color/space/rgb2yiq.wesl +5 -1
- package/color/space/rgb2yuv.wesl +12 -8
- package/color/space/ryb2rgb.wesl +67 -24
- package/color/space/srgb2lab.wesl +3 -1
- package/color/space/srgb2lch.wesl +4 -0
- package/color/space/srgb2luma.wesl +6 -1
- package/color/space/srgb2oklab.wesl +4 -1
- package/color/space/srgb2rgb.wesl +13 -5
- package/color/space/srgb2xyz.wesl +4 -1
- package/color/space/xyY2rgb.wesl +4 -1
- package/color/space/xyY2srgb.wesl +5 -1
- package/color/space/xyY2xyz.wesl +7 -2
- package/color/space/xyz2lab.wesl +8 -4
- package/color/space/xyz2rgb.wesl +18 -4
- package/color/space/xyz2srgb.wesl +4 -1
- package/color/space/xyz2xyY.wesl +5 -1
- package/color/space/yiq2rgb.wesl +7 -2
- package/color/space/yuv2rgb.wesl +11 -8
- package/color/tonemap/aces.wesl +12 -10
- package/color/tonemap/debug.wesl +64 -0
- package/color/tonemap/filmic.wesl +1 -3
- package/color/tonemap/linear.wesl +13 -0
- package/color/tonemap/reinhard.wesl +13 -0
- package/color/tonemap/reinhardJodie.wesl +15 -0
- package/color/tonemap/uncharted.wesl +1 -1
- package/color/tonemap/unreal.wesl +13 -0
- package/color/vibrance.wesl +2 -2
- package/color/whiteBalance.wesl +1 -1
- package/dist/animation/easing/backIn/weslBundle.js +13 -0
- package/dist/animation/easing/backInOut/weslBundle.js +13 -0
- package/dist/animation/easing/backOut/weslBundle.js +13 -0
- package/dist/animation/easing/bounceIn/weslBundle.js +13 -0
- package/dist/animation/easing/bounceInOut/weslBundle.js +13 -0
- package/dist/animation/easing/bounceOut/weslBundle.js +10 -0
- package/dist/animation/easing/circularIn/weslBundle.js +10 -0
- package/dist/animation/easing/circularInOut/weslBundle.js +10 -0
- package/dist/animation/easing/circularOut/weslBundle.js +10 -0
- package/dist/animation/easing/cubicIn/weslBundle.js +10 -0
- package/dist/animation/easing/cubicInOut/weslBundle.js +10 -0
- package/dist/animation/easing/cubicOut/weslBundle.js +10 -0
- package/dist/animation/easing/elasticIn/weslBundle.js +13 -0
- package/dist/animation/easing/elasticInOut/weslBundle.js +13 -0
- package/dist/animation/easing/elasticOut/weslBundle.js +13 -0
- package/dist/animation/easing/exponentialIn/weslBundle.js +10 -0
- package/dist/animation/easing/exponentialInOut/weslBundle.js +10 -0
- package/dist/animation/easing/exponentialOut/weslBundle.js +10 -0
- package/dist/animation/easing/linearIn/weslBundle.js +10 -0
- package/dist/animation/easing/linearInOut/weslBundle.js +10 -0
- package/dist/animation/easing/linearOut/weslBundle.js +10 -0
- package/dist/animation/easing/quadraticIn/weslBundle.js +10 -0
- package/dist/animation/easing/quadraticInOut/weslBundle.js +10 -0
- package/dist/animation/easing/quadraticOut/weslBundle.js +10 -0
- package/dist/animation/easing/quarticIn/weslBundle.js +10 -0
- package/dist/animation/easing/quarticInOut/weslBundle.js +10 -0
- package/dist/animation/easing/quarticOut/weslBundle.js +10 -0
- package/dist/animation/easing/quinticIn/weslBundle.js +10 -0
- package/dist/animation/easing/quinticInOut/weslBundle.js +10 -0
- package/dist/animation/easing/quinticOut/weslBundle.js +10 -0
- package/dist/animation/easing/sineIn/weslBundle.js +13 -0
- package/dist/animation/easing/sineInOut/weslBundle.js +13 -0
- package/dist/animation/easing/sineOut/weslBundle.js +13 -0
- package/dist/animation/spriteLoop/weslBundle.js +13 -0
- package/dist/color/blend/add/weslBundle.js +10 -0
- package/dist/color/blend/average/weslBundle.js +10 -0
- package/dist/color/blend/color/weslBundle.js +14 -0
- package/dist/color/blend/colorBurn/weslBundle.js +10 -0
- package/dist/color/blend/colorDodge/weslBundle.js +10 -0
- package/dist/color/blend/darken/weslBundle.js +10 -0
- package/dist/color/blend/difference/weslBundle.js +10 -0
- package/dist/color/blend/exclusion/weslBundle.js +10 -0
- package/dist/color/blend/glow/weslBundle.js +13 -0
- package/dist/color/blend/hardLight/weslBundle.js +13 -0
- package/dist/color/blend/hardMix/weslBundle.js +13 -0
- package/dist/color/blend/hue/weslBundle.js +14 -0
- package/dist/color/blend/lighten/weslBundle.js +10 -0
- package/dist/color/blend/linearBurn/weslBundle.js +10 -0
- package/dist/color/blend/linearDodge/weslBundle.js +10 -0
- package/dist/color/blend/linearLight/weslBundle.js +14 -0
- package/dist/color/blend/luminosity/weslBundle.js +14 -0
- package/dist/color/blend/multiply/weslBundle.js +10 -0
- package/dist/color/blend/negation/weslBundle.js +10 -0
- package/dist/color/blend/overlay/weslBundle.js +10 -0
- package/dist/color/blend/phoenix/weslBundle.js +10 -0
- package/dist/color/blend/pinLight/weslBundle.js +14 -0
- package/dist/color/blend/reflect/weslBundle.js +10 -0
- package/dist/color/blend/saturation/weslBundle.js +14 -0
- package/dist/color/blend/screen/weslBundle.js +10 -0
- package/dist/color/blend/softLight/weslBundle.js +10 -0
- package/dist/color/blend/subtract/weslBundle.js +10 -0
- package/dist/color/blend/vividLight/weslBundle.js +14 -0
- package/dist/color/brightnessContrast/weslBundle.js +10 -0
- package/dist/color/brightnessMatrix/weslBundle.js +10 -0
- package/dist/color/composite/compositeXor/weslBundle.js +10 -0
- package/dist/color/composite/destinationAtop/weslBundle.js +10 -0
- package/dist/color/composite/destinationIn/weslBundle.js +10 -0
- package/dist/color/composite/destinationOut/weslBundle.js +10 -0
- package/dist/color/composite/destinationOver/weslBundle.js +10 -0
- package/dist/color/composite/sourceAtop/weslBundle.js +10 -0
- package/dist/color/composite/sourceIn/weslBundle.js +10 -0
- package/dist/color/composite/sourceOut/weslBundle.js +10 -0
- package/dist/color/composite/sourceOver/weslBundle.js +10 -0
- package/dist/color/contrast/weslBundle.js +10 -0
- package/dist/color/contrastMatrix/weslBundle.js +10 -0
- package/dist/color/desaturate/weslBundle.js +10 -0
- package/dist/color/distance/weslBundle.js +23 -0
- package/dist/color/dither/bayer/weslBundle.js +13 -0
- package/dist/color/dither/blueNoise/weslBundle.js +14 -0
- package/dist/color/dither/vlachos/weslBundle.js +13 -0
- package/dist/color/exposure/weslBundle.js +10 -0
- package/dist/color/hueShift/weslBundle.js +19 -0
- package/dist/color/hueShiftRYB/weslBundle.js +19 -0
- package/dist/color/layer/addSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/averageSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/colorBurnSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/colorDodgeSourceOver/weslBundle.js +17 -0
- package/dist/color/layer/colorSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/darkenSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/differenceSourceOver/weslBundle.js +17 -0
- package/dist/color/layer/exclusionSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/glowSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/hardLightSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/hardMixSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/hueSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/lightenSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/linearBurnSourceOver/weslBundle.js +17 -0
- package/dist/color/layer/linearDodgeSourceOver/weslBundle.js +17 -0
- package/dist/color/layer/linearLightSourceOver/weslBundle.js +17 -0
- package/dist/color/layer/luminositySourceOver/weslBundle.js +17 -0
- package/dist/color/layer/multiplySourceOver/weslBundle.js +14 -0
- package/dist/color/layer/negationSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/overlaySourceOver/weslBundle.js +14 -0
- package/dist/color/layer/phoenixSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/pinLightSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/reflectSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/saturationSourceOver/weslBundle.js +17 -0
- package/dist/color/layer/screenSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/softLightSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/subtractSourceOver/weslBundle.js +14 -0
- package/dist/color/layer/vividLightSourceOver/weslBundle.js +17 -0
- package/dist/color/levels/gamma/weslBundle.js +10 -0
- package/dist/color/levels/inputRange/weslBundle.js +10 -0
- package/dist/color/levels/outputRange/weslBundle.js +10 -0
- package/dist/color/levels/weslBundle.js +19 -0
- package/dist/color/luma/weslBundle.js +13 -0
- package/dist/color/luminance/weslBundle.js +10 -0
- package/dist/color/mixOklab/weslBundle.js +14 -0
- package/dist/color/mixSpectral/weslBundle.js +13 -0
- package/dist/color/palette/heatmap/weslBundle.js +10 -0
- package/dist/color/palette/hue/weslBundle.js +13 -0
- package/dist/color/saturationMatrix/weslBundle.js +10 -0
- package/dist/color/space/YCbCr2rgb/weslBundle.js +10 -0
- package/dist/color/space/YPbPr2rgb/weslBundle.js +10 -0
- package/dist/color/space/cmyk2rgb/weslBundle.js +13 -0
- package/dist/color/space/gamma2linear/weslBundle.js +10 -0
- package/dist/color/space/hcy2rgb/weslBundle.js +13 -0
- package/dist/color/space/hsl2rgb/weslBundle.js +13 -0
- package/dist/color/space/hsv2rgb/weslBundle.js +13 -0
- package/dist/color/space/hsv2ryb/weslBundle.js +19 -0
- package/dist/color/space/hue2rgb/weslBundle.js +13 -0
- package/dist/color/space/k2rgb/weslBundle.js +13 -0
- package/dist/color/space/lab2lch/weslBundle.js +10 -0
- package/dist/color/space/lab2rgb/weslBundle.js +14 -0
- package/dist/color/space/lab2srgb/weslBundle.js +14 -0
- package/dist/color/space/lab2xyz/weslBundle.js +10 -0
- package/dist/color/space/lch2lab/weslBundle.js +10 -0
- package/dist/color/space/lch2rgb/weslBundle.js +14 -0
- package/dist/color/space/lch2srgb/weslBundle.js +14 -0
- package/dist/color/space/linear2gamma/weslBundle.js +10 -0
- package/dist/color/space/lms2rgb/weslBundle.js +10 -0
- package/dist/color/space/oklab2rgb/weslBundle.js +10 -0
- package/dist/color/space/oklab2srgb/weslBundle.js +14 -0
- package/dist/color/space/rgb2YCbCr/weslBundle.js +10 -0
- package/dist/color/space/rgb2YPbPr/weslBundle.js +10 -0
- package/dist/color/space/rgb2cmyk/weslBundle.js +10 -0
- package/dist/color/space/rgb2hcv/weslBundle.js +10 -0
- package/dist/color/space/rgb2hcy/weslBundle.js +14 -0
- package/dist/color/space/rgb2heat/weslBundle.js +13 -0
- package/dist/color/space/rgb2hsl/weslBundle.js +13 -0
- package/dist/color/space/rgb2hsv/weslBundle.js +10 -0
- package/dist/color/space/rgb2hue/weslBundle.js +10 -0
- package/dist/color/space/rgb2lab/weslBundle.js +14 -0
- package/dist/color/space/rgb2lch/weslBundle.js +14 -0
- package/dist/color/space/rgb2lms/weslBundle.js +10 -0
- package/dist/color/space/rgb2luma/weslBundle.js +10 -0
- package/dist/color/space/rgb2oklab/weslBundle.js +10 -0
- package/dist/color/space/rgb2ryb/weslBundle.js +13 -0
- package/dist/color/space/rgb2srgb/weslBundle.js +13 -0
- package/dist/color/space/rgb2xyY/weslBundle.js +14 -0
- package/dist/color/space/rgb2xyz/weslBundle.js +10 -0
- package/dist/color/space/rgb2yiq/weslBundle.js +10 -0
- package/dist/color/space/rgb2yuv/weslBundle.js +10 -0
- package/dist/color/space/ryb2rgb/weslBundle.js +13 -0
- package/dist/color/space/srgb2lab/weslBundle.js +14 -0
- package/dist/color/space/srgb2lch/weslBundle.js +14 -0
- package/dist/color/space/srgb2luma/weslBundle.js +10 -0
- package/dist/color/space/srgb2oklab/weslBundle.js +14 -0
- package/dist/color/space/srgb2rgb/weslBundle.js +10 -0
- package/dist/color/space/srgb2xyz/weslBundle.js +14 -0
- package/dist/color/space/xyY2rgb/weslBundle.js +14 -0
- package/dist/color/space/xyY2srgb/weslBundle.js +14 -0
- package/dist/color/space/xyY2xyz/weslBundle.js +10 -0
- package/dist/color/space/xyz2lab/weslBundle.js +10 -0
- package/dist/color/space/xyz2rgb/weslBundle.js +10 -0
- package/dist/color/space/xyz2srgb/weslBundle.js +14 -0
- package/dist/color/space/xyz2xyY/weslBundle.js +10 -0
- package/dist/color/space/yiq2rgb/weslBundle.js +10 -0
- package/dist/color/space/yuv2rgb/weslBundle.js +10 -0
- package/dist/color/tonemap/aces/weslBundle.js +13 -0
- package/dist/color/tonemap/debug/weslBundle.js +10 -0
- package/dist/color/tonemap/filmic/weslBundle.js +10 -0
- package/dist/color/tonemap/linear/weslBundle.js +10 -0
- package/dist/color/tonemap/reinhard/weslBundle.js +10 -0
- package/dist/color/tonemap/reinhardJodie/weslBundle.js +10 -0
- package/dist/color/tonemap/uncharted/weslBundle.js +10 -0
- package/dist/color/tonemap/uncharted2/weslBundle.js +10 -0
- package/dist/color/tonemap/unreal/weslBundle.js +10 -0
- package/dist/color/vibrance/weslBundle.js +13 -0
- package/dist/color/whiteBalance/weslBundle.js +10 -0
- package/dist/draw/fill/weslBundle.js +13 -0
- package/dist/draw/stroke/weslBundle.js +14 -0
- package/dist/filter/edge/prewitt/weslBundle.js +10 -0
- package/dist/filter/sharpen/adaptive/weslBundle.js +10 -0
- package/dist/filter/sharpen/fast/weslBundle.js +10 -0
- package/dist/generative/cnoise/weslBundle.js +21 -0
- package/dist/generative/noised/weslBundle.js +13 -0
- package/dist/generative/pnoise/weslBundle.js +21 -0
- package/dist/generative/random/weslBundle.js +10 -0
- package/dist/generative/snoise/weslBundle.js +21 -0
- package/dist/generative/srandom/weslBundle.js +13 -0
- package/dist/generative/wavelet/weslBundle.js +14 -0
- package/dist/generative/worley/weslBundle.js +14 -0
- package/dist/geometry/aabb/aabb/weslBundle.js +10 -0
- package/dist/geometry/aabb/centroid/weslBundle.js +13 -0
- package/dist/geometry/aabb/contain/weslBundle.js +13 -0
- package/dist/geometry/aabb/diagonal/weslBundle.js +13 -0
- package/dist/geometry/aabb/expand/weslBundle.js +13 -0
- package/dist/geometry/aabb/square/weslBundle.js +14 -0
- package/dist/geometry/triangle/area/weslBundle.js +13 -0
- package/dist/geometry/triangle/barycentric/weslBundle.js +17 -0
- package/dist/geometry/triangle/centroid/weslBundle.js +13 -0
- package/dist/geometry/triangle/normal/weslBundle.js +13 -0
- package/dist/geometry/triangle/triangle/weslBundle.js +10 -0
- package/dist/lighting/common/ggx/weslBundle.js +14 -0
- package/dist/lighting/common/schlick/weslBundle.js +13 -0
- package/dist/lighting/common/smithGGXCorrelated/weslBundle.js +13 -0
- package/dist/lighting/diffuse/orenNayar/weslBundle.js +10 -0
- package/dist/lighting/fresnel/weslBundle.js +19 -0
- package/dist/lighting/fresnelReflection/weslBundle.js +13 -0
- package/dist/lighting/raymarch/cast/weslBundle.js +10 -0
- package/dist/lighting/raymarch/normal/weslBundle.js +10 -0
- package/dist/lighting/specular/cookTorrance/weslBundle.js +21 -0
- package/dist/lighting/toShininess/weslBundle.js +10 -0
- package/dist/math/aafloor/weslBundle.js +13 -0
- package/dist/math/aafract/weslBundle.js +13 -0
- package/dist/math/aamirror/weslBundle.js +13 -0
- package/dist/math/aastep/weslBundle.js +10 -0
- package/dist/math/absi/weslBundle.js +10 -0
- package/dist/math/adaptiveThreshold/weslBundle.js +10 -0
- package/dist/math/atan2/weslBundle.js +13 -0
- package/dist/math/bump/weslBundle.js +10 -0
- package/dist/math/consts/weslBundle.js +10 -0
- package/dist/math/cubic/weslBundle.js +10 -0
- package/dist/math/cubicMix/weslBundle.js +13 -0
- package/dist/math/decimate/weslBundle.js +10 -0
- package/dist/math/dist/weslBundle.js +10 -0
- package/dist/math/fcos/weslBundle.js +13 -0
- package/dist/math/fmod/weslBundle.js +10 -0
- package/dist/math/gain/weslBundle.js +10 -0
- package/dist/math/gaussian/weslBundle.js +10 -0
- package/dist/math/grad4/weslBundle.js +10 -0
- package/dist/math/hammersley/weslBundle.js +13 -0
- package/dist/math/highPass/weslBundle.js +10 -0
- package/dist/math/inside/weslBundle.js +10 -0
- package/dist/math/invCubic/weslBundle.js +10 -0
- package/dist/math/invQuartic/weslBundle.js +10 -0
- package/dist/math/inverse/weslBundle.js +10 -0
- package/dist/math/lengthSq/weslBundle.js +10 -0
- package/dist/math/map/weslBundle.js +10 -0
- package/dist/math/mirror/weslBundle.js +10 -0
- package/dist/math/mmax/weslBundle.js +10 -0
- package/dist/math/mmin/weslBundle.js +10 -0
- package/dist/math/mod2/weslBundle.js +10 -0
- package/dist/math/mod289/weslBundle.js +10 -0
- package/dist/math/nyquist/weslBundle.js +10 -0
- package/dist/math/pack/weslBundle.js +10 -0
- package/dist/math/parabola/weslBundle.js +10 -0
- package/dist/math/permute/weslBundle.js +13 -0
- package/dist/math/pow2/weslBundle.js +10 -0
- package/dist/math/pow3/weslBundle.js +10 -0
- package/dist/math/pow5/weslBundle.js +10 -0
- package/dist/math/pow7/weslBundle.js +10 -0
- package/dist/math/powFast/weslBundle.js +10 -0
- package/dist/math/quartic/weslBundle.js +10 -0
- package/dist/math/quat/add/weslBundle.js +10 -0
- package/dist/math/quat/conj/weslBundle.js +10 -0
- package/dist/math/quat/div/weslBundle.js +10 -0
- package/dist/math/quat/identity/weslBundle.js +10 -0
- package/dist/math/quat/inverse/weslBundle.js +19 -0
- package/dist/math/quat/length/weslBundle.js +13 -0
- package/dist/math/quat/lengthSq/weslBundle.js +10 -0
- package/dist/math/quat/lerp/weslBundle.js +10 -0
- package/dist/math/quat/mul/weslBundle.js +10 -0
- package/dist/math/quat/neg/weslBundle.js +10 -0
- package/dist/math/quat/norm/weslBundle.js +14 -0
- package/dist/math/quat/quat2mat3/weslBundle.js +10 -0
- package/dist/math/quat/quat2mat4/weslBundle.js +14 -0
- package/dist/math/quat/sub/weslBundle.js +10 -0
- package/dist/math/quat/weslBundle.js +10 -0
- package/dist/math/quintic/weslBundle.js +10 -0
- package/dist/math/rotate2d/weslBundle.js +10 -0
- package/dist/math/rotate3d/weslBundle.js +10 -0
- package/dist/math/rotate3dX/weslBundle.js +10 -0
- package/dist/math/rotate3dY/weslBundle.js +10 -0
- package/dist/math/rotate3dZ/weslBundle.js +10 -0
- package/dist/math/rotate4d/weslBundle.js +10 -0
- package/dist/math/rotate4dX/weslBundle.js +10 -0
- package/dist/math/rotate4dY/weslBundle.js +10 -0
- package/dist/math/rotate4dZ/weslBundle.js +10 -0
- package/dist/math/round/weslBundle.js +10 -0
- package/dist/math/saturate/weslBundle.js +10 -0
- package/dist/math/saturateMediump/weslBundle.js +10 -0
- package/dist/math/scale2d/weslBundle.js +10 -0
- package/dist/math/scale3d/weslBundle.js +10 -0
- package/dist/math/scale4d/weslBundle.js +10 -0
- package/dist/math/smootherstep/weslBundle.js +14 -0
- package/dist/math/sum/weslBundle.js +10 -0
- package/dist/math/taylorInvSqrt/weslBundle.js +10 -0
- package/dist/math/toMat3/weslBundle.js +10 -0
- package/dist/math/toMat4/weslBundle.js +10 -0
- package/dist/math/translate4d/weslBundle.js +10 -0
- package/dist/math/unpack/weslBundle.js +10 -0
- package/dist/math/within/weslBundle.js +10 -0
- package/dist/sample/sprite/weslBundle.js +13 -0
- package/dist/sdf/boxSDF/weslBundle.js +10 -0
- package/dist/sdf/circleSDF/weslBundle.js +10 -0
- package/dist/sdf/crossSDF/weslBundle.js +13 -0
- package/dist/sdf/cylinderSDF/weslBundle.js +10 -0
- package/dist/sdf/flowerSDF/weslBundle.js +10 -0
- package/dist/sdf/gearSDF/weslBundle.js +13 -0
- package/dist/sdf/heartSDF/weslBundle.js +10 -0
- package/dist/sdf/hexSDF/weslBundle.js +10 -0
- package/dist/sdf/opSubtraction/weslBundle.js +13 -0
- package/dist/sdf/opUnion/weslBundle.js +13 -0
- package/dist/sdf/polySDF/weslBundle.js +13 -0
- package/dist/sdf/raysSDF/weslBundle.js +13 -0
- package/dist/sdf/rectSDF/weslBundle.js +10 -0
- package/dist/sdf/rhombSDF/weslBundle.js +13 -0
- package/dist/sdf/sphereSDF/weslBundle.js +10 -0
- package/dist/sdf/spiralSDF/weslBundle.js +10 -0
- package/dist/sdf/starSDF/weslBundle.js +14 -0
- package/dist/sdf/torusSDF/weslBundle.js +10 -0
- package/dist/sdf/triSDF/weslBundle.js +10 -0
- package/dist/sdf/vesicaSDF/weslBundle.js +13 -0
- package/dist/space/aspect/weslBundle.js +10 -0
- package/dist/space/bracketing/weslBundle.js +13 -0
- package/dist/space/brickTile/weslBundle.js +13 -0
- package/dist/space/cart2polar/weslBundle.js +10 -0
- package/dist/space/center/weslBundle.js +10 -0
- package/dist/space/checkerTile/weslBundle.js +13 -0
- package/dist/space/decimateNormal/weslBundle.js +13 -0
- package/dist/space/depth2viewZ/weslBundle.js +10 -0
- package/dist/space/equirect2xyz/weslBundle.js +13 -0
- package/dist/space/eulerView/weslBundle.js +21 -0
- package/dist/space/fisheye2xyz/weslBundle.js +13 -0
- package/dist/space/flipY/weslBundle.js +10 -0
- package/dist/space/hexTile/weslBundle.js +10 -0
- package/dist/space/kaleidoscope/weslBundle.js +13 -0
- package/dist/space/linearizeDepth/weslBundle.js +10 -0
- package/dist/space/lookAt/weslBundle.js +10 -0
- package/dist/space/lookAtView/weslBundle.js +13 -0
- package/dist/space/mirrorTile/weslBundle.js +14 -0
- package/dist/space/nearest/weslBundle.js +10 -0
- package/dist/space/orthographic/weslBundle.js +10 -0
- package/dist/space/perspective/weslBundle.js +10 -0
- package/dist/space/polar2cart/weslBundle.js +10 -0
- package/dist/space/ratio/weslBundle.js +10 -0
- package/dist/space/rotate/weslBundle.js +14 -0
- package/dist/space/rotateX/weslBundle.js +13 -0
- package/dist/space/rotateY/weslBundle.js +13 -0
- package/dist/space/rotateZ/weslBundle.js +13 -0
- package/dist/space/scale/weslBundle.js +10 -0
- package/dist/space/screen2viewPosition/weslBundle.js +10 -0
- package/dist/space/sprite/weslBundle.js +10 -0
- package/dist/space/sqTile/weslBundle.js +10 -0
- package/dist/space/tbn/weslBundle.js +10 -0
- package/dist/space/translate/weslBundle.js +10 -0
- package/dist/space/triTile/weslBundle.js +10 -0
- package/dist/space/uncenter/weslBundle.js +10 -0
- package/dist/space/unratio/weslBundle.js +10 -0
- package/dist/space/view2screenPosition/weslBundle.js +10 -0
- package/dist/space/viewZ2depth/weslBundle.js +10 -0
- package/dist/space/windmillTile/weslBundle.js +15 -0
- package/dist/space/xyz2equirect/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/brick-tile/weslBundle.js +14 -0
- package/dist/test/wesl/shaders/checker-tile/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/draw-aa/weslBundle.js +23 -0
- package/dist/test/wesl/shaders/draw-shapes/weslBundle.js +47 -0
- package/dist/test/wesl/shaders/draw-stroke/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/hex-tile/weslBundle.js +14 -0
- package/dist/test/wesl/shaders/kaleidoscope/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/mirror-tile/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/perlin-noise-fbm/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/pnoise-tiling/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/snoise-fbm/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/sprite-megaman/weslBundle.js +14 -0
- package/dist/test/wesl/shaders/tri-tile/weslBundle.js +14 -0
- package/dist/test/wesl/shaders/wavelet-vorticity/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/windmill-tile/weslBundle.js +13 -0
- package/dist/test/wesl/shaders/worley-cellular/weslBundle.js +13 -0
- package/dist/test/wesl_util/blendInputs/weslBundle.js +10 -0
- package/dist/test/wesl_util/sampleQuantized/weslBundle.js +10 -0
- package/dist/version/weslBundle.js +10 -0
- package/dist/weslBundle.d.ts +20 -0
- package/draw/fill.wesl +23 -0
- package/draw/stroke.wesl +12 -3
- package/filter/edge/prewitt.wesl +9 -13
- package/filter/sharpen/adaptive.wesl +23 -19
- package/filter/sharpen/fast.wesl +33 -19
- package/generative/cnoise.wesl +232 -232
- package/generative/noised.wesl +38 -34
- package/generative/pnoise.wesl +231 -231
- package/generative/psrdnoise.glsl +12 -0
- package/generative/psrdnoise.hlsl +12 -0
- package/generative/psrdnoise.msl +12 -0
- package/generative/random.wesl +4 -6
- package/generative/snoise.wesl +7 -8
- package/generative/srandom.wesl +6 -6
- package/generative/wavelet.wesl +2 -3
- package/generative/worley.wesl +3 -4
- package/geometry/aabb/aabb.wesl +12 -0
- package/geometry/aabb/centroid.wesl +16 -0
- package/geometry/aabb/contain.wesl +16 -0
- package/geometry/aabb/diagonal.wesl +16 -0
- package/geometry/aabb/expand.wesl +27 -0
- package/geometry/aabb/square.wesl +19 -0
- package/geometry/triangle/area.glsl +1 -1
- package/geometry/triangle/area.wesl +16 -0
- package/geometry/triangle/barycentric.glsl +2 -2
- package/geometry/triangle/barycentric.wesl +42 -0
- package/geometry/triangle/centroid.wesl +16 -0
- package/geometry/triangle/normal.glsl +1 -1
- package/geometry/triangle/normal.wesl +16 -0
- package/geometry/triangle/triangle.glsl +2 -2
- package/geometry/triangle/triangle.wesl +13 -0
- package/lighting/common/ggx.wesl +50 -7
- package/lighting/common/schlick.wesl +15 -3
- package/lighting/common/smithGGXCorrelated.wesl +20 -0
- package/lighting/diffuse/orenNayar.wesl +6 -2
- package/lighting/fresnel.wesl +25 -3
- package/lighting/fresnelReflection.wesl +23 -10
- package/lighting/raymarch/cast.wesl +2 -16
- package/lighting/raymarch/normal.wesl +2 -15
- package/lighting/specular/cookTorrance.wesl +16 -16
- package/lighting/ssao.glsl +40 -14
- package/lighting/toShininess.glsl +1 -1
- package/lighting/toShininess.wesl +2 -1
- package/math/aafloor.wesl +6 -5
- package/math/aafract.wesl +5 -3
- package/math/aamirror.wesl +14 -0
- package/math/aastep.wesl +2 -1
- package/math/absi.wesl +12 -0
- package/math/atan2.wesl +17 -0
- package/math/consts.wesl +3 -0
- package/math/cubic.wesl +1 -1
- package/math/cubicMix.wesl +2 -2
- package/math/decimate.wesl +1 -1
- package/math/dist.wesl +2 -3
- package/math/fcos.wesl +15 -0
- package/math/fmod.wesl +11 -0
- package/math/gain.wesl +1 -1
- package/math/gaussian.wesl +1 -1
- package/math/hammersley.wesl +27 -0
- package/math/highPass.wesl +1 -1
- package/math/inside.wesl +1 -1
- package/math/invCubic.wesl +1 -1
- package/math/inverse.wesl +1 -1
- package/math/inverse.wgsl +53 -0
- package/math/map.wesl +0 -1
- package/math/mirror.wesl +1 -1
- package/math/mmax.wesl +2 -2
- package/math/mmin.wesl +2 -2
- package/math/mod2.wesl +21 -0
- package/math/mod289.wesl +4 -4
- package/math/nyquist.wesl +16 -0
- package/math/pack.wesl +10 -8
- package/math/parabola.wesl +1 -1
- package/math/pow2.wesl +13 -0
- package/math/pow3.wesl +13 -0
- package/math/pow5.wesl +28 -0
- package/math/pow7.wesl +13 -0
- package/math/powFast.wesl +1 -1
- package/math/quartic.wesl +1 -1
- package/math/quat/add.wesl +10 -0
- package/math/quat/conj.wesl +10 -0
- package/math/quat/div.wesl +10 -0
- package/math/quat/identity.wesl +10 -0
- package/math/quat/inverse.wesl +14 -0
- package/math/quat/length.wesl +12 -0
- package/math/quat/lengthSq.wesl +10 -0
- package/math/quat/lerp.wesl +43 -0
- package/math/quat/mul.wesl +25 -0
- package/math/quat/neg.wesl +10 -0
- package/math/quat/norm.wesl +13 -0
- package/math/quat/quat2mat3.wesl +26 -0
- package/math/quat/quat2mat4.wesl +13 -0
- package/math/quat/sub.wesl +10 -0
- package/math/quat.wesl +3 -1
- package/math/rotate2d.wesl +4 -1
- package/math/rotate3d.wesl +3 -3
- package/math/rotate3dX.wesl +5 -3
- package/math/rotate3dY.wesl +2 -2
- package/math/rotate3dZ.wesl +1 -1
- package/math/rotate4dX.wesl +2 -2
- package/math/rotate4dY.wesl +2 -2
- package/math/rotate4dZ.wesl +1 -1
- package/math/saturate.wesl +15 -0
- package/math/saturateMediump.wesl +38 -0
- package/math/scale2d.wesl +3 -1
- package/math/scale4d.wesl +1 -1
- package/math/smootherstep.wesl +4 -3
- package/math/sum.wesl +0 -1
- package/math/toMat3.wesl +12 -0
- package/math/toMat4.wesl +1 -1
- package/math/translate4d.wesl +11 -4
- package/math/unpack.wesl +20 -20
- package/math/within.wesl +5 -5
- package/morphological/dilation.glsl +24 -11
- package/package.json +25 -15
- package/pnpm-workspace.yaml +3 -0
- package/sample/sprite.wesl +14 -0
- package/sdf/boxSDF.wesl +7 -2
- package/sdf/circleSDF.wesl +28 -0
- package/sdf/crossSDF.wesl +19 -0
- package/sdf/cylinderSDF.wesl +26 -1
- package/sdf/flowerSDF.wesl +33 -0
- package/sdf/gearSDF.wesl +43 -0
- package/sdf/heartSDF.wesl +34 -0
- package/sdf/hexSDF.wesl +29 -0
- package/sdf/opSubtraction.wesl +19 -1
- package/sdf/opUnion.wesl +16 -1
- package/sdf/polySDF.wesl +35 -0
- package/sdf/raysSDF.wesl +32 -0
- package/sdf/rectSDF.wesl +36 -8
- package/sdf/rhombSDF.wesl +27 -0
- package/sdf/sphereSDF.wesl +7 -3
- package/sdf/spiralSDF.wesl +33 -0
- package/sdf/starSDF.wesl +41 -0
- package/sdf/torusSDF.wesl +10 -3
- package/sdf/triSDF.wesl +31 -0
- package/sdf/vesicaSDF.wesl +24 -0
- package/space/aspect.wesl +16 -0
- package/space/bracketing.wesl +61 -0
- package/space/brickTile.wesl +34 -0
- package/space/cart2polar.wesl +17 -0
- package/space/center.wesl +16 -0
- package/space/checkerTile.wesl +31 -0
- package/space/decimateNormal.glsl +27 -0
- package/space/decimateNormal.wesl +20 -0
- package/space/depth2viewZ.wesl +33 -0
- package/space/equirect2xyz.wesl +20 -0
- package/space/eulerView.wesl +24 -0
- package/space/fisheye2xyz.wesl +8 -3
- package/space/flipY.glsl +3 -3
- package/space/flipY.wesl +12 -0
- package/space/hexTile.wesl +25 -0
- package/space/kaleidoscope.wesl +38 -0
- package/space/linearizeDepth.wesl +21 -0
- package/space/lookAt.wesl +45 -0
- package/space/lookAtView.wesl +34 -0
- package/space/mirrorTile.wesl +67 -0
- package/space/nearest.wesl +2 -1
- package/space/orthographic.wesl +17 -0
- package/space/perspective.wesl +19 -0
- package/space/polar2cart.wesl +17 -0
- package/space/ratio.wesl +4 -4
- package/space/rotate.wesl +74 -8
- package/space/rotateX.wesl +61 -0
- package/space/rotateY.wesl +61 -0
- package/space/rotateZ.glsl +1 -1
- package/space/rotateZ.wesl +61 -0
- package/space/scale.wesl +101 -7
- package/space/screen2viewPosition.wesl +37 -0
- package/space/sprite.wesl +16 -0
- package/space/sqTile.wesl +16 -0
- package/space/tbn.wesl +16 -0
- package/space/translate.wesl +15 -0
- package/space/triTile.wesl +25 -0
- package/space/uncenter.wesl +14 -0
- package/space/unratio.wesl +12 -0
- package/space/view2screenPosition.wesl +21 -0
- package/space/viewZ2depth.wesl +31 -0
- package/space/windmillTile.wesl +37 -0
- package/space/xyz2equirect.wesl +14 -0
- package/version.glsl +2 -2
- package/version.hlsl +2 -2
- package/version.wesl +3 -2
- package/version.wgsl +2 -2
- package/vitest.config.ts +7 -0
- package/wesl.toml +3 -0
- package/color/mixBox.glsl +0 -121
- package/math/mod.wesl +0 -11
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [tomain, lee/ci, patricio/ci]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
validate:
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
os: [macos-latest]
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
submodules: recursive
|
|
21
|
+
lfs: true
|
|
22
|
+
|
|
23
|
+
- name: Setup pnpm
|
|
24
|
+
uses: pnpm/action-setup@v4
|
|
25
|
+
with:
|
|
26
|
+
version: '10.26.0'
|
|
27
|
+
|
|
28
|
+
- name: Setup Node.js
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: '24'
|
|
32
|
+
cache: 'pnpm'
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: pnpm install --frozen-lockfile
|
|
36
|
+
|
|
37
|
+
- name: Run CI checks (macOS)
|
|
38
|
+
if: matrix.os == 'macos-latest'
|
|
39
|
+
run: pnpm ci:check
|
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ Best of all, LYGIA grows and improves every day thanks to the support of the com
|
|
|
8
8
|
|
|
9
9
|
## How to use it?
|
|
10
10
|
|
|
11
|
+
_For using Lygia with WebGPU, see the [WebGPU README](./README_WebGPU.md)._
|
|
12
|
+
|
|
11
13
|
In your shader just `#include` the functions you need and use them:
|
|
12
14
|
|
|
13
15
|
<div class="codeAndCanvas" data="example.frag">
|
|
@@ -37,13 +39,13 @@ In your shader just `#include` the functions you need and use them:
|
|
|
37
39
|
|
|
38
40
|
</div>
|
|
39
41
|
|
|
40
|
-
If you just need to resolve the dependencies of a shader file you got, the fastest way would be to drag&drop your shader file in the box below. We can resolve the dependencies for you.
|
|
42
|
+
<!-- If you just need to resolve the dependencies of a shader file you got, the fastest way would be to drag&drop your shader file in the box below. We can resolve the dependencies for you.
|
|
41
43
|
|
|
42
44
|
<div class="container">
|
|
43
45
|
<div class="file-drop-area">
|
|
44
46
|
<span class="file-msg">Drop your shader file <a href="https://lygia.xyz/">here</a></span>
|
|
45
47
|
</div>
|
|
46
|
-
</div>
|
|
48
|
+
</div> -->
|
|
47
49
|
|
|
48
50
|
LYGIA have been integrated into the following Engines, Frameworks, Creative Tools and online editors:
|
|
49
51
|
|
|
@@ -60,6 +62,7 @@ LYGIA have been integrated into the following Engines, Frameworks, Creative Tool
|
|
|
60
62
|
<a href="https://github.com/kujohn/lygia_ogl_examples"><img src="https://lygia.xyz/imgs/ogl.png" alt="ogl" title="ogl" width="64" /></a>
|
|
61
63
|
<a href="https://www.npmjs.com/package/lygia"><img src="https://lygia.xyz/imgs/npm.png" alt="npm" title="npm" width="64" /></a>
|
|
62
64
|
<a href="https://codesandbox.io/s/lygia-react-starter-fftx6p"><img src="https://lygia.xyz/imgs/r3f.png" alt="r3rf" title="r3rf" width="64" /></a>
|
|
65
|
+
<a href="https://cycling74.com/packages/jitlygia"><img src="https://lygia.xyz/imgs/max.png" alt="max" title="max" width="64" /></a>
|
|
63
66
|
</p>
|
|
64
67
|
|
|
65
68
|
<p style="text-align: center;" >
|
package/README_WESL.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
## Contributing a WebGPU WESL Shader
|
|
2
|
+
WESL is a strict superset of WGSL, adding import statements, conditional compilation, and other features.
|
|
3
|
+
|
|
4
|
+
### To add a shader to Lygia WESL:
|
|
5
|
+
|
|
6
|
+
1. Add a `.wesl` file alongside the other shader files.
|
|
7
|
+
- The Lygia convention is to have one user-facing function per file.
|
|
8
|
+
This keeps things organized while keeping user application bundle sizes small.
|
|
9
|
+
- It's fine to put multiple type variants of the same function in the same file.
|
|
10
|
+
For example, variants for a `fn` with `f32` and the same `fn` with `vec3f` arguments go in the same file.
|
|
11
|
+
1. Add appropriate tests in `test/wesl`.
|
|
12
|
+
- Use `testCompute()` for pure math functions
|
|
13
|
+
- Use `testFragment()` for derivative functions (`fwidth`, `dpdx`, `dpdy`) or texture sampling
|
|
14
|
+
- Use `toMatchImage()` for visual regression tests (filters, generative patterns, complex rendering)
|
|
15
|
+
|
|
16
|
+
### Notes when porting to WESL:
|
|
17
|
+
- WESL file names can't start with a number, and can't be current WGSL or WESL keywords.
|
|
18
|
+
- The file/directory hierarchy translates to double colons in WESL:
|
|
19
|
+
```rs
|
|
20
|
+
import lygia::color::space::hsl2rgb::hsl2rgb;
|
|
21
|
+
```
|
|
22
|
+
See [WESL imports](https://wesl-lang.dev/spec/Imports) for details.
|
|
23
|
+
- You can also reference other shader modules inline without import statements.
|
|
24
|
+
```rs
|
|
25
|
+
fn foo() -> f32 {
|
|
26
|
+
let p = lygia::math::consts::PI;
|
|
27
|
+
return p;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
- Conditional transpilation is supported via `@if`, `@else`, and `@elseif` statements.
|
|
31
|
+
Conditions can be set at runtime or build time.[^1]
|
|
32
|
+
See [WESL Conditions](https://wesl-lang.dev/spec/ConditionalTranslation) for details.
|
|
33
|
+
|
|
34
|
+
### WESL Resources
|
|
35
|
+
WESL is documented at [wesl-lang.dev](https://wesl-lang.dev).
|
|
36
|
+
Community support for WESL is available on [GitHub](https://github.com/wgsl-tooling-wg) and on [Discord](https://discord.gg/5UhkaSu4dt).
|
|
37
|
+
|
|
38
|
+
### Future Plans
|
|
39
|
+
- Function overloads or generics to reduce duplication across type variants
|
|
40
|
+
- Setting conditions from imported shaders.
|
package/README_WebGPU.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
This page describes how to link Lygia shader functions
|
|
2
|
+
into your WebGPU application using WESL tools.
|
|
3
|
+
|
|
4
|
+
[WESL](https://wesl-lang.dev) is a superset of WGSL that adds
|
|
5
|
+
features with community-supported tools.
|
|
6
|
+
WESL tools are available in Rust and JavaScript/TypeScript.
|
|
7
|
+
|
|
8
|
+
_Most (but not all) Lygia GLSL shaders are now available
|
|
9
|
+
for WebGPU using WESL.
|
|
10
|
+
If a Lygia function you need is missing,
|
|
11
|
+
please file an [issue](https://github.com/patriciogonzalezvivo/lygia/issues)
|
|
12
|
+
or help [contribute](./README_WESL.md)._[^1][^2]
|
|
13
|
+
|
|
14
|
+
## Using JavaScript or TypeScript
|
|
15
|
+
|
|
16
|
+
Install with `npm install lygia` or `pnpm install lygia`
|
|
17
|
+
([lygia npm package](https://www.npmjs.com/package/lygia)).
|
|
18
|
+
Once you install, 500+ Lygia functions
|
|
19
|
+
and constants will be available for you to use
|
|
20
|
+
via `import` statements in your application shader code.
|
|
21
|
+
|
|
22
|
+
```rs
|
|
23
|
+
import lygia::math::consts::PI;
|
|
24
|
+
|
|
25
|
+
fn main() {
|
|
26
|
+
let p = PI;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The JS tools automatically tree-shake, including only the Lygia
|
|
31
|
+
functions your application uses.
|
|
32
|
+
|
|
33
|
+
WESL integrates with popular bundlers (vite, webpack, rollup) through plugins,
|
|
34
|
+
or for custom build pipelines, you can use the `wesl-link` command-line tool
|
|
35
|
+
or the link API.
|
|
36
|
+
|
|
37
|
+
### Using a JavaScript/TypeScript Bundler
|
|
38
|
+
|
|
39
|
+
If you build your application with a JavaScript/TypeScript bundler
|
|
40
|
+
like `vite`, `webpack` or `rollup`,
|
|
41
|
+
install the
|
|
42
|
+
[wesl](https://www.npmjs.com/package/wesl?activeTab=readme) and
|
|
43
|
+
[wesl-plugin](https://www.npmjs.com/package/wesl-plugin) packages.
|
|
44
|
+
|
|
45
|
+
#### Runtime Linking with a Bundler
|
|
46
|
+
Import shader code into your JavaScript or TypeScript application using the
|
|
47
|
+
import statements suffixed with `?link` and the shaders will be linked together at runtime:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import appWesl from "../shaders/app.wesl?link";
|
|
51
|
+
import { link } from "wesl";
|
|
52
|
+
|
|
53
|
+
const linked = await link(appWesl);
|
|
54
|
+
linked.createShaderModule(gpuDevice);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For more details, check the [WESL bundler documentation](https://wesl-lang.dev/docs/JavaScript-Builds#wesl-with-javascript-bundlers) or refer to this
|
|
58
|
+
[lygia example using vite](https://stackblitz.com/github/wgsl-tooling-wg/examples/tree/main/lygia-example?file=README.md).
|
|
59
|
+
|
|
60
|
+
#### Static Linking with a Bundler
|
|
61
|
+
Alternatively,
|
|
62
|
+
you can statically link your shaders in advance using the `?static` suffix:
|
|
63
|
+
```ts
|
|
64
|
+
import appWgsl from "../shaders/app.wesl?static";
|
|
65
|
+
```
|
|
66
|
+
See the [lygia static linking example](https://stackblitz.com/github/wgsl-tooling-wg/examples/tree/main/lygia-static-example)
|
|
67
|
+
for details.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
#### Runtime vs. Static Linking
|
|
71
|
+
Static linking bundles your shader modules together into a single transpiled WGSL string.
|
|
72
|
+
Static linking means you don't need WESL linker in your runtime bundle (~15KB savings).
|
|
73
|
+
However, static linking is less flexible
|
|
74
|
+
because your application can't use WESL's conditional compilation
|
|
75
|
+
features (`@if` directives) to adapt shaders at runtime based on GPU capabilities
|
|
76
|
+
or user configuration.
|
|
77
|
+
|
|
78
|
+
Many Lygia shader functions include `@if` [conditions](https://wesl-lang.dev/spec/ConditionalTranslation).
|
|
79
|
+
For example see `@if(YUV_SDTV)` in [`yuv2rgb`](https://github.com/patriciogonzalezvivo/lygia/blob/main/color/space/yuv2rgb.wesl).
|
|
80
|
+
With runtime linking, you can set these conditions dynamically.
|
|
81
|
+
With static linking, conditions are resolved at build time.
|
|
82
|
+
|
|
83
|
+
### Command Line Linking
|
|
84
|
+
|
|
85
|
+
For custom build pipelines, use the `wesl-link` command-line tool to statically link shaders.
|
|
86
|
+
|
|
87
|
+
#### Linking Application Shaders
|
|
88
|
+
Link your application shader file that imports Lygia functions:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npx wesl-link ./shaders/main.wesl
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
See the [Lygia CLI linking example](https://stackblitz.com/github/wgsl-tooling-wg/examples/tree/main/lygia-cli-example?file=README.md) for details.
|
|
95
|
+
|
|
96
|
+
#### Linking Lygia Modules on the Command Line
|
|
97
|
+
To get standalone WGSL for a specific Lygia module,
|
|
98
|
+
call wesl-link on that module.
|
|
99
|
+
|
|
100
|
+
**From the npm package:**
|
|
101
|
+
```sh
|
|
102
|
+
npx wesl-link lygia::color::layer::addSourceOver
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**From a lygia repository clone:**
|
|
106
|
+
```sh
|
|
107
|
+
npx wesl-link package::color::layer::addSourceOver
|
|
108
|
+
|
|
109
|
+
# alternate syntax
|
|
110
|
+
npx wesl-link color/layer/addSourceOver.wesl
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Either approach produces the WGSL for the requested Lygia module linked with its dependencies.
|
|
114
|
+
|
|
115
|
+
### Link Using the API
|
|
116
|
+
You can use the linking API directly to build custom solutions:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import { link } from "wesl";
|
|
120
|
+
|
|
121
|
+
const main = `import lygia::math::consts::PI; ...`;
|
|
122
|
+
const linked = await link({weslSrc: {main }});
|
|
123
|
+
const shaderModule = linked.createShaderModule(gpuDevice);
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
See the [API documentation](https://wesl-lang.dev/docs/JavaScript-Builds) for details.
|
|
127
|
+
|
|
128
|
+
### Additional WESL Examples
|
|
129
|
+
|
|
130
|
+
More WESL examples are available [here](https://github.com/wgsl-tooling-wg/examples).
|
|
131
|
+
Most examples run with one click in a browser sandbox.
|
|
132
|
+
The examples can also be used as starter templates with `degit`.
|
|
133
|
+
|
|
134
|
+
## Using Rust
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
cargo add lygia
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Linking at build time
|
|
141
|
+
```sh
|
|
142
|
+
cargo add --build wesl
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```rs
|
|
146
|
+
/// build.rs
|
|
147
|
+
fn main() {
|
|
148
|
+
wesl::Wesl::new("src/shaders").build_artifact("main.wesl", "my_shader");
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Linking at run-time
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
cargo add wesl
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```rs
|
|
159
|
+
let shader_string = Wesl::new("src/shaders")
|
|
160
|
+
.compile("main.wesl")
|
|
161
|
+
.inspect_err(|e| eprintln!("WESL error: {e}")) // pretty errors with `display()`
|
|
162
|
+
.unwrap()
|
|
163
|
+
.to_string();
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Using the Rust CLI tool
|
|
167
|
+
```sh
|
|
168
|
+
cargo install wesl-cli
|
|
169
|
+
wesl compile <path/to/shader.wesl>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
### WESL Rust Documentation
|
|
174
|
+
See [Getting Started Rust](https://wesl-lang.dev/docs/Getting-Started-Rust),
|
|
175
|
+
the [wesl crate documentation](https://docs.rs/wesl/latest/wesl/),
|
|
176
|
+
and [WESL rust examples](https://github.com/wgsl-tooling-wg/wesl-rs/tree/main/examples).
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
## About WESL
|
|
180
|
+
WESL extends WGSL with:
|
|
181
|
+
- `import` statements to split shader code across files and load npm/cargo libraries
|
|
182
|
+
- `@if @else @elseif` statements to assemble specialized shaders at build time or runtime
|
|
183
|
+
|
|
184
|
+
Current WESL tools include:
|
|
185
|
+
- Linkers in Rust and JavaScript (to combine WGSL/WESL files into applications)
|
|
186
|
+
- Syntax highlighters for zed, helix and nvim
|
|
187
|
+
|
|
188
|
+
### Coming Soon
|
|
189
|
+
Additional WESL tools in development:
|
|
190
|
+
- HTML [documentation generator](https://github.com/jannik4/wesldoc)
|
|
191
|
+
- [Language server](https://github.com/wgsl-analyzer/wgsl-analyzer)
|
|
192
|
+
- VSCode plugin
|
|
193
|
+
- Code formatter
|
|
194
|
+
|
|
195
|
+
Read more about WESL at [wesl-lang.dev](https://wesl-lang.dev).
|
|
196
|
+
|
|
197
|
+
[^1]: Lygia functions are small and self-contained.
|
|
198
|
+
You can just copy, paste and edit them into your app if you prefer doing things manually!
|
|
199
|
+
|
|
200
|
+
[^2]: Lygia currently hosts two versions of WebGPU shaders.
|
|
201
|
+
The newer versions use the WESL language and have a `.wesl` suffix.
|
|
202
|
+
For new Lygia users, we recommend `.wesl`.
|
|
203
|
+
(The older versions use a `.wgsl` suffix, but are less complete and use a custom `#include` syntax.)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import lygia::math::consts::PI;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Back in easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: backIn(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn backIn(t: f32) -> f32 { return pow(t, 3.0) - t * sin(t * PI); }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import lygia::animation::easing::backIn::{backIn};
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Back in/out easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: backInOut(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn backInOut(t: f32) -> f32 {
|
|
12
|
+
let g = backIn(select(1.0 - (2.0 * t - 1.0), 2.0 * t, t < 0.5));
|
|
13
|
+
return select(0.5 * (1.0 - g) + 0.5, 0.5 * g, t < 0.5);
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import lygia::animation::easing::backIn::{backIn};
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Back out easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: backOut(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn backOut(t: f32) -> f32 { return 1.0 - backIn(1.0 - t); }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import lygia::animation::easing::bounceOut::{bounceOut};
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Bounce in easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: <f32> bounceIn(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/eduardfossas/lygia-study-examples/main/animation/e_EasingBounce.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn bounceIn(t: f32) -> f32 { return 1.0 - bounceOut(1.0 - t); }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import lygia::animation::easing::bounceOut::{bounceOut};
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Bounce in/out easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: <f32> bounceInOut(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/eduardfossas/lygia-study-examples/main/animation/e_EasingBounce.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn bounceInOut(t: f32) -> f32 {
|
|
12
|
+
return select(
|
|
13
|
+
0.5 * bounceOut(t * 2.0 - 1.0) + 0.5,
|
|
14
|
+
0.5 * (1.0 - bounceOut(1.0 - t * 2.0)),
|
|
15
|
+
t < 0.5
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Bounce out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: <f32> bounceOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/eduardfossas/lygia-study-examples/main/animation/e_EasingBounce.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn bounceOut(t: f32) -> f32 {
|
|
10
|
+
const a = 4.0 / 11.0;
|
|
11
|
+
const b = 8.0 / 11.0;
|
|
12
|
+
const c = 9.0 / 10.0;
|
|
13
|
+
|
|
14
|
+
const ca = 4356.0 / 361.0;
|
|
15
|
+
const cb = 35442.0 / 1805.0;
|
|
16
|
+
const cc = 16061.0 / 1805.0;
|
|
17
|
+
|
|
18
|
+
let t2 = t * t;
|
|
19
|
+
|
|
20
|
+
return select(
|
|
21
|
+
select(
|
|
22
|
+
select(
|
|
23
|
+
10.8 * t * t - 20.52 * t + 10.72,
|
|
24
|
+
ca * t2 - cb * t + cc,
|
|
25
|
+
t < c
|
|
26
|
+
),
|
|
27
|
+
9.075 * t2 - 9.9 * t + 3.4,
|
|
28
|
+
t < b
|
|
29
|
+
),
|
|
30
|
+
7.5625 * t2,
|
|
31
|
+
t < a
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Circular in easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: circularIn(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn circularIn(t: f32) -> f32 { return 1.0 - sqrt(1.0 - t * t); }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Circular in/out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: circularInOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn circularInOut(t: f32) -> f32 {
|
|
10
|
+
return select(
|
|
11
|
+
0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0),
|
|
12
|
+
0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t)),
|
|
13
|
+
t < 0.5
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Circular out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: circularOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn circularOut(t: f32) -> f32 { return sqrt((2.0 - t) * t); }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Cubic in easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: cubicIn(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn cubicIn(t: f32) -> f32 { return t * t * t; }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Cubic in/out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: cubicInOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn cubicInOut(t: f32) -> f32 {
|
|
10
|
+
return select(
|
|
11
|
+
0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0,
|
|
12
|
+
4.0 * t * t * t,
|
|
13
|
+
t < 0.5
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Cubic out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: cubicOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn cubicOut(t: f32) -> f32 {
|
|
10
|
+
let f = t - 1.0;
|
|
11
|
+
return f * f * f + 1.0;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import lygia::math::consts::HALF_PI;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Elastic in easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: elasticIn(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn elasticIn(t: f32) -> f32 { return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0)); }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import lygia::math::consts::HALF_PI;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Elastic in/out easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: elasticInOut(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn elasticInOut(t: f32) -> f32 {
|
|
12
|
+
return select(
|
|
13
|
+
0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0,
|
|
14
|
+
0.5 * sin(13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0)),
|
|
15
|
+
t < 0.5
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import lygia::math::consts::HALF_PI;
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
5
|
+
description: Elastic out easing. From https://github.com/stackgl/glsl-easings
|
|
6
|
+
use: elasticOut(<f32> x)
|
|
7
|
+
examples:
|
|
8
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
fn elasticOut(t: f32) -> f32 { return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0; }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Exponential in easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: exponentialIn(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn exponentialIn(t: f32) -> f32 {
|
|
10
|
+
return select(
|
|
11
|
+
pow(2.0, 10.0 * (t - 1.0)),
|
|
12
|
+
t,
|
|
13
|
+
t == 0.0
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Exponential in/out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: exponentialInOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn exponentialInOut(t: f32) -> f32 {
|
|
10
|
+
return select(
|
|
11
|
+
select(
|
|
12
|
+
-0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0,
|
|
13
|
+
0.5 * pow(2.0, (20.0 * t) - 10.0),
|
|
14
|
+
t < 0.5
|
|
15
|
+
),
|
|
16
|
+
t,
|
|
17
|
+
t == 0.0 || t == 1.0
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Exponential out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: exponentialOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn exponentialOut(t: f32) -> f32 {
|
|
10
|
+
return select(
|
|
11
|
+
1.0 - pow(2.0, -10.0 * t),
|
|
12
|
+
t,
|
|
13
|
+
t == 1.0
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Linear easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: linearIn(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn linearIn(t: f32) -> f32 { return t; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Linear easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: linearInOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn linearInOut(t: f32) -> f32 { return t; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Linear easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: linearOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn linearOut(t: f32) -> f32 { return t; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Quadrtic in easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: quadraticIn(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn quadraticIn(t: f32) -> f32 { return t * t; }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Quadrtic in/out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: quadraticInOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn quadraticInOut(t: f32) -> f32 {
|
|
10
|
+
let p = 2.0 * t * t;
|
|
11
|
+
return select(-p + (4.0 * t) - 1.0, p, t < 0.5);
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
contributors: Hugh Kennedy (https://github.com/hughsk)
|
|
3
|
+
description: Quadrtic out easing. From https://github.com/stackgl/glsl-easings
|
|
4
|
+
use: quadraticOut(<f32> x)
|
|
5
|
+
examples:
|
|
6
|
+
- https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fn quadraticOut(t: f32) -> f32 { return -t * (t - 2.0); }
|