shaders 2.5.85 → 2.5.87

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 (209) hide show
  1. package/README.md +1 -1
  2. package/dist/core/Crystal-z-2qqfhQ.js +394 -0
  3. package/dist/core/{Glass-BioLeiH6.js → Glass-BDHs6Enu.js} +40 -19
  4. package/dist/core/{VideoTexture-Dbsbgb1Y.js → VideoTexture-ChFw0jKS.js} +1 -1
  5. package/dist/core/{WebcamTexture-xvb8MuFz.js → WebcamTexture-CF1nwkNG.js} +1 -1
  6. package/dist/core/effects/glass.d.ts.map +1 -1
  7. package/dist/core/index.js +105 -77
  8. package/dist/core/registry.js +76 -75
  9. package/dist/core/renderer.d.ts.map +1 -1
  10. package/dist/core/shaderRegistry-O96t1zA9.js +222 -0
  11. package/dist/core/shaderRegistry.d.ts.map +1 -1
  12. package/dist/core/shaders/Crystal/index.d.ts +152 -0
  13. package/dist/core/shaders/Crystal/index.d.ts.map +1 -0
  14. package/dist/core/shaders/Crystal/index.js +4 -0
  15. package/dist/core/shaders/CursorRipples/index.js +1 -1
  16. package/dist/core/shaders/CursorTrail/index.js +1 -1
  17. package/dist/core/shaders/DiffuseBlur/index.js +1 -1
  18. package/dist/core/shaders/Dither/index.js +1 -1
  19. package/dist/core/shaders/DotGrid/index.js +1 -1
  20. package/dist/core/shaders/Duotone/index.js +1 -1
  21. package/dist/core/shaders/Ellipse/index.js +1 -1
  22. package/dist/core/shaders/Emboss/index.js +1 -1
  23. package/dist/core/shaders/FallingLines/index.js +1 -1
  24. package/dist/core/shaders/FilmGrain/index.js +1 -1
  25. package/dist/core/shaders/FloatingParticles/index.js +1 -1
  26. package/dist/core/shaders/FlowField/index.js +1 -1
  27. package/dist/core/shaders/Flower/index.js +1 -1
  28. package/dist/core/shaders/FlowingGradient/index.js +1 -1
  29. package/dist/core/shaders/Form3D/index.js +1 -1
  30. package/dist/core/shaders/Glass/index.d.ts.map +1 -1
  31. package/dist/core/shaders/Glass/index.js +1 -1
  32. package/dist/core/shaders/GlassTiles/index.js +1 -1
  33. package/dist/core/shaders/Glitch/index.js +1 -1
  34. package/dist/core/shaders/Glow/index.js +1 -1
  35. package/dist/core/shaders/Godrays/index.js +1 -1
  36. package/dist/core/shaders/Grayscale/index.js +1 -1
  37. package/dist/core/shaders/Grid/index.js +1 -1
  38. package/dist/core/shaders/GridDistortion/index.js +1 -1
  39. package/dist/core/shaders/Group/index.js +1 -1
  40. package/dist/core/shaders/Halftone/index.js +1 -1
  41. package/dist/core/shaders/HueShift/index.js +1 -1
  42. package/dist/core/shaders/ImageTexture/index.js +1 -1
  43. package/dist/core/shaders/Invert/index.js +1 -1
  44. package/dist/core/shaders/Kaleidoscope/index.js +1 -1
  45. package/dist/core/shaders/LensFlare/index.js +1 -1
  46. package/dist/core/shaders/LinearBlur/index.js +1 -1
  47. package/dist/core/shaders/LinearGradient/index.js +1 -1
  48. package/dist/core/shaders/Liquify/index.js +1 -1
  49. package/dist/core/shaders/Mirror/index.js +1 -1
  50. package/dist/core/shaders/Neon/index.js +1 -1
  51. package/dist/core/shaders/Paper/index.js +1 -1
  52. package/dist/core/shaders/Perspective/index.js +1 -1
  53. package/dist/core/shaders/Pixelate/index.js +1 -1
  54. package/dist/core/shaders/Plasma/index.js +1 -1
  55. package/dist/core/shaders/PolarCoordinates/index.js +1 -1
  56. package/dist/core/shaders/Polygon/index.js +1 -1
  57. package/dist/core/shaders/Posterize/index.js +1 -1
  58. package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
  59. package/dist/core/shaders/RadialGradient/index.js +1 -1
  60. package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
  61. package/dist/core/shaders/Ring/index.js +1 -1
  62. package/dist/core/shaders/Ripples/index.js +1 -1
  63. package/dist/core/shaders/RoundedRect/index.js +1 -1
  64. package/dist/core/shaders/Saturation/index.js +1 -1
  65. package/dist/core/shaders/Sharpness/index.js +1 -1
  66. package/dist/core/shaders/Shatter/index.js +1 -1
  67. package/dist/core/shaders/SimplexNoise/index.js +1 -1
  68. package/dist/core/shaders/SineWave/index.js +1 -1
  69. package/dist/core/shaders/SolidColor/index.js +1 -1
  70. package/dist/core/shaders/Spherize/index.js +1 -1
  71. package/dist/core/shaders/Spiral/index.js +1 -1
  72. package/dist/core/shaders/Star/index.js +1 -1
  73. package/dist/core/shaders/Strands/index.js +1 -1
  74. package/dist/core/shaders/Stretch/index.js +1 -1
  75. package/dist/core/shaders/Stripes/index.js +1 -1
  76. package/dist/core/shaders/StudioBackground/index.js +1 -1
  77. package/dist/core/shaders/Swirl/index.js +1 -1
  78. package/dist/core/shaders/TiltShift/index.js +1 -1
  79. package/dist/core/shaders/Tint/index.js +1 -1
  80. package/dist/core/shaders/Trapezoid/index.js +1 -1
  81. package/dist/core/shaders/Tritone/index.js +1 -1
  82. package/dist/core/shaders/Twirl/index.js +1 -1
  83. package/dist/core/shaders/Vesica/index.js +1 -1
  84. package/dist/core/shaders/Vibrance/index.js +1 -1
  85. package/dist/core/shaders/VideoTexture/index.js +2 -2
  86. package/dist/core/shaders/WaveDistortion/index.js +1 -1
  87. package/dist/core/shaders/WebcamTexture/index.js +2 -2
  88. package/dist/core/shaders/ZoomBlur/index.js +1 -1
  89. package/dist/core/types.d.ts +3 -0
  90. package/dist/core/types.d.ts.map +1 -1
  91. package/dist/core/utilities/uniforms.d.ts.map +1 -1
  92. package/dist/js/createShader.js +1 -1
  93. package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
  94. package/dist/js/utils/generatePresetCode.js +27 -0
  95. package/dist/react/Crystal.js +181 -0
  96. package/dist/react/Preview.js +1 -0
  97. package/dist/react/Shader.js +1 -1
  98. package/dist/react/components/Crystal.d.ts +33 -0
  99. package/dist/react/components/Crystal.d.ts.map +1 -0
  100. package/dist/react/engine/Preview.d.ts.map +1 -1
  101. package/dist/react/index.d.ts +1 -0
  102. package/dist/react/index.d.ts.map +1 -1
  103. package/dist/react/index.js +2 -1
  104. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  105. package/dist/react/utils/generatePresetCode.js +27 -0
  106. package/dist/registry.js +454 -0
  107. package/dist/solid/components/Crystal.d.ts +30 -0
  108. package/dist/solid/components/Crystal.d.ts.map +1 -0
  109. package/dist/solid/components/Crystal.js +183 -0
  110. package/dist/solid/engine/Preview.d.ts.map +1 -1
  111. package/dist/solid/engine/Preview.js +38 -36
  112. package/dist/solid/engine/Shader.js +1 -1
  113. package/dist/solid/index.d.ts +1 -0
  114. package/dist/solid/index.d.ts.map +1 -1
  115. package/dist/solid/index.js +152 -150
  116. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  117. package/dist/solid/utils/generatePresetCode.js +27 -0
  118. package/dist/svelte/components/Crystal.svelte.d.ts +20 -0
  119. package/dist/svelte/{generatePresetCode-B9QYLcji.js → generatePresetCode-BzFhasGi.js} +27 -0
  120. package/dist/svelte/index.d.ts +1 -0
  121. package/dist/svelte/index.js +477 -330
  122. package/dist/svelte/source/components/Crystal.svelte +287 -0
  123. package/dist/svelte/source/engine/Preview.svelte +2 -0
  124. package/dist/svelte/source/index.js +1 -0
  125. package/dist/svelte/utils/generatePresetCode.js +1 -1
  126. package/dist/vue/Crystal.js +3 -0
  127. package/dist/vue/Crystal.vue_vue_type_script_setup_true_lang.js +186 -0
  128. package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
  129. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  130. package/dist/vue/components/Crystal.vue.d.ts +55 -0
  131. package/dist/vue/components/Crystal.vue.d.ts.map +1 -0
  132. package/dist/vue/index.d.ts +1 -0
  133. package/dist/vue/index.d.ts.map +1 -1
  134. package/dist/vue/index.js +2 -1
  135. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  136. package/dist/vue/utils/generatePresetCode.js +27 -0
  137. package/package.json +9 -1
  138. package/dist/core/shaderRegistry-ClxU5BC7.js +0 -220
  139. /package/dist/core/{CursorRipples-BY1iu4MX.js → CursorRipples-CkVMs3DF.js} +0 -0
  140. /package/dist/core/{CursorTrail-BzrL2WMh.js → CursorTrail-1D7ymT9O.js} +0 -0
  141. /package/dist/core/{DiffuseBlur-Dyd42LXw.js → DiffuseBlur-BAq1jHVB.js} +0 -0
  142. /package/dist/core/{Dither-CTInG_SB.js → Dither-U_UFB8oZ.js} +0 -0
  143. /package/dist/core/{DotGrid-CsL0dnYB.js → DotGrid-BzAsAVrt.js} +0 -0
  144. /package/dist/core/{Duotone-BbCFLFMK.js → Duotone-CuIRHH_k.js} +0 -0
  145. /package/dist/core/{Ellipse-CZWtvB3q.js → Ellipse-CJFK20Xl.js} +0 -0
  146. /package/dist/core/{Emboss-DCKgs4_G.js → Emboss-DWXpvlZO.js} +0 -0
  147. /package/dist/core/{FallingLines-DBNJVWio.js → FallingLines-BQzBwOy0.js} +0 -0
  148. /package/dist/core/{FilmGrain-CSuerGc6.js → FilmGrain-Birzz05_.js} +0 -0
  149. /package/dist/core/{FloatingParticles-CoBM_CJ8.js → FloatingParticles-shoqY6fm.js} +0 -0
  150. /package/dist/core/{FlowField-Bh3-dX6I.js → FlowField-CJdtd3Za.js} +0 -0
  151. /package/dist/core/{Flower-fYEx6ZSB.js → Flower-BST3LQVi.js} +0 -0
  152. /package/dist/core/{FlowingGradient-DVproCI1.js → FlowingGradient-Dsuqf7Yn.js} +0 -0
  153. /package/dist/core/{Form3D-DhezVuyN.js → Form3D-Czd8VBcU.js} +0 -0
  154. /package/dist/core/{GlassTiles-ClrOIpCg.js → GlassTiles-CQFngHS9.js} +0 -0
  155. /package/dist/core/{Glitch-DmWytiRl.js → Glitch-q3H4XH_K.js} +0 -0
  156. /package/dist/core/{Glow-Dm4dfZ_m.js → Glow-BltxRvyM.js} +0 -0
  157. /package/dist/core/{Godrays-CYILZUHg.js → Godrays-YxezlRHu.js} +0 -0
  158. /package/dist/core/{Grayscale-CPR_l4G2.js → Grayscale-D_RwmAV3.js} +0 -0
  159. /package/dist/core/{Grid-CCQZ3GhD.js → Grid-CV2iJqlk.js} +0 -0
  160. /package/dist/core/{GridDistortion-oGT8NaWa.js → GridDistortion-JCuvWcoV.js} +0 -0
  161. /package/dist/core/{Group-CC317vlL.js → Group-CeA8FtS3.js} +0 -0
  162. /package/dist/core/{Halftone-BZk1Hjz_.js → Halftone-4oL_AA-D.js} +0 -0
  163. /package/dist/core/{HueShift-CuE3YTBE.js → HueShift-7Gv8BV4v.js} +0 -0
  164. /package/dist/core/{ImageTexture-DWUSKXX0.js → ImageTexture-BaVcRld1.js} +0 -0
  165. /package/dist/core/{Invert-C9RiDYP_.js → Invert-D_jzp4D9.js} +0 -0
  166. /package/dist/core/{Kaleidoscope-DtVlQWKG.js → Kaleidoscope-Baz9Fu8k.js} +0 -0
  167. /package/dist/core/{LensFlare-AVpiDD1O.js → LensFlare-Dyv84bAb.js} +0 -0
  168. /package/dist/core/{LinearBlur-AR65FcZh.js → LinearBlur-ZGWbzIt4.js} +0 -0
  169. /package/dist/core/{LinearGradient-DXCXjS-K.js → LinearGradient-CZGPiyHq.js} +0 -0
  170. /package/dist/core/{Liquify-mhzPd19o.js → Liquify-DrWLq2Kz.js} +0 -0
  171. /package/dist/core/{Mirror-CSc5mJi1.js → Mirror-C5LuGm-w.js} +0 -0
  172. /package/dist/core/{Neon-uXetpVop.js → Neon-gsfaMvGq.js} +0 -0
  173. /package/dist/core/{Paper-DfUka0dt.js → Paper-BVuYd7u4.js} +0 -0
  174. /package/dist/core/{Perspective-uPiPmWy_.js → Perspective-CqV-lhEE.js} +0 -0
  175. /package/dist/core/{Pixelate-DRkAW4Lo.js → Pixelate-DrG7QsBR.js} +0 -0
  176. /package/dist/core/{Plasma-ELzbK-Us.js → Plasma-LpGeN0eG.js} +0 -0
  177. /package/dist/core/{PolarCoordinates-CalS_TB6.js → PolarCoordinates-CiNUC56M.js} +0 -0
  178. /package/dist/core/{Polygon-7mzxbJeF.js → Polygon-BeqB8MSz.js} +0 -0
  179. /package/dist/core/{Posterize-C4vtRmtA.js → Posterize-CGEUVRt_.js} +0 -0
  180. /package/dist/core/{ProgressiveBlur-CLYhfOvQ.js → ProgressiveBlur-jEam9zrU.js} +0 -0
  181. /package/dist/core/{RadialGradient-DtD8HWdM.js → RadialGradient-BMmhr2qB.js} +0 -0
  182. /package/dist/core/{RectangularCoordinates-B96mflF5.js → RectangularCoordinates-Cj-d2ol3.js} +0 -0
  183. /package/dist/core/{Ring-H6B01ZMz.js → Ring-DJl9JUMR.js} +0 -0
  184. /package/dist/core/{Ripples-Cevf-Hvg.js → Ripples-r12S7WG7.js} +0 -0
  185. /package/dist/core/{RoundedRect-OszKdYVD.js → RoundedRect--rHP7xW4.js} +0 -0
  186. /package/dist/core/{Saturation-CcDwPh2v.js → Saturation-BAORnZso.js} +0 -0
  187. /package/dist/core/{Sharpness-D_dXfDEo.js → Sharpness-CFzYBYlL.js} +0 -0
  188. /package/dist/core/{Shatter-NfZzVt54.js → Shatter-avsezFDy.js} +0 -0
  189. /package/dist/core/{SimplexNoise-aipzNV5j.js → SimplexNoise-BjoeAe6H.js} +0 -0
  190. /package/dist/core/{SineWave-CVeYx3n-.js → SineWave-B-2YxAht.js} +0 -0
  191. /package/dist/core/{SolidColor-BdbBnLxX.js → SolidColor-2o0vQu86.js} +0 -0
  192. /package/dist/core/{Spherize-BRGwLGeu.js → Spherize-DKJKva6y.js} +0 -0
  193. /package/dist/core/{Spiral-BkTBXb7z.js → Spiral-Dzsm_AJG.js} +0 -0
  194. /package/dist/core/{Star-CyjNgJVp.js → Star-CxI_taxd.js} +0 -0
  195. /package/dist/core/{Strands-Cjsw-cPu.js → Strands-42wUIQMv.js} +0 -0
  196. /package/dist/core/{Stretch-9cta3Z1W.js → Stretch-BVPICFxU.js} +0 -0
  197. /package/dist/core/{Stripes-C0sCGCz_.js → Stripes-DpWPzhd5.js} +0 -0
  198. /package/dist/core/{StudioBackground-BYv_-8df.js → StudioBackground-CxOYZ28g.js} +0 -0
  199. /package/dist/core/{Swirl-DXjIXfy7.js → Swirl-CaQpQWY2.js} +0 -0
  200. /package/dist/core/{TiltShift-56lcZ4cJ.js → TiltShift-yJYvxA1V.js} +0 -0
  201. /package/dist/core/{Tint-8_WIy9_e.js → Tint-BR2yMhfB.js} +0 -0
  202. /package/dist/core/{Trapezoid-SuI0dRgI.js → Trapezoid-D7qg9Gc5.js} +0 -0
  203. /package/dist/core/{Tritone-nyJyybHI.js → Tritone-PTTYWr_w.js} +0 -0
  204. /package/dist/core/{Twirl-BzSEz4xK.js → Twirl-CE2yzv3_.js} +0 -0
  205. /package/dist/core/{Vesica-Cj--pgNW.js → Vesica-p8oNtcOH.js} +0 -0
  206. /package/dist/core/{Vibrance-BETLN3Ie.js → Vibrance-CljpZu_J.js} +0 -0
  207. /package/dist/core/{WaveDistortion-C-j597Jm.js → WaveDistortion-BSt0JJbk.js} +0 -0
  208. /package/dist/core/{ZoomBlur-DFw0J9x3.js → ZoomBlur-CAeswzf5.js} +0 -0
  209. /package/dist/core/{browser-CqdrcD5J.js → browser-CWKHEzb9.js} +0 -0
package/dist/registry.js CHANGED
@@ -4187,6 +4187,460 @@ export const shaderRegistry = [
4187
4187
  }
4188
4188
  }
4189
4189
  },
4190
+ {
4191
+ "name": "Crystal",
4192
+ "category": "Shape Effects",
4193
+ "description": "Diamond-like crystal lens with faceted refraction.",
4194
+ "fileName": "Crystal",
4195
+ "requiresChild": true,
4196
+ "definition": {
4197
+ "name": "Crystal",
4198
+ "category": "Shape Effects",
4199
+ "description": "Diamond-like crystal lens with faceted refraction.",
4200
+ "requiresRTT": true,
4201
+ "requiresChild": true,
4202
+ "props": {
4203
+ "center": {
4204
+ "default": {
4205
+ "x": 0.5,
4206
+ "y": 0.5
4207
+ },
4208
+ "description": "Center position of the crystal shape",
4209
+ "ui": {
4210
+ "type": "position",
4211
+ "label": "Center",
4212
+ "group": "Position"
4213
+ }
4214
+ },
4215
+ "scale": {
4216
+ "default": 1,
4217
+ "description": "Scale of the crystal shape (1 = default size)",
4218
+ "ui": {
4219
+ "type": "range",
4220
+ "min": 0.1,
4221
+ "max": 3,
4222
+ "step": 0.05,
4223
+ "label": "Scale",
4224
+ "group": "Position"
4225
+ }
4226
+ },
4227
+ "cutout": {
4228
+ "default": false,
4229
+ "description": "Cut out alpha outside the crystal shape",
4230
+ "ui": {
4231
+ "type": "checkbox",
4232
+ "label": "Cutout",
4233
+ "group": "Crystal"
4234
+ }
4235
+ },
4236
+ "refraction": {
4237
+ "default": 0.5,
4238
+ "description": "How strongly the crystal refracts content beneath",
4239
+ "ui": {
4240
+ "type": "range",
4241
+ "min": 0,
4242
+ "max": 3,
4243
+ "step": 0.01,
4244
+ "label": "Refraction",
4245
+ "group": "Crystal"
4246
+ }
4247
+ },
4248
+ "dispersion": {
4249
+ "default": 0.5,
4250
+ "description": "Prismatic rainbow dispersion — splits light into spectral colors",
4251
+ "ui": {
4252
+ "type": "range",
4253
+ "min": 0,
4254
+ "max": 2,
4255
+ "step": 0.01,
4256
+ "label": "Dispersion",
4257
+ "group": "Crystal"
4258
+ }
4259
+ },
4260
+ "facets": {
4261
+ "default": 5,
4262
+ "description": "Symmetry order — how many times the facet pattern repeats around the center",
4263
+ "ui": {
4264
+ "type": "range",
4265
+ "min": 3,
4266
+ "max": 24,
4267
+ "step": 1,
4268
+ "label": "Facets",
4269
+ "group": "Crystal"
4270
+ }
4271
+ },
4272
+ "fresnel": {
4273
+ "default": 0.05,
4274
+ "description": "Fresnel rim glow intensity around the crystal boundary",
4275
+ "ui": {
4276
+ "type": "range",
4277
+ "min": 0,
4278
+ "max": 1,
4279
+ "step": 0.01,
4280
+ "label": "Fresnel",
4281
+ "group": "Fresnel"
4282
+ }
4283
+ },
4284
+ "fresnelSoftness": {
4285
+ "default": 1,
4286
+ "description": "Fresnel rim width — higher values spread the glow further inward",
4287
+ "ui": {
4288
+ "type": "range",
4289
+ "min": 0,
4290
+ "max": 2,
4291
+ "step": 0.01,
4292
+ "label": "Fresnel Softness",
4293
+ "group": "Fresnel"
4294
+ }
4295
+ },
4296
+ "fresnelColor": {
4297
+ "default": "#ffffff",
4298
+ "description": "Color of the fresnel rim glow",
4299
+ "ui": {
4300
+ "type": "color",
4301
+ "label": "Fresnel Color",
4302
+ "group": "Fresnel"
4303
+ }
4304
+ },
4305
+ "edgeSoftness": {
4306
+ "default": 0,
4307
+ "description": "Softness of the crystal boundary edge",
4308
+ "ui": {
4309
+ "type": "range",
4310
+ "min": 0,
4311
+ "max": 1,
4312
+ "step": 0.05,
4313
+ "label": "Edge Softness",
4314
+ "group": "Crystal"
4315
+ }
4316
+ },
4317
+ "innerZoom": {
4318
+ "default": 1.5,
4319
+ "description": "Magnification of content seen through the crystal",
4320
+ "ui": {
4321
+ "type": "range",
4322
+ "min": 0.5,
4323
+ "max": 3,
4324
+ "step": 0.05,
4325
+ "label": "Inner Zoom",
4326
+ "group": "Crystal"
4327
+ }
4328
+ },
4329
+ "lightAngle": {
4330
+ "default": 270,
4331
+ "description": "Light direction angle in degrees",
4332
+ "ui": {
4333
+ "type": "range",
4334
+ "min": 0,
4335
+ "max": 360,
4336
+ "step": 1,
4337
+ "label": "Light Angle",
4338
+ "group": "Lighting"
4339
+ }
4340
+ },
4341
+ "highlights": {
4342
+ "default": 0.5,
4343
+ "description": "Additive brightness on light-facing facets — never darkens",
4344
+ "ui": {
4345
+ "type": "range",
4346
+ "min": 0,
4347
+ "max": 2,
4348
+ "step": 0.05,
4349
+ "label": "Highlights",
4350
+ "group": "Lighting"
4351
+ }
4352
+ },
4353
+ "shadows": {
4354
+ "default": 0.3,
4355
+ "description": "Darkening on shadow-facing facets — never brightens",
4356
+ "ui": {
4357
+ "type": "range",
4358
+ "min": 0,
4359
+ "max": 1,
4360
+ "step": 0.05,
4361
+ "label": "Shadows",
4362
+ "group": "Lighting"
4363
+ }
4364
+ },
4365
+ "brightness": {
4366
+ "default": 1.2,
4367
+ "description": "Overall crystal brightness — higher values push facets toward brilliant white",
4368
+ "ui": {
4369
+ "type": "range",
4370
+ "min": 0.5,
4371
+ "max": 3,
4372
+ "step": 0.05,
4373
+ "label": "Brightness",
4374
+ "group": "Lighting"
4375
+ }
4376
+ },
4377
+ "tintColor": {
4378
+ "default": "#e8e0ff",
4379
+ "description": "Crystal body tint color",
4380
+ "ui": {
4381
+ "type": "color",
4382
+ "label": "Tint Color",
4383
+ "group": "Tint"
4384
+ }
4385
+ },
4386
+ "tintIntensity": {
4387
+ "default": 0,
4388
+ "description": "How much tint color is applied to the crystal interior",
4389
+ "ui": {
4390
+ "type": "range",
4391
+ "min": 0,
4392
+ "max": 1,
4393
+ "step": 0.01,
4394
+ "label": "Tint Intensity",
4395
+ "group": "Tint"
4396
+ }
4397
+ },
4398
+ "tintPreserveLuminosity": {
4399
+ "default": true,
4400
+ "description": "Preserve original brightness when tinting",
4401
+ "ui": {
4402
+ "type": "checkbox",
4403
+ "label": "Preserve Luminosity",
4404
+ "group": "Tint"
4405
+ }
4406
+ },
4407
+ "shape": {
4408
+ "default": "{\"type\":\"polygonSDF\",\"radius\":0.35,\"sides\":10}",
4409
+ "description": "Serialized shape configuration (JSON)",
4410
+ "ui": {
4411
+ "type": "shape",
4412
+ "label": "Shape",
4413
+ "group": "Shape"
4414
+ }
4415
+ },
4416
+ "shapeSdfUrl": {
4417
+ "default": "",
4418
+ "compileTime": true,
4419
+ "description": "URL to a pre-generated SDF .bin file"
4420
+ },
4421
+ "shapeType": {
4422
+ "default": "",
4423
+ "compileTime": true,
4424
+ "description": "Active SDF shape type"
4425
+ }
4426
+ }
4427
+ },
4428
+ "propsMetadata": {
4429
+ "center": {
4430
+ "ui": {
4431
+ "type": "position",
4432
+ "label": "Center",
4433
+ "group": "Position"
4434
+ },
4435
+ "default": {
4436
+ "x": 0.5,
4437
+ "y": 0.5
4438
+ },
4439
+ "description": "Center position of the crystal shape"
4440
+ },
4441
+ "scale": {
4442
+ "ui": {
4443
+ "type": "range",
4444
+ "min": 0.1,
4445
+ "max": 3,
4446
+ "step": 0.05,
4447
+ "label": "Scale",
4448
+ "group": "Position"
4449
+ },
4450
+ "default": 1,
4451
+ "description": "Scale of the crystal shape (1 = default size)"
4452
+ },
4453
+ "cutout": {
4454
+ "ui": {
4455
+ "type": "checkbox",
4456
+ "label": "Cutout",
4457
+ "group": "Crystal"
4458
+ },
4459
+ "default": false,
4460
+ "description": "Cut out alpha outside the crystal shape"
4461
+ },
4462
+ "refraction": {
4463
+ "ui": {
4464
+ "type": "range",
4465
+ "min": 0,
4466
+ "max": 3,
4467
+ "step": 0.01,
4468
+ "label": "Refraction",
4469
+ "group": "Crystal"
4470
+ },
4471
+ "default": 0.5,
4472
+ "description": "How strongly the crystal refracts content beneath"
4473
+ },
4474
+ "dispersion": {
4475
+ "ui": {
4476
+ "type": "range",
4477
+ "min": 0,
4478
+ "max": 2,
4479
+ "step": 0.01,
4480
+ "label": "Dispersion",
4481
+ "group": "Crystal"
4482
+ },
4483
+ "default": 0.5,
4484
+ "description": "Prismatic rainbow dispersion — splits light into spectral colors"
4485
+ },
4486
+ "facets": {
4487
+ "ui": {
4488
+ "type": "range",
4489
+ "min": 3,
4490
+ "max": 24,
4491
+ "step": 1,
4492
+ "label": "Facets",
4493
+ "group": "Crystal"
4494
+ },
4495
+ "default": 5,
4496
+ "description": "Symmetry order — how many times the facet pattern repeats around the center"
4497
+ },
4498
+ "fresnel": {
4499
+ "ui": {
4500
+ "type": "range",
4501
+ "min": 0,
4502
+ "max": 1,
4503
+ "step": 0.01,
4504
+ "label": "Fresnel",
4505
+ "group": "Fresnel"
4506
+ },
4507
+ "default": 0.05,
4508
+ "description": "Fresnel rim glow intensity around the crystal boundary"
4509
+ },
4510
+ "fresnelSoftness": {
4511
+ "ui": {
4512
+ "type": "range",
4513
+ "min": 0,
4514
+ "max": 2,
4515
+ "step": 0.01,
4516
+ "label": "Fresnel Softness",
4517
+ "group": "Fresnel"
4518
+ },
4519
+ "default": 1,
4520
+ "description": "Fresnel rim width — higher values spread the glow further inward"
4521
+ },
4522
+ "fresnelColor": {
4523
+ "ui": {
4524
+ "type": "color",
4525
+ "label": "Fresnel Color",
4526
+ "group": "Fresnel"
4527
+ },
4528
+ "default": "#ffffff",
4529
+ "description": "Color of the fresnel rim glow"
4530
+ },
4531
+ "edgeSoftness": {
4532
+ "ui": {
4533
+ "type": "range",
4534
+ "min": 0,
4535
+ "max": 1,
4536
+ "step": 0.05,
4537
+ "label": "Edge Softness",
4538
+ "group": "Crystal"
4539
+ },
4540
+ "default": 0,
4541
+ "description": "Softness of the crystal boundary edge"
4542
+ },
4543
+ "innerZoom": {
4544
+ "ui": {
4545
+ "type": "range",
4546
+ "min": 0.5,
4547
+ "max": 3,
4548
+ "step": 0.05,
4549
+ "label": "Inner Zoom",
4550
+ "group": "Crystal"
4551
+ },
4552
+ "default": 1.5,
4553
+ "description": "Magnification of content seen through the crystal"
4554
+ },
4555
+ "lightAngle": {
4556
+ "ui": {
4557
+ "type": "range",
4558
+ "min": 0,
4559
+ "max": 360,
4560
+ "step": 1,
4561
+ "label": "Light Angle",
4562
+ "group": "Lighting"
4563
+ },
4564
+ "default": 270,
4565
+ "description": "Light direction angle in degrees"
4566
+ },
4567
+ "highlights": {
4568
+ "ui": {
4569
+ "type": "range",
4570
+ "min": 0,
4571
+ "max": 2,
4572
+ "step": 0.05,
4573
+ "label": "Highlights",
4574
+ "group": "Lighting"
4575
+ },
4576
+ "default": 0.5,
4577
+ "description": "Additive brightness on light-facing facets — never darkens"
4578
+ },
4579
+ "shadows": {
4580
+ "ui": {
4581
+ "type": "range",
4582
+ "min": 0,
4583
+ "max": 1,
4584
+ "step": 0.05,
4585
+ "label": "Shadows",
4586
+ "group": "Lighting"
4587
+ },
4588
+ "default": 0.3,
4589
+ "description": "Darkening on shadow-facing facets — never brightens"
4590
+ },
4591
+ "brightness": {
4592
+ "ui": {
4593
+ "type": "range",
4594
+ "min": 0.5,
4595
+ "max": 3,
4596
+ "step": 0.05,
4597
+ "label": "Brightness",
4598
+ "group": "Lighting"
4599
+ },
4600
+ "default": 1.2,
4601
+ "description": "Overall crystal brightness — higher values push facets toward brilliant white"
4602
+ },
4603
+ "tintColor": {
4604
+ "ui": {
4605
+ "type": "color",
4606
+ "label": "Tint Color",
4607
+ "group": "Tint"
4608
+ },
4609
+ "default": "#e8e0ff",
4610
+ "description": "Crystal body tint color"
4611
+ },
4612
+ "tintIntensity": {
4613
+ "ui": {
4614
+ "type": "range",
4615
+ "min": 0,
4616
+ "max": 1,
4617
+ "step": 0.01,
4618
+ "label": "Tint Intensity",
4619
+ "group": "Tint"
4620
+ },
4621
+ "default": 0,
4622
+ "description": "How much tint color is applied to the crystal interior"
4623
+ },
4624
+ "tintPreserveLuminosity": {
4625
+ "ui": {
4626
+ "type": "checkbox",
4627
+ "label": "Preserve Luminosity",
4628
+ "group": "Tint"
4629
+ },
4630
+ "default": true,
4631
+ "description": "Preserve original brightness when tinting"
4632
+ },
4633
+ "shape": {
4634
+ "ui": {
4635
+ "type": "shape",
4636
+ "label": "Shape",
4637
+ "group": "Shape"
4638
+ },
4639
+ "default": "{\"type\":\"polygonSDF\",\"radius\":0.35,\"sides\":10}",
4640
+ "description": "Serialized shape configuration (JSON)"
4641
+ }
4642
+ }
4643
+ },
4190
4644
  {
4191
4645
  "name": "CursorRipples",
4192
4646
  "category": "Interactive",
@@ -0,0 +1,30 @@
1
+ import { JSX } from 'solid-js';
2
+ import { BlendMode, PropDriver, TransformConfig } from '../../core';
3
+ import { ComponentProps } from '../../core/shaders/Crystal';
4
+ export type { ComponentProps };
5
+ /**
6
+ * Base props that all shader components have
7
+ */
8
+ interface BaseShaderProps {
9
+ children?: JSX.Element;
10
+ blendMode?: BlendMode;
11
+ opacity?: number;
12
+ visible?: boolean;
13
+ id?: string;
14
+ maskSource?: string;
15
+ maskType?: string;
16
+ renderOrder?: number;
17
+ transform?: Partial<TransformConfig>;
18
+ }
19
+ /**
20
+ * Component-specific props that merge base props with shader-specific props
21
+ * Note: ComponentProps are made optional since they have defaults from the shader definition
22
+ */
23
+ type ShaderComponentProps = BaseShaderProps & Partial<Omit<ComponentProps, 'center'>> & {
24
+ center?: ComponentProps['center'] | PropDriver;
25
+ };
26
+ /**
27
+ * The main Solid wrapper component for Shader shader nodes
28
+ */
29
+ export default function ShaderComponent(props: ShaderComponentProps): JSX.Element;
30
+ //# sourceMappingURL=Crystal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Crystal.d.ts","sourceRoot":"","sources":["../../src/components/Crystal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4E,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,UAAU,EACf,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGhF,YAAY,EAAE,cAAc,EAAE,CAAC;AAI/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACxC;AAOD;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,GAAG;IACtF,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;CAChD,CAAC;AAmCF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA+LlE"}
@@ -0,0 +1,183 @@
1
+ import { createComponent, template, setAttribute, insert, use } from "solid-js/web";
2
+ import { splitProps, createUniqueId, createMemo, onMount, onCleanup, createEffect } from "solid-js";
3
+ import { createUniformsMap } from "../../core/index.js";
4
+ import { setColorSpaceMode } from "../../core/utilities/transformations/index.js";
5
+ import { componentDefinition } from "../../core/shaders/Crystal/index.js";
6
+ import { useShaderContext, ShaderContext } from "../engine/Shader.js";
7
+ var _tmpl$ = /* @__PURE__ */ template(`<span style=display:contents>`);
8
+ function isPropDriver(value) {
9
+ return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
10
+ }
11
+ const DEFAULT_TRANSFORM = {
12
+ offsetX: 0,
13
+ offsetY: 0,
14
+ rotation: 0,
15
+ scale: 1,
16
+ anchorX: 0.5,
17
+ anchorY: 0.5,
18
+ edges: "transparent"
19
+ };
20
+ const defaultProps = {
21
+ blendMode: "normal",
22
+ visible: true
23
+ // opacity intentionally has no default - handled by renderer
24
+ // transform intentionally has no default - handled by effectiveTransform
25
+ };
26
+ try {
27
+ if (componentDefinition && componentDefinition.props) {
28
+ Object.entries(componentDefinition.props).forEach(([key, config]) => {
29
+ const propConfig = config;
30
+ if (propConfig && typeof propConfig === "object" && "default" in propConfig) {
31
+ defaultProps[key] = propConfig.default;
32
+ }
33
+ });
34
+ }
35
+ } catch (e) {
36
+ console.warn("Error extracting default props:", e);
37
+ }
38
+ function ShaderComponent(props) {
39
+ const [local, otherProps] = splitProps(props, ["children"]);
40
+ const context = useShaderContext();
41
+ const {
42
+ shaderParentId: parentId,
43
+ shaderNodeRegister: parentRegister,
44
+ shaderUniformUpdate: parentUniformUpdate,
45
+ shaderMetadataUpdate: parentMetadataUpdate,
46
+ shaderColorSpace
47
+ } = context;
48
+ const instanceId = (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || createUniqueId();
49
+ const effectiveProps = createMemo(() => {
50
+ let baseProps = {
51
+ ...defaultProps
52
+ };
53
+ for (const [key, value] of Object.entries(otherProps)) {
54
+ if (value !== void 0 && !isPropDriver(value)) {
55
+ baseProps[key] = value;
56
+ }
57
+ }
58
+ return baseProps;
59
+ });
60
+ const effectiveTransform = createMemo(() => ({
61
+ ...DEFAULT_TRANSFORM,
62
+ ...props.transform
63
+ }));
64
+ const mapsFromProps = createMemo(() => {
65
+ const maps = {};
66
+ for (const [key, value] of Object.entries(otherProps)) {
67
+ if (isPropDriver(value)) maps[key] = value;
68
+ }
69
+ return Object.keys(maps).length > 0 ? maps : void 0;
70
+ });
71
+ let uniformsMap = null;
72
+ const getUniformsMap = () => {
73
+ if (!uniformsMap) {
74
+ setColorSpaceMode(shaderColorSpace);
75
+ uniformsMap = createUniformsMap(componentDefinition, effectiveProps(), instanceId);
76
+ }
77
+ return uniformsMap;
78
+ };
79
+ const childContextValue = createMemo(() => ({
80
+ ...context,
81
+ shaderParentId: instanceId
82
+ }));
83
+ let markerRef;
84
+ let detectedRenderOrder = void 0;
85
+ let isRegistered = false;
86
+ onMount(() => {
87
+ const uniforms = getUniformsMap();
88
+ if (!uniforms) return;
89
+ try {
90
+ const metadata = {
91
+ blendMode: props.blendMode || "normal",
92
+ opacity: props.opacity,
93
+ visible: props.visible === false ? false : true,
94
+ id: props.id,
95
+ mask: props.maskSource ? {
96
+ source: props.maskSource,
97
+ type: props.maskType || "alpha"
98
+ } : void 0,
99
+ maps: mapsFromProps(),
100
+ renderOrder: props.renderOrder ?? detectedRenderOrder,
101
+ transform: effectiveTransform()
102
+ };
103
+ parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniforms, componentDefinition);
104
+ isRegistered = true;
105
+ if (props.renderOrder === void 0 && markerRef) {
106
+ const parent = markerRef.parentElement;
107
+ if (parent) {
108
+ const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
109
+ const position = Array.from(siblings).indexOf(markerRef);
110
+ if (position >= 0) {
111
+ detectedRenderOrder = position;
112
+ parentMetadataUpdate(instanceId, {
113
+ renderOrder: position
114
+ });
115
+ }
116
+ }
117
+ }
118
+ } catch (error) {
119
+ console.error("Error registering shader node:", error);
120
+ }
121
+ });
122
+ onCleanup(() => {
123
+ isRegistered = false;
124
+ parentRegister(instanceId, null, null, null, null);
125
+ });
126
+ createEffect(() => {
127
+ if (!isRegistered) return;
128
+ const uniforms = getUniformsMap();
129
+ if (!uniforms) return;
130
+ try {
131
+ const props_snapshot = effectiveProps();
132
+ Object.entries(uniforms).forEach(([propName, uniformData]) => {
133
+ if (!uniformData || typeof uniformData !== "object") return;
134
+ const {
135
+ uniform
136
+ } = uniformData;
137
+ if ((uniform == null ? void 0 : uniform.value) !== void 0 && propName in props_snapshot) {
138
+ const newValue = props_snapshot[propName];
139
+ parentUniformUpdate(instanceId, propName, newValue);
140
+ }
141
+ });
142
+ } catch (error) {
143
+ console.error("Error updating uniforms:", error);
144
+ }
145
+ });
146
+ createEffect(() => {
147
+ if (!isRegistered) return;
148
+ try {
149
+ const metadata = {
150
+ blendMode: props.blendMode || "normal",
151
+ opacity: props.opacity,
152
+ visible: props.visible === false ? false : true,
153
+ id: props.id,
154
+ mask: props.maskSource ? {
155
+ source: props.maskSource,
156
+ type: props.maskType || "alpha"
157
+ } : void 0,
158
+ maps: mapsFromProps(),
159
+ renderOrder: props.renderOrder ?? detectedRenderOrder,
160
+ transform: effectiveTransform()
161
+ };
162
+ parentMetadataUpdate(instanceId, metadata);
163
+ } catch (error) {
164
+ console.error("Error updating metadata:", error);
165
+ }
166
+ });
167
+ return createComponent(ShaderContext.Provider, {
168
+ get value() {
169
+ return childContextValue();
170
+ },
171
+ get children() {
172
+ var _el$ = _tmpl$();
173
+ var _ref$ = markerRef;
174
+ typeof _ref$ === "function" ? use(_ref$, _el$) : markerRef = _el$;
175
+ setAttribute(_el$, "data-shader-id", instanceId);
176
+ insert(_el$, () => local.children);
177
+ return _el$;
178
+ }
179
+ });
180
+ }
181
+ export {
182
+ ShaderComponent as default
183
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../src/engine/Preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,GAAG,EAAoC,MAAM,UAAU,CAAA;AAoSlH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,GAAG,CAAC,aAAa,GAAG,MAAM,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAID,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,eAmHlD"}
1
+ {"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../src/engine/Preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,GAAG,EAAoC,MAAM,UAAU,CAAA;AAsSlH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,GAAG,CAAC,aAAa,GAAG,MAAM,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAID,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,eAmHlD"}