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.
Files changed (1869) hide show
  1. package/CONTRIBUTE.md +21 -0
  2. package/DESIGN.md +137 -0
  3. package/EXAMPLES.md +23 -0
  4. package/README.md +100 -182
  5. package/README_GLSL.md +27 -0
  6. package/README_METAL.md +56 -0
  7. package/animation/easing/back.glsl +4 -31
  8. package/animation/easing/back.hlsl +1 -1
  9. package/animation/easing/backIn.glsl +14 -0
  10. package/animation/easing/backInOut.glsl +24 -0
  11. package/animation/easing/backOut.glsl +14 -0
  12. package/animation/easing/bounce.glsl +5 -40
  13. package/animation/easing/bounce.hlsl +2 -2
  14. package/animation/easing/bounceIn.glsl +14 -0
  15. package/animation/easing/bounceInOut.glsl +18 -0
  16. package/animation/easing/bounceOut.glsl +32 -0
  17. package/animation/easing/circular.glsl +5 -24
  18. package/animation/easing/circular.hlsl +7 -7
  19. package/animation/easing/circularIn.glsl +12 -0
  20. package/animation/easing/circularInOut.glsl +16 -0
  21. package/animation/easing/circularOut.glsl +12 -0
  22. package/animation/easing/cubic.glsl +5 -25
  23. package/animation/easing/cubic.hlsl +2 -2
  24. package/animation/easing/cubicIn.glsl +12 -0
  25. package/animation/easing/cubicInOut.glsl +16 -0
  26. package/animation/easing/cubicOut.glsl +16 -0
  27. package/animation/easing/elastic.glsl +5 -26
  28. package/animation/easing/elastic.hlsl +2 -2
  29. package/animation/easing/elasticIn.glsl +14 -0
  30. package/animation/easing/elasticInOut.glsl +18 -0
  31. package/animation/easing/elasticOut.glsl +14 -0
  32. package/animation/easing/exponential.glsl +5 -26
  33. package/animation/easing/exponential.hlsl +2 -2
  34. package/animation/easing/exponentialIn.glsl +12 -0
  35. package/animation/easing/exponentialInOut.glsl +18 -0
  36. package/animation/easing/exponentialOut.glsl +12 -0
  37. package/animation/easing/linear.glsl +4 -15
  38. package/animation/easing/linear.hlsl +1 -1
  39. package/animation/easing/linearIn.glsl +12 -0
  40. package/animation/easing/linearInOut.glsl +12 -0
  41. package/animation/easing/linearOut.glsl +12 -0
  42. package/animation/easing/quadratic.glsl +5 -23
  43. package/animation/easing/quadratic.hlsl +2 -2
  44. package/animation/easing/quadraticIn.glsl +12 -0
  45. package/animation/easing/quadraticInOut.glsl +15 -0
  46. package/animation/easing/quadraticOut.glsl +12 -0
  47. package/animation/easing/quartic.glsl +5 -24
  48. package/animation/easing/quartic.hlsl +7 -7
  49. package/animation/easing/quarticIn.glsl +12 -0
  50. package/animation/easing/quarticInOut.glsl +16 -0
  51. package/animation/easing/quarticOut.glsl +15 -0
  52. package/animation/easing/quintic.glsl +5 -24
  53. package/animation/easing/quintic.hlsl +2 -2
  54. package/animation/easing/quinticIn.glsl +12 -0
  55. package/animation/easing/quinticInOut.glsl +16 -0
  56. package/animation/easing/quinticOut.glsl +12 -0
  57. package/animation/easing/sine.glsl +5 -22
  58. package/animation/easing/sine.hlsl +3 -3
  59. package/animation/easing/sineIn.glsl +14 -0
  60. package/animation/easing/sineInOut.glsl +14 -0
  61. package/animation/easing/sineOut.glsl +14 -0
  62. package/animation/spriteLoop.glsl +6 -3
  63. package/animation/spriteLoop.hlsl +7 -4
  64. package/color/blend/add.glsl +5 -12
  65. package/color/blend/add.hlsl +2 -1
  66. package/color/blend/add.msl +13 -0
  67. package/color/blend/average.glsl +5 -12
  68. package/color/blend/average.hlsl +2 -1
  69. package/color/blend/average.msl +13 -0
  70. package/color/blend/color.glsl +22 -0
  71. package/color/blend/color.msl +23 -0
  72. package/color/blend/colorBurn.glsl +5 -10
  73. package/color/blend/colorBurn.hlsl +2 -1
  74. package/color/blend/colorBurn.msl +17 -0
  75. package/color/blend/colorDodge.glsl +5 -10
  76. package/color/blend/colorDodge.hlsl +2 -1
  77. package/color/blend/colorDodge.msl +17 -0
  78. package/color/blend/darken.glsl +5 -10
  79. package/color/blend/darken.hlsl +2 -1
  80. package/color/blend/darken.msl +17 -0
  81. package/color/blend/difference.glsl +5 -12
  82. package/color/blend/difference.hlsl +2 -1
  83. package/color/blend/difference.msl +13 -0
  84. package/color/blend/exclusion.glsl +5 -12
  85. package/color/blend/exclusion.hlsl +2 -1
  86. package/color/blend/exclusion.msl +13 -0
  87. package/color/blend/glow.glsl +2 -1
  88. package/color/blend/glow.hlsl +3 -2
  89. package/color/blend/glow.msl +23 -0
  90. package/color/blend/hardLight.glsl +2 -1
  91. package/color/blend/hardLight.hlsl +3 -2
  92. package/color/blend/hardLight.msl +23 -0
  93. package/color/blend/hardMix.glsl +2 -1
  94. package/color/blend/hardMix.hlsl +3 -2
  95. package/color/blend/hardMix.msl +25 -0
  96. package/color/blend/hue.glsl +22 -0
  97. package/color/blend/hue.msl +22 -0
  98. package/color/blend/lighten.glsl +2 -1
  99. package/color/blend/lighten.hlsl +2 -1
  100. package/color/blend/lighten.msl +23 -0
  101. package/color/blend/linearBurn.glsl +2 -1
  102. package/color/blend/linearBurn.hlsl +2 -1
  103. package/color/blend/linearBurn.msl +23 -0
  104. package/color/blend/linearDodge.glsl +2 -1
  105. package/color/blend/linearDodge.hlsl +2 -1
  106. package/color/blend/linearDodge.msl +23 -0
  107. package/color/blend/linearLight.glsl +2 -1
  108. package/color/blend/linearLight.msl +26 -0
  109. package/color/blend/luminosity.glsl +22 -0
  110. package/color/blend/luminosity.msl +22 -0
  111. package/color/blend/multiply.glsl +2 -1
  112. package/color/blend/multiply.hlsl +2 -1
  113. package/color/blend/multiply.msl +21 -0
  114. package/color/blend/multiply.wgsl +18 -0
  115. package/color/blend/negation.glsl +2 -1
  116. package/color/blend/negation.hlsl +2 -1
  117. package/color/blend/negation.msl +21 -0
  118. package/color/blend/overlay.glsl +2 -1
  119. package/color/blend/overlay.hlsl +2 -1
  120. package/color/blend/overlay.msl +23 -0
  121. package/color/blend/overlay.wgsl +24 -0
  122. package/color/blend/phoenix.glsl +2 -1
  123. package/color/blend/phoenix.hlsl +2 -1
  124. package/color/blend/phoenix.msl +21 -0
  125. package/color/blend/pinLight.glsl +2 -1
  126. package/color/blend/pinLight.hlsl +2 -1
  127. package/color/blend/pinLight.msl +26 -0
  128. package/color/blend/reflect.glsl +2 -1
  129. package/color/blend/reflect.hlsl +2 -1
  130. package/color/blend/reflect.msl +23 -0
  131. package/color/blend/saturation.glsl +22 -0
  132. package/color/blend/saturation.msl +22 -0
  133. package/color/blend/screen.glsl +2 -1
  134. package/color/blend/screen.hlsl +1 -1
  135. package/color/blend/screen.msl +23 -0
  136. package/color/blend/screen.wgsl +20 -0
  137. package/color/blend/softLight.glsl +1 -1
  138. package/color/blend/softLight.hlsl +2 -1
  139. package/color/blend/softLight.msl +30 -0
  140. package/color/blend/softLight.wgsl +31 -0
  141. package/color/blend/subtract.glsl +2 -1
  142. package/color/blend/subtract.hlsl +2 -1
  143. package/color/blend/subtract.msl +21 -0
  144. package/color/blend/vividLight.glsl +2 -1
  145. package/color/blend/vividLight.hlsl +4 -3
  146. package/color/blend/vividLight.msl +26 -0
  147. package/color/blend.glsl +5 -1
  148. package/color/blend.msl +28 -0
  149. package/color/brightnessContrast.glsl +10 -13
  150. package/color/brightnessContrast.hlsl +7 -2
  151. package/color/brightnessContrast.msl +12 -0
  152. package/color/brightnessContrast.wgsl +16 -0
  153. package/color/brightnessMatrix.glsl +9 -4
  154. package/color/brightnessMatrix.hlsl +7 -2
  155. package/color/brightnessMatrix.msl +18 -0
  156. package/color/composite/compositeXor.glsl +27 -0
  157. package/color/composite/compositeXor.hlsl +29 -0
  158. package/color/composite/compositeXor.msl +32 -0
  159. package/color/composite/destinationAtop.glsl +29 -0
  160. package/color/composite/destinationAtop.hlsl +29 -0
  161. package/color/composite/destinationAtop.msl +32 -0
  162. package/color/composite/destinationIn.glsl +29 -0
  163. package/color/composite/destinationIn.hlsl +30 -0
  164. package/color/composite/destinationIn.msl +33 -0
  165. package/color/composite/destinationOut.glsl +29 -0
  166. package/color/composite/destinationOut.hlsl +29 -0
  167. package/color/composite/destinationOut.msl +32 -0
  168. package/color/composite/destinationOver.glsl +29 -0
  169. package/color/composite/destinationOver.hlsl +29 -0
  170. package/color/composite/destinationOver.msl +32 -0
  171. package/color/composite/sourceAtop.glsl +29 -0
  172. package/color/composite/sourceAtop.hlsl +29 -0
  173. package/color/composite/sourceAtop.msl +32 -0
  174. package/color/composite/sourceIn.glsl +30 -0
  175. package/color/composite/sourceIn.hlsl +30 -0
  176. package/color/composite/sourceIn.msl +33 -0
  177. package/color/composite/sourceOut.glsl +29 -0
  178. package/color/composite/sourceOut.hlsl +29 -0
  179. package/color/composite/sourceOut.msl +32 -0
  180. package/color/composite/sourceOver.glsl +32 -0
  181. package/color/composite/sourceOver.hlsl +32 -0
  182. package/color/composite/sourceOver.msl +35 -0
  183. package/color/composite.glsl +9 -0
  184. package/color/composite.hlsl +9 -0
  185. package/color/composite.msl +9 -0
  186. package/color/contrast.glsl +8 -13
  187. package/color/contrast.hlsl +5 -2
  188. package/color/contrast.msl +15 -0
  189. package/color/contrastMatrix.glsl +13 -8
  190. package/color/contrastMatrix.hlsl +7 -2
  191. package/color/contrastMatrix.msl +19 -0
  192. package/color/daltonize.glsl +10 -3
  193. package/color/daltonize.hlsl +11 -3
  194. package/color/daltonize.msl +184 -0
  195. package/color/desaturate.glsl +9 -6
  196. package/color/desaturate.hlsl +5 -2
  197. package/color/desaturate.msl +19 -0
  198. package/color/distance.glsl +8 -3
  199. package/color/distance.hlsl +8 -3
  200. package/color/distance.msl +55 -0
  201. package/color/distance.wgsl +55 -0
  202. package/color/dither/bayer.glsl +54 -27
  203. package/color/dither/bayer.msl +49 -0
  204. package/color/dither/bayer.wgsl +45 -0
  205. package/color/dither/blueNoise.glsl +88 -45
  206. package/color/dither/blueNoise.hlsl +16 -13
  207. package/color/dither/blueNoise.msl +131 -0
  208. package/color/dither/blueNoise.wgsl +47 -0
  209. package/color/dither/interleavedGradientNoise.glsl +60 -36
  210. package/color/dither/interleavedGradientNoise.hlsl +7 -5
  211. package/color/dither/interleavedGradientNoise.msl +70 -0
  212. package/color/dither/shift.glsl +50 -26
  213. package/color/dither/shift.hlsl +7 -5
  214. package/color/dither/shift.msl +91 -0
  215. package/color/dither/triangleNoise.glsl +51 -62
  216. package/color/dither/triangleNoise.hlsl +10 -8
  217. package/color/dither/triangleNoise.msl +79 -0
  218. package/color/dither/vlachos.glsl +46 -20
  219. package/color/dither/vlachos.hlsl +7 -5
  220. package/color/dither/vlachos.msl +73 -0
  221. package/color/dither/vlachos.wgsl +28 -0
  222. package/color/dither.glsl +12 -30
  223. package/color/dither.hlsl +6 -3
  224. package/color/dither.msl +43 -0
  225. package/color/exposure.glsl +8 -13
  226. package/color/exposure.hlsl +5 -2
  227. package/color/exposure.msl +15 -0
  228. package/color/exposure.wgsl +11 -3
  229. package/color/hueShift.glsl +23 -11
  230. package/color/hueShift.hlsl +22 -12
  231. package/color/hueShift.msl +33 -0
  232. package/color/hueShift.wgsl +22 -0
  233. package/color/hueShiftRYB.glsl +31 -0
  234. package/color/hueShiftRYB.hlsl +31 -0
  235. package/color/hueShiftRYB.msl +31 -0
  236. package/color/hueShiftRYB.wgsl +24 -0
  237. package/color/layer/addSourceOver.glsl +30 -0
  238. package/color/layer/addSourceOver.hlsl +30 -0
  239. package/color/layer/addSourceOver.msl +31 -0
  240. package/color/layer/averageSourceOver.glsl +30 -0
  241. package/color/layer/averageSourceOver.hlsl +30 -0
  242. package/color/layer/averageSourceOver.msl +31 -0
  243. package/color/layer/colorBurnSourceOver.glsl +30 -0
  244. package/color/layer/colorBurnSourceOver.hlsl +30 -0
  245. package/color/layer/colorBurnSourceOver.msl +31 -0
  246. package/color/layer/colorDodgeSourceOver.glsl +30 -0
  247. package/color/layer/colorDodgeSourceOver.hlsl +30 -0
  248. package/color/layer/colorDodgeSourceOver.msl +31 -0
  249. package/color/layer/colorSourceOver.glsl +30 -0
  250. package/color/layer/colorSourceOver.hlsl +30 -0
  251. package/color/layer/colorSourceOver.msl +31 -0
  252. package/color/layer/darkenSourceOver.glsl +30 -0
  253. package/color/layer/darkenSourceOver.hlsl +30 -0
  254. package/color/layer/darkenSourceOver.msl +31 -0
  255. package/color/layer/differenceSourceOver.glsl +30 -0
  256. package/color/layer/differenceSourceOver.hlsl +30 -0
  257. package/color/layer/differenceSourceOver.msl +31 -0
  258. package/color/layer/exclusionSourceOver.glsl +30 -0
  259. package/color/layer/exclusionSourceOver.hlsl +30 -0
  260. package/color/layer/exclusionSourceOver.msl +31 -0
  261. package/color/layer/glowSourceOver.glsl +30 -0
  262. package/color/layer/glowSourceOver.hlsl +30 -0
  263. package/color/layer/glowSourceOver.msl +31 -0
  264. package/color/layer/hardLightSourceOver.glsl +30 -0
  265. package/color/layer/hardLightSourceOver.hlsl +30 -0
  266. package/color/layer/hardLightSourceOver.msl +31 -0
  267. package/color/layer/hardMixSourceOver.glsl +30 -0
  268. package/color/layer/hardMixSourceOver.hlsl +30 -0
  269. package/color/layer/hardMixSourceOver.msl +31 -0
  270. package/color/layer/hueSourceOver.glsl +30 -0
  271. package/color/layer/hueSourceOver.hlsl +30 -0
  272. package/color/layer/hueSourceOver.msl +31 -0
  273. package/color/layer/lightenSourceOver.glsl +30 -0
  274. package/color/layer/lightenSourceOver.hlsl +30 -0
  275. package/color/layer/lightenSourceOver.msl +31 -0
  276. package/color/layer/linearBurnSourceOver.glsl +30 -0
  277. package/color/layer/linearBurnSourceOver.hlsl +30 -0
  278. package/color/layer/linearBurnSourceOver.msl +31 -0
  279. package/color/layer/linearDodgeSourceOver.glsl +30 -0
  280. package/color/layer/linearDodgeSourceOver.hlsl +30 -0
  281. package/color/layer/linearDodgeSourceOver.msl +31 -0
  282. package/color/layer/linearLightSourceOver.glsl +30 -0
  283. package/color/layer/linearLightSourceOver.hlsl +30 -0
  284. package/color/layer/linearLightSourceOver.msl +31 -0
  285. package/color/layer/luminositySourceOver.glsl +30 -0
  286. package/color/layer/luminositySourceOver.hlsl +30 -0
  287. package/color/layer/luminositySourceOver.msl +31 -0
  288. package/color/layer/multiplySourceOver.glsl +30 -0
  289. package/color/layer/multiplySourceOver.hlsl +30 -0
  290. package/color/layer/multiplySourceOver.msl +31 -0
  291. package/color/layer/negationSourceOver.glsl +30 -0
  292. package/color/layer/negationSourceOver.hlsl +30 -0
  293. package/color/layer/negationSourceOver.msl +31 -0
  294. package/color/layer/overlaySourceOver.glsl +30 -0
  295. package/color/layer/overlaySourceOver.hlsl +30 -0
  296. package/color/layer/overlaySourceOver.msl +31 -0
  297. package/color/layer/phoenixSourceOver.glsl +30 -0
  298. package/color/layer/phoenixSourceOver.hlsl +30 -0
  299. package/color/layer/phoenixSourceOver.msl +31 -0
  300. package/color/layer/pinLightSourceOver.glsl +30 -0
  301. package/color/layer/pinLightSourceOver.hlsl +30 -0
  302. package/color/layer/pinLightSourceOver.msl +31 -0
  303. package/color/layer/reflectSourceOver.glsl +30 -0
  304. package/color/layer/reflectSourceOver.hlsl +30 -0
  305. package/color/layer/reflectSourceOver.msl +31 -0
  306. package/color/layer/saturationSourceOver.glsl +30 -0
  307. package/color/layer/saturationSourceOver.hlsl +30 -0
  308. package/color/layer/saturationSourceOver.msl +31 -0
  309. package/color/layer/screenSourceOver.glsl +30 -0
  310. package/color/layer/screenSourceOver.hlsl +30 -0
  311. package/color/layer/screenSourceOver.msl +31 -0
  312. package/color/layer/softLightSourceOver.glsl +30 -0
  313. package/color/layer/softLightSourceOver.hlsl +30 -0
  314. package/color/layer/softLightSourceOver.msl +31 -0
  315. package/color/layer/subtractSourceOver.glsl +30 -0
  316. package/color/layer/subtractSourceOver.hlsl +30 -0
  317. package/color/layer/subtractSourceOver.msl +31 -0
  318. package/color/layer/vividLightSourceOver.glsl +30 -0
  319. package/color/layer/vividLightSourceOver.hlsl +30 -0
  320. package/color/layer/vividLightSourceOver.msl +31 -0
  321. package/color/layer.glsl +28 -0
  322. package/color/layer.hlsl +28 -0
  323. package/color/layer.msl +28 -0
  324. package/color/levels/gamma.glsl +10 -18
  325. package/color/levels/gamma.hlsl +6 -3
  326. package/color/levels/gamma.msl +19 -0
  327. package/color/levels/inputRange.glsl +10 -18
  328. package/color/levels/inputRange.hlsl +6 -3
  329. package/color/levels/inputRange.msl +18 -0
  330. package/color/levels/outputRange.glsl +10 -18
  331. package/color/levels/outputRange.hlsl +7 -4
  332. package/color/levels/outputRange.msl +18 -0
  333. package/color/levels.glsl +14 -11
  334. package/color/levels.hlsl +6 -3
  335. package/color/levels.msl +33 -0
  336. package/color/luma.glsl +5 -13
  337. package/color/luma.hlsl +2 -2
  338. package/color/luma.msl +14 -0
  339. package/color/luma.wgsl +9 -3
  340. package/color/luminance.glsl +7 -2
  341. package/color/luminance.hlsl +3 -1
  342. package/color/luminance.msl +14 -0
  343. package/color/lut.glsl +19 -13
  344. package/color/lut.hlsl +19 -13
  345. package/color/lut.msl +99 -0
  346. package/color/mixBox.glsl +15 -9
  347. package/color/mixOklab.glsl +14 -18
  348. package/color/mixOklab.hlsl +19 -26
  349. package/color/mixOklab.msl +51 -0
  350. package/color/mixOklab.wgsl +29 -16
  351. package/color/mixRYB.glsl +36 -0
  352. package/color/mixRYB.hlsl +36 -0
  353. package/color/mixRYB.msl +36 -0
  354. package/color/mixSpectral.glsl +131 -118
  355. package/color/mixSpectral.hlsl +129 -125
  356. package/color/mixSpectral.msl +168 -0
  357. package/color/mixSpectral.wgsl +199 -134
  358. package/color/palette/fire.cuh +5 -2
  359. package/color/palette/fire.glsl +5 -2
  360. package/color/palette/fire.hlsl +5 -2
  361. package/color/palette/heatmap.cuh +5 -2
  362. package/color/palette/heatmap.glsl +5 -2
  363. package/color/palette/heatmap.hlsl +5 -2
  364. package/color/palette/heatmap.wgsl +14 -0
  365. package/color/palette/hue.cuh +5 -3
  366. package/color/palette/hue.glsl +8 -18
  367. package/color/palette/hue.hlsl +10 -10
  368. package/color/palette/hue.wgsl +16 -0
  369. package/color/palette/lerp.glsl +60 -0
  370. package/color/palette/macbeth.glsl +1016 -0
  371. package/color/palette/macbeth.hlsl +957 -0
  372. package/color/palette/pigments/gamblin_oil.glsl +325 -0
  373. package/color/palette/pigments/gamblin_oil.hlsl +325 -0
  374. package/color/palette/pigments/golden_acrylic.glsl +248 -0
  375. package/color/palette/pigments/golden_acrylic.hlsl +248 -0
  376. package/color/palette/pigments/liquitex_acrylic.glsl +164 -0
  377. package/color/palette/pigments/liquitex_acrylic.hlsl +164 -0
  378. package/color/palette/pigments/rembrandt_oil.glsl +283 -0
  379. package/color/palette/pigments/rembrandt_oil.hlsl +283 -0
  380. package/color/palette/pigments/winsor_acrylic.glsl +430 -0
  381. package/color/palette/pigments/winsor_acrylic.hlsl +430 -0
  382. package/color/palette/pigments/winsor_gouache.glsl +346 -0
  383. package/color/palette/pigments/winsor_gouache.hlsl +346 -0
  384. package/color/palette/pigments/winsor_oil.glsl +507 -0
  385. package/color/palette/pigments/winsor_oil.hlsl +507 -0
  386. package/color/{pigments.glsl → palette/pigments.glsl} +38 -1
  387. package/color/{pigments.hlsl → palette/pigments.hlsl} +37 -0
  388. package/color/palette/ridgway.glsl +7827 -0
  389. package/color/palette/ridgway.hlsl +7827 -0
  390. package/color/palette/spectral/gems.glsl +4 -5
  391. package/color/palette/spectral/gems.hlsl +5 -3
  392. package/color/palette/spectral/geoffrey.glsl +3 -4
  393. package/color/palette/spectral/geoffrey.hlsl +2 -2
  394. package/color/palette/spectral/soft.glsl +6 -4
  395. package/color/palette/spectral/soft.hlsl +5 -2
  396. package/color/palette/spectral/zucconi.glsl +2 -3
  397. package/color/palette/spectral/zucconi.hlsl +1 -1
  398. package/color/palette/spectral/zucconi6.glsl +2 -3
  399. package/color/palette/spectral/zucconi6.hlsl +2 -2
  400. package/color/palette/spectral.glsl +3 -2
  401. package/color/palette/spectral.hlsl +3 -2
  402. package/color/palette/spyder.glsl +690 -0
  403. package/color/palette/spyder.hlsl +680 -0
  404. package/color/palette/wada/dyad.glsl +156 -0
  405. package/color/palette/wada/dyad.hlsl +151 -0
  406. package/color/palette/wada/tetrad.glsl +132 -0
  407. package/color/palette/wada/tetrad.hlsl +127 -0
  408. package/color/palette/wada/triad.glsl +145 -0
  409. package/color/palette/wada/triad.hlsl +140 -0
  410. package/color/palette/wada/value.glsl +2397 -0
  411. package/color/palette/wada/value.hlsl +2387 -0
  412. package/color/palette/wada.glsl +4 -0
  413. package/color/palette/wada.hlsl +4 -0
  414. package/color/palette/water.cuh +5 -2
  415. package/color/palette/water.glsl +5 -2
  416. package/color/palette/water.hlsl +5 -2
  417. package/color/palette/zorn.glsl +39 -0
  418. package/color/palette.glsl +4 -9
  419. package/color/palette.hlsl +1 -1
  420. package/color/palette.msl +13 -0
  421. package/color/saturationMatrix.glsl +14 -19
  422. package/color/saturationMatrix.hlsl +5 -2
  423. package/color/saturationMatrix.msl +23 -0
  424. package/color/saturationMatrix.wgsl +12 -4
  425. package/color/space/YCbCr2rgb.glsl +7 -4
  426. package/color/space/YCbCr2rgb.hlsl +5 -2
  427. package/color/space/YCbCr2rgb.msl +25 -0
  428. package/color/space/YCbCr2rgb.wgsl +10 -2
  429. package/color/space/YPbPr2rgb.glsl +20 -20
  430. package/color/space/YPbPr2rgb.hlsl +21 -21
  431. package/color/space/YPbPr2rgb.msl +31 -0
  432. package/color/space/YPbPr2rgb.wgsl +19 -15
  433. package/color/space/cmyk2rgb.glsl +6 -3
  434. package/color/space/cmyk2rgb.hlsl +5 -2
  435. package/color/space/cmyk2rgb.msl +18 -0
  436. package/color/space/cmyk2rgb.wgsl +10 -2
  437. package/color/space/gamma2linear.glsl +8 -5
  438. package/color/space/gamma2linear.hlsl +5 -2
  439. package/color/space/gamma2linear.msl +37 -0
  440. package/color/space/gamma2linear.wgsl +9 -1
  441. package/color/space/hcy2rgb.glsl +26 -0
  442. package/color/space/hcy2rgb.hlsl +26 -0
  443. package/color/space/hcy2rgb.msl +26 -0
  444. package/color/space/hcy2rgb.wgsl +23 -0
  445. package/color/space/hsl2rgb.glsl +20 -0
  446. package/color/space/hsl2rgb.hlsl +20 -0
  447. package/color/space/hsl2rgb.msl +20 -0
  448. package/color/space/hsl2rgb.wgsl +16 -0
  449. package/color/space/hsv2rgb.glsl +8 -17
  450. package/color/space/hsv2rgb.hlsl +7 -17
  451. package/color/space/hsv2rgb.msl +14 -0
  452. package/color/space/hsv2rgb.wgsl +11 -6
  453. package/color/space/hsv2ryb.glsl +37 -0
  454. package/color/space/hsv2ryb.hlsl +37 -0
  455. package/color/space/hsv2ryb.msl +37 -0
  456. package/color/space/hsv2ryb.wgsl +19 -0
  457. package/color/space/hue2rgb.glsl +20 -0
  458. package/color/space/hue2rgb.hlsl +18 -0
  459. package/color/space/hue2rgb.msl +20 -0
  460. package/color/space/hue2rgb.wgsl +14 -0
  461. package/color/space/k2rgb.glsl +6 -3
  462. package/color/space/k2rgb.hlsl +5 -2
  463. package/color/space/k2rgb.msl +69 -0
  464. package/color/space/k2rgb.wgsl +10 -2
  465. package/color/space/lab2lch.glsl +20 -0
  466. package/color/space/lab2lch.hlsl +20 -0
  467. package/color/space/lab2lch.msl +20 -0
  468. package/color/space/lab2lch.wgsl +15 -0
  469. package/color/space/lab2rgb.glsl +8 -9
  470. package/color/space/lab2rgb.hlsl +5 -7
  471. package/color/space/lab2rgb.msl +18 -0
  472. package/color/space/lab2rgb.wgsl +11 -5
  473. package/color/space/lab2srgb.glsl +18 -0
  474. package/color/space/lab2srgb.hlsl +23 -0
  475. package/color/space/lab2srgb.msl +18 -0
  476. package/color/space/lab2srgb.wgsl +13 -0
  477. package/color/space/lab2xyz.glsl +23 -10
  478. package/color/space/lab2xyz.hlsl +27 -11
  479. package/color/space/lab2xyz.msl +33 -0
  480. package/color/space/lab2xyz.wgsl +11 -3
  481. package/color/space/lch2lab.glsl +20 -0
  482. package/color/space/lch2lab.hlsl +20 -0
  483. package/color/space/lch2lab.msl +20 -0
  484. package/color/space/lch2lab.wgsl +15 -0
  485. package/color/space/lch2rgb.glsl +16 -0
  486. package/color/space/lch2rgb.hlsl +16 -0
  487. package/color/space/lch2rgb.msl +16 -0
  488. package/color/space/lch2rgb.wgsl +13 -0
  489. package/color/space/lch2srgb.glsl +16 -0
  490. package/color/space/lch2srgb.msl +16 -0
  491. package/color/space/linear2gamma.glsl +10 -7
  492. package/color/space/linear2gamma.hlsl +5 -2
  493. package/color/space/linear2gamma.msl +37 -0
  494. package/color/space/linear2gamma.wgsl +10 -2
  495. package/color/space/lms2rgb.glsl +24 -22
  496. package/color/space/lms2rgb.hlsl +24 -20
  497. package/color/space/lms2rgb.msl +31 -0
  498. package/color/space/lms2rgb.wgsl +21 -13
  499. package/color/space/oklab2rgb.glsl +22 -18
  500. package/color/space/oklab2rgb.hlsl +21 -17
  501. package/color/space/oklab2rgb.msl +29 -0
  502. package/color/space/oklab2rgb.wgsl +18 -9
  503. package/color/space/oklab2srgb.glsl +16 -0
  504. package/color/space/oklab2srgb.hlsl +16 -0
  505. package/color/space/oklab2srgb.msl +16 -0
  506. package/color/space/oklab2srgb.wgsl +12 -0
  507. package/color/space/rgb2YCbCr.glsl +10 -7
  508. package/color/space/rgb2YCbCr.hlsl +5 -2
  509. package/color/space/rgb2YCbCr.msl +22 -0
  510. package/color/space/rgb2YCbCr.wgsl +13 -5
  511. package/color/space/rgb2YPbPr.glsl +18 -18
  512. package/color/space/rgb2YPbPr.hlsl +15 -15
  513. package/color/space/rgb2YPbPr.msl +31 -0
  514. package/color/space/rgb2YPbPr.wgsl +17 -11
  515. package/color/space/rgb2cmyk.glsl +6 -3
  516. package/color/space/rgb2cmyk.hlsl +5 -2
  517. package/color/space/rgb2cmyk.msl +22 -0
  518. package/color/space/rgb2cmyk.wgsl +10 -2
  519. package/color/space/rgb2hcv.glsl +24 -0
  520. package/color/space/rgb2hcv.hlsl +24 -0
  521. package/color/space/rgb2hcv.msl +24 -0
  522. package/color/space/rgb2hcv.wgsl +15 -0
  523. package/color/space/rgb2hcy.glsl +34 -0
  524. package/color/space/rgb2hcy.hlsl +33 -0
  525. package/color/space/rgb2hcy.msl +34 -0
  526. package/color/space/rgb2hcy.wgsl +29 -0
  527. package/color/space/rgb2heat.glsl +6 -6
  528. package/color/space/rgb2heat.hlsl +5 -5
  529. package/color/space/rgb2heat.msl +16 -0
  530. package/color/space/rgb2heat.wgsl +10 -3
  531. package/color/space/rgb2hsl.glsl +25 -0
  532. package/color/space/rgb2hsl.hlsl +25 -0
  533. package/color/space/rgb2hsl.msl +25 -0
  534. package/color/space/rgb2hsl.wgsl +17 -0
  535. package/color/space/rgb2hsv.glsl +11 -18
  536. package/color/space/rgb2hsv.hlsl +4 -14
  537. package/color/space/rgb2hsv.msl +23 -0
  538. package/color/space/rgb2hsv.wgsl +9 -11
  539. package/color/space/rgb2hue.glsl +15 -16
  540. package/color/space/rgb2hue.hlsl +11 -15
  541. package/color/space/rgb2hue.msl +27 -0
  542. package/color/space/rgb2hue.wgsl +15 -3
  543. package/color/space/rgb2lab.glsl +7 -10
  544. package/color/space/rgb2lab.hlsl +6 -9
  545. package/color/space/rgb2lab.msl +17 -0
  546. package/color/space/rgb2lab.wgsl +10 -6
  547. package/color/space/rgb2lch.glsl +17 -0
  548. package/color/space/rgb2lch.hlsl +17 -0
  549. package/color/space/rgb2lch.msl +17 -0
  550. package/color/space/rgb2lch.wgsl +13 -0
  551. package/color/space/rgb2lms.glsl +24 -20
  552. package/color/space/rgb2lms.hlsl +24 -20
  553. package/color/space/rgb2lms.msl +31 -0
  554. package/color/space/rgb2lms.wgsl +22 -13
  555. package/color/space/rgb2luma.glsl +8 -10
  556. package/color/space/rgb2luma.hlsl +8 -10
  557. package/color/space/rgb2luma.msl +14 -0
  558. package/color/space/rgb2luma.wgsl +9 -3
  559. package/color/space/rgb2oklab.glsl +23 -19
  560. package/color/space/rgb2oklab.hlsl +23 -19
  561. package/color/space/rgb2oklab.msl +31 -0
  562. package/color/space/rgb2oklab.wgsl +19 -10
  563. package/color/space/rgb2ryb.glsl +88 -0
  564. package/color/space/rgb2ryb.hlsl +88 -0
  565. package/color/space/rgb2ryb.msl +88 -0
  566. package/color/space/rgb2ryb.wgsl +32 -0
  567. package/color/space/rgb2srgb.glsl +12 -18
  568. package/color/space/rgb2srgb.hlsl +14 -18
  569. package/color/space/rgb2srgb.msl +23 -0
  570. package/color/space/rgb2srgb.wgsl +14 -4
  571. package/color/space/rgb2xyY.glsl +17 -0
  572. package/color/space/rgb2xyY.hlsl +17 -0
  573. package/color/space/rgb2xyY.msl +17 -0
  574. package/color/space/rgb2xyY.wgsl +12 -0
  575. package/color/space/rgb2xyz.glsl +23 -16
  576. package/color/space/rgb2xyz.hlsl +23 -16
  577. package/color/space/rgb2xyz.msl +29 -0
  578. package/color/space/rgb2xyz.wgsl +22 -0
  579. package/color/space/rgb2yiq.glsl +15 -16
  580. package/color/space/rgb2yiq.hlsl +14 -19
  581. package/color/space/rgb2yiq.msl +22 -0
  582. package/color/space/rgb2yiq.wgsl +13 -6
  583. package/color/space/rgb2yuv.glsl +20 -20
  584. package/color/space/rgb2yuv.hlsl +20 -20
  585. package/color/space/rgb2yuv.msl +31 -0
  586. package/color/space/rgb2yuv.wgsl +18 -10
  587. package/color/space/ryb2rgb.glsl +79 -0
  588. package/color/space/ryb2rgb.hlsl +79 -0
  589. package/color/space/ryb2rgb.msl +79 -0
  590. package/color/space/ryb2rgb.wgsl +30 -0
  591. package/color/space/srgb2lab.glsl +17 -0
  592. package/color/space/srgb2lab.hlsl +17 -0
  593. package/color/space/srgb2lab.msl +17 -0
  594. package/color/space/srgb2lab.wgsl +14 -0
  595. package/color/space/srgb2lch.glsl +17 -0
  596. package/color/space/srgb2lch.hlsl +17 -0
  597. package/color/space/srgb2lch.msl +17 -0
  598. package/color/space/srgb2lch.wgsl +13 -0
  599. package/color/space/srgb2luma.glsl +14 -0
  600. package/color/space/srgb2luma.hlsl +14 -0
  601. package/color/space/srgb2luma.msl +14 -0
  602. package/color/space/srgb2luma.wgsl +9 -0
  603. package/color/space/srgb2oklab.glsl +17 -0
  604. package/color/space/srgb2oklab.hlsl +16 -0
  605. package/color/space/srgb2oklab.msl +17 -0
  606. package/color/space/srgb2oklab.wgsl +12 -0
  607. package/color/space/srgb2rgb.glsl +12 -20
  608. package/color/space/srgb2rgb.hlsl +12 -18
  609. package/color/space/srgb2rgb.msl +23 -0
  610. package/color/space/srgb2rgb.wgsl +18 -8
  611. package/color/space/srgb2xyz.glsl +17 -0
  612. package/color/space/srgb2xyz.hlsl +17 -0
  613. package/color/space/srgb2xyz.msl +17 -0
  614. package/color/space/srgb2xyz.wgsl +13 -0
  615. package/color/space/w2rgb.glsl +8 -5
  616. package/color/space/w2rgb.hlsl +42 -11
  617. package/color/space/w2rgb.msl +53 -0
  618. package/color/space/xyY2rgb.glsl +17 -0
  619. package/color/space/xyY2rgb.hlsl +17 -0
  620. package/color/space/xyY2rgb.msl +17 -0
  621. package/color/space/xyY2rgb.wgsl +13 -0
  622. package/color/space/xyY2srgb.glsl +17 -0
  623. package/color/space/xyY2srgb.hlsl +17 -0
  624. package/color/space/xyY2srgb.msl +17 -0
  625. package/color/space/xyY2srgb.wgsl +13 -0
  626. package/color/space/xyY2xyz.glsl +20 -0
  627. package/color/space/xyY2xyz.hlsl +20 -0
  628. package/color/space/xyY2xyz.msl +20 -0
  629. package/color/space/xyY2xyz.wgsl +15 -0
  630. package/color/space/xyz2lab.glsl +6 -3
  631. package/color/space/xyz2lab.hlsl +4 -1
  632. package/color/space/xyz2lab.msl +23 -0
  633. package/color/space/xyz2lab.wgsl +13 -5
  634. package/color/space/xyz2rgb.glsl +25 -17
  635. package/color/space/xyz2rgb.hlsl +25 -17
  636. package/color/space/xyz2rgb.msl +32 -0
  637. package/color/space/xyz2rgb.wgsl +12 -10
  638. package/color/space/xyz2srgb.glsl +10 -18
  639. package/color/space/xyz2srgb.hlsl +10 -18
  640. package/color/space/xyz2srgb.msl +17 -0
  641. package/color/space/xyz2srgb.wgsl +11 -8
  642. package/color/space/xyz2xyY.glsl +20 -0
  643. package/color/space/xyz2xyY.hlsl +20 -0
  644. package/color/space/xyz2xyY.msl +20 -0
  645. package/color/space/xyz2xyY.wgsl +15 -0
  646. package/color/space/yiq2rgb.glsl +14 -16
  647. package/color/space/yiq2rgb.hlsl +14 -18
  648. package/color/space/yiq2rgb.msl +21 -0
  649. package/color/space/yiq2rgb.wgsl +12 -7
  650. package/color/space/yuv2rgb.glsl +20 -20
  651. package/color/space/yuv2rgb.hlsl +20 -20
  652. package/color/space/yuv2rgb.msl +31 -0
  653. package/color/space/yuv2rgb.wgsl +17 -12
  654. package/color/space.glsl +45 -15
  655. package/color/space.msl +57 -0
  656. package/color/tonemap/aces.glsl +5 -5
  657. package/color/tonemap/aces.hlsl +1 -1
  658. package/color/tonemap/aces.wgsl +19 -0
  659. package/color/tonemap/debug.glsl +3 -4
  660. package/color/tonemap/debug.hlsl +1 -1
  661. package/color/tonemap/filmic.glsl +5 -9
  662. package/color/tonemap/filmic.hlsl +1 -1
  663. package/color/tonemap/filmic.wgsl +17 -0
  664. package/color/tonemap/linear.glsl +4 -4
  665. package/color/tonemap/linear.hlsl +2 -2
  666. package/color/tonemap/reinhard.glsl +3 -5
  667. package/color/tonemap/reinhard.hlsl +1 -1
  668. package/color/tonemap/reinhardJodie.glsl +2 -5
  669. package/color/tonemap/reinhardJodie.hlsl +1 -1
  670. package/color/tonemap/uncharted.glsl +2 -2
  671. package/color/tonemap/uncharted.hlsl +2 -2
  672. package/color/tonemap/uncharted.wgsl +25 -0
  673. package/color/tonemap/uncharted2.glsl +3 -3
  674. package/color/tonemap/uncharted2.hlsl +1 -1
  675. package/color/tonemap/uncharted2.wgsl +21 -0
  676. package/color/tonemap/unreal.glsl +1 -1
  677. package/color/tonemap/unreal.hlsl +1 -1
  678. package/color/tonemap.glsl +10 -5
  679. package/color/tonemap.hlsl +7 -2
  680. package/color/tonemap.msl +46 -0
  681. package/color/vibrance.glsl +10 -10
  682. package/color/vibrance.hlsl +8 -6
  683. package/color/vibrance.msl +25 -0
  684. package/color/vibrance.wgsl +14 -3
  685. package/color/whiteBalance.glsl +25 -15
  686. package/color/whiteBalance.hlsl +19 -9
  687. package/color/whiteBalance.msl +83 -0
  688. package/color/whiteBalance.wgsl +64 -0
  689. package/distort/barrel.glsl +22 -19
  690. package/distort/barrel.hlsl +10 -7
  691. package/distort/barrel.msl +75 -0
  692. package/distort/chromaAB.glsl +18 -12
  693. package/distort/chromaAB.hlsl +16 -11
  694. package/distort/chromaAB.msl +79 -0
  695. package/distort/grain.glsl +13 -12
  696. package/distort/grain.hlsl +9 -8
  697. package/distort/grain.msl +81 -0
  698. package/distort/pincushion.glsl +53 -0
  699. package/distort/pincushion.msl +53 -0
  700. package/distort/stretch.glsl +10 -5
  701. package/distort/stretch.hlsl +12 -7
  702. package/distort/stretch.msl +68 -0
  703. package/draw/arrows.glsl +2 -4
  704. package/draw/arrows.msl +106 -0
  705. package/draw/axis.glsl +43 -0
  706. package/draw/axis.hlsl +43 -0
  707. package/draw/bridge.glsl +5 -2
  708. package/draw/bridge.hlsl +5 -2
  709. package/draw/bridge.msl +34 -0
  710. package/draw/circle.glsl +6 -3
  711. package/draw/circle.hlsl +5 -2
  712. package/draw/circle.msl +25 -0
  713. package/draw/colorChecker.glsl +136 -0
  714. package/draw/colorChecker.msl +136 -0
  715. package/draw/colorPicker.glsl +65 -0
  716. package/draw/colorPicker.hlsl +65 -0
  717. package/draw/colorPicker.msl +65 -0
  718. package/draw/digits.glsl +82 -5
  719. package/draw/digits.hlsl +85 -7
  720. package/draw/digits.msl +205 -0
  721. package/draw/fill.glsl +8 -3
  722. package/draw/fill.hlsl +6 -3
  723. package/draw/fill.msl +23 -0
  724. package/draw/flip.glsl +4 -1
  725. package/draw/flip.hlsl +5 -2
  726. package/draw/flip.msl +23 -0
  727. package/draw/hex.glsl +5 -2
  728. package/draw/hex.hlsl +5 -2
  729. package/draw/hex.msl +25 -0
  730. package/draw/line.glsl +21 -0
  731. package/draw/line.hlsl +21 -0
  732. package/draw/matrix.glsl +43 -0
  733. package/draw/matrix.hlsl +43 -0
  734. package/draw/matrix.msl +43 -0
  735. package/draw/point.glsl +59 -0
  736. package/draw/point.hlsl +59 -0
  737. package/draw/point.msl +59 -0
  738. package/draw/rect.glsl +5 -2
  739. package/draw/rect.hlsl +5 -2
  740. package/draw/rect.msl +35 -0
  741. package/draw/stroke.glsl +6 -3
  742. package/draw/stroke.hlsl +6 -3
  743. package/draw/stroke.msl +26 -0
  744. package/draw/stroke.wgsl +9 -0
  745. package/draw/tri.glsl +5 -2
  746. package/draw/tri.hlsl +5 -2
  747. package/draw/tri.msl +25 -0
  748. package/filter/bilateral.glsl +6 -12
  749. package/filter/bilateral.hlsl +13 -23
  750. package/filter/bilinear.glsl +45 -0
  751. package/filter/boxBlur/1D.glsl +8 -5
  752. package/filter/boxBlur/1D.hlsl +8 -5
  753. package/filter/boxBlur/1D.msl +63 -0
  754. package/filter/boxBlur/2D.glsl +8 -5
  755. package/filter/boxBlur/2D.hlsl +8 -5
  756. package/filter/boxBlur/2D.msl +75 -0
  757. package/filter/boxBlur/2D_fast9.glsl +8 -5
  758. package/filter/boxBlur/2D_fast9.hlsl +8 -5
  759. package/filter/boxBlur/2D_fast9.msl +48 -0
  760. package/filter/boxBlur.glsl +15 -9
  761. package/filter/boxBlur.hlsl +12 -9
  762. package/filter/boxBlur.msl +78 -0
  763. package/filter/edge/prewitt.glsl +3 -3
  764. package/filter/edge/prewitt.hlsl +4 -4
  765. package/filter/edge/prewitt.wgsl +20 -8
  766. package/filter/edge/sobel.glsl +3 -3
  767. package/filter/edge/sobel.hlsl +4 -4
  768. package/filter/edge/sobelDirectional.glsl +3 -3
  769. package/filter/edge/sobelDirectional.hlsl +4 -4
  770. package/filter/edge.glsl +8 -4
  771. package/filter/edge.hlsl +7 -4
  772. package/filter/fibonacciBokeh.glsl +25 -10
  773. package/filter/gaussianBlur/1D.glsl +12 -8
  774. package/filter/gaussianBlur/1D.hlsl +10 -7
  775. package/filter/gaussianBlur/1D.msl +76 -0
  776. package/filter/gaussianBlur/1D_fast13.glsl +4 -4
  777. package/filter/gaussianBlur/1D_fast13.hlsl +5 -5
  778. package/filter/gaussianBlur/1D_fast13.msl +46 -0
  779. package/filter/gaussianBlur/1D_fast5.glsl +4 -4
  780. package/filter/gaussianBlur/1D_fast5.hlsl +5 -5
  781. package/filter/gaussianBlur/1D_fast5.msl +39 -0
  782. package/filter/gaussianBlur/1D_fast9.glsl +4 -4
  783. package/filter/gaussianBlur/1D_fast9.hlsl +5 -5
  784. package/filter/gaussianBlur/1D_fast9.msl +42 -0
  785. package/filter/gaussianBlur/2D.glsl +16 -13
  786. package/filter/gaussianBlur/2D.hlsl +8 -5
  787. package/filter/gaussianBlur/2D.msl +77 -0
  788. package/filter/gaussianBlur.glsl +15 -10
  789. package/filter/gaussianBlur.hlsl +15 -10
  790. package/filter/gaussianBlur.msl +75 -0
  791. package/filter/jointBilateral.glsl +10 -16
  792. package/filter/kuwahara.glsl +26 -28
  793. package/filter/kuwahara.hlsl +16 -15
  794. package/filter/laplacian.glsl +15 -12
  795. package/filter/laplacian.hlsl +18 -15
  796. package/filter/mean.glsl +6 -6
  797. package/filter/mean.hlsl +7 -7
  798. package/filter/median/2D_fast3.glsl +4 -4
  799. package/filter/median/2D_fast3.hlsl +4 -4
  800. package/filter/median/2D_fast5.glsl +4 -4
  801. package/filter/median/2D_fast5.hlsl +5 -5
  802. package/filter/median.glsl +6 -6
  803. package/filter/median.hlsl +6 -6
  804. package/filter/noiseBlur.glsl +11 -6
  805. package/filter/noiseBlur.hlsl +15 -7
  806. package/filter/radialBlur.glsl +10 -7
  807. package/filter/radialBlur.hlsl +10 -7
  808. package/filter/sharpen/adaptive.glsl +7 -7
  809. package/filter/sharpen/adaptive.hlsl +7 -7
  810. package/filter/sharpen/adaptive.wgsl +288 -0
  811. package/filter/sharpen/contrastAdaptive.glsl +5 -5
  812. package/filter/sharpen/contrastAdaptive.hlsl +5 -5
  813. package/filter/sharpen/fast.glsl +7 -7
  814. package/filter/sharpen/fast.hlsl +8 -8
  815. package/filter/sharpen/fast.wgsl +32 -0
  816. package/filter/sharpen.glsl +9 -6
  817. package/filter/sharpen.hlsl +9 -6
  818. package/filter/smartDeNoise.glsl +69 -0
  819. package/generative/cnoise.glsl +1 -1
  820. package/generative/cnoise.hlsl +1 -1
  821. package/generative/cnoise.msl +259 -0
  822. package/generative/cnoise.wgsl +253 -0
  823. package/generative/curl.glsl +31 -4
  824. package/generative/curl.hlsl +2 -2
  825. package/generative/curl.msl +101 -0
  826. package/generative/fbm.glsl +5 -2
  827. package/generative/fbm.hlsl +4 -1
  828. package/generative/fbm.msl +115 -0
  829. package/generative/gerstnerWave.glsl +5 -2
  830. package/generative/gerstnerWave.hlsl +5 -2
  831. package/generative/gerstnerWave.msl +55 -0
  832. package/generative/gnoise.glsl +11 -2
  833. package/generative/gnoise.msl +73 -0
  834. package/generative/noised.glsl +2 -2
  835. package/generative/noised.hlsl +2 -2
  836. package/generative/noised.msl +84 -0
  837. package/generative/noised.wgsl +72 -0
  838. package/generative/pnoise.glsl +1 -1
  839. package/generative/pnoise.hlsl +1 -1
  840. package/generative/pnoise.msl +261 -0
  841. package/generative/pnoise.wgsl +254 -0
  842. package/generative/psrdnoise.glsl +63 -64
  843. package/generative/psrdnoise.hlsl +6 -6
  844. package/generative/psrdnoise.msl +649 -0
  845. package/generative/random.glsl +15 -15
  846. package/generative/random.hlsl +81 -59
  847. package/generative/random.msl +126 -0
  848. package/generative/random.wgsl +19 -2
  849. package/generative/snoise.glsl +1 -1
  850. package/generative/snoise.hlsl +1 -1
  851. package/generative/snoise.msl +240 -0
  852. package/generative/snoise.wgsl +11 -0
  853. package/generative/srandom.glsl +5 -2
  854. package/generative/srandom.hlsl +5 -2
  855. package/generative/srandom.msl +53 -0
  856. package/generative/srandom.wgsl +60 -0
  857. package/generative/voronoi.glsl +5 -2
  858. package/generative/voronoi.hlsl +5 -2
  859. package/generative/voronoi.msl +45 -0
  860. package/generative/voronoise.glsl +8 -9
  861. package/generative/voronoise.hlsl +2 -2
  862. package/generative/voronoise.msl +77 -0
  863. package/generative/wavelet.glsl +52 -0
  864. package/generative/wavelet.msl +50 -0
  865. package/generative/wavelet.wgsl +51 -0
  866. package/generative/worley.glsl +78 -22
  867. package/generative/worley.hlsl +79 -21
  868. package/generative/worley.msl +52 -0
  869. package/generative/worley.wgsl +95 -0
  870. package/geometry/aabb/aabb.cuh +8 -2
  871. package/geometry/aabb/aabb.glsl +8 -2
  872. package/geometry/aabb/aabb.hlsl +8 -2
  873. package/geometry/aabb/centroid.cuh +6 -3
  874. package/geometry/aabb/centroid.glsl +6 -3
  875. package/geometry/aabb/centroid.hlsl +6 -3
  876. package/geometry/aabb/contain.cuh +5 -2
  877. package/geometry/aabb/contain.glsl +4 -1
  878. package/geometry/aabb/contain.hlsl +5 -2
  879. package/geometry/aabb/diagonal.cuh +5 -2
  880. package/geometry/aabb/diagonal.glsl +5 -2
  881. package/geometry/aabb/diagonal.hlsl +5 -2
  882. package/geometry/aabb/expand.cuh +5 -2
  883. package/geometry/aabb/expand.glsl +6 -3
  884. package/geometry/aabb/expand.hlsl +5 -2
  885. package/geometry/aabb/intersect.cuh +3 -3
  886. package/geometry/aabb/intersect.glsl +4 -3
  887. package/geometry/aabb/intersect.hlsl +3 -3
  888. package/geometry/aabb/intersection.cuh +5 -2
  889. package/geometry/aabb/square.cuh +6 -3
  890. package/geometry/aabb/square.glsl +6 -3
  891. package/geometry/aabb/square.hlsl +6 -3
  892. package/geometry/aabb.glsl +1 -1
  893. package/geometry/aabb.hlsl +1 -1
  894. package/geometry/triangle/area.cuh +6 -3
  895. package/geometry/triangle/area.glsl +6 -3
  896. package/geometry/triangle/area.hlsl +6 -3
  897. package/geometry/triangle/barycentric.cuh +6 -3
  898. package/geometry/triangle/barycentric.glsl +9 -6
  899. package/geometry/triangle/barycentric.hlsl +6 -3
  900. package/geometry/triangle/centroid.cuh +6 -3
  901. package/geometry/triangle/centroid.glsl +7 -4
  902. package/geometry/triangle/centroid.hlsl +6 -3
  903. package/geometry/triangle/closestPoint.cuh +2 -2
  904. package/geometry/triangle/closestPoint.glsl +2 -2
  905. package/geometry/triangle/closestPoint.hlsl +2 -2
  906. package/geometry/triangle/contain.cuh +3 -3
  907. package/geometry/triangle/contain.glsl +3 -3
  908. package/geometry/triangle/contain.hlsl +3 -3
  909. package/geometry/triangle/distanceSq.cuh +2 -2
  910. package/geometry/triangle/distanceSq.glsl +2 -2
  911. package/geometry/triangle/distanceSq.hlsl +3 -3
  912. package/geometry/triangle/intersect.cuh +2 -2
  913. package/geometry/triangle/intersect.glsl +5 -5
  914. package/geometry/triangle/intersect.hlsl +2 -2
  915. package/geometry/triangle/normal.cuh +6 -3
  916. package/geometry/triangle/normal.glsl +6 -3
  917. package/geometry/triangle/normal.hlsl +6 -3
  918. package/geometry/triangle/signedDistance.cuh +2 -2
  919. package/geometry/triangle/signedDistance.glsl +2 -2
  920. package/geometry/triangle/signedDistance.hlsl +2 -2
  921. package/geometry/triangle/triangle.cuh +8 -2
  922. package/geometry/triangle/triangle.glsl +8 -2
  923. package/geometry/triangle/triangle.hlsl +8 -2
  924. package/lighting/atmosphere.glsl +147 -109
  925. package/lighting/atmosphere.hlsl +154 -109
  926. package/lighting/blackbody.glsl +5 -2
  927. package/lighting/blackbody.hlsl +15 -0
  928. package/lighting/camera.cuh +4 -3
  929. package/lighting/camera.glsl +21 -0
  930. package/lighting/camera.hlsl +21 -0
  931. package/lighting/common/beckmann.glsl +0 -4
  932. package/lighting/common/envBRDFApprox.glsl +11 -11
  933. package/lighting/common/envBRDFApprox.hlsl +15 -5
  934. package/lighting/common/ggx.glsl +11 -2
  935. package/lighting/common/ggx.hlsl +11 -2
  936. package/lighting/common/ggx.wgsl +11 -0
  937. package/lighting/common/gtaoMultiBounce.glsl +1 -1
  938. package/lighting/common/gtaoMultiBounce.hlsl +1 -1
  939. package/lighting/common/henyeyGreenstein.glsl +1 -1
  940. package/lighting/common/henyeyGreenstein.hlsl +1 -1
  941. package/lighting/common/penner.glsl +28 -0
  942. package/lighting/common/perceptual2linearRoughness.glsl +20 -0
  943. package/lighting/common/perceptual2linearRoughness.hlsl +20 -0
  944. package/lighting/common/preFilteredImportanceSampling.glsl +11 -0
  945. package/lighting/common/preFilteredImportanceSampling.hlsl +11 -0
  946. package/lighting/common/schlick.wgsl +3 -0
  947. package/lighting/common/specularAO.glsl +6 -2
  948. package/lighting/common/specularAO.hlsl +6 -2
  949. package/lighting/debugCube.glsl +2 -2
  950. package/lighting/debugCube.hlsl +2 -2
  951. package/lighting/diffuse/burley.glsl +10 -16
  952. package/lighting/diffuse/burley.hlsl +9 -15
  953. package/lighting/diffuse/lambert.glsl +14 -6
  954. package/lighting/diffuse/lambert.hlsl +14 -6
  955. package/lighting/diffuse/orenNayar.glsl +9 -8
  956. package/lighting/diffuse/orenNayar.hlsl +8 -7
  957. package/lighting/diffuse/orenNayar.wgsl +20 -0
  958. package/lighting/diffuse.glsl +7 -4
  959. package/lighting/diffuse.hlsl +11 -5
  960. package/lighting/envMap.glsl +40 -16
  961. package/lighting/envMap.hlsl +34 -13
  962. package/lighting/exposure.glsl +16 -0
  963. package/lighting/exposure.hlsl +16 -0
  964. package/lighting/fakeCube.glsl +15 -15
  965. package/lighting/fakeCube.hlsl +5 -2
  966. package/lighting/fresnel.glsl +19 -4
  967. package/lighting/fresnel.hlsl +30 -20
  968. package/lighting/fresnel.wgsl +13 -0
  969. package/lighting/fresnelReflection.glsl +73 -35
  970. package/lighting/fresnelReflection.hlsl +93 -20
  971. package/lighting/fresnelReflection.wgsl +26 -0
  972. package/lighting/gooch.glsl +56 -34
  973. package/lighting/gooch.hlsl +60 -29
  974. package/lighting/ior/2eta.glsl +5 -2
  975. package/lighting/ior/2eta.hlsl +5 -2
  976. package/lighting/ior/2f0.glsl +5 -2
  977. package/lighting/ior/2f0.hlsl +5 -2
  978. package/lighting/ior/reflectance2f0.glsl +11 -0
  979. package/lighting/ior/reflectance2f0.hlsl +11 -0
  980. package/lighting/ior.glsl +7 -2
  981. package/lighting/ior.hlsl +7 -1
  982. package/lighting/iridescence.glsl +10 -16
  983. package/lighting/iridescence.hlsl +14 -17
  984. package/lighting/light/attenuation.glsl +34 -0
  985. package/lighting/light/attenuation.hlsl +34 -0
  986. package/lighting/light/directional.glsl +12 -39
  987. package/lighting/light/directional.hlsl +12 -54
  988. package/lighting/light/directionalEvaluate.glsl +52 -0
  989. package/lighting/light/directionalEvaluate.hlsl +52 -0
  990. package/lighting/light/falloff.glsl +16 -4
  991. package/lighting/light/falloff.hlsl +15 -3
  992. package/lighting/light/iblEvaluate.glsl +73 -0
  993. package/lighting/light/iblEvaluate.hlsl +68 -0
  994. package/lighting/light/new.glsl +77 -0
  995. package/lighting/light/new.hlsl +77 -0
  996. package/lighting/light/point.glsl +13 -61
  997. package/lighting/light/point.hlsl +13 -70
  998. package/lighting/light/pointEvaluate.glsl +60 -0
  999. package/lighting/light/pointEvaluate.hlsl +60 -0
  1000. package/lighting/light/resolve.glsl +19 -0
  1001. package/lighting/light/resolve.hlsl +19 -0
  1002. package/lighting/light/spot.glsl +5 -2
  1003. package/lighting/light/spot.hlsl +5 -2
  1004. package/lighting/material/add.glsl +47 -0
  1005. package/lighting/material/add.hlsl +48 -0
  1006. package/lighting/material/albedo.glsl +8 -5
  1007. package/lighting/material/albedo.hlsl +10 -7
  1008. package/lighting/material/emissive.glsl +7 -4
  1009. package/lighting/material/emissive.hlsl +9 -6
  1010. package/lighting/material/metallic.glsl +9 -6
  1011. package/lighting/material/metallic.hlsl +13 -9
  1012. package/lighting/material/multiply.glsl +42 -0
  1013. package/lighting/material/multiply.hlsl +42 -0
  1014. package/lighting/material/new.glsl +76 -47
  1015. package/lighting/material/new.hlsl +78 -44
  1016. package/lighting/material/normal.glsl +9 -5
  1017. package/lighting/material/normal.hlsl +9 -6
  1018. package/lighting/material/occlusion.glsl +8 -5
  1019. package/lighting/material/occlusion.hlsl +9 -6
  1020. package/lighting/material/roughness.glsl +9 -6
  1021. package/lighting/material/roughness.hlsl +10 -7
  1022. package/lighting/material/shininess.glsl +7 -6
  1023. package/lighting/material/shininess.hlsl +6 -3
  1024. package/lighting/material/specular.glsl +7 -4
  1025. package/lighting/material/specular.hlsl +8 -5
  1026. package/lighting/material/zero.glsl +69 -0
  1027. package/lighting/material/zero.hlsl +69 -0
  1028. package/lighting/material.glsl +26 -24
  1029. package/lighting/material.hlsl +40 -35
  1030. package/lighting/medium/new.glsl +41 -0
  1031. package/lighting/medium/new.hlsl +41 -0
  1032. package/lighting/medium.glsl +16 -0
  1033. package/lighting/medium.hlsl +16 -0
  1034. package/lighting/pbr.glsl +58 -77
  1035. package/lighting/pbr.hlsl +63 -96
  1036. package/lighting/pbrClearCoat.glsl +92 -105
  1037. package/lighting/pbrClearCoat.hlsl +101 -124
  1038. package/lighting/pbrGlass.glsl +75 -49
  1039. package/lighting/pbrGlass.hlsl +76 -67
  1040. package/lighting/pbrLittle.glsl +49 -50
  1041. package/lighting/pbrLittle.hlsl +49 -54
  1042. package/lighting/ray/cast.glsl +5 -2
  1043. package/lighting/ray/direction.glsl +7 -4
  1044. package/lighting/ray/new.glsl +6 -3
  1045. package/lighting/ray.cuh +4 -3
  1046. package/lighting/ray.glsl +4 -1
  1047. package/lighting/ray.hlsl +4 -3
  1048. package/lighting/raymarch/ao.cuh +4 -4
  1049. package/lighting/raymarch/ao.glsl +26 -19
  1050. package/lighting/raymarch/ao.hlsl +28 -19
  1051. package/lighting/raymarch/cast.cuh +4 -4
  1052. package/lighting/raymarch/cast.glsl +19 -42
  1053. package/lighting/raymarch/cast.hlsl +26 -38
  1054. package/lighting/raymarch/cast.wgsl +20 -0
  1055. package/lighting/raymarch/fog.glsl +71 -0
  1056. package/lighting/raymarch/fog.hlsl +75 -0
  1057. package/lighting/raymarch/glass.glsl +302 -0
  1058. package/lighting/raymarch/glass.hlsl +300 -0
  1059. package/lighting/raymarch/map.cuh +2 -2
  1060. package/lighting/raymarch/map.glsl +12 -16
  1061. package/lighting/raymarch/map.hlsl +13 -17
  1062. package/lighting/raymarch/normal.cuh +4 -4
  1063. package/lighting/raymarch/normal.glsl +15 -19
  1064. package/lighting/raymarch/normal.hlsl +16 -20
  1065. package/lighting/raymarch/normal.wgsl +21 -0
  1066. package/lighting/raymarch/render.glsl +44 -37
  1067. package/lighting/raymarch/render.hlsl +47 -38
  1068. package/lighting/raymarch/shading.glsl +83 -0
  1069. package/lighting/raymarch/shading.hlsl +80 -0
  1070. package/lighting/raymarch/softShadow.cuh +4 -4
  1071. package/lighting/raymarch/softShadow.glsl +38 -32
  1072. package/lighting/raymarch/softShadow.hlsl +34 -29
  1073. package/lighting/raymarch/volume.glsl +104 -72
  1074. package/lighting/raymarch/volume.hlsl +106 -72
  1075. package/lighting/raymarch.glsl +117 -38
  1076. package/lighting/raymarch.hlsl +120 -35
  1077. package/lighting/reflection.glsl +14 -1
  1078. package/lighting/reflection.hlsl +14 -1
  1079. package/lighting/shadingData/new.glsl +55 -0
  1080. package/lighting/shadingData/new.hlsl +55 -0
  1081. package/lighting/shadingData/shadingData.glsl +34 -0
  1082. package/lighting/shadingData/shadingData.hlsl +34 -0
  1083. package/lighting/shadow.glsl +8 -5
  1084. package/lighting/shadow.hlsl +8 -5
  1085. package/lighting/specular/beckmann.glsl +2 -11
  1086. package/lighting/specular/beckmann.hlsl +2 -11
  1087. package/lighting/specular/blinnPhong.glsl +6 -12
  1088. package/lighting/specular/blinnPhong.hlsl +6 -12
  1089. package/lighting/specular/cookTorrance.glsl +15 -42
  1090. package/lighting/specular/cookTorrance.hlsl +16 -41
  1091. package/lighting/specular/cookTorrance.wgsl +22 -0
  1092. package/lighting/specular/gaussian.glsl +4 -9
  1093. package/lighting/specular/gaussian.hlsl +4 -9
  1094. package/lighting/specular/importanceSampling.glsl +69 -0
  1095. package/lighting/specular/importanceSampling.hlsl +75 -0
  1096. package/lighting/specular/phong.glsl +4 -8
  1097. package/lighting/specular/phong.hlsl +5 -9
  1098. package/lighting/specular.glsl +10 -9
  1099. package/lighting/specular.hlsl +9 -9
  1100. package/lighting/sphereMap.glsl +11 -8
  1101. package/lighting/sphereMap.hlsl +9 -6
  1102. package/lighting/sphericalHarmonics.glsl +22 -17
  1103. package/lighting/sphericalHarmonics.hlsl +7 -4
  1104. package/lighting/ssao.glsl +27 -16
  1105. package/lighting/ssr.glsl +11 -8
  1106. package/lighting/toMetallic.glsl +5 -2
  1107. package/lighting/toMetallic.hlsl +5 -2
  1108. package/lighting/toShininess.glsl +5 -4
  1109. package/lighting/toShininess.hlsl +5 -2
  1110. package/lighting/toShininess.wgsl +14 -0
  1111. package/lighting/transparent.glsl +99 -0
  1112. package/lighting/transparent.hlsl +99 -0
  1113. package/lighting/volumetricLightScattering.glsl +8 -5
  1114. package/lighting/wavelength.glsl +5 -2
  1115. package/lighting/wavelength.hlsl +15 -0
  1116. package/math/aafloor.glsl +39 -0
  1117. package/math/aafloor.hlsl +28 -0
  1118. package/math/aafloor.msl +34 -0
  1119. package/math/aafloor.wgsl +18 -0
  1120. package/math/aafract.glsl +40 -0
  1121. package/math/aafract.hlsl +30 -0
  1122. package/math/aafract.msl +33 -0
  1123. package/math/aafract.wgsl +17 -0
  1124. package/math/aamirror.glsl +24 -0
  1125. package/math/aamirror.hlsl +24 -0
  1126. package/{draw → math}/aastep.glsl +1 -1
  1127. package/{draw → math}/aastep.hlsl +1 -1
  1128. package/math/aastep.msl +23 -0
  1129. package/math/aastep.wgsl +9 -0
  1130. package/math/abs.cuh +8 -3
  1131. package/math/absi.glsl +4 -1
  1132. package/math/absi.msl +13 -0
  1133. package/math/adaptiveThreshold.cuh +1 -1
  1134. package/math/adaptiveThreshold.glsl +6 -6
  1135. package/math/adaptiveThreshold.hlsl +1 -1
  1136. package/math/adaptiveThreshold.msl +16 -0
  1137. package/math/adaptiveThreshold.wgsl +6 -0
  1138. package/math/asin.cuh +8 -5
  1139. package/math/atan2.glsl +15 -0
  1140. package/math/atan2.msl +15 -0
  1141. package/math/bump.cuh +5 -2
  1142. package/math/bump.glsl +5 -2
  1143. package/math/bump.hlsl +5 -2
  1144. package/math/bump.msl +22 -0
  1145. package/math/bump.wgsl +12 -0
  1146. package/math/clamp.cuh +14 -4
  1147. package/math/const.cuh +5 -2
  1148. package/math/const.glsl +21 -2
  1149. package/math/const.hlsl +24 -2
  1150. package/math/const.msl +55 -0
  1151. package/math/const.wgsl +12 -1
  1152. package/math/cross.cuh +8 -4
  1153. package/math/cubic.cuh +1 -1
  1154. package/math/cubic.glsl +19 -17
  1155. package/math/cubic.hlsl +1 -2
  1156. package/math/cubic.msl +51 -0
  1157. package/math/cubic.wgsl +9 -0
  1158. package/math/cubicMix.glsl +20 -0
  1159. package/math/cubicMix.hlsl +20 -0
  1160. package/math/cubicMix.msl +20 -0
  1161. package/math/cubicMix.wgsl +14 -0
  1162. package/math/decimate.cuh +6 -5
  1163. package/math/decimate.glsl +15 -6
  1164. package/math/decimate.hlsl +13 -6
  1165. package/math/decimate.msl +21 -0
  1166. package/math/decimate.wgsl +12 -0
  1167. package/math/dist.glsl +44 -0
  1168. package/math/dist.hlsl +64 -0
  1169. package/math/dist.wgsl +34 -0
  1170. package/math/dot.cuh +8 -5
  1171. package/math/equal.msl +17 -0
  1172. package/math/fcos.glsl +17 -0
  1173. package/math/fcos.hlsl +17 -0
  1174. package/math/floor.cuh +8 -5
  1175. package/math/frac.cuh +8 -5
  1176. package/math/frac.glsl +8 -5
  1177. package/math/frac.msl +13 -0
  1178. package/math/fract.cuh +8 -5
  1179. package/math/fract.hlsl +13 -0
  1180. package/math/gain.cuh +1 -3
  1181. package/math/gain.glsl +2 -4
  1182. package/math/gain.hlsl +1 -3
  1183. package/math/gain.msl +16 -0
  1184. package/math/gain.wgsl +10 -0
  1185. package/math/gaussian.cuh +4 -3
  1186. package/math/gaussian.glsl +8 -7
  1187. package/math/gaussian.hlsl +11 -8
  1188. package/math/gaussian.msl +18 -0
  1189. package/math/gaussian.msl 2 +18 -0
  1190. package/math/gaussian.wgsl +11 -14
  1191. package/math/grad4.cuh +2 -2
  1192. package/math/grad4.glsl +1 -3
  1193. package/math/grad4.hlsl +3 -3
  1194. package/math/grad4.msl +20 -0
  1195. package/math/grad4.wgsl +6 -3
  1196. package/math/greaterThan.cuh +3 -5
  1197. package/math/greaterThan.hlsl +1 -4
  1198. package/math/greaterThan.msl +17 -0
  1199. package/math/greaterThanEqual.msl +17 -0
  1200. package/math/hammersley.glsl +32 -0
  1201. package/math/hammersley.hlsl +32 -0
  1202. package/math/highPass.cuh +5 -4
  1203. package/math/highPass.glsl +6 -5
  1204. package/math/highPass.hlsl +5 -4
  1205. package/math/highPass.msl +13 -0
  1206. package/math/highPass.wgsl +9 -0
  1207. package/math/inside.glsl +39 -0
  1208. package/math/inside.hlsl +39 -0
  1209. package/math/inside.msl +39 -0
  1210. package/math/inside.wgsl +22 -0
  1211. package/math/invCubic.cuh +1 -3
  1212. package/math/invCubic.glsl +3 -3
  1213. package/math/invCubic.hlsl +1 -3
  1214. package/math/invCubic.msl +15 -0
  1215. package/math/invCubic.wgsl +9 -0
  1216. package/math/invQuartic.cuh +1 -3
  1217. package/math/invQuartic.glsl +3 -3
  1218. package/math/invQuartic.hlsl +1 -3
  1219. package/math/invQuartic.msl +15 -0
  1220. package/math/invQuartic.wgsl +9 -0
  1221. package/math/inverse.glsl +3 -3
  1222. package/math/inverse.msl +74 -0
  1223. package/math/inverse.wgsl +28 -0
  1224. package/math/length.cuh +8 -3
  1225. package/math/lengthSq.cuh +5 -2
  1226. package/math/lengthSq.glsl +5 -2
  1227. package/math/lengthSq.hlsl +5 -2
  1228. package/math/lengthSq.msl +17 -0
  1229. package/math/lengthSq.wgsl +11 -0
  1230. package/math/lerp.cuh +4 -1
  1231. package/math/lerp.glsl +5 -2
  1232. package/math/lerp.msl +13 -0
  1233. package/math/lessThan.msl +17 -0
  1234. package/math/lessThanEqual.msl +17 -0
  1235. package/math/map.cuh +9 -6
  1236. package/math/map.glsl +17 -38
  1237. package/math/map.hlsl +13 -21
  1238. package/math/map.msl +23 -0
  1239. package/math/map.wgsl +13 -0
  1240. package/math/max.cuh +8 -3
  1241. package/math/min.cuh +8 -3
  1242. package/math/mirror.cuh +2 -2
  1243. package/math/mirror.glsl +7 -5
  1244. package/math/mirror.hlsl +2 -2
  1245. package/math/mirror.msl +24 -0
  1246. package/math/mirror.wgsl +6 -1
  1247. package/math/mix.cuh +5 -2
  1248. package/math/mix.hlsl +32 -132
  1249. package/math/mmax.cuh +7 -4
  1250. package/math/mmax.glsl +7 -4
  1251. package/math/mmax.hlsl +7 -4
  1252. package/math/mmax.msl +22 -0
  1253. package/math/mmax.wgsl +11 -0
  1254. package/math/mmin .wgsl +11 -0
  1255. package/math/mmin.cuh +7 -4
  1256. package/math/mmin.glsl +7 -4
  1257. package/math/mmin.hlsl +7 -4
  1258. package/math/mmin.msl +24 -0
  1259. package/math/mmix.glsl +5 -2
  1260. package/math/mmix.msl +167 -0
  1261. package/math/mod.cuh +11 -3
  1262. package/math/mod.hlsl +6 -4
  1263. package/math/mod.msl +26 -0
  1264. package/math/mod.wgsl +11 -0
  1265. package/math/mod2.glsl +22 -0
  1266. package/math/mod2.hlsl +24 -0
  1267. package/math/mod2.msl +22 -0
  1268. package/math/mod289.cuh +2 -2
  1269. package/math/mod289.glsl +2 -2
  1270. package/math/mod289.hlsl +3 -3
  1271. package/math/mod289.msl +15 -0
  1272. package/math/mod289.wgsl +6 -1
  1273. package/math/normalize.cuh +8 -3
  1274. package/math/notEqual.msl +17 -0
  1275. package/math/nyquist.glsl +27 -0
  1276. package/math/nyquist.hlsl +27 -0
  1277. package/math/operations.cuh +8 -0
  1278. package/math/pack.glsl +26 -0
  1279. package/math/pack.hlsl +26 -0
  1280. package/math/pack.msl +26 -0
  1281. package/math/pack.wgsl +17 -0
  1282. package/math/parabola.cuh +1 -1
  1283. package/math/parabola.glsl +1 -3
  1284. package/math/parabola.hlsl +1 -3
  1285. package/math/parabola.msl +13 -0
  1286. package/math/parabola.wgsl +7 -0
  1287. package/math/permute.cuh +2 -2
  1288. package/math/permute.glsl +8 -6
  1289. package/math/permute.hlsl +2 -2
  1290. package/math/permute.msl +19 -0
  1291. package/math/permute.wgsl +6 -1
  1292. package/math/pow.cuh +4 -1
  1293. package/math/pow2.cuh +5 -2
  1294. package/math/pow2.glsl +9 -6
  1295. package/math/pow2.hlsl +5 -2
  1296. package/math/pow2.msl +18 -0
  1297. package/math/pow3.cuh +5 -2
  1298. package/math/pow3.glsl +9 -6
  1299. package/math/pow3.hlsl +5 -2
  1300. package/math/pow3.msl +18 -0
  1301. package/math/pow5.cuh +5 -2
  1302. package/math/pow5.glsl +17 -14
  1303. package/math/pow5.hlsl +5 -2
  1304. package/math/pow5.msl +33 -0
  1305. package/math/pow7.cuh +5 -2
  1306. package/math/pow7.glsl +9 -6
  1307. package/math/pow7.hlsl +5 -2
  1308. package/math/pow7.msl +18 -0
  1309. package/math/powFast.cuh +5 -2
  1310. package/math/powFast.glsl +5 -2
  1311. package/math/powFast.hlsl +5 -2
  1312. package/math/powFast.msl +15 -0
  1313. package/math/powFast.wgsl +12 -0
  1314. package/math/quartic.cuh +1 -1
  1315. package/math/quartic.glsl +3 -1
  1316. package/math/quartic.hlsl +1 -1
  1317. package/math/quartic.msl +17 -0
  1318. package/math/quartic.wgsl +9 -0
  1319. package/math/quat/2mat3.glsl +32 -0
  1320. package/math/quat/2mat3.hlsl +32 -0
  1321. package/math/quat/2mat3.msl +32 -0
  1322. package/math/quat/2mat3.wgsl +26 -0
  1323. package/math/quat/2mat4.glsl +18 -0
  1324. package/math/quat/2mat4.hlsl +18 -0
  1325. package/math/quat/2mat4.msl +18 -0
  1326. package/math/quat/2mat4.wgsl +13 -0
  1327. package/math/quat/add.glsl +15 -0
  1328. package/math/quat/add.hlsl +15 -0
  1329. package/math/quat/add.msl +15 -0
  1330. package/math/quat/add.wgsl +10 -0
  1331. package/math/quat/conj.glsl +15 -0
  1332. package/math/quat/conj.hlsl +15 -0
  1333. package/math/quat/conj.msl +15 -0
  1334. package/math/quat/conj.wgsl +10 -0
  1335. package/math/quat/div.glsl +15 -0
  1336. package/math/quat/div.hlsl +15 -0
  1337. package/math/quat/div.msl +15 -0
  1338. package/math/quat/div.wgsl +10 -0
  1339. package/math/quat/identity.glsl +14 -0
  1340. package/math/quat/identity.hlsl +14 -0
  1341. package/math/quat/identity.msl +14 -0
  1342. package/math/quat/identity.wgsl +10 -0
  1343. package/math/quat/inverse.glsl +17 -0
  1344. package/math/quat/inverse.hlsl +17 -0
  1345. package/math/quat/inverse.msl +17 -0
  1346. package/math/quat/inverse.wgsl +14 -0
  1347. package/math/quat/length.glsl +15 -0
  1348. package/math/quat/length.hlsl +15 -0
  1349. package/math/quat/length.msl +15 -0
  1350. package/math/quat/length.wgsl +12 -0
  1351. package/math/quat/lengthSq.glsl +15 -0
  1352. package/math/quat/lengthSq.hlsl +15 -0
  1353. package/math/quat/lengthSq.msl +15 -0
  1354. package/math/quat/lengthSq.wgsl +10 -0
  1355. package/math/quat/lerp.glsl +47 -0
  1356. package/math/quat/lerp.hlsl +47 -0
  1357. package/math/quat/lerp.msl +47 -0
  1358. package/math/quat/lerp.wgsl +43 -0
  1359. package/math/quat/mul.glsl +22 -0
  1360. package/math/quat/mul.hlsl +22 -0
  1361. package/math/quat/mul.msl +22 -0
  1362. package/math/quat/mul.wgsl +15 -0
  1363. package/math/quat/neg.glsl +15 -0
  1364. package/math/quat/neg.hlsl +15 -0
  1365. package/math/quat/neg.msl +15 -0
  1366. package/math/quat/neg.wgsl +10 -0
  1367. package/math/quat/norm.glsl +16 -0
  1368. package/math/quat/norm.hlsl +16 -0
  1369. package/math/quat/norm.msl +16 -0
  1370. package/math/quat/norm.wgsl +13 -0
  1371. package/math/quat/sub.glsl +15 -0
  1372. package/math/quat/sub.hlsl +15 -0
  1373. package/math/quat/sub.msl +15 -0
  1374. package/math/quat/sub.wgsl +10 -0
  1375. package/math/quat/type.glsl +11 -0
  1376. package/math/quat/type.hlsl +11 -0
  1377. package/math/quat/type.msl +11 -0
  1378. package/math/quat.glsl +83 -0
  1379. package/math/quat.hlsl +83 -0
  1380. package/math/quat.msl +83 -0
  1381. package/math/quat.wgsl +73 -0
  1382. package/math/quintic.cuh +1 -1
  1383. package/math/quintic.glsl +3 -1
  1384. package/math/quintic.hlsl +1 -1
  1385. package/math/quintic.msl +17 -0
  1386. package/math/quintic.wgsl +9 -0
  1387. package/math/radians.msl +15 -0
  1388. package/math/reflect.cuh +9 -5
  1389. package/math/rotate2d.glsl +9 -6
  1390. package/math/rotate2d.hlsl +8 -5
  1391. package/math/rotate2d.msl +17 -0
  1392. package/math/rotate2d.wgsl +8 -0
  1393. package/math/rotate3d.glsl +13 -10
  1394. package/math/rotate3d.hlsl +5 -2
  1395. package/math/rotate3d.msl +21 -0
  1396. package/math/rotate3d.wgsl +16 -0
  1397. package/math/rotate3dX.glsl +19 -0
  1398. package/math/rotate3dX.hlsl +19 -0
  1399. package/math/rotate3dX.msl +17 -0
  1400. package/math/rotate3dX.wgsl +13 -0
  1401. package/math/rotate3dY.glsl +19 -0
  1402. package/math/rotate3dY.hlsl +19 -0
  1403. package/math/rotate3dY.msl +17 -0
  1404. package/math/rotate3dY.wgsl +13 -0
  1405. package/math/rotate3dZ.glsl +19 -0
  1406. package/math/rotate3dZ.hlsl +19 -0
  1407. package/math/rotate3dZ.msl +17 -0
  1408. package/math/rotate3dZ.wgsl +13 -0
  1409. package/math/rotate4d.glsl +14 -11
  1410. package/math/rotate4d.hlsl +6 -4
  1411. package/math/rotate4d.msl +22 -0
  1412. package/math/rotate4d.wgsl +17 -0
  1413. package/math/rotate4dX.glsl +12 -8
  1414. package/math/rotate4dX.hlsl +12 -8
  1415. package/math/rotate4dX.msl +18 -0
  1416. package/math/rotate4dX.wgsl +14 -0
  1417. package/math/rotate4dY.glsl +12 -8
  1418. package/math/rotate4dY.hlsl +12 -8
  1419. package/math/rotate4dY.msl +18 -0
  1420. package/math/rotate4dY.wgsl +14 -0
  1421. package/math/rotate4dZ.glsl +12 -8
  1422. package/math/rotate4dZ.hlsl +12 -8
  1423. package/math/rotate4dZ.msl +18 -0
  1424. package/math/rotate4dZ.wgsl +14 -0
  1425. package/math/round.glsl +16 -0
  1426. package/math/round.msl +16 -0
  1427. package/math/round.wgsl +12 -0
  1428. package/math/saturate.cuh +5 -2
  1429. package/math/saturate.glsl +8 -3
  1430. package/math/saturate.msl +12 -0
  1431. package/math/saturate.msl 2 +15 -0
  1432. package/math/saturateMediump.cuh +5 -2
  1433. package/math/saturateMediump.glsl +7 -4
  1434. package/math/saturateMediump.hlsl +5 -2
  1435. package/math/saturateMediump.msl +23 -0
  1436. package/math/scale2d.glsl +16 -0
  1437. package/math/scale2d.hlsl +16 -0
  1438. package/math/scale2d.msl +16 -0
  1439. package/math/scale2d.wgsl +9 -0
  1440. package/math/scale3d.glsl +30 -0
  1441. package/math/scale3d.hlsl +30 -0
  1442. package/math/scale3d.msl +30 -0
  1443. package/math/scale3d.wgsl +13 -0
  1444. package/math/scale4d.glsl +47 -0
  1445. package/math/scale4d.hlsl +47 -0
  1446. package/math/scale4d.msl +47 -0
  1447. package/math/scale4d.wgsl +14 -0
  1448. package/math/select.glsl +17 -0
  1449. package/math/select.hlsl +17 -0
  1450. package/math/select.msl +17 -0
  1451. package/math/sign.cuh +9 -2
  1452. package/math/sin.cuh +8 -5
  1453. package/math/smootherstep.cuh +6 -5
  1454. package/math/smootherstep.glsl +10 -7
  1455. package/math/smootherstep.hlsl +6 -4
  1456. package/math/smootherstep.msl +19 -0
  1457. package/math/smootherstep.wgsl +15 -0
  1458. package/math/smoothstep.cuh +9 -9
  1459. package/math/sqrt.cuh +6 -3
  1460. package/math/step.cuh +15 -3
  1461. package/math/sum.cuh +4 -1
  1462. package/math/sum.glsl +4 -3
  1463. package/math/sum.hlsl +4 -3
  1464. package/math/sum.msl +16 -0
  1465. package/math/sum.wgsl +13 -0
  1466. package/math/taylorInvSqrt.cuh +1 -3
  1467. package/math/taylorInvSqrt.glsl +1 -1
  1468. package/math/taylorInvSqrt.hlsl +1 -1
  1469. package/math/taylorInvSqrt.msl +13 -0
  1470. package/math/taylorInvSqrt.wgsl +5 -0
  1471. package/math/toMat3.glsl +19 -0
  1472. package/math/toMat4.glsl +18 -0
  1473. package/math/toMat4.hlsl +18 -0
  1474. package/math/toMat4.msl +18 -0
  1475. package/math/toMat4.wgsl +14 -0
  1476. package/math/translate4d.glsl +26 -0
  1477. package/math/translate4d.hlsl +26 -0
  1478. package/math/translate4d.msl +26 -0
  1479. package/math/translate4d.wgsl +14 -0
  1480. package/math/transpose.glsl +8 -23
  1481. package/math/unpack.cuh +4 -1
  1482. package/math/unpack.glsl +44 -25
  1483. package/math/unpack.hlsl +43 -24
  1484. package/math/unpack.msl +72 -0
  1485. package/math/unpack.wgsl +56 -0
  1486. package/math/within.cuh +5 -2
  1487. package/math/within.glsl +13 -10
  1488. package/math/within.hlsl +5 -2
  1489. package/math/within.msl +30 -0
  1490. package/math/within.wgsl +26 -0
  1491. package/math.glsl +24 -2
  1492. package/math.hlsl +18 -2
  1493. package/math.msl +64 -0
  1494. package/math.wgsl +47 -0
  1495. package/morphological/alphaFill.glsl +7 -4
  1496. package/morphological/alphaFill.hlsl +7 -4
  1497. package/morphological/alphaHashing.glsl +56 -0
  1498. package/morphological/dilation.glsl +9 -9
  1499. package/morphological/dilation.hlsl +4 -5
  1500. package/morphological/erosion.glsl +4 -4
  1501. package/morphological/erosion.hlsl +4 -5
  1502. package/morphological/jumpFlood.glsl +85 -0
  1503. package/morphological/marchingSquares.glsl +207 -0
  1504. package/morphological/pyramid/downscale.glsl +49 -0
  1505. package/morphological/pyramid/upscale.glsl +72 -0
  1506. package/morphological/pyramid.glsl +40 -0
  1507. package/package.json +9 -7
  1508. package/prune.py +61 -0
  1509. package/sample/2DCube.glsl +24 -21
  1510. package/sample/2DCube.hlsl +23 -20
  1511. package/sample/3DSdf.glsl +7 -4
  1512. package/sample/3DSdf.hlsl +31 -5
  1513. package/sample/bicubic.glsl +7 -4
  1514. package/sample/bicubic.hlsl +10 -7
  1515. package/sample/bracketing.glsl +10 -9
  1516. package/sample/bracketing.hlsl +6 -6
  1517. package/sample/bumpMap.glsl +6 -3
  1518. package/sample/bumpMap.hlsl +6 -3
  1519. package/sample/clamp2edge.glsl +13 -6
  1520. package/sample/clamp2edge.hlsl +9 -6
  1521. package/sample/clamp2edge.msl +28 -0
  1522. package/sample/derivative.glsl +7 -4
  1523. package/sample/derivative.hlsl +19 -16
  1524. package/sample/dither.glsl +19 -5
  1525. package/sample/dof.glsl +5 -5
  1526. package/sample/dof.hlsl +8 -8
  1527. package/sample/equirect.glsl +34 -19
  1528. package/sample/equirect.hlsl +9 -6
  1529. package/sample/flow.glsl +7 -4
  1530. package/sample/flow.hlsl +7 -4
  1531. package/sample/fxaa.glsl +17 -14
  1532. package/sample/fxaa.hlsl +14 -11
  1533. package/sample/heatmap.glsl +23 -0
  1534. package/sample/heatmap.hlsl +23 -0
  1535. package/sample/hue.glsl +7 -4
  1536. package/sample/hue.hlsl +7 -4
  1537. package/sample/mirror.glsl +8 -5
  1538. package/sample/mirror.hlsl +8 -5
  1539. package/sample/nearest.glsl +7 -4
  1540. package/sample/nearest.hlsl +7 -4
  1541. package/sample/normalFromHeightMap.glsl +35 -0
  1542. package/sample/normalFromHeightMap.hlsl +35 -0
  1543. package/sample/normalMap.glsl +7 -4
  1544. package/sample/normalMap.hlsl +7 -4
  1545. package/sample/opticalFlow.glsl +32 -0
  1546. package/sample/opticalFlow.hlsl +32 -0
  1547. package/sample/quilt.glsl +17 -13
  1548. package/sample/quilt.hlsl +10 -6
  1549. package/sample/repeat.glsl +8 -5
  1550. package/sample/repeat.hlsl +8 -5
  1551. package/sample/shadow.glsl +18 -16
  1552. package/sample/shadow.hlsl +12 -14
  1553. package/sample/shadowLerp.glsl +6 -3
  1554. package/sample/shadowLerp.hlsl +6 -3
  1555. package/sample/shadowPCF.glsl +6 -3
  1556. package/sample/shadowPCF.hlsl +7 -4
  1557. package/sample/smooth.glsl +4 -4
  1558. package/sample/smooth.hlsl +4 -4
  1559. package/sample/sprite.glsl +9 -6
  1560. package/sample/sprite.hlsl +9 -6
  1561. package/sample/triplanar.glsl +44 -0
  1562. package/sample/triplanar.hlsl +45 -0
  1563. package/sample/untile.glsl +10 -10
  1564. package/sample/untile.hlsl +7 -7
  1565. package/sample/viewPosition.glsl +9 -6
  1566. package/sample/viewPosition.hlsl +11 -8
  1567. package/sample/yuv.glsl +7 -4
  1568. package/sample/yuv.hlsl +7 -4
  1569. package/sample/zero.glsl +38 -0
  1570. package/sample/zero.hlsl +19 -0
  1571. package/sample.glsl +32 -7
  1572. package/sample.hlsl +31 -3
  1573. package/sampler.glsl +18 -0
  1574. package/sampler.hlsl +50 -0
  1575. package/sampler.msl +19 -0
  1576. package/sdf/arrowSDF.glsl +60 -0
  1577. package/sdf/arrowSDF.msl +60 -0
  1578. package/sdf/boxFrameSDF.glsl +1 -1
  1579. package/sdf/boxFrameSDF.hlsl +1 -1
  1580. package/sdf/boxFrameSDF.msl +20 -0
  1581. package/sdf/boxSDF.glsl +1 -1
  1582. package/sdf/boxSDF.hlsl +1 -1
  1583. package/sdf/boxSDF.msl +20 -0
  1584. package/sdf/boxSDF.wgsl +10 -0
  1585. package/sdf/capsuleSDF.glsl +1 -1
  1586. package/sdf/capsuleSDF.hlsl +1 -1
  1587. package/sdf/capsuleSDF.msl +17 -0
  1588. package/sdf/circleSDF.glsl +15 -9
  1589. package/sdf/circleSDF.hlsl +13 -9
  1590. package/sdf/circleSDF.msl +30 -0
  1591. package/sdf/coneSDF.glsl +1 -1
  1592. package/sdf/coneSDF.hlsl +1 -1
  1593. package/sdf/coneSDF.msl +44 -0
  1594. package/sdf/crossSDF.glsl +8 -1
  1595. package/sdf/crossSDF.hlsl +4 -1
  1596. package/sdf/crossSDF.msl +23 -0
  1597. package/sdf/cubeSDF.msl +11 -0
  1598. package/sdf/cylinderSDF.glsl +1 -1
  1599. package/sdf/cylinderSDF.hlsl +2 -2
  1600. package/sdf/cylinderSDF.msl +42 -0
  1601. package/sdf/cylinderSDF.wgsl +10 -0
  1602. package/sdf/dodecahedronSDF.msl +31 -0
  1603. package/sdf/ellipsoidSDF.glsl +1 -1
  1604. package/sdf/ellipsoidSDF.hlsl +1 -1
  1605. package/sdf/ellipsoidSDF.msl +16 -0
  1606. package/sdf/flowerSDF.glsl +14 -2
  1607. package/sdf/flowerSDF.hlsl +10 -2
  1608. package/sdf/flowerSDF.msl +28 -0
  1609. package/sdf/gearSDF.glsl +38 -0
  1610. package/sdf/gearSDF.hlsl +37 -0
  1611. package/sdf/gearSDF.msl +38 -0
  1612. package/sdf/heartSDF.glsl +12 -2
  1613. package/sdf/heartSDF.hlsl +10 -2
  1614. package/sdf/heartSDF.msl +25 -0
  1615. package/sdf/hexPrismSDF.glsl +1 -1
  1616. package/sdf/hexPrismSDF.hlsl +1 -1
  1617. package/sdf/hexPrismSDF.msl +17 -0
  1618. package/sdf/hexSDF.glsl +15 -2
  1619. package/sdf/hexSDF.hlsl +11 -2
  1620. package/sdf/hexSDF.msl +26 -0
  1621. package/sdf/icosahedronSDF.msl +24 -0
  1622. package/sdf/juliaSDF.glsl +44 -0
  1623. package/sdf/juliaSDF.hlsl +34 -0
  1624. package/sdf/juliaSDF.msl +44 -0
  1625. package/sdf/kochSDF.glsl +40 -0
  1626. package/sdf/kochSDF.hlsl +35 -0
  1627. package/sdf/kochSDF.msl +40 -0
  1628. package/sdf/lineSDF.glsl +1 -1
  1629. package/sdf/lineSDF.hlsl +1 -1
  1630. package/sdf/lineSDF.msl +22 -0
  1631. package/sdf/linkSDF.glsl +1 -1
  1632. package/sdf/linkSDF.hlsl +1 -1
  1633. package/sdf/linkSDF.msl +13 -0
  1634. package/sdf/mandelbulbSDF.glsl +43 -0
  1635. package/sdf/mandelbulbSDF.hlsl +43 -0
  1636. package/sdf/mandelbulbSDF.msl +43 -0
  1637. package/sdf/octahedronSDF.glsl +1 -1
  1638. package/sdf/octahedronSDF.hlsl +1 -1
  1639. package/sdf/octahedronSDF.msl +39 -0
  1640. package/sdf/octogonPrismSDF.glsl +1 -1
  1641. package/sdf/octogonPrismSDF.hlsl +1 -1
  1642. package/sdf/octogonPrismSDF.msl +24 -0
  1643. package/sdf/opElongate.glsl +1 -1
  1644. package/sdf/opElongate.hlsl +1 -1
  1645. package/sdf/opElongate.msl +24 -0
  1646. package/sdf/opExtrude.glsl +1 -1
  1647. package/sdf/opExtrude.hlsl +1 -1
  1648. package/sdf/opExtrude.msl +16 -0
  1649. package/sdf/opIntersection.glsl +11 -2
  1650. package/sdf/opIntersection.hlsl +14 -3
  1651. package/sdf/opIntersection.msl +19 -0
  1652. package/sdf/opOnion.glsl +2 -2
  1653. package/sdf/opOnion.hlsl +2 -2
  1654. package/sdf/opOnion.msl +15 -0
  1655. package/sdf/opRepeat.glsl +27 -0
  1656. package/sdf/opRepeat.hlsl +29 -0
  1657. package/sdf/opRepeat.msl +27 -0
  1658. package/sdf/opRevolve.glsl +1 -1
  1659. package/sdf/opRevolve.hlsl +1 -1
  1660. package/sdf/opRevolve.msl +15 -0
  1661. package/sdf/opRound.glsl +3 -3
  1662. package/sdf/opRound.hlsl +1 -1
  1663. package/sdf/opRound.msl +15 -0
  1664. package/sdf/opSubtraction.glsl +4 -2
  1665. package/sdf/opSubtraction.hlsl +1 -1
  1666. package/sdf/opSubtraction.msl +26 -0
  1667. package/sdf/opSubtraction.wgsl +7 -0
  1668. package/sdf/opUnion.cuh +4 -2
  1669. package/sdf/opUnion.glsl +14 -4
  1670. package/sdf/opUnion.hlsl +15 -4
  1671. package/sdf/opUnion.msl +26 -0
  1672. package/sdf/opUnion.wgsl +7 -0
  1673. package/sdf/planeSDF.cuh +1 -1
  1674. package/sdf/planeSDF.glsl +1 -1
  1675. package/sdf/planeSDF.hlsl +2 -2
  1676. package/sdf/planeSDF.msl +16 -0
  1677. package/sdf/polySDF.glsl +14 -2
  1678. package/sdf/polySDF.hlsl +10 -2
  1679. package/sdf/polySDF.msl +30 -0
  1680. package/sdf/pyramidSDF.glsl +1 -1
  1681. package/sdf/pyramidSDF.hlsl +1 -1
  1682. package/sdf/pyramidSDF.msl +36 -0
  1683. package/sdf/raysSDF.glsl +13 -2
  1684. package/sdf/raysSDF.hlsl +10 -3
  1685. package/sdf/raysSDF.msl +26 -0
  1686. package/sdf/rectSDF.glsl +17 -3
  1687. package/sdf/rectSDF.hlsl +27 -2
  1688. package/sdf/rectSDF.msl +47 -0
  1689. package/sdf/rectSDF.wgsl +15 -3
  1690. package/sdf/rhombSDF.glsl +13 -2
  1691. package/sdf/rhombSDF.hlsl +11 -3
  1692. package/sdf/rhombSDF.msl +26 -0
  1693. package/sdf/sphereSDF.cuh +1 -1
  1694. package/sdf/sphereSDF.glsl +1 -1
  1695. package/sdf/sphereSDF.hlsl +1 -1
  1696. package/sdf/sphereSDF.msl +11 -0
  1697. package/sdf/sphereSDF.wgsl +9 -0
  1698. package/sdf/spiralSDF.glsl +12 -1
  1699. package/sdf/spiralSDF.hlsl +8 -1
  1700. package/sdf/spiralSDF.msl +26 -0
  1701. package/sdf/starSDF.glsl +19 -4
  1702. package/sdf/starSDF.hlsl +17 -5
  1703. package/sdf/starSDF.msl +36 -0
  1704. package/sdf/superShapeSDF.glsl +54 -0
  1705. package/sdf/superShapeSDF.hlsl +43 -0
  1706. package/sdf/superShapeSDF.msl +54 -0
  1707. package/sdf/tetrahedronSDF.glsl +1 -1
  1708. package/sdf/tetrahedronSDF.hlsl +1 -1
  1709. package/sdf/tetrahedronSDF.msl +17 -0
  1710. package/sdf/torusSDF.glsl +1 -1
  1711. package/sdf/torusSDF.hlsl +1 -1
  1712. package/sdf/torusSDF.msl +16 -0
  1713. package/sdf/torusSDF.wgsl +9 -0
  1714. package/sdf/triPrismSDF.glsl +1 -1
  1715. package/sdf/triPrismSDF.hlsl +5 -5
  1716. package/sdf/triPrismSDF.msl +45 -0
  1717. package/sdf/triSDF.glsl +16 -3
  1718. package/sdf/triSDF.hlsl +12 -3
  1719. package/sdf/triSDF.msl +26 -0
  1720. package/sdf/vesicaSDF.glsl +12 -3
  1721. package/sdf/vesicaSDF.hlsl +9 -2
  1722. package/sdf/vesicaSDF.msl +25 -0
  1723. package/sdf.glsl +5 -2
  1724. package/sdf.hlsl +6 -2
  1725. package/sdf.msl +46 -0
  1726. package/space/aspect.glsl +18 -0
  1727. package/space/aspect.hlsl +20 -0
  1728. package/space/aspect.msl +18 -0
  1729. package/space/bracketing.glsl +3 -2
  1730. package/space/bracketing.hlsl +3 -2
  1731. package/space/bracketing.msl +51 -0
  1732. package/space/brickTile.glsl +37 -0
  1733. package/space/brickTile.hlsl +31 -0
  1734. package/space/brickTile.msl +37 -0
  1735. package/space/cart2polar.glsl +12 -2
  1736. package/space/cart2polar.hlsl +13 -3
  1737. package/space/cart2polar.msl +21 -0
  1738. package/space/center.glsl +20 -0
  1739. package/space/center.hlsl +20 -0
  1740. package/space/center.msl +20 -0
  1741. package/space/checkerTile.glsl +34 -0
  1742. package/space/checkerTile.hlsl +32 -0
  1743. package/space/checkerTile.msl +34 -0
  1744. package/space/depth2viewZ.glsl +6 -3
  1745. package/space/depth2viewZ.hlsl +7 -4
  1746. package/space/depth2viewZ.msl +32 -0
  1747. package/space/displace.glsl +10 -7
  1748. package/space/displace.hlsl +10 -7
  1749. package/space/displace.msl +79 -0
  1750. package/space/equirect2xyz.glsl +5 -2
  1751. package/space/equirect2xyz.hlsl +5 -2
  1752. package/space/equirect2xyz.msl +22 -0
  1753. package/space/eulerView.glsl +25 -0
  1754. package/space/eulerView.hlsl +25 -0
  1755. package/space/fisheye2xyz.glsl +5 -2
  1756. package/space/fisheye2xyz.hlsl +5 -2
  1757. package/space/fisheye2xyz.msl +23 -0
  1758. package/space/fisheye2xyz.wgsl +22 -0
  1759. package/space/flipY.glsl +8 -5
  1760. package/space/flipY.hlsl +8 -5
  1761. package/space/flipY.msl +15 -0
  1762. package/space/hexTile.glsl +7 -32
  1763. package/space/hexTile.hlsl +5 -32
  1764. package/space/hexTile.msl +27 -0
  1765. package/space/kaleidoscope.glsl +43 -0
  1766. package/space/kaleidoscope.hlsl +43 -0
  1767. package/space/kaleidoscope.msl +43 -0
  1768. package/space/linearizeDepth.glsl +6 -8
  1769. package/space/linearizeDepth.hlsl +6 -8
  1770. package/space/linearizeDepth.msl +27 -0
  1771. package/space/lookAt.glsl +29 -18
  1772. package/space/lookAt.hlsl +33 -18
  1773. package/space/lookAt.msl +51 -0
  1774. package/space/lookAtView.glsl +28 -0
  1775. package/space/lookAtView.hlsl +28 -0
  1776. package/space/mirrorTile.glsl +28 -8
  1777. package/space/mirrorTile.hlsl +27 -8
  1778. package/space/mirrorTile.msl +39 -0
  1779. package/space/nearest.glsl +13 -7
  1780. package/space/nearest.hlsl +5 -3
  1781. package/space/nearest.msl +20 -0
  1782. package/space/nearest.wgsl +12 -0
  1783. package/space/orthographic.glsl +20 -0
  1784. package/space/orthographic.msl +20 -0
  1785. package/space/parallaxMapping.glsl +12 -9
  1786. package/space/parallaxMapping.hlsl +12 -9
  1787. package/space/parallaxMapping.msl +234 -0
  1788. package/space/perspective.glsl +24 -0
  1789. package/space/perspective.msl +24 -0
  1790. package/space/polar2cart.glsl +11 -1
  1791. package/space/polar2cart.hlsl +11 -1
  1792. package/space/polar2cart.msl +10 -0
  1793. package/space/ratio.cuh +4 -1
  1794. package/space/ratio.glsl +13 -6
  1795. package/space/ratio.hlsl +8 -3
  1796. package/space/ratio.msl +21 -0
  1797. package/space/ratio.wgsl +15 -3
  1798. package/space/rotate.glsl +39 -21
  1799. package/space/rotate.hlsl +4 -1
  1800. package/space/rotate.msl +80 -0
  1801. package/space/rotate.wgsl +16 -1
  1802. package/space/rotateX.glsl +15 -12
  1803. package/space/rotateX.hlsl +7 -4
  1804. package/space/rotateX.msl +39 -0
  1805. package/space/rotateY.glsl +14 -11
  1806. package/space/rotateY.hlsl +7 -4
  1807. package/space/rotateY.msl +39 -0
  1808. package/space/rotateZ.glsl +15 -13
  1809. package/space/rotateZ.hlsl +8 -6
  1810. package/space/rotateZ.msl +39 -0
  1811. package/space/scale.glsl +41 -43
  1812. package/space/scale.hlsl +4 -1
  1813. package/space/scale.msl +63 -0
  1814. package/space/scale.wgsl +12 -1
  1815. package/space/screen2viewPosition.glsl +5 -2
  1816. package/space/screen2viewPosition.hlsl +9 -6
  1817. package/space/screen2viewPosition.msl +33 -0
  1818. package/space/sprite.glsl +4 -1
  1819. package/space/sprite.hlsl +4 -1
  1820. package/space/sprite.msl +21 -0
  1821. package/space/sqTile.glsl +4 -1
  1822. package/space/sqTile.hlsl +4 -1
  1823. package/space/sqTile.msl +14 -0
  1824. package/space/tbn.glsl +21 -0
  1825. package/space/tbn.hlsl +25 -0
  1826. package/space/translate.glsl +20 -0
  1827. package/space/translate.hlsl +19 -0
  1828. package/space/triTile.glsl +12 -9
  1829. package/space/triTile.hlsl +22 -0
  1830. package/space/triTile.msl +23 -0
  1831. package/space/uncenter.glsl +19 -0
  1832. package/space/uncenter.hlsl +19 -0
  1833. package/space/uncenter.msl +19 -0
  1834. package/space/unratio.glsl +6 -5
  1835. package/space/unratio.hlsl +5 -2
  1836. package/space/unratio.msl +13 -0
  1837. package/space/view2screenPosition.glsl +5 -2
  1838. package/space/view2screenPosition.hlsl +8 -5
  1839. package/space/view2screenPosition.msl +22 -0
  1840. package/space/viewZ2depth.glsl +6 -3
  1841. package/space/viewZ2depth.hlsl +7 -4
  1842. package/space/viewZ2depth.msl +30 -0
  1843. package/space/windmillTile.glsl +43 -0
  1844. package/space/windmillTile.hlsl +41 -0
  1845. package/space/windmillTile.msl +43 -0
  1846. package/space/xyz2equirect.glsl +5 -2
  1847. package/space/xyz2equirect.hlsl +6 -3
  1848. package/space/xyz2equirect.msl +17 -0
  1849. package/version.glsl +8 -1
  1850. package/version.hlsl +8 -1
  1851. package/version.wgsl +10 -0
  1852. package/Lygia.asmdef +0 -14
  1853. package/color/mixBox.hlsl +0 -105
  1854. package/lighting/raymarch/camera.glsl +0 -38
  1855. package/lighting/raymarch/camera.hlsl +0 -36
  1856. package/lighting/raymarch/material.glsl +0 -133
  1857. package/lighting/raymarch/material.hlsl +0 -130
  1858. package/lighting/specular/ggx.glsl +0 -43
  1859. package/lighting/specular/ggx.hlsl +0 -43
  1860. package/morphological/poissonFill/downscale.glsl +0 -34
  1861. package/morphological/poissonFill/upscale.glsl +0 -51
  1862. package/morphological/poissonFill.glsl +0 -36
  1863. package/sdf/opRepite.glsl +0 -27
  1864. package/sdf/opRepite.hlsl +0 -29
  1865. package/simulate/fluidSolver.glsl +0 -96
  1866. package/simulate/grayscott.glsl +0 -74
  1867. package/simulate/ripple.glsl +0 -31
  1868. package/space/brick.glsl +0 -26
  1869. 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
- Tired of searching, porting and/or reimplementing the same functions over and over? LYGIA is a shader library of reusable functions that can be included easily into your projects. LYGIA is very granular and designed for reusability, performance, and flexibility. LYGIA can easily be added to any project or framework.
6
-
7
- [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](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://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](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
- #ifdef GL_ES
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 are working **locally** in an environment that can resolve `#include` dependencies, just clone LYGIA into your project relative to the shader you are loading:
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
- ### LYGIA on the cloud
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
- If you are working on a **cloud platform** you probably want to resolve the dependencies without needing to install anything. Just add a link to `https://lygia.xyz/resolve.js` (JS) or `https://lygia.xyz/resolve.esm.js` (ES6 module):
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
- ### Integrations examples
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 it organized?
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
- #ifndef MYFUNC_TYPE
251
- #define MYFUNC_TYPE vec4
252
- #endif
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
- * **Function Overloading**. Arguments are arranged in such a way that optional elements are at the end. When possible sort them according their memory size (except textures that remain at the top). Ex.: `sampler2D, mat4, mat3, mat2, vec4, vec3, vec2, float, ivec4, ivec3, ivec2, int, bool`
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. Your support will be appreciated and rewarded! All contributors are automatically added to the [commercial license](https://lygia.xyz/license). This support can take multiple forms:
211
+ LYGIA has a long way to go and welcomes all kinds of contributions. You can help by:
296
212
 
297
- * fixing bugs!
298
- * expanding the cross-compatibility between languages GLSL/HLSL/MSL/WGSL/CUDA
299
- * contributing new functions
300
- * adding new examples and integrations for new environments like: [GoDot](https://godotengine.org/), [ISF](https://isf.video/), [MaxMSP](https://cycling74.com/products/max), etc.
301
- * through [sponsorships](https://github.com/sponsors/patriciogonzalezvivo)
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 is 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).
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 (please take a look at the exceptions).
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
- **Exceptions**:
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. This library has been built over years, and 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/), [Hugh Kennedy](https://github.com/hughsk), [Matt DesLauriers](https://www.mattdesl.com/), and many others.
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.
@@ -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
+