lygia 1.3.3 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (766) hide show
  1. package/.github/workflows/ci.yml +39 -0
  2. package/README.md +5 -2
  3. package/README_WESL.md +40 -0
  4. package/README_WebGPU.md +203 -0
  5. package/animation/easing/backIn.wesl +11 -0
  6. package/animation/easing/backInOut.wesl +14 -0
  7. package/animation/easing/backOut.wesl +11 -0
  8. package/animation/easing/bounceIn.wesl +11 -0
  9. package/animation/easing/bounceInOut.wesl +17 -0
  10. package/animation/easing/bounceOut.wesl +33 -0
  11. package/animation/easing/circularIn.wesl +9 -0
  12. package/animation/easing/circularInOut.wesl +15 -0
  13. package/animation/easing/circularOut.wesl +9 -0
  14. package/animation/easing/cubicIn.wesl +9 -0
  15. package/animation/easing/cubicInOut.wesl +15 -0
  16. package/animation/easing/cubicOut.wesl +12 -0
  17. package/animation/easing/elasticIn.wesl +11 -0
  18. package/animation/easing/elasticInOut.wesl +17 -0
  19. package/animation/easing/elasticOut.wesl +11 -0
  20. package/animation/easing/exponentialIn.wesl +15 -0
  21. package/animation/easing/exponentialInOut.wesl +19 -0
  22. package/animation/easing/exponentialOut.wesl +15 -0
  23. package/animation/easing/linearIn.wesl +9 -0
  24. package/animation/easing/linearInOut.wesl +9 -0
  25. package/animation/easing/linearOut.wesl +9 -0
  26. package/animation/easing/quadraticIn.wesl +9 -0
  27. package/animation/easing/quadraticInOut.wesl +12 -0
  28. package/animation/easing/quadraticOut.wesl +9 -0
  29. package/animation/easing/quarticIn.wesl +9 -0
  30. package/animation/easing/quarticInOut.wesl +15 -0
  31. package/animation/easing/quarticOut.wesl +12 -0
  32. package/animation/easing/quinticIn.wesl +9 -0
  33. package/animation/easing/quinticInOut.wesl +15 -0
  34. package/animation/easing/quinticOut.wesl +9 -0
  35. package/animation/easing/sineIn.wesl +11 -0
  36. package/animation/easing/sineInOut.wesl +11 -0
  37. package/animation/easing/sineOut.wesl +11 -0
  38. package/animation/spriteLoop.wesl +15 -0
  39. package/color/blend/add.wesl +3 -3
  40. package/color/blend/color.wesl +4 -4
  41. package/color/blend/colorDodge.wesl +7 -7
  42. package/color/blend/darken.wesl +7 -7
  43. package/color/blend/difference.wesl +3 -3
  44. package/color/blend/glow.wesl +3 -3
  45. package/color/blend/hardLight.wesl +2 -2
  46. package/color/blend/hardMix.wesl +7 -7
  47. package/color/blend/hue.wesl +4 -4
  48. package/color/blend/lighten.wesl +7 -7
  49. package/color/blend/linearBurn.wesl +5 -5
  50. package/color/blend/linearDodge.wesl +5 -5
  51. package/color/blend/linearLight.wesl +8 -9
  52. package/color/blend/luminosity.wesl +4 -4
  53. package/color/blend/multiply.wesl +1 -1
  54. package/color/blend/negation.wesl +3 -3
  55. package/color/blend/overlay.wesl +3 -3
  56. package/color/blend/phoenix.wesl +4 -4
  57. package/color/blend/pinLight.wesl +8 -9
  58. package/color/blend/reflect.wesl +7 -7
  59. package/color/blend/saturation.wesl +4 -4
  60. package/color/blend/screen.wesl +5 -5
  61. package/color/blend/softLight.wesl +4 -4
  62. package/color/blend/subtract.wesl +3 -3
  63. package/color/blend/vividLight.wesl +8 -9
  64. package/color/brightnessContrast.wesl +1 -1
  65. package/color/brightnessMatrix.wesl +19 -0
  66. package/color/composite/compositeXor.wesl +23 -0
  67. package/color/composite/destinationAtop.wesl +23 -0
  68. package/color/composite/destinationIn.wesl +23 -0
  69. package/color/composite/destinationOut.wesl +23 -0
  70. package/color/composite/destinationOver.wesl +23 -0
  71. package/color/composite/sourceAtop.wesl +23 -0
  72. package/color/composite/sourceIn.wesl +23 -0
  73. package/color/composite/sourceOut.wesl +23 -0
  74. package/color/composite/sourceOver.wesl +23 -0
  75. package/color/contrast.wesl +20 -0
  76. package/color/contrastMatrix.wesl +20 -0
  77. package/color/desaturate.wesl +16 -0
  78. package/color/distance.wesl +21 -6
  79. package/color/dither/bayer.wesl +44 -23
  80. package/color/dither/blueNoise.wesl +52 -18
  81. package/color/dither/vlachos.wesl +44 -14
  82. package/color/exposure.wesl +11 -2
  83. package/color/hueShift.wesl +20 -5
  84. package/color/hueShiftRYB.wesl +10 -5
  85. package/color/layer/addSourceOver.wesl +25 -0
  86. package/color/layer/averageSourceOver.wesl +25 -0
  87. package/color/layer/colorBurnSourceOver.wesl +25 -0
  88. package/color/layer/colorDodgeSourceOver.wesl +25 -0
  89. package/color/layer/colorSourceOver.wesl +25 -0
  90. package/color/layer/darkenSourceOver.wesl +25 -0
  91. package/color/layer/differenceSourceOver.wesl +25 -0
  92. package/color/layer/exclusionSourceOver.wesl +25 -0
  93. package/color/layer/glowSourceOver.wesl +25 -0
  94. package/color/layer/hardLightSourceOver.glsl +1 -1
  95. package/color/layer/hardLightSourceOver.wesl +25 -0
  96. package/color/layer/hardMixSourceOver.wesl +25 -0
  97. package/color/layer/hueSourceOver.wesl +25 -0
  98. package/color/layer/lightenSourceOver.wesl +25 -0
  99. package/color/layer/linearBurnSourceOver.wesl +25 -0
  100. package/color/layer/linearDodgeSourceOver.wesl +25 -0
  101. package/color/layer/linearLightSourceOver.wesl +26 -0
  102. package/color/layer/luminositySourceOver.wesl +26 -0
  103. package/color/layer/multiplySourceOver.wesl +22 -0
  104. package/color/layer/negationSourceOver.wesl +26 -0
  105. package/color/layer/overlaySourceOver.wesl +26 -0
  106. package/color/layer/phoenixSourceOver.wesl +26 -0
  107. package/color/layer/pinLightSourceOver.wesl +26 -0
  108. package/color/layer/reflectSourceOver.glsl +1 -1
  109. package/color/layer/reflectSourceOver.wesl +26 -0
  110. package/color/layer/saturationSourceOver.wesl +26 -0
  111. package/color/layer/screenSourceOver.wesl +26 -0
  112. package/color/layer/softLightSourceOver.wesl +26 -0
  113. package/color/layer/subtractSourceOver.wesl +26 -0
  114. package/color/layer/vividLightSourceOver.wesl +26 -0
  115. package/color/levels/gamma.wesl +26 -0
  116. package/color/levels/inputRange.wesl +26 -0
  117. package/color/levels/outputRange.wesl +26 -0
  118. package/color/levels.wesl +30 -0
  119. package/color/luma.wesl +11 -3
  120. package/color/luminance.wesl +18 -0
  121. package/color/mixOklab.wesl +34 -12
  122. package/color/mixSpectral.glsl +3 -3
  123. package/color/mixSpectral.wesl +14 -10
  124. package/color/palette/heatmap.wesl +1 -1
  125. package/color/palette/hue.wesl +8 -4
  126. package/color/saturationMatrix.wesl +14 -7
  127. package/color/space/YCbCr2rgb.wesl +4 -0
  128. package/color/space/YPbPr2rgb.wesl +10 -7
  129. package/color/space/cmyk2rgb.wesl +3 -1
  130. package/color/space/gamma2linear.wesl +15 -3
  131. package/color/space/hcy2rgb.wesl +10 -7
  132. package/color/space/hsl2rgb.wesl +6 -3
  133. package/color/space/hsv2rgb.wesl +4 -1
  134. package/color/space/hsv2ryb.wesl +20 -1
  135. package/color/space/hue2rgb.wesl +3 -1
  136. package/color/space/k2rgb.wesl +4 -1
  137. package/color/space/lab2lch.wesl +5 -1
  138. package/color/space/lab2rgb.wesl +1 -0
  139. package/color/space/lab2srgb.wesl +1 -0
  140. package/color/space/lab2xyz.wesl +13 -1
  141. package/color/space/lch2lab.wesl +5 -1
  142. package/color/space/lch2rgb.wesl +1 -1
  143. package/color/space/lch2srgb.wesl +21 -0
  144. package/color/space/linear2gamma.wesl +16 -3
  145. package/color/space/lms2rgb.wesl +4 -0
  146. package/color/space/oklab2rgb.wesl +5 -1
  147. package/color/space/oklab2srgb.wesl +4 -0
  148. package/color/space/rgb2YCbCr.wesl +4 -0
  149. package/color/space/rgb2YPbPr.wesl +12 -8
  150. package/color/space/rgb2cmyk.wesl +1 -1
  151. package/color/space/rgb2hcv.wesl +9 -2
  152. package/color/space/rgb2hcy.wesl +4 -0
  153. package/color/space/rgb2heat.wesl +5 -0
  154. package/color/space/rgb2hsl.wesl +8 -2
  155. package/color/space/rgb2hsv.wesl +8 -3
  156. package/color/space/rgb2hue.wesl +10 -2
  157. package/color/space/rgb2lab.wesl +4 -1
  158. package/color/space/rgb2lch.wesl +4 -1
  159. package/color/space/rgb2lms.wesl +4 -0
  160. package/color/space/rgb2luma.wesl +5 -1
  161. package/color/space/rgb2oklab.wesl +5 -1
  162. package/color/space/rgb2ryb.wesl +60 -12
  163. package/color/space/rgb2srgb.wesl +14 -4
  164. package/color/space/rgb2xyY.wesl +5 -1
  165. package/color/space/rgb2xyz.wesl +16 -10
  166. package/color/space/rgb2yiq.wesl +5 -1
  167. package/color/space/rgb2yuv.wesl +12 -8
  168. package/color/space/ryb2rgb.wesl +67 -24
  169. package/color/space/srgb2lab.wesl +3 -1
  170. package/color/space/srgb2lch.wesl +4 -0
  171. package/color/space/srgb2luma.wesl +6 -1
  172. package/color/space/srgb2oklab.wesl +4 -1
  173. package/color/space/srgb2rgb.wesl +13 -5
  174. package/color/space/srgb2xyz.wesl +4 -1
  175. package/color/space/xyY2rgb.wesl +4 -1
  176. package/color/space/xyY2srgb.wesl +5 -1
  177. package/color/space/xyY2xyz.wesl +7 -2
  178. package/color/space/xyz2lab.wesl +8 -4
  179. package/color/space/xyz2rgb.wesl +18 -4
  180. package/color/space/xyz2srgb.wesl +4 -1
  181. package/color/space/xyz2xyY.wesl +5 -1
  182. package/color/space/yiq2rgb.wesl +7 -2
  183. package/color/space/yuv2rgb.wesl +11 -8
  184. package/color/tonemap/aces.wesl +12 -10
  185. package/color/tonemap/debug.wesl +64 -0
  186. package/color/tonemap/filmic.wesl +1 -3
  187. package/color/tonemap/linear.wesl +13 -0
  188. package/color/tonemap/reinhard.wesl +13 -0
  189. package/color/tonemap/reinhardJodie.wesl +15 -0
  190. package/color/tonemap/uncharted.wesl +1 -1
  191. package/color/tonemap/unreal.wesl +13 -0
  192. package/color/vibrance.wesl +2 -2
  193. package/color/whiteBalance.wesl +1 -1
  194. package/dist/animation/easing/backIn/weslBundle.js +13 -0
  195. package/dist/animation/easing/backInOut/weslBundle.js +13 -0
  196. package/dist/animation/easing/backOut/weslBundle.js +13 -0
  197. package/dist/animation/easing/bounceIn/weslBundle.js +13 -0
  198. package/dist/animation/easing/bounceInOut/weslBundle.js +13 -0
  199. package/dist/animation/easing/bounceOut/weslBundle.js +10 -0
  200. package/dist/animation/easing/circularIn/weslBundle.js +10 -0
  201. package/dist/animation/easing/circularInOut/weslBundle.js +10 -0
  202. package/dist/animation/easing/circularOut/weslBundle.js +10 -0
  203. package/dist/animation/easing/cubicIn/weslBundle.js +10 -0
  204. package/dist/animation/easing/cubicInOut/weslBundle.js +10 -0
  205. package/dist/animation/easing/cubicOut/weslBundle.js +10 -0
  206. package/dist/animation/easing/elasticIn/weslBundle.js +13 -0
  207. package/dist/animation/easing/elasticInOut/weslBundle.js +13 -0
  208. package/dist/animation/easing/elasticOut/weslBundle.js +13 -0
  209. package/dist/animation/easing/exponentialIn/weslBundle.js +10 -0
  210. package/dist/animation/easing/exponentialInOut/weslBundle.js +10 -0
  211. package/dist/animation/easing/exponentialOut/weslBundle.js +10 -0
  212. package/dist/animation/easing/linearIn/weslBundle.js +10 -0
  213. package/dist/animation/easing/linearInOut/weslBundle.js +10 -0
  214. package/dist/animation/easing/linearOut/weslBundle.js +10 -0
  215. package/dist/animation/easing/quadraticIn/weslBundle.js +10 -0
  216. package/dist/animation/easing/quadraticInOut/weslBundle.js +10 -0
  217. package/dist/animation/easing/quadraticOut/weslBundle.js +10 -0
  218. package/dist/animation/easing/quarticIn/weslBundle.js +10 -0
  219. package/dist/animation/easing/quarticInOut/weslBundle.js +10 -0
  220. package/dist/animation/easing/quarticOut/weslBundle.js +10 -0
  221. package/dist/animation/easing/quinticIn/weslBundle.js +10 -0
  222. package/dist/animation/easing/quinticInOut/weslBundle.js +10 -0
  223. package/dist/animation/easing/quinticOut/weslBundle.js +10 -0
  224. package/dist/animation/easing/sineIn/weslBundle.js +13 -0
  225. package/dist/animation/easing/sineInOut/weslBundle.js +13 -0
  226. package/dist/animation/easing/sineOut/weslBundle.js +13 -0
  227. package/dist/animation/spriteLoop/weslBundle.js +13 -0
  228. package/dist/color/blend/add/weslBundle.js +10 -0
  229. package/dist/color/blend/average/weslBundle.js +10 -0
  230. package/dist/color/blend/color/weslBundle.js +14 -0
  231. package/dist/color/blend/colorBurn/weslBundle.js +10 -0
  232. package/dist/color/blend/colorDodge/weslBundle.js +10 -0
  233. package/dist/color/blend/darken/weslBundle.js +10 -0
  234. package/dist/color/blend/difference/weslBundle.js +10 -0
  235. package/dist/color/blend/exclusion/weslBundle.js +10 -0
  236. package/dist/color/blend/glow/weslBundle.js +13 -0
  237. package/dist/color/blend/hardLight/weslBundle.js +13 -0
  238. package/dist/color/blend/hardMix/weslBundle.js +13 -0
  239. package/dist/color/blend/hue/weslBundle.js +14 -0
  240. package/dist/color/blend/lighten/weslBundle.js +10 -0
  241. package/dist/color/blend/linearBurn/weslBundle.js +10 -0
  242. package/dist/color/blend/linearDodge/weslBundle.js +10 -0
  243. package/dist/color/blend/linearLight/weslBundle.js +14 -0
  244. package/dist/color/blend/luminosity/weslBundle.js +14 -0
  245. package/dist/color/blend/multiply/weslBundle.js +10 -0
  246. package/dist/color/blend/negation/weslBundle.js +10 -0
  247. package/dist/color/blend/overlay/weslBundle.js +10 -0
  248. package/dist/color/blend/phoenix/weslBundle.js +10 -0
  249. package/dist/color/blend/pinLight/weslBundle.js +14 -0
  250. package/dist/color/blend/reflect/weslBundle.js +10 -0
  251. package/dist/color/blend/saturation/weslBundle.js +14 -0
  252. package/dist/color/blend/screen/weslBundle.js +10 -0
  253. package/dist/color/blend/softLight/weslBundle.js +10 -0
  254. package/dist/color/blend/subtract/weslBundle.js +10 -0
  255. package/dist/color/blend/vividLight/weslBundle.js +14 -0
  256. package/dist/color/brightnessContrast/weslBundle.js +10 -0
  257. package/dist/color/brightnessMatrix/weslBundle.js +10 -0
  258. package/dist/color/composite/compositeXor/weslBundle.js +10 -0
  259. package/dist/color/composite/destinationAtop/weslBundle.js +10 -0
  260. package/dist/color/composite/destinationIn/weslBundle.js +10 -0
  261. package/dist/color/composite/destinationOut/weslBundle.js +10 -0
  262. package/dist/color/composite/destinationOver/weslBundle.js +10 -0
  263. package/dist/color/composite/sourceAtop/weslBundle.js +10 -0
  264. package/dist/color/composite/sourceIn/weslBundle.js +10 -0
  265. package/dist/color/composite/sourceOut/weslBundle.js +10 -0
  266. package/dist/color/composite/sourceOver/weslBundle.js +10 -0
  267. package/dist/color/contrast/weslBundle.js +10 -0
  268. package/dist/color/contrastMatrix/weslBundle.js +10 -0
  269. package/dist/color/desaturate/weslBundle.js +10 -0
  270. package/dist/color/distance/weslBundle.js +23 -0
  271. package/dist/color/dither/bayer/weslBundle.js +13 -0
  272. package/dist/color/dither/blueNoise/weslBundle.js +14 -0
  273. package/dist/color/dither/vlachos/weslBundle.js +13 -0
  274. package/dist/color/exposure/weslBundle.js +10 -0
  275. package/dist/color/hueShift/weslBundle.js +19 -0
  276. package/dist/color/hueShiftRYB/weslBundle.js +19 -0
  277. package/dist/color/layer/addSourceOver/weslBundle.js +14 -0
  278. package/dist/color/layer/averageSourceOver/weslBundle.js +14 -0
  279. package/dist/color/layer/colorBurnSourceOver/weslBundle.js +14 -0
  280. package/dist/color/layer/colorDodgeSourceOver/weslBundle.js +17 -0
  281. package/dist/color/layer/colorSourceOver/weslBundle.js +14 -0
  282. package/dist/color/layer/darkenSourceOver/weslBundle.js +14 -0
  283. package/dist/color/layer/differenceSourceOver/weslBundle.js +17 -0
  284. package/dist/color/layer/exclusionSourceOver/weslBundle.js +14 -0
  285. package/dist/color/layer/glowSourceOver/weslBundle.js +14 -0
  286. package/dist/color/layer/hardLightSourceOver/weslBundle.js +14 -0
  287. package/dist/color/layer/hardMixSourceOver/weslBundle.js +14 -0
  288. package/dist/color/layer/hueSourceOver/weslBundle.js +14 -0
  289. package/dist/color/layer/lightenSourceOver/weslBundle.js +14 -0
  290. package/dist/color/layer/linearBurnSourceOver/weslBundle.js +17 -0
  291. package/dist/color/layer/linearDodgeSourceOver/weslBundle.js +17 -0
  292. package/dist/color/layer/linearLightSourceOver/weslBundle.js +17 -0
  293. package/dist/color/layer/luminositySourceOver/weslBundle.js +17 -0
  294. package/dist/color/layer/multiplySourceOver/weslBundle.js +14 -0
  295. package/dist/color/layer/negationSourceOver/weslBundle.js +14 -0
  296. package/dist/color/layer/overlaySourceOver/weslBundle.js +14 -0
  297. package/dist/color/layer/phoenixSourceOver/weslBundle.js +14 -0
  298. package/dist/color/layer/pinLightSourceOver/weslBundle.js +14 -0
  299. package/dist/color/layer/reflectSourceOver/weslBundle.js +14 -0
  300. package/dist/color/layer/saturationSourceOver/weslBundle.js +17 -0
  301. package/dist/color/layer/screenSourceOver/weslBundle.js +14 -0
  302. package/dist/color/layer/softLightSourceOver/weslBundle.js +14 -0
  303. package/dist/color/layer/subtractSourceOver/weslBundle.js +14 -0
  304. package/dist/color/layer/vividLightSourceOver/weslBundle.js +17 -0
  305. package/dist/color/levels/gamma/weslBundle.js +10 -0
  306. package/dist/color/levels/inputRange/weslBundle.js +10 -0
  307. package/dist/color/levels/outputRange/weslBundle.js +10 -0
  308. package/dist/color/levels/weslBundle.js +19 -0
  309. package/dist/color/luma/weslBundle.js +13 -0
  310. package/dist/color/luminance/weslBundle.js +10 -0
  311. package/dist/color/mixOklab/weslBundle.js +14 -0
  312. package/dist/color/mixSpectral/weslBundle.js +13 -0
  313. package/dist/color/palette/heatmap/weslBundle.js +10 -0
  314. package/dist/color/palette/hue/weslBundle.js +13 -0
  315. package/dist/color/saturationMatrix/weslBundle.js +10 -0
  316. package/dist/color/space/YCbCr2rgb/weslBundle.js +10 -0
  317. package/dist/color/space/YPbPr2rgb/weslBundle.js +10 -0
  318. package/dist/color/space/cmyk2rgb/weslBundle.js +13 -0
  319. package/dist/color/space/gamma2linear/weslBundle.js +10 -0
  320. package/dist/color/space/hcy2rgb/weslBundle.js +13 -0
  321. package/dist/color/space/hsl2rgb/weslBundle.js +13 -0
  322. package/dist/color/space/hsv2rgb/weslBundle.js +13 -0
  323. package/dist/color/space/hsv2ryb/weslBundle.js +19 -0
  324. package/dist/color/space/hue2rgb/weslBundle.js +13 -0
  325. package/dist/color/space/k2rgb/weslBundle.js +13 -0
  326. package/dist/color/space/lab2lch/weslBundle.js +10 -0
  327. package/dist/color/space/lab2rgb/weslBundle.js +14 -0
  328. package/dist/color/space/lab2srgb/weslBundle.js +14 -0
  329. package/dist/color/space/lab2xyz/weslBundle.js +10 -0
  330. package/dist/color/space/lch2lab/weslBundle.js +10 -0
  331. package/dist/color/space/lch2rgb/weslBundle.js +14 -0
  332. package/dist/color/space/lch2srgb/weslBundle.js +14 -0
  333. package/dist/color/space/linear2gamma/weslBundle.js +10 -0
  334. package/dist/color/space/lms2rgb/weslBundle.js +10 -0
  335. package/dist/color/space/oklab2rgb/weslBundle.js +10 -0
  336. package/dist/color/space/oklab2srgb/weslBundle.js +14 -0
  337. package/dist/color/space/rgb2YCbCr/weslBundle.js +10 -0
  338. package/dist/color/space/rgb2YPbPr/weslBundle.js +10 -0
  339. package/dist/color/space/rgb2cmyk/weslBundle.js +10 -0
  340. package/dist/color/space/rgb2hcv/weslBundle.js +10 -0
  341. package/dist/color/space/rgb2hcy/weslBundle.js +14 -0
  342. package/dist/color/space/rgb2heat/weslBundle.js +13 -0
  343. package/dist/color/space/rgb2hsl/weslBundle.js +13 -0
  344. package/dist/color/space/rgb2hsv/weslBundle.js +10 -0
  345. package/dist/color/space/rgb2hue/weslBundle.js +10 -0
  346. package/dist/color/space/rgb2lab/weslBundle.js +14 -0
  347. package/dist/color/space/rgb2lch/weslBundle.js +14 -0
  348. package/dist/color/space/rgb2lms/weslBundle.js +10 -0
  349. package/dist/color/space/rgb2luma/weslBundle.js +10 -0
  350. package/dist/color/space/rgb2oklab/weslBundle.js +10 -0
  351. package/dist/color/space/rgb2ryb/weslBundle.js +13 -0
  352. package/dist/color/space/rgb2srgb/weslBundle.js +13 -0
  353. package/dist/color/space/rgb2xyY/weslBundle.js +14 -0
  354. package/dist/color/space/rgb2xyz/weslBundle.js +10 -0
  355. package/dist/color/space/rgb2yiq/weslBundle.js +10 -0
  356. package/dist/color/space/rgb2yuv/weslBundle.js +10 -0
  357. package/dist/color/space/ryb2rgb/weslBundle.js +13 -0
  358. package/dist/color/space/srgb2lab/weslBundle.js +14 -0
  359. package/dist/color/space/srgb2lch/weslBundle.js +14 -0
  360. package/dist/color/space/srgb2luma/weslBundle.js +10 -0
  361. package/dist/color/space/srgb2oklab/weslBundle.js +14 -0
  362. package/dist/color/space/srgb2rgb/weslBundle.js +10 -0
  363. package/dist/color/space/srgb2xyz/weslBundle.js +14 -0
  364. package/dist/color/space/xyY2rgb/weslBundle.js +14 -0
  365. package/dist/color/space/xyY2srgb/weslBundle.js +14 -0
  366. package/dist/color/space/xyY2xyz/weslBundle.js +10 -0
  367. package/dist/color/space/xyz2lab/weslBundle.js +10 -0
  368. package/dist/color/space/xyz2rgb/weslBundle.js +10 -0
  369. package/dist/color/space/xyz2srgb/weslBundle.js +14 -0
  370. package/dist/color/space/xyz2xyY/weslBundle.js +10 -0
  371. package/dist/color/space/yiq2rgb/weslBundle.js +10 -0
  372. package/dist/color/space/yuv2rgb/weslBundle.js +10 -0
  373. package/dist/color/tonemap/aces/weslBundle.js +13 -0
  374. package/dist/color/tonemap/debug/weslBundle.js +10 -0
  375. package/dist/color/tonemap/filmic/weslBundle.js +10 -0
  376. package/dist/color/tonemap/linear/weslBundle.js +10 -0
  377. package/dist/color/tonemap/reinhard/weslBundle.js +10 -0
  378. package/dist/color/tonemap/reinhardJodie/weslBundle.js +10 -0
  379. package/dist/color/tonemap/uncharted/weslBundle.js +10 -0
  380. package/dist/color/tonemap/uncharted2/weslBundle.js +10 -0
  381. package/dist/color/tonemap/unreal/weslBundle.js +10 -0
  382. package/dist/color/vibrance/weslBundle.js +13 -0
  383. package/dist/color/whiteBalance/weslBundle.js +10 -0
  384. package/dist/draw/fill/weslBundle.js +13 -0
  385. package/dist/draw/stroke/weslBundle.js +14 -0
  386. package/dist/filter/edge/prewitt/weslBundle.js +10 -0
  387. package/dist/filter/sharpen/adaptive/weslBundle.js +10 -0
  388. package/dist/filter/sharpen/fast/weslBundle.js +10 -0
  389. package/dist/generative/cnoise/weslBundle.js +21 -0
  390. package/dist/generative/noised/weslBundle.js +13 -0
  391. package/dist/generative/pnoise/weslBundle.js +21 -0
  392. package/dist/generative/random/weslBundle.js +10 -0
  393. package/dist/generative/snoise/weslBundle.js +21 -0
  394. package/dist/generative/srandom/weslBundle.js +13 -0
  395. package/dist/generative/wavelet/weslBundle.js +14 -0
  396. package/dist/generative/worley/weslBundle.js +14 -0
  397. package/dist/geometry/aabb/aabb/weslBundle.js +10 -0
  398. package/dist/geometry/aabb/centroid/weslBundle.js +13 -0
  399. package/dist/geometry/aabb/contain/weslBundle.js +13 -0
  400. package/dist/geometry/aabb/diagonal/weslBundle.js +13 -0
  401. package/dist/geometry/aabb/expand/weslBundle.js +13 -0
  402. package/dist/geometry/aabb/square/weslBundle.js +14 -0
  403. package/dist/geometry/triangle/area/weslBundle.js +13 -0
  404. package/dist/geometry/triangle/barycentric/weslBundle.js +17 -0
  405. package/dist/geometry/triangle/centroid/weslBundle.js +13 -0
  406. package/dist/geometry/triangle/normal/weslBundle.js +13 -0
  407. package/dist/geometry/triangle/triangle/weslBundle.js +10 -0
  408. package/dist/lighting/common/ggx/weslBundle.js +14 -0
  409. package/dist/lighting/common/schlick/weslBundle.js +13 -0
  410. package/dist/lighting/common/smithGGXCorrelated/weslBundle.js +13 -0
  411. package/dist/lighting/diffuse/orenNayar/weslBundle.js +10 -0
  412. package/dist/lighting/fresnel/weslBundle.js +19 -0
  413. package/dist/lighting/fresnelReflection/weslBundle.js +13 -0
  414. package/dist/lighting/raymarch/cast/weslBundle.js +10 -0
  415. package/dist/lighting/raymarch/normal/weslBundle.js +10 -0
  416. package/dist/lighting/specular/cookTorrance/weslBundle.js +21 -0
  417. package/dist/lighting/toShininess/weslBundle.js +10 -0
  418. package/dist/math/aafloor/weslBundle.js +13 -0
  419. package/dist/math/aafract/weslBundle.js +13 -0
  420. package/dist/math/aamirror/weslBundle.js +13 -0
  421. package/dist/math/aastep/weslBundle.js +10 -0
  422. package/dist/math/absi/weslBundle.js +10 -0
  423. package/dist/math/adaptiveThreshold/weslBundle.js +10 -0
  424. package/dist/math/atan2/weslBundle.js +13 -0
  425. package/dist/math/bump/weslBundle.js +10 -0
  426. package/dist/math/consts/weslBundle.js +10 -0
  427. package/dist/math/cubic/weslBundle.js +10 -0
  428. package/dist/math/cubicMix/weslBundle.js +13 -0
  429. package/dist/math/decimate/weslBundle.js +10 -0
  430. package/dist/math/dist/weslBundle.js +10 -0
  431. package/dist/math/fcos/weslBundle.js +13 -0
  432. package/dist/math/fmod/weslBundle.js +10 -0
  433. package/dist/math/gain/weslBundle.js +10 -0
  434. package/dist/math/gaussian/weslBundle.js +10 -0
  435. package/dist/math/grad4/weslBundle.js +10 -0
  436. package/dist/math/hammersley/weslBundle.js +13 -0
  437. package/dist/math/highPass/weslBundle.js +10 -0
  438. package/dist/math/inside/weslBundle.js +10 -0
  439. package/dist/math/invCubic/weslBundle.js +10 -0
  440. package/dist/math/invQuartic/weslBundle.js +10 -0
  441. package/dist/math/inverse/weslBundle.js +10 -0
  442. package/dist/math/lengthSq/weslBundle.js +10 -0
  443. package/dist/math/map/weslBundle.js +10 -0
  444. package/dist/math/mirror/weslBundle.js +10 -0
  445. package/dist/math/mmax/weslBundle.js +10 -0
  446. package/dist/math/mmin/weslBundle.js +10 -0
  447. package/dist/math/mod2/weslBundle.js +10 -0
  448. package/dist/math/mod289/weslBundle.js +10 -0
  449. package/dist/math/nyquist/weslBundle.js +10 -0
  450. package/dist/math/pack/weslBundle.js +10 -0
  451. package/dist/math/parabola/weslBundle.js +10 -0
  452. package/dist/math/permute/weslBundle.js +13 -0
  453. package/dist/math/pow2/weslBundle.js +10 -0
  454. package/dist/math/pow3/weslBundle.js +10 -0
  455. package/dist/math/pow5/weslBundle.js +10 -0
  456. package/dist/math/pow7/weslBundle.js +10 -0
  457. package/dist/math/powFast/weslBundle.js +10 -0
  458. package/dist/math/quartic/weslBundle.js +10 -0
  459. package/dist/math/quat/add/weslBundle.js +10 -0
  460. package/dist/math/quat/conj/weslBundle.js +10 -0
  461. package/dist/math/quat/div/weslBundle.js +10 -0
  462. package/dist/math/quat/identity/weslBundle.js +10 -0
  463. package/dist/math/quat/inverse/weslBundle.js +19 -0
  464. package/dist/math/quat/length/weslBundle.js +13 -0
  465. package/dist/math/quat/lengthSq/weslBundle.js +10 -0
  466. package/dist/math/quat/lerp/weslBundle.js +10 -0
  467. package/dist/math/quat/mul/weslBundle.js +10 -0
  468. package/dist/math/quat/neg/weslBundle.js +10 -0
  469. package/dist/math/quat/norm/weslBundle.js +14 -0
  470. package/dist/math/quat/quat2mat3/weslBundle.js +10 -0
  471. package/dist/math/quat/quat2mat4/weslBundle.js +14 -0
  472. package/dist/math/quat/sub/weslBundle.js +10 -0
  473. package/dist/math/quat/weslBundle.js +10 -0
  474. package/dist/math/quintic/weslBundle.js +10 -0
  475. package/dist/math/rotate2d/weslBundle.js +10 -0
  476. package/dist/math/rotate3d/weslBundle.js +10 -0
  477. package/dist/math/rotate3dX/weslBundle.js +10 -0
  478. package/dist/math/rotate3dY/weslBundle.js +10 -0
  479. package/dist/math/rotate3dZ/weslBundle.js +10 -0
  480. package/dist/math/rotate4d/weslBundle.js +10 -0
  481. package/dist/math/rotate4dX/weslBundle.js +10 -0
  482. package/dist/math/rotate4dY/weslBundle.js +10 -0
  483. package/dist/math/rotate4dZ/weslBundle.js +10 -0
  484. package/dist/math/round/weslBundle.js +10 -0
  485. package/dist/math/saturate/weslBundle.js +10 -0
  486. package/dist/math/saturateMediump/weslBundle.js +10 -0
  487. package/dist/math/scale2d/weslBundle.js +10 -0
  488. package/dist/math/scale3d/weslBundle.js +10 -0
  489. package/dist/math/scale4d/weslBundle.js +10 -0
  490. package/dist/math/smootherstep/weslBundle.js +14 -0
  491. package/dist/math/sum/weslBundle.js +10 -0
  492. package/dist/math/taylorInvSqrt/weslBundle.js +10 -0
  493. package/dist/math/toMat3/weslBundle.js +10 -0
  494. package/dist/math/toMat4/weslBundle.js +10 -0
  495. package/dist/math/translate4d/weslBundle.js +10 -0
  496. package/dist/math/unpack/weslBundle.js +10 -0
  497. package/dist/math/within/weslBundle.js +10 -0
  498. package/dist/sample/sprite/weslBundle.js +13 -0
  499. package/dist/sdf/boxSDF/weslBundle.js +10 -0
  500. package/dist/sdf/circleSDF/weslBundle.js +10 -0
  501. package/dist/sdf/crossSDF/weslBundle.js +13 -0
  502. package/dist/sdf/cylinderSDF/weslBundle.js +10 -0
  503. package/dist/sdf/flowerSDF/weslBundle.js +10 -0
  504. package/dist/sdf/gearSDF/weslBundle.js +13 -0
  505. package/dist/sdf/heartSDF/weslBundle.js +10 -0
  506. package/dist/sdf/hexSDF/weslBundle.js +10 -0
  507. package/dist/sdf/opSubtraction/weslBundle.js +13 -0
  508. package/dist/sdf/opUnion/weslBundle.js +13 -0
  509. package/dist/sdf/polySDF/weslBundle.js +13 -0
  510. package/dist/sdf/raysSDF/weslBundle.js +13 -0
  511. package/dist/sdf/rectSDF/weslBundle.js +10 -0
  512. package/dist/sdf/rhombSDF/weslBundle.js +13 -0
  513. package/dist/sdf/sphereSDF/weslBundle.js +10 -0
  514. package/dist/sdf/spiralSDF/weslBundle.js +10 -0
  515. package/dist/sdf/starSDF/weslBundle.js +14 -0
  516. package/dist/sdf/torusSDF/weslBundle.js +10 -0
  517. package/dist/sdf/triSDF/weslBundle.js +10 -0
  518. package/dist/sdf/vesicaSDF/weslBundle.js +13 -0
  519. package/dist/space/aspect/weslBundle.js +10 -0
  520. package/dist/space/bracketing/weslBundle.js +13 -0
  521. package/dist/space/brickTile/weslBundle.js +13 -0
  522. package/dist/space/cart2polar/weslBundle.js +10 -0
  523. package/dist/space/center/weslBundle.js +10 -0
  524. package/dist/space/checkerTile/weslBundle.js +13 -0
  525. package/dist/space/decimateNormal/weslBundle.js +13 -0
  526. package/dist/space/depth2viewZ/weslBundle.js +10 -0
  527. package/dist/space/equirect2xyz/weslBundle.js +13 -0
  528. package/dist/space/eulerView/weslBundle.js +21 -0
  529. package/dist/space/fisheye2xyz/weslBundle.js +13 -0
  530. package/dist/space/flipY/weslBundle.js +10 -0
  531. package/dist/space/hexTile/weslBundle.js +10 -0
  532. package/dist/space/kaleidoscope/weslBundle.js +13 -0
  533. package/dist/space/linearizeDepth/weslBundle.js +10 -0
  534. package/dist/space/lookAt/weslBundle.js +10 -0
  535. package/dist/space/lookAtView/weslBundle.js +13 -0
  536. package/dist/space/mirrorTile/weslBundle.js +14 -0
  537. package/dist/space/nearest/weslBundle.js +10 -0
  538. package/dist/space/orthographic/weslBundle.js +10 -0
  539. package/dist/space/perspective/weslBundle.js +10 -0
  540. package/dist/space/polar2cart/weslBundle.js +10 -0
  541. package/dist/space/ratio/weslBundle.js +10 -0
  542. package/dist/space/rotate/weslBundle.js +14 -0
  543. package/dist/space/rotateX/weslBundle.js +13 -0
  544. package/dist/space/rotateY/weslBundle.js +13 -0
  545. package/dist/space/rotateZ/weslBundle.js +13 -0
  546. package/dist/space/scale/weslBundle.js +10 -0
  547. package/dist/space/screen2viewPosition/weslBundle.js +10 -0
  548. package/dist/space/sprite/weslBundle.js +10 -0
  549. package/dist/space/sqTile/weslBundle.js +10 -0
  550. package/dist/space/tbn/weslBundle.js +10 -0
  551. package/dist/space/translate/weslBundle.js +10 -0
  552. package/dist/space/triTile/weslBundle.js +10 -0
  553. package/dist/space/uncenter/weslBundle.js +10 -0
  554. package/dist/space/unratio/weslBundle.js +10 -0
  555. package/dist/space/view2screenPosition/weslBundle.js +10 -0
  556. package/dist/space/viewZ2depth/weslBundle.js +10 -0
  557. package/dist/space/windmillTile/weslBundle.js +15 -0
  558. package/dist/space/xyz2equirect/weslBundle.js +13 -0
  559. package/dist/test/wesl/shaders/brick-tile/weslBundle.js +14 -0
  560. package/dist/test/wesl/shaders/checker-tile/weslBundle.js +13 -0
  561. package/dist/test/wesl/shaders/draw-aa/weslBundle.js +23 -0
  562. package/dist/test/wesl/shaders/draw-shapes/weslBundle.js +47 -0
  563. package/dist/test/wesl/shaders/draw-stroke/weslBundle.js +13 -0
  564. package/dist/test/wesl/shaders/hex-tile/weslBundle.js +14 -0
  565. package/dist/test/wesl/shaders/kaleidoscope/weslBundle.js +13 -0
  566. package/dist/test/wesl/shaders/mirror-tile/weslBundle.js +13 -0
  567. package/dist/test/wesl/shaders/perlin-noise-fbm/weslBundle.js +13 -0
  568. package/dist/test/wesl/shaders/pnoise-tiling/weslBundle.js +13 -0
  569. package/dist/test/wesl/shaders/snoise-fbm/weslBundle.js +13 -0
  570. package/dist/test/wesl/shaders/sprite-megaman/weslBundle.js +14 -0
  571. package/dist/test/wesl/shaders/tri-tile/weslBundle.js +14 -0
  572. package/dist/test/wesl/shaders/wavelet-vorticity/weslBundle.js +13 -0
  573. package/dist/test/wesl/shaders/windmill-tile/weslBundle.js +13 -0
  574. package/dist/test/wesl/shaders/worley-cellular/weslBundle.js +13 -0
  575. package/dist/test/wesl_util/blendInputs/weslBundle.js +10 -0
  576. package/dist/test/wesl_util/sampleQuantized/weslBundle.js +10 -0
  577. package/dist/version/weslBundle.js +10 -0
  578. package/dist/weslBundle.d.ts +20 -0
  579. package/draw/fill.wesl +23 -0
  580. package/draw/stroke.wesl +12 -3
  581. package/filter/edge/prewitt.wesl +9 -13
  582. package/filter/sharpen/adaptive.wesl +23 -19
  583. package/filter/sharpen/fast.wesl +33 -19
  584. package/generative/cnoise.wesl +232 -232
  585. package/generative/noised.wesl +38 -34
  586. package/generative/pnoise.wesl +231 -231
  587. package/generative/psrdnoise.glsl +12 -0
  588. package/generative/psrdnoise.hlsl +12 -0
  589. package/generative/psrdnoise.msl +12 -0
  590. package/generative/random.wesl +4 -6
  591. package/generative/snoise.wesl +7 -8
  592. package/generative/srandom.wesl +6 -6
  593. package/generative/wavelet.wesl +2 -3
  594. package/generative/worley.wesl +3 -4
  595. package/geometry/aabb/aabb.wesl +12 -0
  596. package/geometry/aabb/centroid.wesl +16 -0
  597. package/geometry/aabb/contain.wesl +16 -0
  598. package/geometry/aabb/diagonal.wesl +16 -0
  599. package/geometry/aabb/expand.wesl +27 -0
  600. package/geometry/aabb/square.wesl +19 -0
  601. package/geometry/triangle/area.glsl +1 -1
  602. package/geometry/triangle/area.wesl +16 -0
  603. package/geometry/triangle/barycentric.glsl +2 -2
  604. package/geometry/triangle/barycentric.wesl +42 -0
  605. package/geometry/triangle/centroid.wesl +16 -0
  606. package/geometry/triangle/normal.glsl +1 -1
  607. package/geometry/triangle/normal.wesl +16 -0
  608. package/geometry/triangle/triangle.glsl +2 -2
  609. package/geometry/triangle/triangle.wesl +13 -0
  610. package/lighting/common/ggx.wesl +50 -7
  611. package/lighting/common/schlick.wesl +15 -3
  612. package/lighting/common/smithGGXCorrelated.wesl +20 -0
  613. package/lighting/diffuse/orenNayar.wesl +6 -2
  614. package/lighting/fresnel.wesl +25 -3
  615. package/lighting/fresnelReflection.wesl +23 -10
  616. package/lighting/raymarch/cast.wesl +2 -16
  617. package/lighting/raymarch/normal.wesl +2 -15
  618. package/lighting/specular/cookTorrance.wesl +16 -16
  619. package/lighting/ssao.glsl +40 -14
  620. package/lighting/toShininess.glsl +1 -1
  621. package/lighting/toShininess.wesl +2 -1
  622. package/math/aafloor.wesl +6 -5
  623. package/math/aafract.wesl +5 -3
  624. package/math/aamirror.wesl +14 -0
  625. package/math/aastep.wesl +2 -1
  626. package/math/absi.wesl +12 -0
  627. package/math/atan2.wesl +17 -0
  628. package/math/consts.wesl +3 -0
  629. package/math/cubic.wesl +1 -1
  630. package/math/cubicMix.wesl +2 -2
  631. package/math/decimate.wesl +1 -1
  632. package/math/dist.wesl +2 -3
  633. package/math/fcos.wesl +15 -0
  634. package/math/fmod.wesl +11 -0
  635. package/math/gain.wesl +1 -1
  636. package/math/gaussian.wesl +1 -1
  637. package/math/hammersley.wesl +27 -0
  638. package/math/highPass.wesl +1 -1
  639. package/math/inside.wesl +1 -1
  640. package/math/invCubic.wesl +1 -1
  641. package/math/inverse.wesl +1 -1
  642. package/math/inverse.wgsl +53 -0
  643. package/math/map.wesl +0 -1
  644. package/math/mirror.wesl +1 -1
  645. package/math/mmax.wesl +2 -2
  646. package/math/mmin.wesl +2 -2
  647. package/math/mod2.wesl +21 -0
  648. package/math/mod289.wesl +4 -4
  649. package/math/nyquist.wesl +16 -0
  650. package/math/pack.wesl +10 -8
  651. package/math/parabola.wesl +1 -1
  652. package/math/pow2.wesl +13 -0
  653. package/math/pow3.wesl +13 -0
  654. package/math/pow5.wesl +28 -0
  655. package/math/pow7.wesl +13 -0
  656. package/math/powFast.wesl +1 -1
  657. package/math/quartic.wesl +1 -1
  658. package/math/quat/add.wesl +10 -0
  659. package/math/quat/conj.wesl +10 -0
  660. package/math/quat/div.wesl +10 -0
  661. package/math/quat/identity.wesl +10 -0
  662. package/math/quat/inverse.wesl +14 -0
  663. package/math/quat/length.wesl +12 -0
  664. package/math/quat/lengthSq.wesl +10 -0
  665. package/math/quat/lerp.wesl +43 -0
  666. package/math/quat/mul.wesl +25 -0
  667. package/math/quat/neg.wesl +10 -0
  668. package/math/quat/norm.wesl +13 -0
  669. package/math/quat/quat2mat3.wesl +26 -0
  670. package/math/quat/quat2mat4.wesl +13 -0
  671. package/math/quat/sub.wesl +10 -0
  672. package/math/quat.wesl +3 -1
  673. package/math/rotate2d.wesl +4 -1
  674. package/math/rotate3d.wesl +3 -3
  675. package/math/rotate3dX.wesl +5 -3
  676. package/math/rotate3dY.wesl +2 -2
  677. package/math/rotate3dZ.wesl +1 -1
  678. package/math/rotate4dX.wesl +2 -2
  679. package/math/rotate4dY.wesl +2 -2
  680. package/math/rotate4dZ.wesl +1 -1
  681. package/math/saturate.wesl +15 -0
  682. package/math/saturateMediump.wesl +38 -0
  683. package/math/scale2d.wesl +3 -1
  684. package/math/scale4d.wesl +1 -1
  685. package/math/smootherstep.wesl +4 -3
  686. package/math/sum.wesl +0 -1
  687. package/math/toMat3.wesl +12 -0
  688. package/math/toMat4.wesl +1 -1
  689. package/math/translate4d.wesl +11 -4
  690. package/math/unpack.wesl +20 -20
  691. package/math/within.wesl +5 -5
  692. package/morphological/dilation.glsl +24 -11
  693. package/package.json +25 -15
  694. package/pnpm-workspace.yaml +3 -0
  695. package/sample/sprite.wesl +14 -0
  696. package/sdf/boxSDF.wesl +7 -2
  697. package/sdf/circleSDF.wesl +28 -0
  698. package/sdf/crossSDF.wesl +19 -0
  699. package/sdf/cylinderSDF.wesl +26 -1
  700. package/sdf/flowerSDF.wesl +33 -0
  701. package/sdf/gearSDF.wesl +43 -0
  702. package/sdf/heartSDF.wesl +34 -0
  703. package/sdf/hexSDF.wesl +29 -0
  704. package/sdf/opSubtraction.wesl +19 -1
  705. package/sdf/opUnion.wesl +16 -1
  706. package/sdf/polySDF.wesl +35 -0
  707. package/sdf/raysSDF.wesl +32 -0
  708. package/sdf/rectSDF.wesl +36 -8
  709. package/sdf/rhombSDF.wesl +27 -0
  710. package/sdf/sphereSDF.wesl +7 -3
  711. package/sdf/spiralSDF.wesl +33 -0
  712. package/sdf/starSDF.wesl +41 -0
  713. package/sdf/torusSDF.wesl +10 -3
  714. package/sdf/triSDF.wesl +31 -0
  715. package/sdf/vesicaSDF.wesl +24 -0
  716. package/space/aspect.wesl +16 -0
  717. package/space/bracketing.wesl +61 -0
  718. package/space/brickTile.wesl +34 -0
  719. package/space/cart2polar.wesl +17 -0
  720. package/space/center.wesl +16 -0
  721. package/space/checkerTile.wesl +31 -0
  722. package/space/decimateNormal.glsl +27 -0
  723. package/space/decimateNormal.wesl +20 -0
  724. package/space/depth2viewZ.wesl +33 -0
  725. package/space/equirect2xyz.wesl +20 -0
  726. package/space/eulerView.wesl +24 -0
  727. package/space/fisheye2xyz.wesl +8 -3
  728. package/space/flipY.glsl +3 -3
  729. package/space/flipY.wesl +12 -0
  730. package/space/hexTile.wesl +25 -0
  731. package/space/kaleidoscope.wesl +38 -0
  732. package/space/linearizeDepth.wesl +21 -0
  733. package/space/lookAt.wesl +45 -0
  734. package/space/lookAtView.wesl +34 -0
  735. package/space/mirrorTile.wesl +67 -0
  736. package/space/nearest.wesl +2 -1
  737. package/space/orthographic.wesl +17 -0
  738. package/space/perspective.wesl +19 -0
  739. package/space/polar2cart.wesl +17 -0
  740. package/space/ratio.wesl +4 -4
  741. package/space/rotate.wesl +74 -8
  742. package/space/rotateX.wesl +61 -0
  743. package/space/rotateY.wesl +61 -0
  744. package/space/rotateZ.glsl +1 -1
  745. package/space/rotateZ.wesl +61 -0
  746. package/space/scale.wesl +101 -7
  747. package/space/screen2viewPosition.wesl +37 -0
  748. package/space/sprite.wesl +16 -0
  749. package/space/sqTile.wesl +16 -0
  750. package/space/tbn.wesl +16 -0
  751. package/space/translate.wesl +15 -0
  752. package/space/triTile.wesl +25 -0
  753. package/space/uncenter.wesl +14 -0
  754. package/space/unratio.wesl +12 -0
  755. package/space/view2screenPosition.wesl +21 -0
  756. package/space/viewZ2depth.wesl +31 -0
  757. package/space/windmillTile.wesl +37 -0
  758. package/space/xyz2equirect.wesl +14 -0
  759. package/version.glsl +2 -2
  760. package/version.hlsl +2 -2
  761. package/version.wesl +3 -2
  762. package/version.wgsl +2 -2
  763. package/vitest.config.ts +7 -0
  764. package/wesl.toml +3 -0
  765. package/color/mixBox.glsl +0 -121
  766. package/math/mod.wesl +0 -11
@@ -0,0 +1,39 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [tomain, lee/ci, patricio/ci]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ validate:
11
+ strategy:
12
+ matrix:
13
+ os: [macos-latest]
14
+ runs-on: ${{ matrix.os }}
15
+
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+ with:
20
+ submodules: recursive
21
+ lfs: true
22
+
23
+ - name: Setup pnpm
24
+ uses: pnpm/action-setup@v4
25
+ with:
26
+ version: '10.26.0'
27
+
28
+ - name: Setup Node.js
29
+ uses: actions/setup-node@v4
30
+ with:
31
+ node-version: '24'
32
+ cache: 'pnpm'
33
+
34
+ - name: Install dependencies
35
+ run: pnpm install --frozen-lockfile
36
+
37
+ - name: Run CI checks (macOS)
38
+ if: matrix.os == 'macos-latest'
39
+ run: pnpm ci:check
package/README.md CHANGED
@@ -8,6 +8,8 @@ Best of all, LYGIA grows and improves every day thanks to the support of the com
8
8
 
9
9
  ## How to use it?
10
10
 
11
+ _For using Lygia with WebGPU, see the [WebGPU README](./README_WebGPU.md)._
12
+
11
13
  In your shader just `#include` the functions you need and use them:
12
14
 
13
15
  <div class="codeAndCanvas" data="example.frag">
@@ -37,13 +39,13 @@ In your shader just `#include` the functions you need and use them:
37
39
 
38
40
  </div>
39
41
 
40
- If you just need to resolve the dependencies of a shader file you got, the fastest way would be to drag&drop your shader file in the box below. We can resolve the dependencies for you.
42
+ <!-- If you just need to resolve the dependencies of a shader file you got, the fastest way would be to drag&drop your shader file in the box below. We can resolve the dependencies for you.
41
43
 
42
44
  <div class="container">
43
45
  <div class="file-drop-area">
44
46
  <span class="file-msg">Drop your shader file <a href="https://lygia.xyz/">here</a></span>
45
47
  </div>
46
- </div>
48
+ </div> -->
47
49
 
48
50
  LYGIA have been integrated into the following Engines, Frameworks, Creative Tools and online editors:
49
51
 
@@ -60,6 +62,7 @@ LYGIA have been integrated into the following Engines, Frameworks, Creative Tool
60
62
  <a href="https://github.com/kujohn/lygia_ogl_examples"><img src="https://lygia.xyz/imgs/ogl.png" alt="ogl" title="ogl" width="64" /></a>
61
63
  <a href="https://www.npmjs.com/package/lygia"><img src="https://lygia.xyz/imgs/npm.png" alt="npm" title="npm" width="64" /></a>
62
64
  <a href="https://codesandbox.io/s/lygia-react-starter-fftx6p"><img src="https://lygia.xyz/imgs/r3f.png" alt="r3rf" title="r3rf" width="64" /></a>
65
+ <a href="https://cycling74.com/packages/jitlygia"><img src="https://lygia.xyz/imgs/max.png" alt="max" title="max" width="64" /></a>
63
66
  </p>
64
67
 
65
68
  <p style="text-align: center;" >
package/README_WESL.md ADDED
@@ -0,0 +1,40 @@
1
+ ## Contributing a WebGPU WESL Shader
2
+ WESL is a strict superset of WGSL, adding import statements, conditional compilation, and other features.
3
+
4
+ ### To add a shader to Lygia WESL:
5
+
6
+ 1. Add a `.wesl` file alongside the other shader files.
7
+ - The Lygia convention is to have one user-facing function per file.
8
+ This keeps things organized while keeping user application bundle sizes small.
9
+ - It's fine to put multiple type variants of the same function in the same file.
10
+ For example, variants for a `fn` with `f32` and the same `fn` with `vec3f` arguments go in the same file.
11
+ 1. Add appropriate tests in `test/wesl`.
12
+ - Use `testCompute()` for pure math functions
13
+ - Use `testFragment()` for derivative functions (`fwidth`, `dpdx`, `dpdy`) or texture sampling
14
+ - Use `toMatchImage()` for visual regression tests (filters, generative patterns, complex rendering)
15
+
16
+ ### Notes when porting to WESL:
17
+ - WESL file names can't start with a number, and can't be current WGSL or WESL keywords.
18
+ - The file/directory hierarchy translates to double colons in WESL:
19
+ ```rs
20
+ import lygia::color::space::hsl2rgb::hsl2rgb;
21
+ ```
22
+ See [WESL imports](https://wesl-lang.dev/spec/Imports) for details.
23
+ - You can also reference other shader modules inline without import statements.
24
+ ```rs
25
+ fn foo() -> f32 {
26
+ let p = lygia::math::consts::PI;
27
+ return p;
28
+ }
29
+ ```
30
+ - Conditional transpilation is supported via `@if`, `@else`, and `@elseif` statements.
31
+ Conditions can be set at runtime or build time.[^1]
32
+ See [WESL Conditions](https://wesl-lang.dev/spec/ConditionalTranslation) for details.
33
+
34
+ ### WESL Resources
35
+ WESL is documented at [wesl-lang.dev](https://wesl-lang.dev).
36
+ Community support for WESL is available on [GitHub](https://github.com/wgsl-tooling-wg) and on [Discord](https://discord.gg/5UhkaSu4dt).
37
+
38
+ ### Future Plans
39
+ - Function overloads or generics to reduce duplication across type variants
40
+ - Setting conditions from imported shaders.
@@ -0,0 +1,203 @@
1
+ This page describes how to link Lygia shader functions
2
+ into your WebGPU application using WESL tools.
3
+
4
+ [WESL](https://wesl-lang.dev) is a superset of WGSL that adds
5
+ features with community-supported tools.
6
+ WESL tools are available in Rust and JavaScript/TypeScript.
7
+
8
+ _Most (but not all) Lygia GLSL shaders are now available
9
+ for WebGPU using WESL.
10
+ If a Lygia function you need is missing,
11
+ please file an [issue](https://github.com/patriciogonzalezvivo/lygia/issues)
12
+ or help [contribute](./README_WESL.md)._[^1][^2]
13
+
14
+ ## Using JavaScript or TypeScript
15
+
16
+ Install with `npm install lygia` or `pnpm install lygia`
17
+ ([lygia npm package](https://www.npmjs.com/package/lygia)).
18
+ Once you install, 500+ Lygia functions
19
+ and constants will be available for you to use
20
+ via `import` statements in your application shader code.
21
+
22
+ ```rs
23
+ import lygia::math::consts::PI;
24
+
25
+ fn main() {
26
+ let p = PI;
27
+ }
28
+ ```
29
+
30
+ The JS tools automatically tree-shake, including only the Lygia
31
+ functions your application uses.
32
+
33
+ WESL integrates with popular bundlers (vite, webpack, rollup) through plugins,
34
+ or for custom build pipelines, you can use the `wesl-link` command-line tool
35
+ or the link API.
36
+
37
+ ### Using a JavaScript/TypeScript Bundler
38
+
39
+ If you build your application with a JavaScript/TypeScript bundler
40
+ like `vite`, `webpack` or `rollup`,
41
+ install the
42
+ [wesl](https://www.npmjs.com/package/wesl?activeTab=readme) and
43
+ [wesl-plugin](https://www.npmjs.com/package/wesl-plugin) packages.
44
+
45
+ #### Runtime Linking with a Bundler
46
+ Import shader code into your JavaScript or TypeScript application using the
47
+ import statements suffixed with `?link` and the shaders will be linked together at runtime:
48
+
49
+ ```ts
50
+ import appWesl from "../shaders/app.wesl?link";
51
+ import { link } from "wesl";
52
+
53
+ const linked = await link(appWesl);
54
+ linked.createShaderModule(gpuDevice);
55
+ ```
56
+
57
+ For more details, check the [WESL bundler documentation](https://wesl-lang.dev/docs/JavaScript-Builds#wesl-with-javascript-bundlers) or refer to this
58
+ [lygia example using vite](https://stackblitz.com/github/wgsl-tooling-wg/examples/tree/main/lygia-example?file=README.md).
59
+
60
+ #### Static Linking with a Bundler
61
+ Alternatively,
62
+ you can statically link your shaders in advance using the `?static` suffix:
63
+ ```ts
64
+ import appWgsl from "../shaders/app.wesl?static";
65
+ ```
66
+ See the [lygia static linking example](https://stackblitz.com/github/wgsl-tooling-wg/examples/tree/main/lygia-static-example)
67
+ for details.
68
+
69
+
70
+ #### Runtime vs. Static Linking
71
+ Static linking bundles your shader modules together into a single transpiled WGSL string.
72
+ Static linking means you don't need WESL linker in your runtime bundle (~15KB savings).
73
+ However, static linking is less flexible
74
+ because your application can't use WESL's conditional compilation
75
+ features (`@if` directives) to adapt shaders at runtime based on GPU capabilities
76
+ or user configuration.
77
+
78
+ Many Lygia shader functions include `@if` [conditions](https://wesl-lang.dev/spec/ConditionalTranslation).
79
+ For example see `@if(YUV_SDTV)` in [`yuv2rgb`](https://github.com/patriciogonzalezvivo/lygia/blob/main/color/space/yuv2rgb.wesl).
80
+ With runtime linking, you can set these conditions dynamically.
81
+ With static linking, conditions are resolved at build time.
82
+
83
+ ### Command Line Linking
84
+
85
+ For custom build pipelines, use the `wesl-link` command-line tool to statically link shaders.
86
+
87
+ #### Linking Application Shaders
88
+ Link your application shader file that imports Lygia functions:
89
+
90
+ ```sh
91
+ npx wesl-link ./shaders/main.wesl
92
+ ```
93
+
94
+ See the [Lygia CLI linking example](https://stackblitz.com/github/wgsl-tooling-wg/examples/tree/main/lygia-cli-example?file=README.md) for details.
95
+
96
+ #### Linking Lygia Modules on the Command Line
97
+ To get standalone WGSL for a specific Lygia module,
98
+ call wesl-link on that module.
99
+
100
+ **From the npm package:**
101
+ ```sh
102
+ npx wesl-link lygia::color::layer::addSourceOver
103
+ ```
104
+
105
+ **From a lygia repository clone:**
106
+ ```sh
107
+ npx wesl-link package::color::layer::addSourceOver
108
+
109
+ # alternate syntax
110
+ npx wesl-link color/layer/addSourceOver.wesl
111
+ ```
112
+
113
+ Either approach produces the WGSL for the requested Lygia module linked with its dependencies.
114
+
115
+ ### Link Using the API
116
+ You can use the linking API directly to build custom solutions:
117
+
118
+ ```ts
119
+ import { link } from "wesl";
120
+
121
+ const main = `import lygia::math::consts::PI; ...`;
122
+ const linked = await link({weslSrc: {main }});
123
+ const shaderModule = linked.createShaderModule(gpuDevice);
124
+ ```
125
+
126
+ See the [API documentation](https://wesl-lang.dev/docs/JavaScript-Builds) for details.
127
+
128
+ ### Additional WESL Examples
129
+
130
+ More WESL examples are available [here](https://github.com/wgsl-tooling-wg/examples).
131
+ Most examples run with one click in a browser sandbox.
132
+ The examples can also be used as starter templates with `degit`.
133
+
134
+ ## Using Rust
135
+
136
+ ```sh
137
+ cargo add lygia
138
+ ```
139
+
140
+ ### Linking at build time
141
+ ```sh
142
+ cargo add --build wesl
143
+ ```
144
+
145
+ ```rs
146
+ /// build.rs
147
+ fn main() {
148
+ wesl::Wesl::new("src/shaders").build_artifact("main.wesl", "my_shader");
149
+ }
150
+ ```
151
+
152
+ ### Linking at run-time
153
+
154
+ ```sh
155
+ cargo add wesl
156
+ ```
157
+
158
+ ```rs
159
+ let shader_string = Wesl::new("src/shaders")
160
+ .compile("main.wesl")
161
+ .inspect_err(|e| eprintln!("WESL error: {e}")) // pretty errors with `display()`
162
+ .unwrap()
163
+ .to_string();
164
+ ```
165
+
166
+ ### Using the Rust CLI tool
167
+ ```sh
168
+ cargo install wesl-cli
169
+ wesl compile <path/to/shader.wesl>
170
+ ```
171
+
172
+
173
+ ### WESL Rust Documentation
174
+ See [Getting Started Rust](https://wesl-lang.dev/docs/Getting-Started-Rust),
175
+ the [wesl crate documentation](https://docs.rs/wesl/latest/wesl/),
176
+ and [WESL rust examples](https://github.com/wgsl-tooling-wg/wesl-rs/tree/main/examples).
177
+
178
+
179
+ ## About WESL
180
+ WESL extends WGSL with:
181
+ - `import` statements to split shader code across files and load npm/cargo libraries
182
+ - `@if @else @elseif` statements to assemble specialized shaders at build time or runtime
183
+
184
+ Current WESL tools include:
185
+ - Linkers in Rust and JavaScript (to combine WGSL/WESL files into applications)
186
+ - Syntax highlighters for zed, helix and nvim
187
+
188
+ ### Coming Soon
189
+ Additional WESL tools in development:
190
+ - HTML [documentation generator](https://github.com/jannik4/wesldoc)
191
+ - [Language server](https://github.com/wgsl-analyzer/wgsl-analyzer)
192
+ - VSCode plugin
193
+ - Code formatter
194
+
195
+ Read more about WESL at [wesl-lang.dev](https://wesl-lang.dev).
196
+
197
+ [^1]: Lygia functions are small and self-contained.
198
+ You can just copy, paste and edit them into your app if you prefer doing things manually!
199
+
200
+ [^2]: Lygia currently hosts two versions of WebGPU shaders.
201
+ The newer versions use the WESL language and have a `.wesl` suffix.
202
+ For new Lygia users, we recommend `.wesl`.
203
+ (The older versions use a `.wgsl` suffix, but are less complete and use a custom `#include` syntax.)
@@ -0,0 +1,11 @@
1
+ import lygia::math::consts::PI;
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Back in easing. From https://github.com/stackgl/glsl-easings
6
+ use: backIn(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
9
+ */
10
+
11
+ fn backIn(t: f32) -> f32 { return pow(t, 3.0) - t * sin(t * PI); }
@@ -0,0 +1,14 @@
1
+ import lygia::animation::easing::backIn::{backIn};
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Back in/out easing. From https://github.com/stackgl/glsl-easings
6
+ use: backInOut(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
9
+ */
10
+
11
+ fn backInOut(t: f32) -> f32 {
12
+ let g = backIn(select(1.0 - (2.0 * t - 1.0), 2.0 * t, t < 0.5));
13
+ return select(0.5 * (1.0 - g) + 0.5, 0.5 * g, t < 0.5);
14
+ }
@@ -0,0 +1,11 @@
1
+ import lygia::animation::easing::backIn::{backIn};
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Back out easing. From https://github.com/stackgl/glsl-easings
6
+ use: backOut(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
9
+ */
10
+
11
+ fn backOut(t: f32) -> f32 { return 1.0 - backIn(1.0 - t); }
@@ -0,0 +1,11 @@
1
+ import lygia::animation::easing::bounceOut::{bounceOut};
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Bounce in easing. From https://github.com/stackgl/glsl-easings
6
+ use: <f32> bounceIn(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/eduardfossas/lygia-study-examples/main/animation/e_EasingBounce.frag
9
+ */
10
+
11
+ fn bounceIn(t: f32) -> f32 { return 1.0 - bounceOut(1.0 - t); }
@@ -0,0 +1,17 @@
1
+ import lygia::animation::easing::bounceOut::{bounceOut};
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Bounce in/out easing. From https://github.com/stackgl/glsl-easings
6
+ use: <f32> bounceInOut(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/eduardfossas/lygia-study-examples/main/animation/e_EasingBounce.frag
9
+ */
10
+
11
+ fn bounceInOut(t: f32) -> f32 {
12
+ return select(
13
+ 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5,
14
+ 0.5 * (1.0 - bounceOut(1.0 - t * 2.0)),
15
+ t < 0.5
16
+ );
17
+ }
@@ -0,0 +1,33 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Bounce out easing. From https://github.com/stackgl/glsl-easings
4
+ use: <f32> bounceOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/eduardfossas/lygia-study-examples/main/animation/e_EasingBounce.frag
7
+ */
8
+
9
+ fn bounceOut(t: f32) -> f32 {
10
+ const a = 4.0 / 11.0;
11
+ const b = 8.0 / 11.0;
12
+ const c = 9.0 / 10.0;
13
+
14
+ const ca = 4356.0 / 361.0;
15
+ const cb = 35442.0 / 1805.0;
16
+ const cc = 16061.0 / 1805.0;
17
+
18
+ let t2 = t * t;
19
+
20
+ return select(
21
+ select(
22
+ select(
23
+ 10.8 * t * t - 20.52 * t + 10.72,
24
+ ca * t2 - cb * t + cc,
25
+ t < c
26
+ ),
27
+ 9.075 * t2 - 9.9 * t + 3.4,
28
+ t < b
29
+ ),
30
+ 7.5625 * t2,
31
+ t < a
32
+ );
33
+ }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Circular in easing. From https://github.com/stackgl/glsl-easings
4
+ use: circularIn(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn circularIn(t: f32) -> f32 { return 1.0 - sqrt(1.0 - t * t); }
@@ -0,0 +1,15 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Circular in/out easing. From https://github.com/stackgl/glsl-easings
4
+ use: circularInOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn circularInOut(t: f32) -> f32 {
10
+ return select(
11
+ 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0),
12
+ 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t)),
13
+ t < 0.5
14
+ );
15
+ }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Circular out easing. From https://github.com/stackgl/glsl-easings
4
+ use: circularOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn circularOut(t: f32) -> f32 { return sqrt((2.0 - t) * t); }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Cubic in easing. From https://github.com/stackgl/glsl-easings
4
+ use: cubicIn(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn cubicIn(t: f32) -> f32 { return t * t * t; }
@@ -0,0 +1,15 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Cubic in/out easing. From https://github.com/stackgl/glsl-easings
4
+ use: cubicInOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn cubicInOut(t: f32) -> f32 {
10
+ return select(
11
+ 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0,
12
+ 4.0 * t * t * t,
13
+ t < 0.5
14
+ );
15
+ }
@@ -0,0 +1,12 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Cubic out easing. From https://github.com/stackgl/glsl-easings
4
+ use: cubicOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn cubicOut(t: f32) -> f32 {
10
+ let f = t - 1.0;
11
+ return f * f * f + 1.0;
12
+ }
@@ -0,0 +1,11 @@
1
+ import lygia::math::consts::HALF_PI;
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Elastic in easing. From https://github.com/stackgl/glsl-easings
6
+ use: elasticIn(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
9
+ */
10
+
11
+ fn elasticIn(t: f32) -> f32 { return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0)); }
@@ -0,0 +1,17 @@
1
+ import lygia::math::consts::HALF_PI;
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Elastic in/out easing. From https://github.com/stackgl/glsl-easings
6
+ use: elasticInOut(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
9
+ */
10
+
11
+ fn elasticInOut(t: f32) -> f32 {
12
+ return select(
13
+ 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0,
14
+ 0.5 * sin(13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0)),
15
+ t < 0.5
16
+ );
17
+ }
@@ -0,0 +1,11 @@
1
+ import lygia::math::consts::HALF_PI;
2
+
3
+ /*
4
+ contributors: Hugh Kennedy (https://github.com/hughsk)
5
+ description: Elastic out easing. From https://github.com/stackgl/glsl-easings
6
+ use: elasticOut(<f32> x)
7
+ examples:
8
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
9
+ */
10
+
11
+ fn elasticOut(t: f32) -> f32 { return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0; }
@@ -0,0 +1,15 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Exponential in easing. From https://github.com/stackgl/glsl-easings
4
+ use: exponentialIn(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn exponentialIn(t: f32) -> f32 {
10
+ return select(
11
+ pow(2.0, 10.0 * (t - 1.0)),
12
+ t,
13
+ t == 0.0
14
+ );
15
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Exponential in/out easing. From https://github.com/stackgl/glsl-easings
4
+ use: exponentialInOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn exponentialInOut(t: f32) -> f32 {
10
+ return select(
11
+ select(
12
+ -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0,
13
+ 0.5 * pow(2.0, (20.0 * t) - 10.0),
14
+ t < 0.5
15
+ ),
16
+ t,
17
+ t == 0.0 || t == 1.0
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Exponential out easing. From https://github.com/stackgl/glsl-easings
4
+ use: exponentialOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn exponentialOut(t: f32) -> f32 {
10
+ return select(
11
+ 1.0 - pow(2.0, -10.0 * t),
12
+ t,
13
+ t == 1.0
14
+ );
15
+ }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Linear easing. From https://github.com/stackgl/glsl-easings
4
+ use: linearIn(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn linearIn(t: f32) -> f32 { return t; }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Linear easing. From https://github.com/stackgl/glsl-easings
4
+ use: linearInOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn linearInOut(t: f32) -> f32 { return t; }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Linear easing. From https://github.com/stackgl/glsl-easings
4
+ use: linearOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn linearOut(t: f32) -> f32 { return t; }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Quadrtic in easing. From https://github.com/stackgl/glsl-easings
4
+ use: quadraticIn(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn quadraticIn(t: f32) -> f32 { return t * t; }
@@ -0,0 +1,12 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Quadrtic in/out easing. From https://github.com/stackgl/glsl-easings
4
+ use: quadraticInOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn quadraticInOut(t: f32) -> f32 {
10
+ let p = 2.0 * t * t;
11
+ return select(-p + (4.0 * t) - 1.0, p, t < 0.5);
12
+ }
@@ -0,0 +1,9 @@
1
+ /*
2
+ contributors: Hugh Kennedy (https://github.com/hughsk)
3
+ description: Quadrtic out easing. From https://github.com/stackgl/glsl-easings
4
+ use: quadraticOut(<f32> x)
5
+ examples:
6
+ - https://raw.githubusercontent.com/patriciogonzalezvivo/lygia_examples/main/animation_easing.frag
7
+ */
8
+
9
+ fn quadraticOut(t: f32) -> f32 { return -t * (t - 2.0); }