lygia 1.1.2 → 1.3.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/CONTRIBUTE.md +21 -0
- package/DESIGN.md +137 -0
- package/EXAMPLES.md +23 -0
- package/README.md +100 -182
- package/README_GLSL.md +27 -0
- package/README_METAL.md +56 -0
- package/animation/easing/back.glsl +4 -31
- package/animation/easing/back.hlsl +1 -1
- package/animation/easing/backIn.glsl +14 -0
- package/animation/easing/backInOut.glsl +24 -0
- package/animation/easing/backOut.glsl +14 -0
- package/animation/easing/bounce.glsl +5 -40
- package/animation/easing/bounce.hlsl +2 -2
- package/animation/easing/bounceIn.glsl +14 -0
- package/animation/easing/bounceInOut.glsl +18 -0
- package/animation/easing/bounceOut.glsl +32 -0
- package/animation/easing/circular.glsl +5 -24
- package/animation/easing/circular.hlsl +7 -7
- package/animation/easing/circularIn.glsl +12 -0
- package/animation/easing/circularInOut.glsl +16 -0
- package/animation/easing/circularOut.glsl +12 -0
- package/animation/easing/cubic.glsl +5 -25
- package/animation/easing/cubic.hlsl +2 -2
- package/animation/easing/cubicIn.glsl +12 -0
- package/animation/easing/cubicInOut.glsl +16 -0
- package/animation/easing/cubicOut.glsl +16 -0
- package/animation/easing/elastic.glsl +5 -26
- package/animation/easing/elastic.hlsl +2 -2
- package/animation/easing/elasticIn.glsl +14 -0
- package/animation/easing/elasticInOut.glsl +18 -0
- package/animation/easing/elasticOut.glsl +14 -0
- package/animation/easing/exponential.glsl +5 -26
- package/animation/easing/exponential.hlsl +2 -2
- package/animation/easing/exponentialIn.glsl +12 -0
- package/animation/easing/exponentialInOut.glsl +18 -0
- package/animation/easing/exponentialOut.glsl +12 -0
- package/animation/easing/linear.glsl +4 -15
- package/animation/easing/linear.hlsl +1 -1
- package/animation/easing/linearIn.glsl +12 -0
- package/animation/easing/linearInOut.glsl +12 -0
- package/animation/easing/linearOut.glsl +12 -0
- package/animation/easing/quadratic.glsl +5 -23
- package/animation/easing/quadratic.hlsl +2 -2
- package/animation/easing/quadraticIn.glsl +12 -0
- package/animation/easing/quadraticInOut.glsl +15 -0
- package/animation/easing/quadraticOut.glsl +12 -0
- package/animation/easing/quartic.glsl +5 -24
- package/animation/easing/quartic.hlsl +7 -7
- package/animation/easing/quarticIn.glsl +12 -0
- package/animation/easing/quarticInOut.glsl +16 -0
- package/animation/easing/quarticOut.glsl +15 -0
- package/animation/easing/quintic.glsl +5 -24
- package/animation/easing/quintic.hlsl +2 -2
- package/animation/easing/quinticIn.glsl +12 -0
- package/animation/easing/quinticInOut.glsl +16 -0
- package/animation/easing/quinticOut.glsl +12 -0
- package/animation/easing/sine.glsl +5 -22
- package/animation/easing/sine.hlsl +3 -3
- package/animation/easing/sineIn.glsl +14 -0
- package/animation/easing/sineInOut.glsl +14 -0
- package/animation/easing/sineOut.glsl +14 -0
- package/animation/spriteLoop.glsl +6 -3
- package/animation/spriteLoop.hlsl +7 -4
- package/color/blend/add.glsl +5 -12
- package/color/blend/add.hlsl +2 -1
- package/color/blend/add.msl +13 -0
- package/color/blend/average.glsl +5 -12
- package/color/blend/average.hlsl +2 -1
- package/color/blend/average.msl +13 -0
- package/color/blend/color.glsl +22 -0
- package/color/blend/color.msl +23 -0
- package/color/blend/colorBurn.glsl +5 -10
- package/color/blend/colorBurn.hlsl +2 -1
- package/color/blend/colorBurn.msl +17 -0
- package/color/blend/colorDodge.glsl +5 -10
- package/color/blend/colorDodge.hlsl +2 -1
- package/color/blend/colorDodge.msl +17 -0
- package/color/blend/darken.glsl +5 -10
- package/color/blend/darken.hlsl +2 -1
- package/color/blend/darken.msl +17 -0
- package/color/blend/difference.glsl +5 -12
- package/color/blend/difference.hlsl +2 -1
- package/color/blend/difference.msl +13 -0
- package/color/blend/exclusion.glsl +5 -12
- package/color/blend/exclusion.hlsl +2 -1
- package/color/blend/exclusion.msl +13 -0
- package/color/blend/glow.glsl +2 -1
- package/color/blend/glow.hlsl +3 -2
- package/color/blend/glow.msl +23 -0
- package/color/blend/hardLight.glsl +2 -1
- package/color/blend/hardLight.hlsl +3 -2
- package/color/blend/hardLight.msl +23 -0
- package/color/blend/hardMix.glsl +2 -1
- package/color/blend/hardMix.hlsl +3 -2
- package/color/blend/hardMix.msl +25 -0
- package/color/blend/hue.glsl +22 -0
- package/color/blend/hue.msl +22 -0
- package/color/blend/lighten.glsl +2 -1
- package/color/blend/lighten.hlsl +2 -1
- package/color/blend/lighten.msl +23 -0
- package/color/blend/linearBurn.glsl +2 -1
- package/color/blend/linearBurn.hlsl +2 -1
- package/color/blend/linearBurn.msl +23 -0
- package/color/blend/linearDodge.glsl +2 -1
- package/color/blend/linearDodge.hlsl +2 -1
- package/color/blend/linearDodge.msl +23 -0
- package/color/blend/linearLight.glsl +2 -1
- package/color/blend/linearLight.msl +26 -0
- package/color/blend/luminosity.glsl +22 -0
- package/color/blend/luminosity.msl +22 -0
- package/color/blend/multiply.glsl +2 -1
- package/color/blend/multiply.hlsl +2 -1
- package/color/blend/multiply.msl +21 -0
- package/color/blend/multiply.wgsl +18 -0
- package/color/blend/negation.glsl +2 -1
- package/color/blend/negation.hlsl +2 -1
- package/color/blend/negation.msl +21 -0
- package/color/blend/overlay.glsl +2 -1
- package/color/blend/overlay.hlsl +2 -1
- package/color/blend/overlay.msl +23 -0
- package/color/blend/overlay.wgsl +24 -0
- package/color/blend/phoenix.glsl +2 -1
- package/color/blend/phoenix.hlsl +2 -1
- package/color/blend/phoenix.msl +21 -0
- package/color/blend/pinLight.glsl +2 -1
- package/color/blend/pinLight.hlsl +2 -1
- package/color/blend/pinLight.msl +26 -0
- package/color/blend/reflect.glsl +2 -1
- package/color/blend/reflect.hlsl +2 -1
- package/color/blend/reflect.msl +23 -0
- package/color/blend/saturation.glsl +22 -0
- package/color/blend/saturation.msl +22 -0
- package/color/blend/screen.glsl +2 -1
- package/color/blend/screen.hlsl +1 -1
- package/color/blend/screen.msl +23 -0
- package/color/blend/screen.wgsl +20 -0
- package/color/blend/softLight.glsl +1 -1
- package/color/blend/softLight.hlsl +2 -1
- package/color/blend/softLight.msl +30 -0
- package/color/blend/softLight.wgsl +31 -0
- package/color/blend/subtract.glsl +2 -1
- package/color/blend/subtract.hlsl +2 -1
- package/color/blend/subtract.msl +21 -0
- package/color/blend/vividLight.glsl +2 -1
- package/color/blend/vividLight.hlsl +4 -3
- package/color/blend/vividLight.msl +26 -0
- package/color/blend.glsl +5 -1
- package/color/blend.msl +28 -0
- package/color/brightnessContrast.glsl +10 -13
- package/color/brightnessContrast.hlsl +7 -2
- package/color/brightnessContrast.msl +12 -0
- package/color/brightnessContrast.wgsl +16 -0
- package/color/brightnessMatrix.glsl +9 -4
- package/color/brightnessMatrix.hlsl +7 -2
- package/color/brightnessMatrix.msl +18 -0
- package/color/composite/compositeXor.glsl +27 -0
- package/color/composite/compositeXor.hlsl +29 -0
- package/color/composite/compositeXor.msl +32 -0
- package/color/composite/destinationAtop.glsl +29 -0
- package/color/composite/destinationAtop.hlsl +29 -0
- package/color/composite/destinationAtop.msl +32 -0
- package/color/composite/destinationIn.glsl +29 -0
- package/color/composite/destinationIn.hlsl +30 -0
- package/color/composite/destinationIn.msl +33 -0
- package/color/composite/destinationOut.glsl +29 -0
- package/color/composite/destinationOut.hlsl +29 -0
- package/color/composite/destinationOut.msl +32 -0
- package/color/composite/destinationOver.glsl +29 -0
- package/color/composite/destinationOver.hlsl +29 -0
- package/color/composite/destinationOver.msl +32 -0
- package/color/composite/sourceAtop.glsl +29 -0
- package/color/composite/sourceAtop.hlsl +29 -0
- package/color/composite/sourceAtop.msl +32 -0
- package/color/composite/sourceIn.glsl +30 -0
- package/color/composite/sourceIn.hlsl +30 -0
- package/color/composite/sourceIn.msl +33 -0
- package/color/composite/sourceOut.glsl +29 -0
- package/color/composite/sourceOut.hlsl +29 -0
- package/color/composite/sourceOut.msl +32 -0
- package/color/composite/sourceOver.glsl +32 -0
- package/color/composite/sourceOver.hlsl +32 -0
- package/color/composite/sourceOver.msl +35 -0
- package/color/composite.glsl +9 -0
- package/color/composite.hlsl +9 -0
- package/color/composite.msl +9 -0
- package/color/contrast.glsl +8 -13
- package/color/contrast.hlsl +5 -2
- package/color/contrast.msl +15 -0
- package/color/contrastMatrix.glsl +13 -8
- package/color/contrastMatrix.hlsl +7 -2
- package/color/contrastMatrix.msl +19 -0
- package/color/daltonize.glsl +10 -3
- package/color/daltonize.hlsl +11 -3
- package/color/daltonize.msl +184 -0
- package/color/desaturate.glsl +9 -6
- package/color/desaturate.hlsl +5 -2
- package/color/desaturate.msl +19 -0
- package/color/distance.glsl +8 -3
- package/color/distance.hlsl +8 -3
- package/color/distance.msl +55 -0
- package/color/distance.wgsl +55 -0
- package/color/dither/bayer.glsl +54 -27
- package/color/dither/bayer.msl +49 -0
- package/color/dither/bayer.wgsl +45 -0
- package/color/dither/blueNoise.glsl +88 -45
- package/color/dither/blueNoise.hlsl +16 -13
- package/color/dither/blueNoise.msl +131 -0
- package/color/dither/blueNoise.wgsl +47 -0
- package/color/dither/interleavedGradientNoise.glsl +60 -36
- package/color/dither/interleavedGradientNoise.hlsl +7 -5
- package/color/dither/interleavedGradientNoise.msl +70 -0
- package/color/dither/shift.glsl +50 -26
- package/color/dither/shift.hlsl +7 -5
- package/color/dither/shift.msl +91 -0
- package/color/dither/triangleNoise.glsl +51 -62
- package/color/dither/triangleNoise.hlsl +10 -8
- package/color/dither/triangleNoise.msl +79 -0
- package/color/dither/vlachos.glsl +46 -20
- package/color/dither/vlachos.hlsl +7 -5
- package/color/dither/vlachos.msl +73 -0
- package/color/dither/vlachos.wgsl +28 -0
- package/color/dither.glsl +12 -30
- package/color/dither.hlsl +6 -3
- package/color/dither.msl +43 -0
- package/color/exposure.glsl +8 -13
- package/color/exposure.hlsl +5 -2
- package/color/exposure.msl +15 -0
- package/color/exposure.wgsl +11 -3
- package/color/hueShift.glsl +23 -11
- package/color/hueShift.hlsl +22 -12
- package/color/hueShift.msl +33 -0
- package/color/hueShift.wgsl +22 -0
- package/color/hueShiftRYB.glsl +31 -0
- package/color/hueShiftRYB.hlsl +31 -0
- package/color/hueShiftRYB.msl +31 -0
- package/color/hueShiftRYB.wgsl +24 -0
- package/color/layer/addSourceOver.glsl +30 -0
- package/color/layer/addSourceOver.hlsl +30 -0
- package/color/layer/addSourceOver.msl +31 -0
- package/color/layer/averageSourceOver.glsl +30 -0
- package/color/layer/averageSourceOver.hlsl +30 -0
- package/color/layer/averageSourceOver.msl +31 -0
- package/color/layer/colorBurnSourceOver.glsl +30 -0
- package/color/layer/colorBurnSourceOver.hlsl +30 -0
- package/color/layer/colorBurnSourceOver.msl +31 -0
- package/color/layer/colorDodgeSourceOver.glsl +30 -0
- package/color/layer/colorDodgeSourceOver.hlsl +30 -0
- package/color/layer/colorDodgeSourceOver.msl +31 -0
- package/color/layer/colorSourceOver.glsl +30 -0
- package/color/layer/colorSourceOver.hlsl +30 -0
- package/color/layer/colorSourceOver.msl +31 -0
- package/color/layer/darkenSourceOver.glsl +30 -0
- package/color/layer/darkenSourceOver.hlsl +30 -0
- package/color/layer/darkenSourceOver.msl +31 -0
- package/color/layer/differenceSourceOver.glsl +30 -0
- package/color/layer/differenceSourceOver.hlsl +30 -0
- package/color/layer/differenceSourceOver.msl +31 -0
- package/color/layer/exclusionSourceOver.glsl +30 -0
- package/color/layer/exclusionSourceOver.hlsl +30 -0
- package/color/layer/exclusionSourceOver.msl +31 -0
- package/color/layer/glowSourceOver.glsl +30 -0
- package/color/layer/glowSourceOver.hlsl +30 -0
- package/color/layer/glowSourceOver.msl +31 -0
- package/color/layer/hardLightSourceOver.glsl +30 -0
- package/color/layer/hardLightSourceOver.hlsl +30 -0
- package/color/layer/hardLightSourceOver.msl +31 -0
- package/color/layer/hardMixSourceOver.glsl +30 -0
- package/color/layer/hardMixSourceOver.hlsl +30 -0
- package/color/layer/hardMixSourceOver.msl +31 -0
- package/color/layer/hueSourceOver.glsl +30 -0
- package/color/layer/hueSourceOver.hlsl +30 -0
- package/color/layer/hueSourceOver.msl +31 -0
- package/color/layer/lightenSourceOver.glsl +30 -0
- package/color/layer/lightenSourceOver.hlsl +30 -0
- package/color/layer/lightenSourceOver.msl +31 -0
- package/color/layer/linearBurnSourceOver.glsl +30 -0
- package/color/layer/linearBurnSourceOver.hlsl +30 -0
- package/color/layer/linearBurnSourceOver.msl +31 -0
- package/color/layer/linearDodgeSourceOver.glsl +30 -0
- package/color/layer/linearDodgeSourceOver.hlsl +30 -0
- package/color/layer/linearDodgeSourceOver.msl +31 -0
- package/color/layer/linearLightSourceOver.glsl +30 -0
- package/color/layer/linearLightSourceOver.hlsl +30 -0
- package/color/layer/linearLightSourceOver.msl +31 -0
- package/color/layer/luminositySourceOver.glsl +30 -0
- package/color/layer/luminositySourceOver.hlsl +30 -0
- package/color/layer/luminositySourceOver.msl +31 -0
- package/color/layer/multiplySourceOver.glsl +30 -0
- package/color/layer/multiplySourceOver.hlsl +30 -0
- package/color/layer/multiplySourceOver.msl +31 -0
- package/color/layer/negationSourceOver.glsl +30 -0
- package/color/layer/negationSourceOver.hlsl +30 -0
- package/color/layer/negationSourceOver.msl +31 -0
- package/color/layer/overlaySourceOver.glsl +30 -0
- package/color/layer/overlaySourceOver.hlsl +30 -0
- package/color/layer/overlaySourceOver.msl +31 -0
- package/color/layer/phoenixSourceOver.glsl +30 -0
- package/color/layer/phoenixSourceOver.hlsl +30 -0
- package/color/layer/phoenixSourceOver.msl +31 -0
- package/color/layer/pinLightSourceOver.glsl +30 -0
- package/color/layer/pinLightSourceOver.hlsl +30 -0
- package/color/layer/pinLightSourceOver.msl +31 -0
- package/color/layer/reflectSourceOver.glsl +30 -0
- package/color/layer/reflectSourceOver.hlsl +30 -0
- package/color/layer/reflectSourceOver.msl +31 -0
- package/color/layer/saturationSourceOver.glsl +30 -0
- package/color/layer/saturationSourceOver.hlsl +30 -0
- package/color/layer/saturationSourceOver.msl +31 -0
- package/color/layer/screenSourceOver.glsl +30 -0
- package/color/layer/screenSourceOver.hlsl +30 -0
- package/color/layer/screenSourceOver.msl +31 -0
- package/color/layer/softLightSourceOver.glsl +30 -0
- package/color/layer/softLightSourceOver.hlsl +30 -0
- package/color/layer/softLightSourceOver.msl +31 -0
- package/color/layer/subtractSourceOver.glsl +30 -0
- package/color/layer/subtractSourceOver.hlsl +30 -0
- package/color/layer/subtractSourceOver.msl +31 -0
- package/color/layer/vividLightSourceOver.glsl +30 -0
- package/color/layer/vividLightSourceOver.hlsl +30 -0
- package/color/layer/vividLightSourceOver.msl +31 -0
- package/color/layer.glsl +28 -0
- package/color/layer.hlsl +28 -0
- package/color/layer.msl +28 -0
- package/color/levels/gamma.glsl +10 -18
- package/color/levels/gamma.hlsl +6 -3
- package/color/levels/gamma.msl +19 -0
- package/color/levels/inputRange.glsl +10 -18
- package/color/levels/inputRange.hlsl +6 -3
- package/color/levels/inputRange.msl +18 -0
- package/color/levels/outputRange.glsl +10 -18
- package/color/levels/outputRange.hlsl +7 -4
- package/color/levels/outputRange.msl +18 -0
- package/color/levels.glsl +14 -11
- package/color/levels.hlsl +6 -3
- package/color/levels.msl +33 -0
- package/color/luma.glsl +5 -13
- package/color/luma.hlsl +2 -2
- package/color/luma.msl +14 -0
- package/color/luma.wgsl +9 -3
- package/color/luminance.glsl +7 -2
- package/color/luminance.hlsl +3 -1
- package/color/luminance.msl +14 -0
- package/color/lut.glsl +19 -13
- package/color/lut.hlsl +19 -13
- package/color/lut.msl +99 -0
- package/color/mixBox.glsl +15 -9
- package/color/mixOklab.glsl +14 -18
- package/color/mixOklab.hlsl +19 -26
- package/color/mixOklab.msl +51 -0
- package/color/mixOklab.wgsl +29 -16
- package/color/mixRYB.glsl +36 -0
- package/color/mixRYB.hlsl +36 -0
- package/color/mixRYB.msl +36 -0
- package/color/mixSpectral.glsl +131 -118
- package/color/mixSpectral.hlsl +129 -125
- package/color/mixSpectral.msl +168 -0
- package/color/mixSpectral.wgsl +199 -134
- package/color/palette/fire.cuh +5 -2
- package/color/palette/fire.glsl +5 -2
- package/color/palette/fire.hlsl +5 -2
- package/color/palette/heatmap.cuh +5 -2
- package/color/palette/heatmap.glsl +5 -2
- package/color/palette/heatmap.hlsl +5 -2
- package/color/palette/heatmap.wgsl +14 -0
- package/color/palette/hue.cuh +5 -3
- package/color/palette/hue.glsl +8 -18
- package/color/palette/hue.hlsl +10 -10
- package/color/palette/hue.wgsl +16 -0
- package/color/palette/lerp.glsl +60 -0
- package/color/palette/macbeth.glsl +1016 -0
- package/color/palette/macbeth.hlsl +957 -0
- package/color/palette/pigments/gamblin_oil.glsl +325 -0
- package/color/palette/pigments/gamblin_oil.hlsl +325 -0
- package/color/palette/pigments/golden_acrylic.glsl +248 -0
- package/color/palette/pigments/golden_acrylic.hlsl +248 -0
- package/color/palette/pigments/liquitex_acrylic.glsl +164 -0
- package/color/palette/pigments/liquitex_acrylic.hlsl +164 -0
- package/color/palette/pigments/rembrandt_oil.glsl +283 -0
- package/color/palette/pigments/rembrandt_oil.hlsl +283 -0
- package/color/palette/pigments/winsor_acrylic.glsl +430 -0
- package/color/palette/pigments/winsor_acrylic.hlsl +430 -0
- package/color/palette/pigments/winsor_gouache.glsl +346 -0
- package/color/palette/pigments/winsor_gouache.hlsl +346 -0
- package/color/palette/pigments/winsor_oil.glsl +507 -0
- package/color/palette/pigments/winsor_oil.hlsl +507 -0
- package/color/{pigments.glsl → palette/pigments.glsl} +38 -1
- package/color/{pigments.hlsl → palette/pigments.hlsl} +37 -0
- package/color/palette/ridgway.glsl +7827 -0
- package/color/palette/ridgway.hlsl +7827 -0
- package/color/palette/spectral/gems.glsl +4 -5
- package/color/palette/spectral/gems.hlsl +5 -3
- package/color/palette/spectral/geoffrey.glsl +3 -4
- package/color/palette/spectral/geoffrey.hlsl +2 -2
- package/color/palette/spectral/soft.glsl +6 -4
- package/color/palette/spectral/soft.hlsl +5 -2
- package/color/palette/spectral/zucconi.glsl +2 -3
- package/color/palette/spectral/zucconi.hlsl +1 -1
- package/color/palette/spectral/zucconi6.glsl +2 -3
- package/color/palette/spectral/zucconi6.hlsl +2 -2
- package/color/palette/spectral.glsl +3 -2
- package/color/palette/spectral.hlsl +3 -2
- package/color/palette/spyder.glsl +690 -0
- package/color/palette/spyder.hlsl +680 -0
- package/color/palette/wada/dyad.glsl +156 -0
- package/color/palette/wada/dyad.hlsl +151 -0
- package/color/palette/wada/tetrad.glsl +132 -0
- package/color/palette/wada/tetrad.hlsl +127 -0
- package/color/palette/wada/triad.glsl +145 -0
- package/color/palette/wada/triad.hlsl +140 -0
- package/color/palette/wada/value.glsl +2397 -0
- package/color/palette/wada/value.hlsl +2387 -0
- package/color/palette/wada.glsl +4 -0
- package/color/palette/wada.hlsl +4 -0
- package/color/palette/water.cuh +5 -2
- package/color/palette/water.glsl +5 -2
- package/color/palette/water.hlsl +5 -2
- package/color/palette/zorn.glsl +39 -0
- package/color/palette.glsl +4 -9
- package/color/palette.hlsl +1 -1
- package/color/palette.msl +13 -0
- package/color/saturationMatrix.glsl +14 -19
- package/color/saturationMatrix.hlsl +5 -2
- package/color/saturationMatrix.msl +23 -0
- package/color/saturationMatrix.wgsl +12 -4
- package/color/space/YCbCr2rgb.glsl +7 -4
- package/color/space/YCbCr2rgb.hlsl +5 -2
- package/color/space/YCbCr2rgb.msl +25 -0
- package/color/space/YCbCr2rgb.wgsl +10 -2
- package/color/space/YPbPr2rgb.glsl +20 -20
- package/color/space/YPbPr2rgb.hlsl +21 -21
- package/color/space/YPbPr2rgb.msl +31 -0
- package/color/space/YPbPr2rgb.wgsl +19 -15
- package/color/space/cmyk2rgb.glsl +6 -3
- package/color/space/cmyk2rgb.hlsl +5 -2
- package/color/space/cmyk2rgb.msl +18 -0
- package/color/space/cmyk2rgb.wgsl +10 -2
- package/color/space/gamma2linear.glsl +8 -5
- package/color/space/gamma2linear.hlsl +5 -2
- package/color/space/gamma2linear.msl +37 -0
- package/color/space/gamma2linear.wgsl +9 -1
- package/color/space/hcy2rgb.glsl +26 -0
- package/color/space/hcy2rgb.hlsl +26 -0
- package/color/space/hcy2rgb.msl +26 -0
- package/color/space/hcy2rgb.wgsl +23 -0
- package/color/space/hsl2rgb.glsl +20 -0
- package/color/space/hsl2rgb.hlsl +20 -0
- package/color/space/hsl2rgb.msl +20 -0
- package/color/space/hsl2rgb.wgsl +16 -0
- package/color/space/hsv2rgb.glsl +8 -17
- package/color/space/hsv2rgb.hlsl +7 -17
- package/color/space/hsv2rgb.msl +14 -0
- package/color/space/hsv2rgb.wgsl +11 -6
- package/color/space/hsv2ryb.glsl +37 -0
- package/color/space/hsv2ryb.hlsl +37 -0
- package/color/space/hsv2ryb.msl +37 -0
- package/color/space/hsv2ryb.wgsl +19 -0
- package/color/space/hue2rgb.glsl +20 -0
- package/color/space/hue2rgb.hlsl +18 -0
- package/color/space/hue2rgb.msl +20 -0
- package/color/space/hue2rgb.wgsl +14 -0
- package/color/space/k2rgb.glsl +6 -3
- package/color/space/k2rgb.hlsl +5 -2
- package/color/space/k2rgb.msl +69 -0
- package/color/space/k2rgb.wgsl +10 -2
- package/color/space/lab2lch.glsl +20 -0
- package/color/space/lab2lch.hlsl +20 -0
- package/color/space/lab2lch.msl +20 -0
- package/color/space/lab2lch.wgsl +15 -0
- package/color/space/lab2rgb.glsl +8 -9
- package/color/space/lab2rgb.hlsl +5 -7
- package/color/space/lab2rgb.msl +18 -0
- package/color/space/lab2rgb.wgsl +11 -5
- package/color/space/lab2srgb.glsl +18 -0
- package/color/space/lab2srgb.hlsl +23 -0
- package/color/space/lab2srgb.msl +18 -0
- package/color/space/lab2srgb.wgsl +13 -0
- package/color/space/lab2xyz.glsl +23 -10
- package/color/space/lab2xyz.hlsl +27 -11
- package/color/space/lab2xyz.msl +33 -0
- package/color/space/lab2xyz.wgsl +11 -3
- package/color/space/lch2lab.glsl +20 -0
- package/color/space/lch2lab.hlsl +20 -0
- package/color/space/lch2lab.msl +20 -0
- package/color/space/lch2lab.wgsl +15 -0
- package/color/space/lch2rgb.glsl +16 -0
- package/color/space/lch2rgb.hlsl +16 -0
- package/color/space/lch2rgb.msl +16 -0
- package/color/space/lch2rgb.wgsl +13 -0
- package/color/space/lch2srgb.glsl +16 -0
- package/color/space/lch2srgb.msl +16 -0
- package/color/space/linear2gamma.glsl +10 -7
- package/color/space/linear2gamma.hlsl +5 -2
- package/color/space/linear2gamma.msl +37 -0
- package/color/space/linear2gamma.wgsl +10 -2
- package/color/space/lms2rgb.glsl +24 -22
- package/color/space/lms2rgb.hlsl +24 -20
- package/color/space/lms2rgb.msl +31 -0
- package/color/space/lms2rgb.wgsl +21 -13
- package/color/space/oklab2rgb.glsl +22 -18
- package/color/space/oklab2rgb.hlsl +21 -17
- package/color/space/oklab2rgb.msl +29 -0
- package/color/space/oklab2rgb.wgsl +18 -9
- package/color/space/oklab2srgb.glsl +16 -0
- package/color/space/oklab2srgb.hlsl +16 -0
- package/color/space/oklab2srgb.msl +16 -0
- package/color/space/oklab2srgb.wgsl +12 -0
- package/color/space/rgb2YCbCr.glsl +10 -7
- package/color/space/rgb2YCbCr.hlsl +5 -2
- package/color/space/rgb2YCbCr.msl +22 -0
- package/color/space/rgb2YCbCr.wgsl +13 -5
- package/color/space/rgb2YPbPr.glsl +18 -18
- package/color/space/rgb2YPbPr.hlsl +15 -15
- package/color/space/rgb2YPbPr.msl +31 -0
- package/color/space/rgb2YPbPr.wgsl +17 -11
- package/color/space/rgb2cmyk.glsl +6 -3
- package/color/space/rgb2cmyk.hlsl +5 -2
- package/color/space/rgb2cmyk.msl +22 -0
- package/color/space/rgb2cmyk.wgsl +10 -2
- package/color/space/rgb2hcv.glsl +24 -0
- package/color/space/rgb2hcv.hlsl +24 -0
- package/color/space/rgb2hcv.msl +24 -0
- package/color/space/rgb2hcv.wgsl +15 -0
- package/color/space/rgb2hcy.glsl +34 -0
- package/color/space/rgb2hcy.hlsl +33 -0
- package/color/space/rgb2hcy.msl +34 -0
- package/color/space/rgb2hcy.wgsl +29 -0
- package/color/space/rgb2heat.glsl +6 -6
- package/color/space/rgb2heat.hlsl +5 -5
- package/color/space/rgb2heat.msl +16 -0
- package/color/space/rgb2heat.wgsl +10 -3
- package/color/space/rgb2hsl.glsl +25 -0
- package/color/space/rgb2hsl.hlsl +25 -0
- package/color/space/rgb2hsl.msl +25 -0
- package/color/space/rgb2hsl.wgsl +17 -0
- package/color/space/rgb2hsv.glsl +11 -18
- package/color/space/rgb2hsv.hlsl +4 -14
- package/color/space/rgb2hsv.msl +23 -0
- package/color/space/rgb2hsv.wgsl +9 -11
- package/color/space/rgb2hue.glsl +15 -16
- package/color/space/rgb2hue.hlsl +11 -15
- package/color/space/rgb2hue.msl +27 -0
- package/color/space/rgb2hue.wgsl +15 -3
- package/color/space/rgb2lab.glsl +7 -10
- package/color/space/rgb2lab.hlsl +6 -9
- package/color/space/rgb2lab.msl +17 -0
- package/color/space/rgb2lab.wgsl +10 -6
- package/color/space/rgb2lch.glsl +17 -0
- package/color/space/rgb2lch.hlsl +17 -0
- package/color/space/rgb2lch.msl +17 -0
- package/color/space/rgb2lch.wgsl +13 -0
- package/color/space/rgb2lms.glsl +24 -20
- package/color/space/rgb2lms.hlsl +24 -20
- package/color/space/rgb2lms.msl +31 -0
- package/color/space/rgb2lms.wgsl +22 -13
- package/color/space/rgb2luma.glsl +8 -10
- package/color/space/rgb2luma.hlsl +8 -10
- package/color/space/rgb2luma.msl +14 -0
- package/color/space/rgb2luma.wgsl +9 -3
- package/color/space/rgb2oklab.glsl +23 -19
- package/color/space/rgb2oklab.hlsl +23 -19
- package/color/space/rgb2oklab.msl +31 -0
- package/color/space/rgb2oklab.wgsl +19 -10
- package/color/space/rgb2ryb.glsl +88 -0
- package/color/space/rgb2ryb.hlsl +88 -0
- package/color/space/rgb2ryb.msl +88 -0
- package/color/space/rgb2ryb.wgsl +32 -0
- package/color/space/rgb2srgb.glsl +12 -18
- package/color/space/rgb2srgb.hlsl +14 -18
- package/color/space/rgb2srgb.msl +23 -0
- package/color/space/rgb2srgb.wgsl +14 -4
- package/color/space/rgb2xyY.glsl +17 -0
- package/color/space/rgb2xyY.hlsl +17 -0
- package/color/space/rgb2xyY.msl +17 -0
- package/color/space/rgb2xyY.wgsl +12 -0
- package/color/space/rgb2xyz.glsl +23 -16
- package/color/space/rgb2xyz.hlsl +23 -16
- package/color/space/rgb2xyz.msl +29 -0
- package/color/space/rgb2xyz.wgsl +22 -0
- package/color/space/rgb2yiq.glsl +15 -16
- package/color/space/rgb2yiq.hlsl +14 -19
- package/color/space/rgb2yiq.msl +22 -0
- package/color/space/rgb2yiq.wgsl +13 -6
- package/color/space/rgb2yuv.glsl +20 -20
- package/color/space/rgb2yuv.hlsl +20 -20
- package/color/space/rgb2yuv.msl +31 -0
- package/color/space/rgb2yuv.wgsl +18 -10
- package/color/space/ryb2rgb.glsl +79 -0
- package/color/space/ryb2rgb.hlsl +79 -0
- package/color/space/ryb2rgb.msl +79 -0
- package/color/space/ryb2rgb.wgsl +30 -0
- package/color/space/srgb2lab.glsl +17 -0
- package/color/space/srgb2lab.hlsl +17 -0
- package/color/space/srgb2lab.msl +17 -0
- package/color/space/srgb2lab.wgsl +14 -0
- package/color/space/srgb2lch.glsl +17 -0
- package/color/space/srgb2lch.hlsl +17 -0
- package/color/space/srgb2lch.msl +17 -0
- package/color/space/srgb2lch.wgsl +13 -0
- package/color/space/srgb2luma.glsl +14 -0
- package/color/space/srgb2luma.hlsl +14 -0
- package/color/space/srgb2luma.msl +14 -0
- package/color/space/srgb2luma.wgsl +9 -0
- package/color/space/srgb2oklab.glsl +17 -0
- package/color/space/srgb2oklab.hlsl +16 -0
- package/color/space/srgb2oklab.msl +17 -0
- package/color/space/srgb2oklab.wgsl +12 -0
- package/color/space/srgb2rgb.glsl +12 -20
- package/color/space/srgb2rgb.hlsl +12 -18
- package/color/space/srgb2rgb.msl +23 -0
- package/color/space/srgb2rgb.wgsl +18 -8
- package/color/space/srgb2xyz.glsl +17 -0
- package/color/space/srgb2xyz.hlsl +17 -0
- package/color/space/srgb2xyz.msl +17 -0
- package/color/space/srgb2xyz.wgsl +13 -0
- package/color/space/w2rgb.glsl +8 -5
- package/color/space/w2rgb.hlsl +42 -11
- package/color/space/w2rgb.msl +53 -0
- package/color/space/xyY2rgb.glsl +17 -0
- package/color/space/xyY2rgb.hlsl +17 -0
- package/color/space/xyY2rgb.msl +17 -0
- package/color/space/xyY2rgb.wgsl +13 -0
- package/color/space/xyY2srgb.glsl +17 -0
- package/color/space/xyY2srgb.hlsl +17 -0
- package/color/space/xyY2srgb.msl +17 -0
- package/color/space/xyY2srgb.wgsl +13 -0
- package/color/space/xyY2xyz.glsl +20 -0
- package/color/space/xyY2xyz.hlsl +20 -0
- package/color/space/xyY2xyz.msl +20 -0
- package/color/space/xyY2xyz.wgsl +15 -0
- package/color/space/xyz2lab.glsl +6 -3
- package/color/space/xyz2lab.hlsl +4 -1
- package/color/space/xyz2lab.msl +23 -0
- package/color/space/xyz2lab.wgsl +13 -5
- package/color/space/xyz2rgb.glsl +25 -17
- package/color/space/xyz2rgb.hlsl +25 -17
- package/color/space/xyz2rgb.msl +32 -0
- package/color/space/xyz2rgb.wgsl +12 -10
- package/color/space/xyz2srgb.glsl +10 -18
- package/color/space/xyz2srgb.hlsl +10 -18
- package/color/space/xyz2srgb.msl +17 -0
- package/color/space/xyz2srgb.wgsl +11 -8
- package/color/space/xyz2xyY.glsl +20 -0
- package/color/space/xyz2xyY.hlsl +20 -0
- package/color/space/xyz2xyY.msl +20 -0
- package/color/space/xyz2xyY.wgsl +15 -0
- package/color/space/yiq2rgb.glsl +14 -16
- package/color/space/yiq2rgb.hlsl +14 -18
- package/color/space/yiq2rgb.msl +21 -0
- package/color/space/yiq2rgb.wgsl +12 -7
- package/color/space/yuv2rgb.glsl +20 -20
- package/color/space/yuv2rgb.hlsl +20 -20
- package/color/space/yuv2rgb.msl +31 -0
- package/color/space/yuv2rgb.wgsl +17 -12
- package/color/space.glsl +45 -15
- package/color/space.msl +57 -0
- package/color/tonemap/aces.glsl +5 -5
- package/color/tonemap/aces.hlsl +1 -1
- package/color/tonemap/aces.wgsl +19 -0
- package/color/tonemap/debug.glsl +3 -4
- package/color/tonemap/debug.hlsl +1 -1
- package/color/tonemap/filmic.glsl +5 -9
- package/color/tonemap/filmic.hlsl +1 -1
- package/color/tonemap/filmic.wgsl +17 -0
- package/color/tonemap/linear.glsl +4 -4
- package/color/tonemap/linear.hlsl +2 -2
- package/color/tonemap/reinhard.glsl +3 -5
- package/color/tonemap/reinhard.hlsl +1 -1
- package/color/tonemap/reinhardJodie.glsl +2 -5
- package/color/tonemap/reinhardJodie.hlsl +1 -1
- package/color/tonemap/uncharted.glsl +2 -2
- package/color/tonemap/uncharted.hlsl +2 -2
- package/color/tonemap/uncharted.wgsl +25 -0
- package/color/tonemap/uncharted2.glsl +3 -3
- package/color/tonemap/uncharted2.hlsl +1 -1
- package/color/tonemap/uncharted2.wgsl +21 -0
- package/color/tonemap/unreal.glsl +1 -1
- package/color/tonemap/unreal.hlsl +1 -1
- package/color/tonemap.glsl +10 -5
- package/color/tonemap.hlsl +7 -2
- package/color/tonemap.msl +46 -0
- package/color/vibrance.glsl +10 -10
- package/color/vibrance.hlsl +8 -6
- package/color/vibrance.msl +25 -0
- package/color/vibrance.wgsl +14 -3
- package/color/whiteBalance.glsl +25 -15
- package/color/whiteBalance.hlsl +19 -9
- package/color/whiteBalance.msl +83 -0
- package/color/whiteBalance.wgsl +64 -0
- package/distort/barrel.glsl +22 -19
- package/distort/barrel.hlsl +10 -7
- package/distort/barrel.msl +75 -0
- package/distort/chromaAB.glsl +18 -12
- package/distort/chromaAB.hlsl +16 -11
- package/distort/chromaAB.msl +79 -0
- package/distort/grain.glsl +13 -12
- package/distort/grain.hlsl +9 -8
- package/distort/grain.msl +81 -0
- package/distort/pincushion.glsl +53 -0
- package/distort/pincushion.msl +53 -0
- package/distort/stretch.glsl +10 -5
- package/distort/stretch.hlsl +12 -7
- package/distort/stretch.msl +68 -0
- package/draw/arrows.glsl +2 -4
- package/draw/arrows.msl +106 -0
- package/draw/axis.glsl +43 -0
- package/draw/axis.hlsl +43 -0
- package/draw/bridge.glsl +5 -2
- package/draw/bridge.hlsl +5 -2
- package/draw/bridge.msl +34 -0
- package/draw/circle.glsl +6 -3
- package/draw/circle.hlsl +5 -2
- package/draw/circle.msl +25 -0
- package/draw/colorChecker.glsl +136 -0
- package/draw/colorChecker.msl +136 -0
- package/draw/colorPicker.glsl +65 -0
- package/draw/colorPicker.hlsl +65 -0
- package/draw/colorPicker.msl +65 -0
- package/draw/digits.glsl +82 -5
- package/draw/digits.hlsl +85 -7
- package/draw/digits.msl +205 -0
- package/draw/fill.glsl +8 -3
- package/draw/fill.hlsl +6 -3
- package/draw/fill.msl +23 -0
- package/draw/flip.glsl +4 -1
- package/draw/flip.hlsl +5 -2
- package/draw/flip.msl +23 -0
- package/draw/hex.glsl +5 -2
- package/draw/hex.hlsl +5 -2
- package/draw/hex.msl +25 -0
- package/draw/line.glsl +21 -0
- package/draw/line.hlsl +21 -0
- package/draw/matrix.glsl +43 -0
- package/draw/matrix.hlsl +43 -0
- package/draw/matrix.msl +43 -0
- package/draw/point.glsl +59 -0
- package/draw/point.hlsl +59 -0
- package/draw/point.msl +59 -0
- package/draw/rect.glsl +5 -2
- package/draw/rect.hlsl +5 -2
- package/draw/rect.msl +35 -0
- package/draw/stroke.glsl +6 -3
- package/draw/stroke.hlsl +6 -3
- package/draw/stroke.msl +26 -0
- package/draw/stroke.wgsl +9 -0
- package/draw/tri.glsl +5 -2
- package/draw/tri.hlsl +5 -2
- package/draw/tri.msl +25 -0
- package/filter/bilateral.glsl +6 -12
- package/filter/bilateral.hlsl +13 -23
- package/filter/bilinear.glsl +45 -0
- package/filter/boxBlur/1D.glsl +8 -5
- package/filter/boxBlur/1D.hlsl +8 -5
- package/filter/boxBlur/1D.msl +63 -0
- package/filter/boxBlur/2D.glsl +8 -5
- package/filter/boxBlur/2D.hlsl +8 -5
- package/filter/boxBlur/2D.msl +75 -0
- package/filter/boxBlur/2D_fast9.glsl +8 -5
- package/filter/boxBlur/2D_fast9.hlsl +8 -5
- package/filter/boxBlur/2D_fast9.msl +48 -0
- package/filter/boxBlur.glsl +15 -9
- package/filter/boxBlur.hlsl +12 -9
- package/filter/boxBlur.msl +78 -0
- package/filter/edge/prewitt.glsl +3 -3
- package/filter/edge/prewitt.hlsl +4 -4
- package/filter/edge/prewitt.wgsl +20 -8
- package/filter/edge/sobel.glsl +3 -3
- package/filter/edge/sobel.hlsl +4 -4
- package/filter/edge/sobelDirectional.glsl +3 -3
- package/filter/edge/sobelDirectional.hlsl +4 -4
- package/filter/edge.glsl +8 -4
- package/filter/edge.hlsl +7 -4
- package/filter/fibonacciBokeh.glsl +25 -10
- package/filter/gaussianBlur/1D.glsl +12 -8
- package/filter/gaussianBlur/1D.hlsl +10 -7
- package/filter/gaussianBlur/1D.msl +76 -0
- package/filter/gaussianBlur/1D_fast13.glsl +4 -4
- package/filter/gaussianBlur/1D_fast13.hlsl +5 -5
- package/filter/gaussianBlur/1D_fast13.msl +46 -0
- package/filter/gaussianBlur/1D_fast5.glsl +4 -4
- package/filter/gaussianBlur/1D_fast5.hlsl +5 -5
- package/filter/gaussianBlur/1D_fast5.msl +39 -0
- package/filter/gaussianBlur/1D_fast9.glsl +4 -4
- package/filter/gaussianBlur/1D_fast9.hlsl +5 -5
- package/filter/gaussianBlur/1D_fast9.msl +42 -0
- package/filter/gaussianBlur/2D.glsl +16 -13
- package/filter/gaussianBlur/2D.hlsl +8 -5
- package/filter/gaussianBlur/2D.msl +77 -0
- package/filter/gaussianBlur.glsl +15 -10
- package/filter/gaussianBlur.hlsl +15 -10
- package/filter/gaussianBlur.msl +75 -0
- package/filter/jointBilateral.glsl +10 -16
- package/filter/kuwahara.glsl +26 -28
- package/filter/kuwahara.hlsl +16 -15
- package/filter/laplacian.glsl +15 -12
- package/filter/laplacian.hlsl +18 -15
- package/filter/mean.glsl +6 -6
- package/filter/mean.hlsl +7 -7
- package/filter/median/2D_fast3.glsl +4 -4
- package/filter/median/2D_fast3.hlsl +4 -4
- package/filter/median/2D_fast5.glsl +4 -4
- package/filter/median/2D_fast5.hlsl +5 -5
- package/filter/median.glsl +6 -6
- package/filter/median.hlsl +6 -6
- package/filter/noiseBlur.glsl +11 -6
- package/filter/noiseBlur.hlsl +15 -7
- package/filter/radialBlur.glsl +10 -7
- package/filter/radialBlur.hlsl +10 -7
- package/filter/sharpen/adaptive.glsl +7 -7
- package/filter/sharpen/adaptive.hlsl +7 -7
- package/filter/sharpen/adaptive.wgsl +288 -0
- package/filter/sharpen/contrastAdaptive.glsl +5 -5
- package/filter/sharpen/contrastAdaptive.hlsl +5 -5
- package/filter/sharpen/fast.glsl +7 -7
- package/filter/sharpen/fast.hlsl +8 -8
- package/filter/sharpen/fast.wgsl +32 -0
- package/filter/sharpen.glsl +9 -6
- package/filter/sharpen.hlsl +9 -6
- package/filter/smartDeNoise.glsl +69 -0
- package/generative/cnoise.glsl +1 -1
- package/generative/cnoise.hlsl +1 -1
- package/generative/cnoise.msl +259 -0
- package/generative/cnoise.wgsl +253 -0
- package/generative/curl.glsl +31 -4
- package/generative/curl.hlsl +2 -2
- package/generative/curl.msl +101 -0
- package/generative/fbm.glsl +5 -2
- package/generative/fbm.hlsl +4 -1
- package/generative/fbm.msl +115 -0
- package/generative/gerstnerWave.glsl +5 -2
- package/generative/gerstnerWave.hlsl +5 -2
- package/generative/gerstnerWave.msl +55 -0
- package/generative/gnoise.glsl +11 -2
- package/generative/gnoise.msl +73 -0
- package/generative/noised.glsl +2 -2
- package/generative/noised.hlsl +2 -2
- package/generative/noised.msl +84 -0
- package/generative/noised.wgsl +72 -0
- package/generative/pnoise.glsl +1 -1
- package/generative/pnoise.hlsl +1 -1
- package/generative/pnoise.msl +261 -0
- package/generative/pnoise.wgsl +254 -0
- package/generative/psrdnoise.glsl +63 -64
- package/generative/psrdnoise.hlsl +6 -6
- package/generative/psrdnoise.msl +649 -0
- package/generative/random.glsl +15 -15
- package/generative/random.hlsl +81 -59
- package/generative/random.msl +126 -0
- package/generative/random.wgsl +19 -2
- package/generative/snoise.glsl +1 -1
- package/generative/snoise.hlsl +1 -1
- package/generative/snoise.msl +240 -0
- package/generative/snoise.wgsl +11 -0
- package/generative/srandom.glsl +5 -2
- package/generative/srandom.hlsl +5 -2
- package/generative/srandom.msl +53 -0
- package/generative/srandom.wgsl +60 -0
- package/generative/voronoi.glsl +5 -2
- package/generative/voronoi.hlsl +5 -2
- package/generative/voronoi.msl +45 -0
- package/generative/voronoise.glsl +8 -9
- package/generative/voronoise.hlsl +2 -2
- package/generative/voronoise.msl +77 -0
- package/generative/wavelet.glsl +52 -0
- package/generative/wavelet.msl +50 -0
- package/generative/wavelet.wgsl +51 -0
- package/generative/worley.glsl +78 -22
- package/generative/worley.hlsl +79 -21
- package/generative/worley.msl +52 -0
- package/generative/worley.wgsl +95 -0
- package/geometry/aabb/aabb.cuh +8 -2
- package/geometry/aabb/aabb.glsl +8 -2
- package/geometry/aabb/aabb.hlsl +8 -2
- package/geometry/aabb/centroid.cuh +6 -3
- package/geometry/aabb/centroid.glsl +6 -3
- package/geometry/aabb/centroid.hlsl +6 -3
- package/geometry/aabb/contain.cuh +5 -2
- package/geometry/aabb/contain.glsl +4 -1
- package/geometry/aabb/contain.hlsl +5 -2
- package/geometry/aabb/diagonal.cuh +5 -2
- package/geometry/aabb/diagonal.glsl +5 -2
- package/geometry/aabb/diagonal.hlsl +5 -2
- package/geometry/aabb/expand.cuh +5 -2
- package/geometry/aabb/expand.glsl +6 -3
- package/geometry/aabb/expand.hlsl +5 -2
- package/geometry/aabb/intersect.cuh +3 -3
- package/geometry/aabb/intersect.glsl +4 -3
- package/geometry/aabb/intersect.hlsl +3 -3
- package/geometry/aabb/intersection.cuh +5 -2
- package/geometry/aabb/square.cuh +6 -3
- package/geometry/aabb/square.glsl +6 -3
- package/geometry/aabb/square.hlsl +6 -3
- package/geometry/aabb.glsl +1 -1
- package/geometry/aabb.hlsl +1 -1
- package/geometry/triangle/area.cuh +6 -3
- package/geometry/triangle/area.glsl +6 -3
- package/geometry/triangle/area.hlsl +6 -3
- package/geometry/triangle/barycentric.cuh +6 -3
- package/geometry/triangle/barycentric.glsl +9 -6
- package/geometry/triangle/barycentric.hlsl +6 -3
- package/geometry/triangle/centroid.cuh +6 -3
- package/geometry/triangle/centroid.glsl +7 -4
- package/geometry/triangle/centroid.hlsl +6 -3
- package/geometry/triangle/closestPoint.cuh +2 -2
- package/geometry/triangle/closestPoint.glsl +2 -2
- package/geometry/triangle/closestPoint.hlsl +2 -2
- package/geometry/triangle/contain.cuh +3 -3
- package/geometry/triangle/contain.glsl +3 -3
- package/geometry/triangle/contain.hlsl +3 -3
- package/geometry/triangle/distanceSq.cuh +2 -2
- package/geometry/triangle/distanceSq.glsl +2 -2
- package/geometry/triangle/distanceSq.hlsl +3 -3
- package/geometry/triangle/intersect.cuh +2 -2
- package/geometry/triangle/intersect.glsl +5 -5
- package/geometry/triangle/intersect.hlsl +2 -2
- package/geometry/triangle/normal.cuh +6 -3
- package/geometry/triangle/normal.glsl +6 -3
- package/geometry/triangle/normal.hlsl +6 -3
- package/geometry/triangle/signedDistance.cuh +2 -2
- package/geometry/triangle/signedDistance.glsl +2 -2
- package/geometry/triangle/signedDistance.hlsl +2 -2
- package/geometry/triangle/triangle.cuh +8 -2
- package/geometry/triangle/triangle.glsl +8 -2
- package/geometry/triangle/triangle.hlsl +8 -2
- package/lighting/atmosphere.glsl +147 -109
- package/lighting/atmosphere.hlsl +154 -109
- package/lighting/blackbody.glsl +5 -2
- package/lighting/blackbody.hlsl +15 -0
- package/lighting/camera.cuh +4 -3
- package/lighting/camera.glsl +21 -0
- package/lighting/camera.hlsl +21 -0
- package/lighting/common/beckmann.glsl +0 -4
- package/lighting/common/envBRDFApprox.glsl +11 -11
- package/lighting/common/envBRDFApprox.hlsl +15 -5
- package/lighting/common/ggx.glsl +11 -2
- package/lighting/common/ggx.hlsl +11 -2
- package/lighting/common/ggx.wgsl +11 -0
- package/lighting/common/gtaoMultiBounce.glsl +1 -1
- package/lighting/common/gtaoMultiBounce.hlsl +1 -1
- package/lighting/common/henyeyGreenstein.glsl +1 -1
- package/lighting/common/henyeyGreenstein.hlsl +1 -1
- package/lighting/common/penner.glsl +28 -0
- package/lighting/common/perceptual2linearRoughness.glsl +20 -0
- package/lighting/common/perceptual2linearRoughness.hlsl +20 -0
- package/lighting/common/preFilteredImportanceSampling.glsl +11 -0
- package/lighting/common/preFilteredImportanceSampling.hlsl +11 -0
- package/lighting/common/schlick.wgsl +3 -0
- package/lighting/common/specularAO.glsl +6 -2
- package/lighting/common/specularAO.hlsl +6 -2
- package/lighting/debugCube.glsl +2 -2
- package/lighting/debugCube.hlsl +2 -2
- package/lighting/diffuse/burley.glsl +10 -16
- package/lighting/diffuse/burley.hlsl +9 -15
- package/lighting/diffuse/lambert.glsl +14 -6
- package/lighting/diffuse/lambert.hlsl +14 -6
- package/lighting/diffuse/orenNayar.glsl +9 -8
- package/lighting/diffuse/orenNayar.hlsl +8 -7
- package/lighting/diffuse/orenNayar.wgsl +20 -0
- package/lighting/diffuse.glsl +7 -4
- package/lighting/diffuse.hlsl +11 -5
- package/lighting/envMap.glsl +40 -16
- package/lighting/envMap.hlsl +34 -13
- package/lighting/exposure.glsl +16 -0
- package/lighting/exposure.hlsl +16 -0
- package/lighting/fakeCube.glsl +15 -15
- package/lighting/fakeCube.hlsl +5 -2
- package/lighting/fresnel.glsl +19 -4
- package/lighting/fresnel.hlsl +30 -20
- package/lighting/fresnel.wgsl +13 -0
- package/lighting/fresnelReflection.glsl +73 -35
- package/lighting/fresnelReflection.hlsl +93 -20
- package/lighting/fresnelReflection.wgsl +26 -0
- package/lighting/gooch.glsl +56 -34
- package/lighting/gooch.hlsl +60 -29
- package/lighting/ior/2eta.glsl +5 -2
- package/lighting/ior/2eta.hlsl +5 -2
- package/lighting/ior/2f0.glsl +5 -2
- package/lighting/ior/2f0.hlsl +5 -2
- package/lighting/ior/reflectance2f0.glsl +11 -0
- package/lighting/ior/reflectance2f0.hlsl +11 -0
- package/lighting/ior.glsl +7 -2
- package/lighting/ior.hlsl +7 -1
- package/lighting/iridescence.glsl +10 -16
- package/lighting/iridescence.hlsl +14 -17
- package/lighting/light/attenuation.glsl +34 -0
- package/lighting/light/attenuation.hlsl +34 -0
- package/lighting/light/directional.glsl +12 -39
- package/lighting/light/directional.hlsl +12 -54
- package/lighting/light/directionalEvaluate.glsl +52 -0
- package/lighting/light/directionalEvaluate.hlsl +52 -0
- package/lighting/light/falloff.glsl +16 -4
- package/lighting/light/falloff.hlsl +15 -3
- package/lighting/light/iblEvaluate.glsl +73 -0
- package/lighting/light/iblEvaluate.hlsl +68 -0
- package/lighting/light/new.glsl +77 -0
- package/lighting/light/new.hlsl +77 -0
- package/lighting/light/point.glsl +13 -61
- package/lighting/light/point.hlsl +13 -70
- package/lighting/light/pointEvaluate.glsl +60 -0
- package/lighting/light/pointEvaluate.hlsl +60 -0
- package/lighting/light/resolve.glsl +19 -0
- package/lighting/light/resolve.hlsl +19 -0
- package/lighting/light/spot.glsl +5 -2
- package/lighting/light/spot.hlsl +5 -2
- package/lighting/material/add.glsl +47 -0
- package/lighting/material/add.hlsl +48 -0
- package/lighting/material/albedo.glsl +8 -5
- package/lighting/material/albedo.hlsl +10 -7
- package/lighting/material/emissive.glsl +7 -4
- package/lighting/material/emissive.hlsl +9 -6
- package/lighting/material/metallic.glsl +9 -6
- package/lighting/material/metallic.hlsl +13 -9
- package/lighting/material/multiply.glsl +42 -0
- package/lighting/material/multiply.hlsl +42 -0
- package/lighting/material/new.glsl +76 -47
- package/lighting/material/new.hlsl +78 -44
- package/lighting/material/normal.glsl +9 -5
- package/lighting/material/normal.hlsl +9 -6
- package/lighting/material/occlusion.glsl +8 -5
- package/lighting/material/occlusion.hlsl +9 -6
- package/lighting/material/roughness.glsl +9 -6
- package/lighting/material/roughness.hlsl +10 -7
- package/lighting/material/shininess.glsl +7 -6
- package/lighting/material/shininess.hlsl +6 -3
- package/lighting/material/specular.glsl +7 -4
- package/lighting/material/specular.hlsl +8 -5
- package/lighting/material/zero.glsl +69 -0
- package/lighting/material/zero.hlsl +69 -0
- package/lighting/material.glsl +26 -24
- package/lighting/material.hlsl +40 -35
- package/lighting/medium/new.glsl +41 -0
- package/lighting/medium/new.hlsl +41 -0
- package/lighting/medium.glsl +16 -0
- package/lighting/medium.hlsl +16 -0
- package/lighting/pbr.glsl +58 -77
- package/lighting/pbr.hlsl +63 -96
- package/lighting/pbrClearCoat.glsl +92 -105
- package/lighting/pbrClearCoat.hlsl +101 -124
- package/lighting/pbrGlass.glsl +75 -49
- package/lighting/pbrGlass.hlsl +76 -67
- package/lighting/pbrLittle.glsl +49 -50
- package/lighting/pbrLittle.hlsl +49 -54
- package/lighting/ray/cast.glsl +5 -2
- package/lighting/ray/direction.glsl +7 -4
- package/lighting/ray/new.glsl +6 -3
- package/lighting/ray.cuh +4 -3
- package/lighting/ray.glsl +4 -1
- package/lighting/ray.hlsl +4 -3
- package/lighting/raymarch/ao.cuh +4 -4
- package/lighting/raymarch/ao.glsl +26 -19
- package/lighting/raymarch/ao.hlsl +28 -19
- package/lighting/raymarch/cast.cuh +4 -4
- package/lighting/raymarch/cast.glsl +19 -42
- package/lighting/raymarch/cast.hlsl +26 -38
- package/lighting/raymarch/cast.wgsl +20 -0
- package/lighting/raymarch/fog.glsl +71 -0
- package/lighting/raymarch/fog.hlsl +75 -0
- package/lighting/raymarch/glass.glsl +302 -0
- package/lighting/raymarch/glass.hlsl +300 -0
- package/lighting/raymarch/map.cuh +2 -2
- package/lighting/raymarch/map.glsl +12 -16
- package/lighting/raymarch/map.hlsl +13 -17
- package/lighting/raymarch/normal.cuh +4 -4
- package/lighting/raymarch/normal.glsl +15 -19
- package/lighting/raymarch/normal.hlsl +16 -20
- package/lighting/raymarch/normal.wgsl +21 -0
- package/lighting/raymarch/render.glsl +44 -37
- package/lighting/raymarch/render.hlsl +47 -38
- package/lighting/raymarch/shading.glsl +83 -0
- package/lighting/raymarch/shading.hlsl +80 -0
- package/lighting/raymarch/softShadow.cuh +4 -4
- package/lighting/raymarch/softShadow.glsl +38 -32
- package/lighting/raymarch/softShadow.hlsl +34 -29
- package/lighting/raymarch/volume.glsl +104 -72
- package/lighting/raymarch/volume.hlsl +106 -72
- package/lighting/raymarch.glsl +117 -38
- package/lighting/raymarch.hlsl +120 -35
- package/lighting/reflection.glsl +14 -1
- package/lighting/reflection.hlsl +14 -1
- package/lighting/shadingData/new.glsl +55 -0
- package/lighting/shadingData/new.hlsl +55 -0
- package/lighting/shadingData/shadingData.glsl +34 -0
- package/lighting/shadingData/shadingData.hlsl +34 -0
- package/lighting/shadow.glsl +8 -5
- package/lighting/shadow.hlsl +8 -5
- package/lighting/specular/beckmann.glsl +2 -11
- package/lighting/specular/beckmann.hlsl +2 -11
- package/lighting/specular/blinnPhong.glsl +6 -12
- package/lighting/specular/blinnPhong.hlsl +6 -12
- package/lighting/specular/cookTorrance.glsl +15 -42
- package/lighting/specular/cookTorrance.hlsl +16 -41
- package/lighting/specular/cookTorrance.wgsl +22 -0
- package/lighting/specular/gaussian.glsl +4 -9
- package/lighting/specular/gaussian.hlsl +4 -9
- package/lighting/specular/importanceSampling.glsl +69 -0
- package/lighting/specular/importanceSampling.hlsl +75 -0
- package/lighting/specular/phong.glsl +4 -8
- package/lighting/specular/phong.hlsl +5 -9
- package/lighting/specular.glsl +10 -9
- package/lighting/specular.hlsl +9 -9
- package/lighting/sphereMap.glsl +11 -8
- package/lighting/sphereMap.hlsl +9 -6
- package/lighting/sphericalHarmonics.glsl +22 -17
- package/lighting/sphericalHarmonics.hlsl +7 -4
- package/lighting/ssao.glsl +27 -16
- package/lighting/ssr.glsl +11 -8
- package/lighting/toMetallic.glsl +5 -2
- package/lighting/toMetallic.hlsl +5 -2
- package/lighting/toShininess.glsl +5 -4
- package/lighting/toShininess.hlsl +5 -2
- package/lighting/toShininess.wgsl +14 -0
- package/lighting/transparent.glsl +99 -0
- package/lighting/transparent.hlsl +99 -0
- package/lighting/volumetricLightScattering.glsl +8 -5
- package/lighting/wavelength.glsl +5 -2
- package/lighting/wavelength.hlsl +15 -0
- package/math/aafloor.glsl +39 -0
- package/math/aafloor.hlsl +28 -0
- package/math/aafloor.msl +34 -0
- package/math/aafloor.wgsl +18 -0
- package/math/aafract.glsl +40 -0
- package/math/aafract.hlsl +30 -0
- package/math/aafract.msl +33 -0
- package/math/aafract.wgsl +17 -0
- package/math/aamirror.glsl +24 -0
- package/math/aamirror.hlsl +24 -0
- package/{draw → math}/aastep.glsl +1 -1
- package/{draw → math}/aastep.hlsl +1 -1
- package/math/aastep.msl +23 -0
- package/math/aastep.wgsl +9 -0
- package/math/abs.cuh +8 -3
- package/math/absi.glsl +4 -1
- package/math/absi.msl +13 -0
- package/math/adaptiveThreshold.cuh +1 -1
- package/math/adaptiveThreshold.glsl +6 -6
- package/math/adaptiveThreshold.hlsl +1 -1
- package/math/adaptiveThreshold.msl +16 -0
- package/math/adaptiveThreshold.wgsl +6 -0
- package/math/asin.cuh +8 -5
- package/math/atan2.glsl +15 -0
- package/math/atan2.msl +15 -0
- package/math/bump.cuh +5 -2
- package/math/bump.glsl +5 -2
- package/math/bump.hlsl +5 -2
- package/math/bump.msl +22 -0
- package/math/bump.wgsl +12 -0
- package/math/clamp.cuh +14 -4
- package/math/const.cuh +5 -2
- package/math/const.glsl +21 -2
- package/math/const.hlsl +24 -2
- package/math/const.msl +55 -0
- package/math/const.wgsl +12 -1
- package/math/cross.cuh +8 -4
- package/math/cubic.cuh +1 -1
- package/math/cubic.glsl +19 -17
- package/math/cubic.hlsl +1 -2
- package/math/cubic.msl +51 -0
- package/math/cubic.wgsl +9 -0
- package/math/cubicMix.glsl +20 -0
- package/math/cubicMix.hlsl +20 -0
- package/math/cubicMix.msl +20 -0
- package/math/cubicMix.wgsl +14 -0
- package/math/decimate.cuh +6 -5
- package/math/decimate.glsl +15 -6
- package/math/decimate.hlsl +13 -6
- package/math/decimate.msl +21 -0
- package/math/decimate.wgsl +12 -0
- package/math/dist.glsl +44 -0
- package/math/dist.hlsl +64 -0
- package/math/dist.wgsl +34 -0
- package/math/dot.cuh +8 -5
- package/math/equal.msl +17 -0
- package/math/fcos.glsl +17 -0
- package/math/fcos.hlsl +17 -0
- package/math/floor.cuh +8 -5
- package/math/frac.cuh +8 -5
- package/math/frac.glsl +8 -5
- package/math/frac.msl +13 -0
- package/math/fract.cuh +8 -5
- package/math/fract.hlsl +13 -0
- package/math/gain.cuh +1 -3
- package/math/gain.glsl +2 -4
- package/math/gain.hlsl +1 -3
- package/math/gain.msl +16 -0
- package/math/gain.wgsl +10 -0
- package/math/gaussian.cuh +4 -3
- package/math/gaussian.glsl +8 -7
- package/math/gaussian.hlsl +11 -8
- package/math/gaussian.msl +18 -0
- package/math/gaussian.msl 2 +18 -0
- package/math/gaussian.wgsl +11 -14
- package/math/grad4.cuh +2 -2
- package/math/grad4.glsl +1 -3
- package/math/grad4.hlsl +3 -3
- package/math/grad4.msl +20 -0
- package/math/grad4.wgsl +6 -3
- package/math/greaterThan.cuh +3 -5
- package/math/greaterThan.hlsl +1 -4
- package/math/greaterThan.msl +17 -0
- package/math/greaterThanEqual.msl +17 -0
- package/math/hammersley.glsl +32 -0
- package/math/hammersley.hlsl +32 -0
- package/math/highPass.cuh +5 -4
- package/math/highPass.glsl +6 -5
- package/math/highPass.hlsl +5 -4
- package/math/highPass.msl +13 -0
- package/math/highPass.wgsl +9 -0
- package/math/inside.glsl +39 -0
- package/math/inside.hlsl +39 -0
- package/math/inside.msl +39 -0
- package/math/inside.wgsl +22 -0
- package/math/invCubic.cuh +1 -3
- package/math/invCubic.glsl +3 -3
- package/math/invCubic.hlsl +1 -3
- package/math/invCubic.msl +15 -0
- package/math/invCubic.wgsl +9 -0
- package/math/invQuartic.cuh +1 -3
- package/math/invQuartic.glsl +3 -3
- package/math/invQuartic.hlsl +1 -3
- package/math/invQuartic.msl +15 -0
- package/math/invQuartic.wgsl +9 -0
- package/math/inverse.glsl +3 -3
- package/math/inverse.msl +74 -0
- package/math/inverse.wgsl +28 -0
- package/math/length.cuh +8 -3
- package/math/lengthSq.cuh +5 -2
- package/math/lengthSq.glsl +5 -2
- package/math/lengthSq.hlsl +5 -2
- package/math/lengthSq.msl +17 -0
- package/math/lengthSq.wgsl +11 -0
- package/math/lerp.cuh +4 -1
- package/math/lerp.glsl +5 -2
- package/math/lerp.msl +13 -0
- package/math/lessThan.msl +17 -0
- package/math/lessThanEqual.msl +17 -0
- package/math/map.cuh +9 -6
- package/math/map.glsl +17 -38
- package/math/map.hlsl +13 -21
- package/math/map.msl +23 -0
- package/math/map.wgsl +13 -0
- package/math/max.cuh +8 -3
- package/math/min.cuh +8 -3
- package/math/mirror.cuh +2 -2
- package/math/mirror.glsl +7 -5
- package/math/mirror.hlsl +2 -2
- package/math/mirror.msl +24 -0
- package/math/mirror.wgsl +6 -1
- package/math/mix.cuh +5 -2
- package/math/mix.hlsl +32 -132
- package/math/mmax.cuh +7 -4
- package/math/mmax.glsl +7 -4
- package/math/mmax.hlsl +7 -4
- package/math/mmax.msl +22 -0
- package/math/mmax.wgsl +11 -0
- package/math/mmin .wgsl +11 -0
- package/math/mmin.cuh +7 -4
- package/math/mmin.glsl +7 -4
- package/math/mmin.hlsl +7 -4
- package/math/mmin.msl +24 -0
- package/math/mmix.glsl +5 -2
- package/math/mmix.msl +167 -0
- package/math/mod.cuh +11 -3
- package/math/mod.hlsl +6 -4
- package/math/mod.msl +26 -0
- package/math/mod.wgsl +11 -0
- package/math/mod2.glsl +22 -0
- package/math/mod2.hlsl +24 -0
- package/math/mod2.msl +22 -0
- package/math/mod289.cuh +2 -2
- package/math/mod289.glsl +2 -2
- package/math/mod289.hlsl +3 -3
- package/math/mod289.msl +15 -0
- package/math/mod289.wgsl +6 -1
- package/math/normalize.cuh +8 -3
- package/math/notEqual.msl +17 -0
- package/math/nyquist.glsl +27 -0
- package/math/nyquist.hlsl +27 -0
- package/math/operations.cuh +8 -0
- package/math/pack.glsl +26 -0
- package/math/pack.hlsl +26 -0
- package/math/pack.msl +26 -0
- package/math/pack.wgsl +17 -0
- package/math/parabola.cuh +1 -1
- package/math/parabola.glsl +1 -3
- package/math/parabola.hlsl +1 -3
- package/math/parabola.msl +13 -0
- package/math/parabola.wgsl +7 -0
- package/math/permute.cuh +2 -2
- package/math/permute.glsl +8 -6
- package/math/permute.hlsl +2 -2
- package/math/permute.msl +19 -0
- package/math/permute.wgsl +6 -1
- package/math/pow.cuh +4 -1
- package/math/pow2.cuh +5 -2
- package/math/pow2.glsl +9 -6
- package/math/pow2.hlsl +5 -2
- package/math/pow2.msl +18 -0
- package/math/pow3.cuh +5 -2
- package/math/pow3.glsl +9 -6
- package/math/pow3.hlsl +5 -2
- package/math/pow3.msl +18 -0
- package/math/pow5.cuh +5 -2
- package/math/pow5.glsl +17 -14
- package/math/pow5.hlsl +5 -2
- package/math/pow5.msl +33 -0
- package/math/pow7.cuh +5 -2
- package/math/pow7.glsl +9 -6
- package/math/pow7.hlsl +5 -2
- package/math/pow7.msl +18 -0
- package/math/powFast.cuh +5 -2
- package/math/powFast.glsl +5 -2
- package/math/powFast.hlsl +5 -2
- package/math/powFast.msl +15 -0
- package/math/powFast.wgsl +12 -0
- package/math/quartic.cuh +1 -1
- package/math/quartic.glsl +3 -1
- package/math/quartic.hlsl +1 -1
- package/math/quartic.msl +17 -0
- package/math/quartic.wgsl +9 -0
- package/math/quat/2mat3.glsl +32 -0
- package/math/quat/2mat3.hlsl +32 -0
- package/math/quat/2mat3.msl +32 -0
- package/math/quat/2mat3.wgsl +26 -0
- package/math/quat/2mat4.glsl +18 -0
- package/math/quat/2mat4.hlsl +18 -0
- package/math/quat/2mat4.msl +18 -0
- package/math/quat/2mat4.wgsl +13 -0
- package/math/quat/add.glsl +15 -0
- package/math/quat/add.hlsl +15 -0
- package/math/quat/add.msl +15 -0
- package/math/quat/add.wgsl +10 -0
- package/math/quat/conj.glsl +15 -0
- package/math/quat/conj.hlsl +15 -0
- package/math/quat/conj.msl +15 -0
- package/math/quat/conj.wgsl +10 -0
- package/math/quat/div.glsl +15 -0
- package/math/quat/div.hlsl +15 -0
- package/math/quat/div.msl +15 -0
- package/math/quat/div.wgsl +10 -0
- package/math/quat/identity.glsl +14 -0
- package/math/quat/identity.hlsl +14 -0
- package/math/quat/identity.msl +14 -0
- package/math/quat/identity.wgsl +10 -0
- package/math/quat/inverse.glsl +17 -0
- package/math/quat/inverse.hlsl +17 -0
- package/math/quat/inverse.msl +17 -0
- package/math/quat/inverse.wgsl +14 -0
- package/math/quat/length.glsl +15 -0
- package/math/quat/length.hlsl +15 -0
- package/math/quat/length.msl +15 -0
- package/math/quat/length.wgsl +12 -0
- package/math/quat/lengthSq.glsl +15 -0
- package/math/quat/lengthSq.hlsl +15 -0
- package/math/quat/lengthSq.msl +15 -0
- package/math/quat/lengthSq.wgsl +10 -0
- package/math/quat/lerp.glsl +47 -0
- package/math/quat/lerp.hlsl +47 -0
- package/math/quat/lerp.msl +47 -0
- package/math/quat/lerp.wgsl +43 -0
- package/math/quat/mul.glsl +22 -0
- package/math/quat/mul.hlsl +22 -0
- package/math/quat/mul.msl +22 -0
- package/math/quat/mul.wgsl +15 -0
- package/math/quat/neg.glsl +15 -0
- package/math/quat/neg.hlsl +15 -0
- package/math/quat/neg.msl +15 -0
- package/math/quat/neg.wgsl +10 -0
- package/math/quat/norm.glsl +16 -0
- package/math/quat/norm.hlsl +16 -0
- package/math/quat/norm.msl +16 -0
- package/math/quat/norm.wgsl +13 -0
- package/math/quat/sub.glsl +15 -0
- package/math/quat/sub.hlsl +15 -0
- package/math/quat/sub.msl +15 -0
- package/math/quat/sub.wgsl +10 -0
- package/math/quat/type.glsl +11 -0
- package/math/quat/type.hlsl +11 -0
- package/math/quat/type.msl +11 -0
- package/math/quat.glsl +83 -0
- package/math/quat.hlsl +83 -0
- package/math/quat.msl +83 -0
- package/math/quat.wgsl +73 -0
- package/math/quintic.cuh +1 -1
- package/math/quintic.glsl +3 -1
- package/math/quintic.hlsl +1 -1
- package/math/quintic.msl +17 -0
- package/math/quintic.wgsl +9 -0
- package/math/radians.msl +15 -0
- package/math/reflect.cuh +9 -5
- package/math/rotate2d.glsl +9 -6
- package/math/rotate2d.hlsl +8 -5
- package/math/rotate2d.msl +17 -0
- package/math/rotate2d.wgsl +8 -0
- package/math/rotate3d.glsl +13 -10
- package/math/rotate3d.hlsl +5 -2
- package/math/rotate3d.msl +21 -0
- package/math/rotate3d.wgsl +16 -0
- package/math/rotate3dX.glsl +19 -0
- package/math/rotate3dX.hlsl +19 -0
- package/math/rotate3dX.msl +17 -0
- package/math/rotate3dX.wgsl +13 -0
- package/math/rotate3dY.glsl +19 -0
- package/math/rotate3dY.hlsl +19 -0
- package/math/rotate3dY.msl +17 -0
- package/math/rotate3dY.wgsl +13 -0
- package/math/rotate3dZ.glsl +19 -0
- package/math/rotate3dZ.hlsl +19 -0
- package/math/rotate3dZ.msl +17 -0
- package/math/rotate3dZ.wgsl +13 -0
- package/math/rotate4d.glsl +14 -11
- package/math/rotate4d.hlsl +6 -4
- package/math/rotate4d.msl +22 -0
- package/math/rotate4d.wgsl +17 -0
- package/math/rotate4dX.glsl +12 -8
- package/math/rotate4dX.hlsl +12 -8
- package/math/rotate4dX.msl +18 -0
- package/math/rotate4dX.wgsl +14 -0
- package/math/rotate4dY.glsl +12 -8
- package/math/rotate4dY.hlsl +12 -8
- package/math/rotate4dY.msl +18 -0
- package/math/rotate4dY.wgsl +14 -0
- package/math/rotate4dZ.glsl +12 -8
- package/math/rotate4dZ.hlsl +12 -8
- package/math/rotate4dZ.msl +18 -0
- package/math/rotate4dZ.wgsl +14 -0
- package/math/round.glsl +16 -0
- package/math/round.msl +16 -0
- package/math/round.wgsl +12 -0
- package/math/saturate.cuh +5 -2
- package/math/saturate.glsl +8 -3
- package/math/saturate.msl +12 -0
- package/math/saturate.msl 2 +15 -0
- package/math/saturateMediump.cuh +5 -2
- package/math/saturateMediump.glsl +7 -4
- package/math/saturateMediump.hlsl +5 -2
- package/math/saturateMediump.msl +23 -0
- package/math/scale2d.glsl +16 -0
- package/math/scale2d.hlsl +16 -0
- package/math/scale2d.msl +16 -0
- package/math/scale2d.wgsl +9 -0
- package/math/scale3d.glsl +30 -0
- package/math/scale3d.hlsl +30 -0
- package/math/scale3d.msl +30 -0
- package/math/scale3d.wgsl +13 -0
- package/math/scale4d.glsl +47 -0
- package/math/scale4d.hlsl +47 -0
- package/math/scale4d.msl +47 -0
- package/math/scale4d.wgsl +14 -0
- package/math/select.glsl +17 -0
- package/math/select.hlsl +17 -0
- package/math/select.msl +17 -0
- package/math/sign.cuh +9 -2
- package/math/sin.cuh +8 -5
- package/math/smootherstep.cuh +6 -5
- package/math/smootherstep.glsl +10 -7
- package/math/smootherstep.hlsl +6 -4
- package/math/smootherstep.msl +19 -0
- package/math/smootherstep.wgsl +15 -0
- package/math/smoothstep.cuh +9 -9
- package/math/sqrt.cuh +6 -3
- package/math/step.cuh +15 -3
- package/math/sum.cuh +4 -1
- package/math/sum.glsl +4 -3
- package/math/sum.hlsl +4 -3
- package/math/sum.msl +16 -0
- package/math/sum.wgsl +13 -0
- package/math/taylorInvSqrt.cuh +1 -3
- package/math/taylorInvSqrt.glsl +1 -1
- package/math/taylorInvSqrt.hlsl +1 -1
- package/math/taylorInvSqrt.msl +13 -0
- package/math/taylorInvSqrt.wgsl +5 -0
- package/math/toMat3.glsl +19 -0
- package/math/toMat4.glsl +18 -0
- package/math/toMat4.hlsl +18 -0
- package/math/toMat4.msl +18 -0
- package/math/toMat4.wgsl +14 -0
- package/math/translate4d.glsl +26 -0
- package/math/translate4d.hlsl +26 -0
- package/math/translate4d.msl +26 -0
- package/math/translate4d.wgsl +14 -0
- package/math/transpose.glsl +8 -23
- package/math/unpack.cuh +4 -1
- package/math/unpack.glsl +44 -25
- package/math/unpack.hlsl +43 -24
- package/math/unpack.msl +72 -0
- package/math/unpack.wgsl +56 -0
- package/math/within.cuh +5 -2
- package/math/within.glsl +13 -10
- package/math/within.hlsl +5 -2
- package/math/within.msl +30 -0
- package/math/within.wgsl +26 -0
- package/math.glsl +24 -2
- package/math.hlsl +18 -2
- package/math.msl +64 -0
- package/math.wgsl +47 -0
- package/morphological/alphaFill.glsl +7 -4
- package/morphological/alphaFill.hlsl +7 -4
- package/morphological/alphaHashing.glsl +56 -0
- package/morphological/dilation.glsl +9 -9
- package/morphological/dilation.hlsl +4 -5
- package/morphological/erosion.glsl +4 -4
- package/morphological/erosion.hlsl +4 -5
- package/morphological/jumpFlood.glsl +85 -0
- package/morphological/marchingSquares.glsl +207 -0
- package/morphological/pyramid/downscale.glsl +49 -0
- package/morphological/pyramid/upscale.glsl +72 -0
- package/morphological/pyramid.glsl +40 -0
- package/package.json +9 -7
- package/prune.py +61 -0
- package/sample/2DCube.glsl +24 -21
- package/sample/2DCube.hlsl +23 -20
- package/sample/3DSdf.glsl +7 -4
- package/sample/3DSdf.hlsl +31 -5
- package/sample/bicubic.glsl +7 -4
- package/sample/bicubic.hlsl +10 -7
- package/sample/bracketing.glsl +10 -9
- package/sample/bracketing.hlsl +6 -6
- package/sample/bumpMap.glsl +6 -3
- package/sample/bumpMap.hlsl +6 -3
- package/sample/clamp2edge.glsl +13 -6
- package/sample/clamp2edge.hlsl +9 -6
- package/sample/clamp2edge.msl +28 -0
- package/sample/derivative.glsl +7 -4
- package/sample/derivative.hlsl +19 -16
- package/sample/dither.glsl +19 -5
- package/sample/dof.glsl +5 -5
- package/sample/dof.hlsl +8 -8
- package/sample/equirect.glsl +34 -19
- package/sample/equirect.hlsl +9 -6
- package/sample/flow.glsl +7 -4
- package/sample/flow.hlsl +7 -4
- package/sample/fxaa.glsl +17 -14
- package/sample/fxaa.hlsl +14 -11
- package/sample/heatmap.glsl +23 -0
- package/sample/heatmap.hlsl +23 -0
- package/sample/hue.glsl +7 -4
- package/sample/hue.hlsl +7 -4
- package/sample/mirror.glsl +8 -5
- package/sample/mirror.hlsl +8 -5
- package/sample/nearest.glsl +7 -4
- package/sample/nearest.hlsl +7 -4
- package/sample/normalFromHeightMap.glsl +35 -0
- package/sample/normalFromHeightMap.hlsl +35 -0
- package/sample/normalMap.glsl +7 -4
- package/sample/normalMap.hlsl +7 -4
- package/sample/opticalFlow.glsl +32 -0
- package/sample/opticalFlow.hlsl +32 -0
- package/sample/quilt.glsl +17 -13
- package/sample/quilt.hlsl +10 -6
- package/sample/repeat.glsl +8 -5
- package/sample/repeat.hlsl +8 -5
- package/sample/shadow.glsl +18 -16
- package/sample/shadow.hlsl +12 -14
- package/sample/shadowLerp.glsl +6 -3
- package/sample/shadowLerp.hlsl +6 -3
- package/sample/shadowPCF.glsl +6 -3
- package/sample/shadowPCF.hlsl +7 -4
- package/sample/smooth.glsl +4 -4
- package/sample/smooth.hlsl +4 -4
- package/sample/sprite.glsl +9 -6
- package/sample/sprite.hlsl +9 -6
- package/sample/triplanar.glsl +44 -0
- package/sample/triplanar.hlsl +45 -0
- package/sample/untile.glsl +10 -10
- package/sample/untile.hlsl +7 -7
- package/sample/viewPosition.glsl +9 -6
- package/sample/viewPosition.hlsl +11 -8
- package/sample/yuv.glsl +7 -4
- package/sample/yuv.hlsl +7 -4
- package/sample/zero.glsl +38 -0
- package/sample/zero.hlsl +19 -0
- package/sample.glsl +32 -7
- package/sample.hlsl +31 -3
- package/sampler.glsl +18 -0
- package/sampler.hlsl +50 -0
- package/sampler.msl +19 -0
- package/sdf/arrowSDF.glsl +60 -0
- package/sdf/arrowSDF.msl +60 -0
- package/sdf/boxFrameSDF.glsl +1 -1
- package/sdf/boxFrameSDF.hlsl +1 -1
- package/sdf/boxFrameSDF.msl +20 -0
- package/sdf/boxSDF.glsl +1 -1
- package/sdf/boxSDF.hlsl +1 -1
- package/sdf/boxSDF.msl +20 -0
- package/sdf/boxSDF.wgsl +10 -0
- package/sdf/capsuleSDF.glsl +1 -1
- package/sdf/capsuleSDF.hlsl +1 -1
- package/sdf/capsuleSDF.msl +17 -0
- package/sdf/circleSDF.glsl +15 -9
- package/sdf/circleSDF.hlsl +13 -9
- package/sdf/circleSDF.msl +30 -0
- package/sdf/coneSDF.glsl +1 -1
- package/sdf/coneSDF.hlsl +1 -1
- package/sdf/coneSDF.msl +44 -0
- package/sdf/crossSDF.glsl +8 -1
- package/sdf/crossSDF.hlsl +4 -1
- package/sdf/crossSDF.msl +23 -0
- package/sdf/cubeSDF.msl +11 -0
- package/sdf/cylinderSDF.glsl +1 -1
- package/sdf/cylinderSDF.hlsl +2 -2
- package/sdf/cylinderSDF.msl +42 -0
- package/sdf/cylinderSDF.wgsl +10 -0
- package/sdf/dodecahedronSDF.msl +31 -0
- package/sdf/ellipsoidSDF.glsl +1 -1
- package/sdf/ellipsoidSDF.hlsl +1 -1
- package/sdf/ellipsoidSDF.msl +16 -0
- package/sdf/flowerSDF.glsl +14 -2
- package/sdf/flowerSDF.hlsl +10 -2
- package/sdf/flowerSDF.msl +28 -0
- package/sdf/gearSDF.glsl +38 -0
- package/sdf/gearSDF.hlsl +37 -0
- package/sdf/gearSDF.msl +38 -0
- package/sdf/heartSDF.glsl +12 -2
- package/sdf/heartSDF.hlsl +10 -2
- package/sdf/heartSDF.msl +25 -0
- package/sdf/hexPrismSDF.glsl +1 -1
- package/sdf/hexPrismSDF.hlsl +1 -1
- package/sdf/hexPrismSDF.msl +17 -0
- package/sdf/hexSDF.glsl +15 -2
- package/sdf/hexSDF.hlsl +11 -2
- package/sdf/hexSDF.msl +26 -0
- package/sdf/icosahedronSDF.msl +24 -0
- package/sdf/juliaSDF.glsl +44 -0
- package/sdf/juliaSDF.hlsl +34 -0
- package/sdf/juliaSDF.msl +44 -0
- package/sdf/kochSDF.glsl +40 -0
- package/sdf/kochSDF.hlsl +35 -0
- package/sdf/kochSDF.msl +40 -0
- package/sdf/lineSDF.glsl +1 -1
- package/sdf/lineSDF.hlsl +1 -1
- package/sdf/lineSDF.msl +22 -0
- package/sdf/linkSDF.glsl +1 -1
- package/sdf/linkSDF.hlsl +1 -1
- package/sdf/linkSDF.msl +13 -0
- package/sdf/mandelbulbSDF.glsl +43 -0
- package/sdf/mandelbulbSDF.hlsl +43 -0
- package/sdf/mandelbulbSDF.msl +43 -0
- package/sdf/octahedronSDF.glsl +1 -1
- package/sdf/octahedronSDF.hlsl +1 -1
- package/sdf/octahedronSDF.msl +39 -0
- package/sdf/octogonPrismSDF.glsl +1 -1
- package/sdf/octogonPrismSDF.hlsl +1 -1
- package/sdf/octogonPrismSDF.msl +24 -0
- package/sdf/opElongate.glsl +1 -1
- package/sdf/opElongate.hlsl +1 -1
- package/sdf/opElongate.msl +24 -0
- package/sdf/opExtrude.glsl +1 -1
- package/sdf/opExtrude.hlsl +1 -1
- package/sdf/opExtrude.msl +16 -0
- package/sdf/opIntersection.glsl +11 -2
- package/sdf/opIntersection.hlsl +14 -3
- package/sdf/opIntersection.msl +19 -0
- package/sdf/opOnion.glsl +2 -2
- package/sdf/opOnion.hlsl +2 -2
- package/sdf/opOnion.msl +15 -0
- package/sdf/opRepeat.glsl +27 -0
- package/sdf/opRepeat.hlsl +29 -0
- package/sdf/opRepeat.msl +27 -0
- package/sdf/opRevolve.glsl +1 -1
- package/sdf/opRevolve.hlsl +1 -1
- package/sdf/opRevolve.msl +15 -0
- package/sdf/opRound.glsl +3 -3
- package/sdf/opRound.hlsl +1 -1
- package/sdf/opRound.msl +15 -0
- package/sdf/opSubtraction.glsl +4 -2
- package/sdf/opSubtraction.hlsl +1 -1
- package/sdf/opSubtraction.msl +26 -0
- package/sdf/opSubtraction.wgsl +7 -0
- package/sdf/opUnion.cuh +4 -2
- package/sdf/opUnion.glsl +14 -4
- package/sdf/opUnion.hlsl +15 -4
- package/sdf/opUnion.msl +26 -0
- package/sdf/opUnion.wgsl +7 -0
- package/sdf/planeSDF.cuh +1 -1
- package/sdf/planeSDF.glsl +1 -1
- package/sdf/planeSDF.hlsl +2 -2
- package/sdf/planeSDF.msl +16 -0
- package/sdf/polySDF.glsl +14 -2
- package/sdf/polySDF.hlsl +10 -2
- package/sdf/polySDF.msl +30 -0
- package/sdf/pyramidSDF.glsl +1 -1
- package/sdf/pyramidSDF.hlsl +1 -1
- package/sdf/pyramidSDF.msl +36 -0
- package/sdf/raysSDF.glsl +13 -2
- package/sdf/raysSDF.hlsl +10 -3
- package/sdf/raysSDF.msl +26 -0
- package/sdf/rectSDF.glsl +17 -3
- package/sdf/rectSDF.hlsl +27 -2
- package/sdf/rectSDF.msl +47 -0
- package/sdf/rectSDF.wgsl +15 -3
- package/sdf/rhombSDF.glsl +13 -2
- package/sdf/rhombSDF.hlsl +11 -3
- package/sdf/rhombSDF.msl +26 -0
- package/sdf/sphereSDF.cuh +1 -1
- package/sdf/sphereSDF.glsl +1 -1
- package/sdf/sphereSDF.hlsl +1 -1
- package/sdf/sphereSDF.msl +11 -0
- package/sdf/sphereSDF.wgsl +9 -0
- package/sdf/spiralSDF.glsl +12 -1
- package/sdf/spiralSDF.hlsl +8 -1
- package/sdf/spiralSDF.msl +26 -0
- package/sdf/starSDF.glsl +19 -4
- package/sdf/starSDF.hlsl +17 -5
- package/sdf/starSDF.msl +36 -0
- package/sdf/superShapeSDF.glsl +54 -0
- package/sdf/superShapeSDF.hlsl +43 -0
- package/sdf/superShapeSDF.msl +54 -0
- package/sdf/tetrahedronSDF.glsl +1 -1
- package/sdf/tetrahedronSDF.hlsl +1 -1
- package/sdf/tetrahedronSDF.msl +17 -0
- package/sdf/torusSDF.glsl +1 -1
- package/sdf/torusSDF.hlsl +1 -1
- package/sdf/torusSDF.msl +16 -0
- package/sdf/torusSDF.wgsl +9 -0
- package/sdf/triPrismSDF.glsl +1 -1
- package/sdf/triPrismSDF.hlsl +5 -5
- package/sdf/triPrismSDF.msl +45 -0
- package/sdf/triSDF.glsl +16 -3
- package/sdf/triSDF.hlsl +12 -3
- package/sdf/triSDF.msl +26 -0
- package/sdf/vesicaSDF.glsl +12 -3
- package/sdf/vesicaSDF.hlsl +9 -2
- package/sdf/vesicaSDF.msl +25 -0
- package/sdf.glsl +5 -2
- package/sdf.hlsl +6 -2
- package/sdf.msl +46 -0
- package/space/aspect.glsl +18 -0
- package/space/aspect.hlsl +20 -0
- package/space/aspect.msl +18 -0
- package/space/bracketing.glsl +3 -2
- package/space/bracketing.hlsl +3 -2
- package/space/bracketing.msl +51 -0
- package/space/brickTile.glsl +37 -0
- package/space/brickTile.hlsl +31 -0
- package/space/brickTile.msl +37 -0
- package/space/cart2polar.glsl +12 -2
- package/space/cart2polar.hlsl +13 -3
- package/space/cart2polar.msl +21 -0
- package/space/center.glsl +20 -0
- package/space/center.hlsl +20 -0
- package/space/center.msl +20 -0
- package/space/checkerTile.glsl +34 -0
- package/space/checkerTile.hlsl +32 -0
- package/space/checkerTile.msl +34 -0
- package/space/depth2viewZ.glsl +6 -3
- package/space/depth2viewZ.hlsl +7 -4
- package/space/depth2viewZ.msl +32 -0
- package/space/displace.glsl +10 -7
- package/space/displace.hlsl +10 -7
- package/space/displace.msl +79 -0
- package/space/equirect2xyz.glsl +5 -2
- package/space/equirect2xyz.hlsl +5 -2
- package/space/equirect2xyz.msl +22 -0
- package/space/eulerView.glsl +25 -0
- package/space/eulerView.hlsl +25 -0
- package/space/fisheye2xyz.glsl +5 -2
- package/space/fisheye2xyz.hlsl +5 -2
- package/space/fisheye2xyz.msl +23 -0
- package/space/fisheye2xyz.wgsl +22 -0
- package/space/flipY.glsl +8 -5
- package/space/flipY.hlsl +8 -5
- package/space/flipY.msl +15 -0
- package/space/hexTile.glsl +7 -32
- package/space/hexTile.hlsl +5 -32
- package/space/hexTile.msl +27 -0
- package/space/kaleidoscope.glsl +43 -0
- package/space/kaleidoscope.hlsl +43 -0
- package/space/kaleidoscope.msl +43 -0
- package/space/linearizeDepth.glsl +6 -8
- package/space/linearizeDepth.hlsl +6 -8
- package/space/linearizeDepth.msl +27 -0
- package/space/lookAt.glsl +29 -18
- package/space/lookAt.hlsl +33 -18
- package/space/lookAt.msl +51 -0
- package/space/lookAtView.glsl +28 -0
- package/space/lookAtView.hlsl +28 -0
- package/space/mirrorTile.glsl +28 -8
- package/space/mirrorTile.hlsl +27 -8
- package/space/mirrorTile.msl +39 -0
- package/space/nearest.glsl +13 -7
- package/space/nearest.hlsl +5 -3
- package/space/nearest.msl +20 -0
- package/space/nearest.wgsl +12 -0
- package/space/orthographic.glsl +20 -0
- package/space/orthographic.msl +20 -0
- package/space/parallaxMapping.glsl +12 -9
- package/space/parallaxMapping.hlsl +12 -9
- package/space/parallaxMapping.msl +234 -0
- package/space/perspective.glsl +24 -0
- package/space/perspective.msl +24 -0
- package/space/polar2cart.glsl +11 -1
- package/space/polar2cart.hlsl +11 -1
- package/space/polar2cart.msl +10 -0
- package/space/ratio.cuh +4 -1
- package/space/ratio.glsl +13 -6
- package/space/ratio.hlsl +8 -3
- package/space/ratio.msl +21 -0
- package/space/ratio.wgsl +15 -3
- package/space/rotate.glsl +39 -21
- package/space/rotate.hlsl +4 -1
- package/space/rotate.msl +80 -0
- package/space/rotate.wgsl +16 -1
- package/space/rotateX.glsl +15 -12
- package/space/rotateX.hlsl +7 -4
- package/space/rotateX.msl +39 -0
- package/space/rotateY.glsl +14 -11
- package/space/rotateY.hlsl +7 -4
- package/space/rotateY.msl +39 -0
- package/space/rotateZ.glsl +15 -13
- package/space/rotateZ.hlsl +8 -6
- package/space/rotateZ.msl +39 -0
- package/space/scale.glsl +41 -43
- package/space/scale.hlsl +4 -1
- package/space/scale.msl +63 -0
- package/space/scale.wgsl +12 -1
- package/space/screen2viewPosition.glsl +5 -2
- package/space/screen2viewPosition.hlsl +9 -6
- package/space/screen2viewPosition.msl +33 -0
- package/space/sprite.glsl +4 -1
- package/space/sprite.hlsl +4 -1
- package/space/sprite.msl +21 -0
- package/space/sqTile.glsl +4 -1
- package/space/sqTile.hlsl +4 -1
- package/space/sqTile.msl +14 -0
- package/space/tbn.glsl +21 -0
- package/space/tbn.hlsl +25 -0
- package/space/translate.glsl +20 -0
- package/space/translate.hlsl +19 -0
- package/space/triTile.glsl +12 -9
- package/space/triTile.hlsl +22 -0
- package/space/triTile.msl +23 -0
- package/space/uncenter.glsl +19 -0
- package/space/uncenter.hlsl +19 -0
- package/space/uncenter.msl +19 -0
- package/space/unratio.glsl +6 -5
- package/space/unratio.hlsl +5 -2
- package/space/unratio.msl +13 -0
- package/space/view2screenPosition.glsl +5 -2
- package/space/view2screenPosition.hlsl +8 -5
- package/space/view2screenPosition.msl +22 -0
- package/space/viewZ2depth.glsl +6 -3
- package/space/viewZ2depth.hlsl +7 -4
- package/space/viewZ2depth.msl +30 -0
- package/space/windmillTile.glsl +43 -0
- package/space/windmillTile.hlsl +41 -0
- package/space/windmillTile.msl +43 -0
- package/space/xyz2equirect.glsl +5 -2
- package/space/xyz2equirect.hlsl +6 -3
- package/space/xyz2equirect.msl +17 -0
- package/version.glsl +8 -1
- package/version.hlsl +8 -1
- package/version.wgsl +10 -0
- package/Lygia.asmdef +0 -14
- package/color/mixBox.hlsl +0 -105
- package/lighting/raymarch/camera.glsl +0 -38
- package/lighting/raymarch/camera.hlsl +0 -36
- package/lighting/raymarch/material.glsl +0 -133
- package/lighting/raymarch/material.hlsl +0 -130
- package/lighting/specular/ggx.glsl +0 -43
- package/lighting/specular/ggx.hlsl +0 -43
- package/morphological/poissonFill/downscale.glsl +0 -34
- package/morphological/poissonFill/upscale.glsl +0 -51
- package/morphological/poissonFill.glsl +0 -36
- package/sdf/opRepite.glsl +0 -27
- package/sdf/opRepite.hlsl +0 -29
- package/simulate/fluidSolver.glsl +0 -96
- package/simulate/grayscott.glsl +0 -74
- package/simulate/ripple.glsl +0 -31
- package/space/brick.glsl +0 -26
- package/space/brick.hlsl +0 -26
package/CONTRIBUTE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Contributing to LYIGA
|
|
2
|
+
|
|
3
|
+
LYGIA is a project that aims to provide a unified API for writing shaders in different shading languages, with carefully tailored code, optimized for each language. It is a community-driven project and we welcome contributions from everyone.
|
|
4
|
+
|
|
5
|
+
At the moment we are figuring the best way to organize the project and the best practices to follow. If you have any suggestions, please open an issue.
|
|
6
|
+
|
|
7
|
+
As a general guideline, we are following these rules:
|
|
8
|
+
|
|
9
|
+
* Everything goes through PRs. No standalone commits.
|
|
10
|
+
* PRs need to be peer-reviewed by at least one language lead
|
|
11
|
+
* PRs that change existing functions need to maintain language parity.
|
|
12
|
+
|
|
13
|
+
## Who are the language leads?
|
|
14
|
+
|
|
15
|
+
* GLSL: @patriciogonzalezvivo
|
|
16
|
+
* HLSL: Shadi El Hajj (@shadielhajj)
|
|
17
|
+
* WGSL: Stevan Dedovic (@sdedovic)
|
|
18
|
+
* METAL: Anton Marini (@vade)
|
|
19
|
+
* CUDA: (help wanted)
|
|
20
|
+
* TSL: (help wanted)
|
|
21
|
+
* OSL: (help wanted)
|
package/DESIGN.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
|
|
2
|
+
## Design Guidelines
|
|
3
|
+
|
|
4
|
+
* **Granularity**. One function per file. The file and the function share the same name, namely: `myFunc.glsl` contains `myFunct()`. There are some files that just include a collection of files inside a folder with the same name. For example:
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
color/blend.glsl
|
|
8
|
+
// which includes
|
|
9
|
+
color/blend/*.glsl
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
* **Multi-language**. Right now, most of the code is GLSL (`*.glsl`) and HLSL (`*.hlsl`), but we are slowly extending to WGSL (`*.wgsl`), CUDA (`*.cuh`) and Metal (`*.msl`).
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
math/mirror.glsl
|
|
17
|
+
math/mirror.hlsl
|
|
18
|
+
math/mirror.wgsl
|
|
19
|
+
math/mirror.msl
|
|
20
|
+
math/mirror.cuh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* **Self documented**. Each file contains a structured comment (in YAML) at the top of the file. This one contains the name of the original author, description, use, `#define` options, and any implementation-specific notes.
|
|
24
|
+
|
|
25
|
+
```glsl
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
contributors: <FULL NAME>
|
|
29
|
+
description: [DESCRIPTION + URL]
|
|
30
|
+
use: <vec2> myFunc(<vec2> st, <float> x [, <float> y])
|
|
31
|
+
notes:
|
|
32
|
+
- The option MYFUNC_TYPE is not supported on WGSL.
|
|
33
|
+
options:
|
|
34
|
+
- MYFUNC_TYPE
|
|
35
|
+
- MYFUNC_SAMPLER_FNC()
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
* **Prevent name collisions** by using the following pattern where `FNC_` is followed with the function name:
|
|
41
|
+
|
|
42
|
+
```glsl
|
|
43
|
+
|
|
44
|
+
#ifndef FNC_MYFUNC
|
|
45
|
+
#define FNC_MYFUNC
|
|
46
|
+
|
|
47
|
+
float myFunc(float in) {
|
|
48
|
+
return in;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
* **Templating capabilities through `#defines`**. Probably the most frequent use is templating the sampling function for reusability. The `#define` options start with the name of the function, in this example `MYFUNC_`. They are added as `options:` in the header.
|
|
56
|
+
|
|
57
|
+
```glsl
|
|
58
|
+
|
|
59
|
+
#ifndef MYFUNC_TYPE
|
|
60
|
+
#define MYFUNC_TYPE vec4
|
|
61
|
+
#endif
|
|
62
|
+
|
|
63
|
+
#ifndef MYFUNC_SAMPLER_FNC
|
|
64
|
+
#define MYFUNC_SAMPLER_FNC(TEX, UV) texture2D(TEX, UV)
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
#ifndef FNC_MYFUNC
|
|
68
|
+
#define FNC_MYFUNC
|
|
69
|
+
MYFUNC_TYPE myFunc(SAMPLER_TYPE tex, vec2 st) {
|
|
70
|
+
return MYFUNC_SAMPLER_FNC(tex, st);
|
|
71
|
+
}
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
* **Argument order**. Optional elements are at the end. When possible sort them according their memory footprint (except textures that remain at the top). Ex.: `SAMPLER_TYPE, mat4, mat3, mat2, vec4, vec3, vec2, float, ivec4, ivec3, ivec2, int, bool`
|
|
77
|
+
|
|
78
|
+
```glsl
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
...
|
|
82
|
+
use: myFunc(<vec2> st, <vec2|float> x[, <float> y])
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
#ifndef FNC_MYFUNC
|
|
86
|
+
#define FNC_MYFUNC
|
|
87
|
+
vec2 myFunc(vec2 st, vec2 x) {
|
|
88
|
+
return st * x;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
vec2 myFunc(vec2 st, float x) {
|
|
92
|
+
return st * x;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
vec2 myFunc(vec2 st, float x, float y) {
|
|
96
|
+
return st * vec2(x, y);
|
|
97
|
+
}
|
|
98
|
+
#endif
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### WGSL Specifics
|
|
103
|
+
|
|
104
|
+
WGSL as a language has some fundamental differences from GLSL, HLSL and METAL. Here are some guidelines to help with the transition:
|
|
105
|
+
|
|
106
|
+
* **WGSL Function Renaming**. WGSL [does not support function overloading](https://github.com/gpuweb/gpuweb/issues/876) and as such function names must be unique and should reflect the size of parameter, return types. See documented examples below.
|
|
107
|
+
|
|
108
|
+
```wgsl
|
|
109
|
+
// When the parameter types and return type is consistent and scalar, no suffix is needed.
|
|
110
|
+
fn random(p: f32) -> f32 { ... }
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
When only the return type is consistent and scalar, the function name is suffixed based on the size of the parameter types, i.e.
|
|
114
|
+
- vec2<T> -> 2
|
|
115
|
+
- vec3<T> -> 3
|
|
116
|
+
- vec4<T> -> 4
|
|
117
|
+
*/
|
|
118
|
+
fn random2(p: vec2f) -> f32 { ... }
|
|
119
|
+
fn random3(p: vec3f) -> f32 { ... }
|
|
120
|
+
fn random3(p: vec4f) -> f32 { ... }
|
|
121
|
+
|
|
122
|
+
/*
|
|
123
|
+
When both parameters and return types are inconsistent, function name has two suffixes:
|
|
124
|
+
- first for return type size
|
|
125
|
+
- second for parameter type size
|
|
126
|
+
*/
|
|
127
|
+
fn random21(p: f32) -> vec2f { ... }
|
|
128
|
+
fn random22(p: vec2f) -> vec2f { ... }
|
|
129
|
+
fn random23(p: vec3f) -> vec2f { ... }
|
|
130
|
+
fn random31(p: f32) -> vec3f { ... }
|
|
131
|
+
fn random32(p: vec2f) -> vec3f { ... }
|
|
132
|
+
fn random33(p_: vec3f) -> vec3f { ... }
|
|
133
|
+
fn random41(p: f32) -> vec4f { ... }
|
|
134
|
+
fn random42(p: vec2f) -> vec4f { ... }
|
|
135
|
+
fn random43(p: vec3f) -> vec4f { ... }
|
|
136
|
+
fn random44(p: vec4f) -> vec4f { ... }
|
|
137
|
+
```
|
package/EXAMPLES.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
### Integrations examples
|
|
2
|
+
|
|
3
|
+
Learn more about LYGIA and how to use it from these **examples**:
|
|
4
|
+
|
|
5
|
+
* [2D examples for Processing (GLSL)](https://github.com/patriciogonzalezvivo/lygia_p5_examples)
|
|
6
|
+
* [2D/3D examples for P5.js (GLSL)](https://editor.p5js.org/patriciogonzalezvivo/sketches)
|
|
7
|
+
* [2D examples for Three.js + React (GLSL)](https://codesandbox.io/s/lygia-react-starter-fftx6p) by [Eduard Fossas](https://eduardfossas.vercel.app/)
|
|
8
|
+
* [2D examples for Three.js (GLSL)](https://github.com/patriciogonzalezvivo/lygia_threejs_examples)
|
|
9
|
+
* [3D examples for Three.js (GLSL)](https://github.com/guidoschmidt/lygia_threejs_examples) by [Guido Schmidt](https://guidoschmidt.cc/)
|
|
10
|
+
* [2D examples for OpenFrameworks (GLSL)](https://github.com/patriciogonzalezvivo/lygia_of_examples)
|
|
11
|
+
* [2D/3D examples for Unity3D (HLSL)](https://github.com/patriciogonzalezvivo/lygia_unity_examples)
|
|
12
|
+
* [Examples for Unreal Engine (HLSL)](https://github.com/franklzt/lygia_unreal_engine_examples)
|
|
13
|
+
* [Examples for Touch Designer (GLSL)](https://derivative.ca/community-post/asset/lygia-touchdesginer/66804) (dynamic resolver) by [Leith Ben Abdessalem](https://leithba.com)
|
|
14
|
+
* [Examples for Touch Designer (GLSL)](https://github.com/vectorsize/lygia-td) (static resolver) by [Victor Saz](https://github.com/vectorsize)
|
|
15
|
+
* [2D examples on Observable Notebook (GLSL)](https://observablehq.com/@radames/hello-lygia-shader-library) by [Radames Ajna](https://twitter.com/radamar)
|
|
16
|
+
* [Figma's noise&texture plugin](https://www.figma.com/community/plugin/1138854718618193875) by [Rogie King](https://twitter.com/rogie). You will need to go to the "Custom" tab on the plugin to edit shaders and load LYGIA modules
|
|
17
|
+
* [3D example on Irmf](https://github.com/irmf/irmf-examples/tree/master/examples/028-lygia) by [Glenn Lewis](https://github.com/gmlewis)
|
|
18
|
+
* [2D/3D examples on GlslViewer (GLSL)](https://github.com/patriciogonzalezvivo/lygia_examples)
|
|
19
|
+
* [2D examples on Ossia](https://github.com/ossia/score-examples) by [Jean-Michaël Celerier](https://jcelerier.name/)
|
|
20
|
+
* [Ogl integration](https://github.com/kujohn/lygia_ogl_examples) by [John Ku](https://github.com/kujohn)
|
|
21
|
+
* [2D templates for Ogl(TS) and Three.js(JS/TS)](https://github.com/cdaein/create-ssam) by [Daeinc](https://paperdove.com)
|
|
22
|
+
|
|
23
|
+
For more information, guidance, or feedback about using LYGIA, join [#Lygia channel on shader.zone discord](https://shader.zone/).
|
package/README.md
CHANGED
|
@@ -2,35 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# LYGIA Shader Library
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[](https://github.com/sponsors/patriciogonzalezvivo)
|
|
8
|
-
|
|
9
|
-
<p style="text-align: center;" >
|
|
10
|
-
<a href="https://github.com/patriciogonzalezvivo/lygia_unity_examples"><img src="https://lygia.xyz/imgs/unity.png" alt="uUnity" width="64" /></a>
|
|
11
|
-
<a href="https://github.com/guidoschmidt/lygia_threejs_examples"><img src="https://lygia.xyz/imgs/threejs.png" alt="threejs" width="64" /></a>
|
|
12
|
-
<a href="https://github.com/patriciogonzalezvivo/lygia_p5_examples"><img src="https://lygia.xyz/imgs/p5.png" alt="p5" width="64" /></a>
|
|
13
|
-
<a href="https://editor.p5js.org/patriciogonzalezvivo/sketches"><img src="https://lygia.xyz/imgs/p5js.png" alt="p5js" width="64" /></a>
|
|
14
|
-
<a href="https://github.com/patriciogonzalezvivo/lygia_of_examples"><img src="https://lygia.xyz/imgs/of.png" alt="openFrameworks" width="64" /></a>
|
|
15
|
-
<a href="https://github.com/vectorsize/lygia-td"><img title="static-resolver by vectorsize" src="https://lygia.xyz/imgs/td.png" alt="touchDesigner" width="64" /></a>
|
|
16
|
-
<a href="https://github.com/patriciogonzalezvivo/lygia_examples"><img src="https://lygia.xyz/imgs/glslViewer.png" alt="glslViewer" width="64" /></a>
|
|
17
|
-
<a href="https://observablehq.com/@radames/hello-lygia-shader-library"><img src="https://lygia.xyz/imgs/ob.png" alt="ob" width="64" /></a>
|
|
18
|
-
<a href="https://codesandbox.io/s/lygia-react-starter-fftx6p"><img src="https://lygia.xyz/imgs/r3f.png" alt="r3rf" width="64" /></a>
|
|
19
|
-
<a href="https://www.figma.com/community/plugin/1138854718618193875"><img src="https://lygia.xyz/imgs/figma.png" alt="Figma" width="64" /></a>
|
|
20
|
-
<a href="https://github.com/irmf/irmf-examples/tree/master/examples/028-lygia"><img src="https://lygia.xyz/imgs/irmf.png" alt="irmf" width="64" /></a>
|
|
21
|
-
<a href="https://github.com/ossia/score-examples"><img src="https://lygia.xyz/imgs/ossia.png" alt="Ossia" width="64" /></a>
|
|
22
|
-
<a href="https://www.npmjs.com/package/resolve-lygia"><img src="https://lygia.xyz/imgs/npm.png" alt="npm" width="64" /></a>
|
|
23
|
-
|
|
24
|
-
</p>
|
|
5
|
+
LYGIA is the biggest shader library. Battle proof, cross platform and multi-language. Is made of reusable functions that will let you prototype, port and ship projects in just few minutes. It's very granular, flexible and efficient. Support multiple shading languages and can easily be added to virtually any project. There are already integrations for almost all mayor enviroments, engines and frameworks.
|
|
25
6
|
|
|
7
|
+
Best of all, LYGIA grows and improves every day thanks to the support of the community. Become a [Contributor](https://github.com/patriciogonzalezvivo/lygia) or a [](https://github.com/sponsors/patriciogonzalezvivo)
|
|
26
8
|
|
|
27
9
|
## How to use it?
|
|
28
10
|
|
|
29
|
-
In your shader `#include` the functions you need:
|
|
11
|
+
In your shader just `#include` the functions you need and then use them:
|
|
30
12
|
|
|
31
13
|
<div class="codeAndCanvas" data="example.frag">
|
|
32
14
|
|
|
33
|
-
|
|
15
|
+
#ifdef GL_ES
|
|
34
16
|
precision mediump float;
|
|
35
17
|
#endif
|
|
36
18
|
|
|
@@ -55,10 +37,54 @@ In your shader `#include` the functions you need:
|
|
|
55
37
|
|
|
56
38
|
</div>
|
|
57
39
|
|
|
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.
|
|
41
|
+
|
|
42
|
+
<div class="container">
|
|
43
|
+
<div class="file-drop-area">
|
|
44
|
+
<span class="file-msg">Drop your shader file <a href="https://lygia.xyz/">here</a></span>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
LYGIA have been integrated into the following Engines, Frameworks, Creative Tools and online editors:
|
|
49
|
+
|
|
50
|
+
<p style="text-align: center;" >
|
|
51
|
+
<a href="https://github.com/patriciogonzalezvivo/lygia_unity_examples"><img src="https://lygia.xyz/imgs/unity.png" alt="unity" title="unity" width="64" /></a>
|
|
52
|
+
<a href="https://github.com/franklzt/lygia_unreal_engine_examples"><img src="https://lygia.xyz/imgs/unreal.png" alt="unreal" title="unreal" width="64" /></a>
|
|
53
|
+
<a href="https://www.curseforge.com/minecraft/search?page=1&pageSize=20&sortType=1&search=LYGIA%20Shader%20Library"><img src="https://lygia.xyz/imgs/minecraft.png" alt="minecraft" title="minecraft" width="64" /></a>
|
|
54
|
+
<a href="https://github.com/patriciogonzalezvivo/lygia_examples"><img src="https://lygia.xyz/imgs/glslViewer.png" alt="glslViewer" title="glslViewer" width="64" /></a>
|
|
55
|
+
<a href="https://github.com/irmf/irmf-examples/tree/master/examples/028-lygia"><img src="https://lygia.xyz/imgs/irmf.png" alt="irmf" title="irmf" width="64" /></a>
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
<p style="text-align: center;" >
|
|
59
|
+
<a href="https://github.com/guidoschmidt/lygia_threejs_examples"><img src="https://lygia.xyz/imgs/threejs.png" alt="threejs" title="threejs" width="64" /></a>
|
|
60
|
+
<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
|
+
<a href="https://www.npmjs.com/package/lygia"><img src="https://lygia.xyz/imgs/npm.png" alt="npm" title="npm" width="64" /></a>
|
|
62
|
+
<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>
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
<p style="text-align: center;" >
|
|
66
|
+
<a href="https://github.com/patriciogonzalezvivo/lygia_p5_examples"><img src="https://lygia.xyz/imgs/p5.png" alt="p5" title="processing" width="64" /></a>
|
|
67
|
+
<a href="https://editor.p5js.org/patriciogonzalezvivo/sketches"><img src="https://lygia.xyz/imgs/p5js.png" alt="p5js" title="p5js" width="64" /></a>
|
|
68
|
+
<a href="https://github.com/patriciogonzalezvivo/lygia_of_examples"><img src="https://lygia.xyz/imgs/of.png" alt="openFrameworks" tittle="openframeworks" width="64" /></a>
|
|
69
|
+
<a href="https://github.com/vectorsize/lygia-td"><img title="static-resolver by vectorsize" src="https://lygia.xyz/imgs/td.png" alt="touchDesigner" title="touchDesigner" width="64" /></a>
|
|
70
|
+
<a href="https://github.com/patriciogonzalezvivo/comfyui_glslnodes"><img src="https://lygia.xyz/imgs/comfy.png" alt="comfyui" title="comfyUI" width="64" /></a>
|
|
71
|
+
<a href="https://github.com/ossia/score-examples"><img src="https://lygia.xyz/imgs/ossia.png" alt="ossia" title="ossia" width="64" /></a>
|
|
72
|
+
</p>
|
|
73
|
+
|
|
74
|
+
<p style="text-align: center;" >
|
|
75
|
+
<a href="https://www.figma.com/community/plugin/1138854718618193875"><img src="https://lygia.xyz/imgs/figma.png" alt="figma" title="figma" width="64" /></a>
|
|
76
|
+
<a href="https://observablehq.com/@radames/hello-lygia-shader-library"><img src="https://lygia.xyz/imgs/ob.png" alt="observable" title="observable" width="64" /></a>
|
|
77
|
+
<a href="https://www.productioncrate.com/laforge/"><img src="https://lygia.xyz/imgs/laforge.png" alt="laforge" title="laforge" width="64" /></a>
|
|
78
|
+
<a href="https://synesthesia.live/"><img src="https://lygia.xyz/imgs/synesthesia.png" alt="synesthesia" title="synesthesia" width="64" /></a>
|
|
79
|
+
<a href="https://glsl.app/"><img src="https://glsl.app/icon-256.png" alt="glslApp" title="glslApp" width="64"/></a>
|
|
80
|
+
<a href="https://dev.shader.app/"><img src="https://dev.shaders.app/apple-touch-icon.png" alt="shaderApp" title="shaderApp" width="64"/></a>
|
|
81
|
+
</p>
|
|
82
|
+
|
|
83
|
+
If you are working on a project and want to use LYGIA, you have two options: cloning a **local** version that then you can bundle into your project; or using the **server** ( https://lygia.xyz ) to resolve the dependencies online. How each one works?
|
|
58
84
|
|
|
59
85
|
### LYGIA Locally
|
|
60
86
|
|
|
61
|
-
If you
|
|
87
|
+
If you want to work **locally**, you must ensure that your environment can resolve `#include` dependencies. You can find some examples in [here specially for GLSL](https://github.com/patriciogonzalezvivo/lygia/blob/main/README_GLSL.md). Then you just need to clone LYGIA into your project relative to the shader you are loading:
|
|
62
88
|
|
|
63
89
|
```bash
|
|
64
90
|
git clone https://github.com/patriciogonzalezvivo/lygia.git
|
|
@@ -70,9 +96,26 @@ or as a submodule:
|
|
|
70
96
|
git submodule add https://github.com/patriciogonzalezvivo/lygia.git
|
|
71
97
|
```
|
|
72
98
|
|
|
73
|
-
|
|
99
|
+
Alternatively you may clone LYGIA without the git history and reduce the project size (9MB+) with the following command:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx degit https://github.com/patriciogonzalezvivo/lygia.git lygia
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
If you are concerned about the size of the library you might also be interested on pruning the library to only the language you are using. You can do that by using the `prune.py` script. For example:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
python prune.py --all --keep glsl
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Alternatively, if your are working on a `npm` project, there is a [npm bundle](https://www.npmjs.com/package/lygia) you could use.
|
|
112
|
+
|
|
113
|
+
If you are working on web project you may want to resolve the dependencies using a bundler like [vite glsl plugin (local bundle)](https://github.com/UstymUkhman/vite-plugin-glsl), [esbuild glsl plugin (local bundle)](https://github.com/ricardomatias/esbuild-plugin-glsl-include) or [webpack glsl plugin (local bundle)](https://github.com/grieve/webpack-glsl-loader).
|
|
74
114
|
|
|
75
|
-
|
|
115
|
+
|
|
116
|
+
### LYGIA server
|
|
117
|
+
|
|
118
|
+
If you are working on a **cloud platform** (like [CodePen](https://codepen.io/) or [Observable](https://observablehq.com/@radames/hello-lygia-shader-library) ) you probably want to resolve the dependencies without needing to install anything. For that just add a link to `https://lygia.xyz/resolve.js` (JS) or `https://lygia.xyz/resolve.esm.js` (ES6 module):
|
|
76
119
|
|
|
77
120
|
```html
|
|
78
121
|
<!-- as a JavaScript source -->
|
|
@@ -105,29 +148,14 @@ To then resolve the dependencies by passing a `string` or `strings[]` to `resolv
|
|
|
105
148
|
shdr = createShader(vertSource, fragSource);
|
|
106
149
|
```
|
|
107
150
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Learn more about LYGIA and how to use it from these **examples**:
|
|
111
|
-
|
|
112
|
-
* [2D examples for Processing (GLSL)](https://github.com/patriciogonzalezvivo/lygia_p5_examples)
|
|
113
|
-
* [2D/3D examples for P5.js (GLSL)](https://editor.p5js.org/patriciogonzalezvivo/sketches)
|
|
114
|
-
* [2D examples for Three.js + React (GLSL)](https://codesandbox.io/s/lygia-react-starter-fftx6p) by [Eduard Fossas](https://eduardfossas.vercel.app/)
|
|
115
|
-
* [2D examples for Three.js (GLSL)](https://github.com/patriciogonzalezvivo/lygia_threejs_examples)
|
|
116
|
-
* [3D examples for Three.js (GLSL)](https://github.com/guidoschmidt/lygia_threejs_examples) by [Guido Schmidt](https://guidoschmidt.cc/)
|
|
117
|
-
* [2D examples for OpenFrameworks (GLSL)](https://github.com/patriciogonzalezvivo/lygia_of_examples)
|
|
118
|
-
* [2D/3D examples for Unity3D (HLSL)](https://github.com/patriciogonzalezvivo/lygia_unity_examples)
|
|
119
|
-
* [2D examples for Touch Designer (GLSL)](https://derivative.ca/community-post/asset/lygia-touchdesginer/66804) (dynamic resolver) by [Leith Ben Abdessalem](https://leithba.com)
|
|
120
|
-
* [2D examples for Touch Designer (GLSL)](https://github.com/vectorsize/lygia-td) (static resolver) by [Victor Saz](https://github.com/vectorsize)
|
|
121
|
-
* [2D examples on Observable Notebook (GLSL)](https://observablehq.com/@radames/hello-lygia-shader-library) by [Radames Ajna](https://twitter.com/radamar)
|
|
122
|
-
* [Figma's noise&texture plugin](https://www.figma.com/community/plugin/1138854718618193875) by [Rogie King](https://twitter.com/rogie). You will need to go to the "Custom" tab on the plugin to edit shaders and load LYGIA modules
|
|
123
|
-
* [3D example on Irmf](https://github.com/irmf/irmf-examples/tree/master/examples/028-lygia) by [Glenn Lewis](https://github.com/gmlewis)
|
|
124
|
-
* [2D/3D examples on GlslViewer (GLSL)](https://github.com/patriciogonzalezvivo/lygia_examples)
|
|
125
|
-
* [2D examples on Ossia by Jean-Michaël Celerier](https://github.com/ossia/score-examples)
|
|
126
|
-
|
|
127
|
-
For more information, guidance, or feedback about using LYGIA, join [#Lygia channel on shader.zone discord](https://shader.zone/).
|
|
151
|
+
This function can also resolve dependencies to previous versions of LYGIA by using this pattern `lygia/vX.X/...` or `lygia/vX.X.X/...` on you dependency paths. For example:
|
|
128
152
|
|
|
153
|
+
```glsl
|
|
154
|
+
#include "lygia/v1.0/math/decimation.glsl"
|
|
155
|
+
#include "lygia/v1.2.1/math/decimation.glsl"
|
|
156
|
+
```
|
|
129
157
|
|
|
130
|
-
### How is
|
|
158
|
+
### How is LYGIA organized?
|
|
131
159
|
|
|
132
160
|
The functions are divided into different categories:
|
|
133
161
|
|
|
@@ -141,13 +169,14 @@ The functions are divided into different categories:
|
|
|
141
169
|
* [`sample/`](https://lygia.xyz/sample): sample operations
|
|
142
170
|
* [`filter/`](https://lygia.xyz/filter): typical filter operations: different kind of blurs, mean and median filters.
|
|
143
171
|
* [`distort/`](https://lygia.xyz/distort): distort sampling operations
|
|
144
|
-
* [`simulate/`](https://lygia.xyz/simulate): simulate sampling operations
|
|
145
172
|
* [`lighting/`](https://lygia.xyz/lighting): different lighting models and functions for foward/deferred/raymarching rendering
|
|
146
173
|
* [`geometry/`](https://lygia.xyz/geometry): operation related to geometries: intersections and AABB accelerating structures.
|
|
147
174
|
* [`morphological/`](https://lygia.xyz/morphological): morphological filters: dilation, erosion, alpha and poisson fill.
|
|
148
175
|
|
|
149
|
-
### Flexible how?
|
|
150
176
|
|
|
177
|
+
### How is it [designed](https://github.com/patriciogonzalezvivo/lygia/blob/main/DESIGN.md)?
|
|
178
|
+
|
|
179
|
+
LYGIA is designed to be very granular (each file holds one function), multilanguage (each language have it's onw file extension) and flexible. Flexible how?
|
|
151
180
|
There are some functions whose behavior can be changed using the `#defines` keyword before including it. For example, [gaussian blurs](filter/gaussianBlur.glsl) are usually are done in two passes. By default, these are performed on their 1D version, but if you are interested in using a 2D kernel, all in the same pass, you will need to add the `GAUSSIANBLUR_2D` keyword this way:
|
|
152
181
|
|
|
153
182
|
```glsl
|
|
@@ -165,159 +194,48 @@ There are some functions whose behavior can be changed using the `#defines` keyw
|
|
|
165
194
|
|
|
166
195
|
```
|
|
167
196
|
|
|
197
|
+
In the same way you can change the sampling function that the gaussian uses. Ex:
|
|
168
198
|
|
|
169
|
-
## Design Principles
|
|
170
|
-
|
|
171
|
-
1. It relies on `#include "path/to/file.*lsl"` which is defined by Khronos GLSL standard and requires a typical C-like pre-compiler MACRO which is easy to implement with just basic string operations to resolve dependencies.
|
|
172
|
-
|
|
173
|
-
Here you can find some implementations on different languages:
|
|
174
|
-
|
|
175
|
-
- C#:
|
|
176
|
-
|
|
177
|
-
. [GLSLIncludes](https://github.com/seb776/GLSLIncludes) a small utility to add the include feature to glsl by [z0rg](https://github.com/seb776).
|
|
178
|
-
|
|
179
|
-
- C++:
|
|
180
|
-
|
|
181
|
-
. [VERA's routines](https://github.com/patriciogonzalezvivo/vera/blob/main/src/ops/fs.cpp#L110-L171) for resolving GLSL dependencies.
|
|
182
|
-
|
|
183
|
-
- Python:
|
|
184
|
-
|
|
185
|
-
. [Small and simple routing to resolve includes](https://gist.github.com/patriciogonzalezvivo/9a50569c2ef9b08058706443a39d838e)
|
|
186
|
-
|
|
187
|
-
- JavaScript:
|
|
188
|
-
|
|
189
|
-
. [vanilla JS (online resolver)](https://lygia.xyz/resolve.js) This small file brings `resolveLygia()` which takes a `string` or `string[]` and parses it, solving all the `#include` dependencies into a single `string` you can load on your shaders.
|
|
190
|
-
|
|
191
|
-
. [npm module (online resolver)](https://www.npmjs.com/package/resolve-lygia) by Eduardo Fossas; [vite glsl plugin (local bundle)](https://github.com/UstymUkhman/vite-plugin-glsl) by Ustym Ukhman. Imports `.glsl` local dependencies, or load inline shaders through vite.
|
|
192
|
-
|
|
193
|
-
. [esbuild glsl plugin (local bundle)](https://github.com/ricardomatias/esbuild-plugin-glsl-include) by Ricardo Matias. Imports local `.glsl` dependencies through esbuild.
|
|
194
|
-
|
|
195
|
-
. [webpack glsl plugin (local bundle)](https://github.com/grieve/webpack-glsl-loader) by Ryan Grieve that imports local `.glsl` dependencies through webpack.
|
|
196
|
-
|
|
197
|
-
* It's **very granular**. One function per file. The file and the function share the same name, namely: `myFunc.glsl` contains `myFunct()`. There are some files that just include a collection of files inside a folder with the same name. For example:
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
color/blend.glsl
|
|
201
|
-
// which includes
|
|
202
|
-
color/blend/*.glsl
|
|
203
|
-
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
* It's **multi language**. Right now most of is GLSL (`*.glsl`) and HLSL (`*.hlsl`), but we are slowly extending to WGSL (`*.wgsl`), CUDA (`*.cuh`) and Metal (`*.msl`).
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
math/mirror.glsl
|
|
210
|
-
math/mirror.hlsl
|
|
211
|
-
math/mirror.wgsl
|
|
212
|
-
math/mirror.msl
|
|
213
|
-
math/mirror.cuh
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
* **Self documented**. Each file contains a structured comment (in YAML) at the top of the file. This one contains the name of the original author, description, use, and `#define` options
|
|
217
|
-
|
|
218
|
-
```glsl
|
|
219
|
-
|
|
220
|
-
/*
|
|
221
|
-
original_author: <FULL NAME>
|
|
222
|
-
description: [DESCRIPTION + URL]
|
|
223
|
-
use: <vec2> myFunc(<vec2> st, <float> x [, <float> y])
|
|
224
|
-
options:
|
|
225
|
-
- MYFUNC_TYPE
|
|
226
|
-
- MYFUNC_SAMPLER_FNC()
|
|
227
|
-
*/
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
* Prevents **name collisions** by using the following pattern where `FNC_` is followed with the function name:
|
|
232
|
-
|
|
233
|
-
```glsl
|
|
234
|
-
|
|
235
|
-
#ifndef FNC_MYFUNC
|
|
236
|
-
#define FNC_MYFUNC
|
|
237
|
-
|
|
238
|
-
float myFunc(float in) {
|
|
239
|
-
return in;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
#endif
|
|
243
|
-
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
* **Templating capabilities through `#defines`**. Probably the most frequent use is templating the sampling function for reusability. The `#define` options start with the name of the function, in this example `MYFUNC_`. They are added as `options:` in the header.
|
|
247
|
-
|
|
248
199
|
```glsl
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
#ifndef MYFUNC_SAMPLER_FNC
|
|
255
|
-
#define MYFUNC_SAMPLER_FNC(TEX, UV) texture2D(TEX, UV)
|
|
256
|
-
#endif
|
|
257
|
-
|
|
258
|
-
#ifndef FNC_MYFUNC
|
|
259
|
-
#define FNC_MYFUNC
|
|
260
|
-
MYFUNC_TYPE myFunc(sampler2D tex, vec2 st) {
|
|
261
|
-
return MYFUNC_SAMPLER_FNC(tex, st);
|
|
262
|
-
}
|
|
263
|
-
#endif
|
|
264
|
-
|
|
200
|
+
// from
|
|
201
|
+
#define GAUSSIANBLUR_SAMPLER_FNC(TEX, UV) texture2D(TEX, UV)
|
|
202
|
+
// to
|
|
203
|
+
#include "lygia/sample/clamp2edges.glsl"
|
|
204
|
+
#define GAUSSIANBLUR_SAMPLER_FNC(TEX, UV) sampleClamp2edge(TEX, UV)
|
|
265
205
|
```
|
|
266
206
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
```glsl
|
|
270
|
-
|
|
271
|
-
/*
|
|
272
|
-
...
|
|
273
|
-
use: myFunc(<vec2> st, <vec2|float> x[, <float> y])
|
|
274
|
-
*/
|
|
275
|
-
|
|
276
|
-
#ifndef FNC_MYFUNC
|
|
277
|
-
#define FNC_MYFUNC
|
|
278
|
-
vec2 myFunc(vec2 st, vec2 x) {
|
|
279
|
-
return st * x;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
vec2 myFunc(vec2 st, float x) {
|
|
283
|
-
return st * x;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
vec2 myFunc(vec2 st, float x, float y) {
|
|
287
|
-
return st * vec2(x, y);
|
|
288
|
-
}
|
|
289
|
-
#endif
|
|
290
|
-
|
|
291
|
-
```
|
|
207
|
+
Learn more about [LYGIAS design principles in the DESIGN.md file](https://github.com/patriciogonzalezvivo/lygia/blob/main/DESIGN.md).
|
|
292
208
|
|
|
293
209
|
## Contributions
|
|
294
210
|
|
|
295
|
-
LYGIA has a long way to go
|
|
211
|
+
LYGIA has a long way to go and welcomes all kinds of contributions. You can help by:
|
|
296
212
|
|
|
297
|
-
* fixing
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
213
|
+
* **Bug fixing**
|
|
214
|
+
* **Translation**, keeping parity between languages (GLSL, HLSL, MSL, WGSL, TSL, CUDA, OSL, etc) is a big part of the challenge. Not all language are the same and we want to make sure make sure each function is optimized and carefully crafted for each enviroment. This means, the more eyes looking at this, the better. Please make sure to read and understand the [Design Principles](https://github.com/patriciogonzalezvivo/lygia/blob/main/DESIGN.md) before starting.
|
|
215
|
+
* **New functions or improving the current implementations**. Please take a look to the [Contributing Guidelines](https://github.com/patriciogonzalezvivo/lygia/blob/main/CONTRIBUTING.md) before starting.
|
|
216
|
+
* **Documentation**. Each function has a header with some information describing the function. Make sure to fill this information when adding a new function.
|
|
217
|
+
* Adding new **examples** and integrations for new environments like: [Godot](https://godotengine.org/), [ISF](https://isf.video/), [MaxMSP](https://cycling74.com/products/max), etc.
|
|
218
|
+
* **Financial** [sponsorships](https://github.com/sponsors/patriciogonzalezvivo). Right now, the money that flows in is invested on the server and infraestructure. Long term plan will be to be able to pay lead contributors and mantainers.
|
|
302
219
|
|
|
220
|
+
Collaborators and sponsors are automatically added to the [commercial license](https://lygia.xyz/license). Making a PR or subscribing to the github sponsors program is the shortest path to get access to the commercial license. It's all automated, not red taping. LYGIA belongs to those that takes care of it.
|
|
303
221
|
|
|
304
222
|
## License
|
|
305
223
|
|
|
306
|
-
LYGIA
|
|
224
|
+
LYGIA belongs to those that support it. For that it uses a dual-licensed under the [Prosperity License](https://prosperitylicense.com/versions/3.0.0) and the [Patron License](https://lygia.xyz/license) for [sponsors](https://github.com/sponsors/patriciogonzalezvivo) and [contributors](https://github.com/patriciogonzalezvivo/lygia/graphs/contributors).
|
|
307
225
|
|
|
308
|
-
[Sponsors](https://github.com/sponsors/patriciogonzalezvivo) and [contributors](https://github.com/patriciogonzalezvivo/lygia/graphs/contributors) are automatically added to the [Patron License](https://lygia.xyz/license) and they can ignore any non-commercial rule of the [Prosperity License](https://prosperitylicense.com/versions/3.0.0) software
|
|
226
|
+
[Sponsors](https://github.com/sponsors/patriciogonzalezvivo) and [contributors](https://github.com/patriciogonzalezvivo/lygia/graphs/contributors) are automatically added to the [Patron License](https://lygia.xyz/license) and they can ignore any non-commercial rule of the [Prosperity License](https://prosperitylicense.com/versions/3.0.0) software.
|
|
309
227
|
|
|
310
228
|
It's also possible to get a permanent commercial license hooked to a single and specific version of LYGIA.
|
|
311
229
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
* `color/mixBox.glsl` and `color/mixBox.hlsl` are copyrighted by Secret Weapons with their own non-commercial license. These functions also require a LUT texture which is provided for research and evaluation purposes, if you wish to obtain it together with a commercial license, please contact them at [mixbox@scrtwpns.com](mailto:mixbox@scrtwpns.com).
|
|
230
|
+
If you have doubts please reaching out to patriciogonzalezvivo at gmail dot com
|
|
315
231
|
|
|
316
232
|
## Credits
|
|
317
233
|
|
|
318
|
-
Created and mantained by [Patricio Gonzalez Vivo](https://patriciogonzalezvivo.com/)( <a rel="me" href="https://merveilles.town/@patricio">Mastodon</a> | [Twitter](https://twitter.com/patriciogv) | [Instagram](https://www.instagram.com/patriciogonzalezvivo/) | [GitHub](https://github.com/sponsors/patriciogonzalezvivo) ) and every direct or indirect [contributors](https://github.com/patriciogonzalezvivo/lygia/graphs/contributors) to the GitHub.
|
|
234
|
+
Created and mantained by [Patricio Gonzalez Vivo](https://patriciogonzalezvivo.com/)( <a rel="me" href="https://merveilles.town/@patricio">Mastodon</a> | [Twitter](https://twitter.com/patriciogv) | [Instagram](https://www.instagram.com/patriciogonzalezvivo/) | [GitHub](https://github.com/sponsors/patriciogonzalezvivo) ) and every direct or indirect [contributors](https://github.com/patriciogonzalezvivo/lygia/graphs/contributors) to the GitHub.
|
|
235
|
+
|
|
236
|
+
This library has been built in many cases on top of the work of brilliant and generous people like: [Inigo Quiles](https://www.iquilezles.org/), [Morgan McGuire](https://casual-effects.com/), [Alan Wolfe](https://blog.demofox.org/), [Matt DesLauriers](https://www.mattdesl.com/), [Bjorn Ottosson](https://github.com/bottosson), [Hugh Kennedy](https://github.com/hughsk), and many others.
|
|
237
|
+
|
|
238
|
+
Also is being constantly mantain, translated and/or extended by generous contributors like: [Shadi El Hajj](https://github.com/shadielhajj), [Kathy](https://github.com/kfahn22), [Bonsak Schiledrop](https://github.com/bonsak), [Amin Shazrin](https://github.com/ammein), [Guido Schmidt](https://github.com/guidoschmidt), and many others.
|
|
319
239
|
|
|
320
240
|
|
|
321
|
-
## Get the latest news and releases
|
|
322
241
|
|
|
323
|
-
Sign up for the news letter below, join [the LYGIA's channel on Discord](https://shader.zone) or follow the [Github repository](https://github.com/patriciogonzalezvivo/lygia)
|
package/README_GLSL.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
LYGIA relies on `#include "path/to/file.glsl"` which is defined by Khronos GLSL standard but it's up to the project developer to implement. Good news is that it's not that hard, it just requires a typical C-like MACRO pre-compiler, which is easy to implement with just basic string operations to resolve dependencies.
|
|
2
|
+
|
|
3
|
+
Here you can find some examples in different languages:
|
|
4
|
+
|
|
5
|
+
- C#:
|
|
6
|
+
|
|
7
|
+
. [GLSLIncludes](https://github.com/seb776/GLSLIncludes) a small utility to add the include feature to glsl by [z0rg](https://github.com/seb776).
|
|
8
|
+
|
|
9
|
+
- C++:
|
|
10
|
+
|
|
11
|
+
. [VERA's routines](https://github.com/patriciogonzalezvivo/vera/blob/main/src/ops/fs.cpp#L110-L171) for resolving GLSL dependencies.
|
|
12
|
+
|
|
13
|
+
- Python:
|
|
14
|
+
|
|
15
|
+
. [Small and simple routing to resolve includes](https://gist.github.com/patriciogonzalezvivo/9a50569c2ef9b08058706443a39d838e)
|
|
16
|
+
|
|
17
|
+
- JavaScript:
|
|
18
|
+
|
|
19
|
+
. [vanilla JS (online resolver)](https://lygia.xyz/resolve.js) This small file brings `resolveLygia()` which takes a `string` or `string[]` and parses it, solving all the `#include` dependencies into a single `string` you can load on your shaders. It also has a `resolveLygiaAsync()` version that resolves all the dependencies in parallel. Both support dependencies to previous versions of LYGIA by using this pattern `lygia/vX.X.X/...` on you dependency paths.
|
|
20
|
+
|
|
21
|
+
. [npm module (online resolver)](https://www.npmjs.com/package/resolve-lygia) by Eduardo Fossas. This is bring the same `resolveLygia()` and `resolveLygiaAsync()` function but as a npm module.
|
|
22
|
+
|
|
23
|
+
. [vite glsl plugin (local bundle)](https://github.com/UstymUkhman/vite-plugin-glsl) by Ustym Ukhman. Imports `.glsl` local dependencies, or load inline shaders through vite.
|
|
24
|
+
|
|
25
|
+
. [esbuild glsl plugin (local bundle)](https://github.com/ricardomatias/esbuild-plugin-glsl-include) by Ricardo Matias. Imports local `.glsl` dependencies through esbuild.
|
|
26
|
+
|
|
27
|
+
. [webpack glsl plugin (local bundle)](https://github.com/grieve/webpack-glsl-loader) by Ryan Grieve that imports local `.glsl` dependencies through webpack.
|
package/README_METAL.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# METAL version
|
|
2
|
+
|
|
3
|
+
Metal support is currently highly experimental and very work in progress.
|
|
4
|
+
|
|
5
|
+
## Porting Progress
|
|
6
|
+
|
|
7
|
+
- [ ] Animation
|
|
8
|
+
- [x] Blend
|
|
9
|
+
- [ ] Color
|
|
10
|
+
- [x] Blend
|
|
11
|
+
- [x] Dither (not fully vetted / just spot checked)
|
|
12
|
+
- [ ] Palette
|
|
13
|
+
- [x] Levels
|
|
14
|
+
- [x] Space
|
|
15
|
+
- [ ] Tonemap
|
|
16
|
+
- [x] Distort
|
|
17
|
+
- [x] Draw - (not fully vetted / just spot checked)
|
|
18
|
+
- [ ] Filters
|
|
19
|
+
- [x] Gaussian Blur
|
|
20
|
+
- [x] Box 2d
|
|
21
|
+
- [x] Generative (not fully vetted / just spot checked)
|
|
22
|
+
- [ ] Geometry
|
|
23
|
+
- [ ] Lighting
|
|
24
|
+
- [x] Math - (not fully vetted / just spot checked)
|
|
25
|
+
- [ ] Morphological
|
|
26
|
+
- [ ] Sample
|
|
27
|
+
- [x] Sampler
|
|
28
|
+
- [x] SDF - (not fully vetted / just spot checked)
|
|
29
|
+
- [ ] Space
|
|
30
|
+
|
|
31
|
+
## Porting Methodology
|
|
32
|
+
|
|
33
|
+
- dupe `*.glsl` files-> and rename them to `*.msl`
|
|
34
|
+
- find replace `.glsl` -> `.msl` and ensure you repeat the above for imports
|
|
35
|
+
- find replace `vec2` -> `float2`
|
|
36
|
+
- find replace `vec3` -> `float3`
|
|
37
|
+
- find replace `vec4` -> `float4`
|
|
38
|
+
- find replace `matN` -> `matrix<float, n, n>`
|
|
39
|
+
- find replace `in ` function argument keyword -> `` as metal doesn't have the in function keyword
|
|
40
|
+
- find `inout` and determine which thread local memory keyword should replace it, and make it a reference
|
|
41
|
+
- ensure `const` is only used within functions, `constant` must be used for global scoped constants
|
|
42
|
+
|
|
43
|
+
## Things to look out for
|
|
44
|
+
|
|
45
|
+
- Metal does not have the same basic math functions signatures as GLSL. We are adding all the polyfill functions in the `math/` folder.
|
|
46
|
+
- Texture precision and filtering.
|
|
47
|
+
- Added `SAMPLER_TYPE` which specifies the texture precisions. Defaults to `texture2d<float>`
|
|
48
|
+
- This means your texture definition must match the default `float` precision, or you will need to override `SAMPLER_TYPE`
|
|
49
|
+
- Added `SAMPLER` which specifies the Metal sampler object. Defaults to `sampler( min_filter::linear, mag_filter::linear )`
|
|
50
|
+
|
|
51
|
+
## Things not yet done
|
|
52
|
+
|
|
53
|
+
- `gl_FragCoord` compatibilty. Not sure if there is a nice way to make this work without end users annotating their root Metal shader entry point.
|
|
54
|
+
- For now, use the function definitions which pass the [[position]] coords from your main shader.
|
|
55
|
+
- `atan` / `atan2` compatibility. Need to see if there is a nice way to override the function signatures to match.
|
|
56
|
+
|