shaders 3.2.474 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -142
- package/README.md +192 -19
- package/dist/cli.js +2 -2
- package/dist/core/{AngularBlur-g4-fDx1N.js → AngularBlur-BEBs-lRR.js} +2 -3
- package/dist/core/{Arc-B4VGPOtO.js → Arc-D-WnjM7T.js} +1 -3
- package/dist/core/{Ascii-DxiduEzP.js → Ascii-BGPIwMc3.js} +2 -5
- package/dist/core/{Aurora-FgWLcSkh.js → Aurora-DqJBPdMQ.js} +2 -11
- package/dist/core/{BarShift-BukEd3jr.js → BarShift-BcCOweUh.js} +2 -3
- package/dist/core/{BarnDoors-BC0LM0aD.js → BarnDoors-B9B-AmCV.js} +2 -3
- package/dist/core/{Beam-CxAXVlAf.js → Beam-QG_9OS8I.js} +2 -3
- package/dist/core/{Bend-BfVVIo2C.js → Bend-Cy9VAowL.js} +1 -2
- package/dist/core/{Blob-D_IbcUCc.js → Blob-C3txJeW0.js} +2 -10
- package/dist/core/{BlockDissolve-C9nsgIz9.js → BlockDissolve-C1SFUys7.js} +2 -3
- package/dist/core/{BlockNoise-BgwbD0rx.js → BlockNoise-Cm3y8hce.js} +2 -4
- package/dist/core/{BlueNoise-BdwOaq4G.js → BlueNoise-BCLObOMm.js} +2 -4
- package/dist/core/{Blur-ceuv7ZTm.js → Blur-Dg29SnXd.js} +1 -2
- package/dist/core/{Boids-DEHsYo46.js → Boids-rsGsPN5h.js} +2 -5
- package/dist/core/{BokehBlur-C8xJ0xA8.js → BokehBlur-rFSFEnb0.js} +3 -4
- package/dist/core/{BrickPattern-C-6QFzp6.js → BrickPattern-DqN6JKEN.js} +2 -3
- package/dist/core/{BrightnessContrast-CMUaNvo0.js → BrightnessContrast-J9fCSBiC.js} +1 -3
- package/dist/core/{BrushedMetal-CQsu_96R.js → BrushedMetal-74wSZKjG.js} +3 -8
- package/dist/core/{Bulge-CgO7_0fe.js → Bulge-BIk0oq8j.js} +1 -2
- package/dist/core/{CRTScreen-DNqe2klB.js → CRTScreen-hEH-JNRd.js} +2 -3
- package/dist/core/{CarbonFiber-D0vgwlrV.js → CarbonFiber-CZdUDvRU.js} +4 -8
- package/dist/core/{Chalkboard-CDUJz_Ae.js → Chalkboard-CClJHqvs.js} +2 -3
- package/dist/core/{ChannelBlur-Z8ZvN6W3.js → ChannelBlur-BEuEwQOC.js} +1 -2
- package/dist/core/{CheckerWipe-DXm9kDaS.js → CheckerWipe-KuAWj2qg.js} +2 -3
- package/dist/core/{Checkerboard-DZAABNKo.js → Checkerboard-Rq9ze1W3.js} +2 -3
- package/dist/core/{Chevron-Dn1iHSiS.js → Chevron-C1j6X2Ye.js} +2 -3
- package/dist/core/{ChromaFlow-lnaJ4o1Y.js → ChromaFlow-BgsCUYIl.js} +2 -5
- package/dist/core/{ChromaticAberration-CGOQe4Pp.js → ChromaticAberration-2_4tjQ0u.js} +2 -4
- package/dist/core/{Chrome-DPAmErfN.js → Chrome-Be3z6C5i.js} +5 -11
- package/dist/core/{Circle-DVPhvXdr.js → Circle-e_qQI3tU.js} +1 -3
- package/dist/core/{ColorWheel-DXkVOQl2.js → ColorWheel-s5ep1H7d.js} +2 -3
- package/dist/core/{CompressionArtifacts-CEw9gfTu.js → CompressionArtifacts-OE9U9Qrq.js} +1 -3
- package/dist/core/{ConcentricSpin-GtNEq1T1.js → ConcentricSpin-CLE_5yCJ.js} +1 -2
- package/dist/core/{ConicGradient-DYPNJAOg.js → ConicGradient-Cji2SgVO.js} +2 -4
- package/dist/core/{ContourLines-DEmEepvT.js → ContourLines-wpPK00cF.js} +2 -3
- package/dist/core/{CornerPin-CJJeGyVf.js → CornerPin-gYU0Uf2m.js} +2 -3
- package/dist/core/{Crescent-C7yy9-xf.js → Crescent-viNc7Unp.js} +1 -2
- package/dist/core/{Cross-DyYrdTVw.js → Cross-DyQSsw_k.js} +1 -2
- package/dist/core/{Crystal-DQJd5oAd.js → Crystal-Vjj8azWg.js} +4 -9
- package/dist/core/{CurlNoise-Bjc6hhjR.js → CurlNoise-C7PHjDht.js} +2 -4
- package/dist/core/{CursorRipples-C1PNyYcB.js → CursorRipples-BzPPNkA3.js} +3 -39
- package/dist/core/{CursorTrail-C6v97bId.js → CursorTrail-cBj0AuQA.js} +2 -4
- package/dist/core/{DataMosh-AX4kIi4R.js → DataMosh-5Yr9TyVx.js} +1 -3
- package/dist/core/{DiamondGradient-Bj6mUxOy.js → DiamondGradient-DZM7HwF5.js} +2 -4
- package/dist/core/{DiamondWipe-BNSkpUn9.js → DiamondWipe-CqeT7lCt.js} +2 -3
- package/dist/core/{DiffuseBlur-C7l-5Dw3.js → DiffuseBlur-Y5hSDTZF.js} +2 -3
- package/dist/core/{DisplacementMap-DGpLSlxs.js → DisplacementMap-FobRx5Ie.js} +2 -3
- package/dist/core/{Dither-C9KDpqgP.js → Dither-50rqHpt9.js} +2 -3
- package/dist/core/{DotGrid-CkAtf-j_.js → DotGrid-B6AGLUbR.js} +3 -4
- package/dist/core/{DropShadow-BxI_a7dC.js → DropShadow-CEPpgatB.js} +2 -3
- package/dist/core/{Duotone-CrJ0P0SL.js → Duotone-D76Kp7Pb.js} +2 -3
- package/dist/core/{Ellipse-C2Tie_19.js → Ellipse-BGod1LeG.js} +1 -2
- package/dist/core/{Emboss-BjOlYydL.js → Emboss-DMNFb_ww.js} +3 -6
- package/dist/core/{Engraving-RpxXPqQq.js → Engraving-Dj7bCATQ.js} +2 -3
- package/dist/core/{ErosionNoise-D0qefxhq.js → ErosionNoise-4O68wJQZ.js} +2 -4
- package/dist/core/{Exposure-B7W7AVbY.js → Exposure-h-vapOpj.js} +1 -3
- package/dist/core/{FallingLines-Cxhmtqf4.js → FallingLines-Dzop_89k.js} +2 -3
- package/dist/core/{FilmGrain-CghUJIeK.js → FilmGrain-Bs8PCfdf.js} +1 -3
- package/dist/core/{FilmStock-DmOaROtC.js → FilmStock-DBjVo6rL.js} +1 -4
- package/dist/core/{Flip-BuOdbWjK.js → Flip-CfrS4KfZ.js} +2 -3
- package/dist/core/{FloatingParticles-BfFlt06Y.js → FloatingParticles-D1R2tD2J.js} +2 -5
- package/dist/core/{FlowField-A2njOtGx.js → FlowField-Slirm5AI.js} +2 -3
- package/dist/core/{Flower-CwdJOVR1.js → Flower-Ddlut7QZ.js} +1 -2
- package/dist/core/{FlowingGradient-D3BG2FW9.js → FlowingGradient-CwIgTtbj.js} +2 -7
- package/dist/core/{FlutedGlass-BWlTrLF-.js → FlutedGlass-CMMy2GJ5.js} +2 -4
- package/dist/core/{Fog-CpmIyRtJ.js → Fog-DjjUkcTZ.js} +2 -4
- package/dist/core/{Form3D-D-eUD4_k.js → Form3D-DQDOHWpC.js} +2 -4
- package/dist/core/{FractalNoise-DsESU8cP.js → FractalNoise-BjI3IOIj.js} +2 -4
- package/dist/core/{Frost-B1s1W_Qm.js → Frost-CK12HnL1.js} +4 -9
- package/dist/core/{GaborNoise-D3U1iz9E.js → GaborNoise-DKEIvvRJ.js} +3 -5
- package/dist/core/{Glass-O5o5OxlN.js → Glass-CzcOVD5Y.js} +3 -8
- package/dist/core/{GlassTiles-BxdT6Ee8.js → GlassTiles-gjhc563g.js} +1 -2
- package/dist/core/{Glitch-DQeLaNdU.js → Glitch-C_XAWltC.js} +1 -2
- package/dist/core/{Glow-DksG7wdu.js → Glow-CrYCanBI.js} +1 -3
- package/dist/core/{Godrays-D2Pzd9K9.js → Godrays-BBTMOVLP.js} +2 -3
- package/dist/core/{Goo-BL_ifIPI.js → Goo-Brhjk8aS.js} +3 -8
- package/dist/core/{GradientMap-B-5yUYjX.js → GradientMap-C5325QWw.js} +2 -4
- package/dist/core/{Grayscale-g7jQsxgi.js → Grayscale-dPjs-wvf.js} +1 -2
- package/dist/core/{Grid-DAglpJFP.js → Grid-UjEd3O76.js} +3 -4
- package/dist/core/{GridDistortion-CNlIESbs.js → GridDistortion-vVgYya1U.js} +1 -5
- package/dist/core/{Group-CeOfFv2K.js → Group-KVdmAi5g.js} +1 -1
- package/dist/core/{HTMLInCanvas-BgwCnbYn.js → HTMLInCanvas-CKr2u76R.js} +1 -2
- package/dist/core/{Halftone-DCiP4EDq.js → Halftone-pRV3TRUW.js} +4 -5
- package/dist/core/{Heart-CQhtzwFu.js → Heart-CX7MvvHZ.js} +1 -2
- package/dist/core/{Heatmap-e-lF_uZu.js → Heatmap-Dn6qyd2e.js} +3 -8
- package/dist/core/{HexGrid-BY_BPH8J.js → HexGrid-BIfYhkfV.js} +3 -4
- package/dist/core/{Hologram-BA_LJPm0.js → Hologram-ou27baPQ.js} +4 -8
- package/dist/core/{Holographic-CX8OG-Wa.js → Holographic-CiHdBSMg.js} +3 -7
- package/dist/core/{HueShift-BnwOshrg.js → HueShift-CG7pcXfg.js} +1 -3
- package/dist/core/{ImageTexture-Cd6vH2Z0.js → ImageTexture-BiZuU58C.js} +1 -2
- package/dist/core/{InkFlow-B7F9i3Kd.js → InkFlow-D9_L7opB.js} +9 -12
- package/dist/core/{Invert-6Q5kX8vd.js → Invert-CHEaiQZO.js} +1 -2
- package/dist/core/{IrisWipe-Cl5yYdEi.js → IrisWipe-x22vOQHm.js} +2 -3
- package/dist/core/Irradiance-7yq2K87_.js +389 -0
- package/dist/core/{IsometricCubes-BhK9MhCy.js → IsometricCubes-CkPGWr7M.js} +2 -3
- package/dist/core/{Kaleidoscope-D4X5N_qk.js → Kaleidoscope-CEC5m1Ww.js} +1 -2
- package/dist/core/{KeyFrames-Dv1vFfMa.js → KeyFrames-BMGEZsAZ.js} +2 -3
- package/dist/core/{LensDistortion-BqVp5WBS.js → LensDistortion-DKo8PiO5.js} +2 -3
- package/dist/core/{LensFlare-z0k68uJ1.js → LensFlare-DMS-NUtK.js} +2 -3
- package/dist/core/LightEdge-DxmnCRls.js +315 -0
- package/dist/core/{LightLeak-BgFq4bLG.js → LightLeak-yoEsZtYg.js} +2 -4
- package/dist/core/{Line--Ur3CJp1.js → Line-D17XDUjO.js} +2 -3
- package/dist/core/{LinearBlur-BkHF6lVm.js → LinearBlur-CiyjPTUH.js} +2 -3
- package/dist/core/{LinearGradient-DIdq_fiw.js → LinearGradient-DfjKG70q.js} +2 -4
- package/dist/core/{LinearWipe-DuCB9oV_.js → LinearWipe-D9CtBg6S.js} +2 -3
- package/dist/core/{LiquidMetal-B2Cz80Ka.js → LiquidMetal-8EG6DwV6.js} +3 -8
- package/dist/core/{Liquify-CvPn1ze-.js → Liquify-BySXF1OB.js} +1 -4
- package/dist/core/{MagneticFilings-BOgYrPhz.js → MagneticFilings-DNESH3Zs.js} +2 -5
- package/dist/core/{Marble-c2QGDXxB.js → Marble-C9WvdxrP.js} +2 -7
- package/dist/core/{MeshGradient-DMsza5tg.js → MeshGradient-d9--RXOU.js} +2 -10
- package/dist/core/{Mirror-Ck8qk1Km.js → Mirror-1V2FF2kD.js} +1 -2
- package/dist/core/{MultiPointGradient-DwO6snxn.js → MultiPointGradient-cRA9ytgL.js} +2 -3
- package/dist/core/{Nebula-3a9pYBDC.js → Nebula-BRV-q74y.js} +7 -90
- package/dist/core/{Neon-Cf95sJ7W.js → Neon-4PemK9Rj.js} +3 -6
- package/dist/core/{NoiseDissolve-DgvzEFOD.js → NoiseDissolve-B7LgD46G.js} +2 -3
- package/dist/core/{ObjectTracker-IopW8Jvf.js → ObjectTracker-CdzDxhpy.js} +3 -4
- package/dist/core/{Obsidian-BL_0ordp.js → Obsidian-2J1eX9kT.js} +9 -15
- package/dist/core/{PagePeel-BeAr_n0U.js → PagePeel-D-ziraOm.js} +1 -2
- package/dist/core/{Paper-BDEsyIPI.js → Paper-BxzCLyzB.js} +1 -2
- package/dist/core/{Parallelogram-Duj-0MLr.js → Parallelogram-D4OflTwn.js} +1 -2
- package/dist/core/{ParticleField-gk7JuNx4.js → ParticleField-tWNicEDO.js} +1 -4
- package/dist/core/{ParticleFlow-BzWOl7Hm.js → ParticleFlow-BiEYFyWR.js} +2 -6
- package/dist/core/{Particles-DYAtR6jZ.js → Particles-B7W4yWgo.js} +3 -7
- package/dist/core/{PerlinNoise-BHQ318g4.js → PerlinNoise-C-irUxp9.js} +3 -5
- package/dist/core/{Perspective-xBfd9BSE.js → Perspective-DlnAW-pe.js} +2 -3
- package/dist/core/{PixelSort-Bx9sUnGm.js → PixelSort-BBOTYuOE.js} +1 -4
- package/dist/core/{PixelThrow-0nJiGsmZ.js → PixelThrow-DCJb9Lxd.js} +2 -4
- package/dist/core/{Pixelate-CvCzoA0h.js → Pixelate-CZdwB--K.js} +1 -2
- package/dist/core/{Plasma-Be1yxNcP.js → Plasma-CTOQJeqy.js} +2 -4
- package/dist/core/{Plastic-Bom1oFFR.js → Plastic-DvyH9x-4.js} +3 -8
- package/dist/core/{PolarCoordinates-BGwTZ6NO.js → PolarCoordinates-XhdDAOD0.js} +1 -2
- package/dist/core/{Polygon-Byw5C7Qy.js → Polygon-CLohB-Ly.js} +2 -4
- package/dist/core/{Posterize-BHOstvyj.js → Posterize-BAQfnvmK.js} +1 -2
- package/dist/core/{Prism-pNsLhW8w.js → Prism-DJVCVAXX.js} +4 -8
- package/dist/core/{ProgressiveBlur-CR1IbvKQ.js → ProgressiveBlur-Dirva1on.js} +2 -3
- package/dist/core/{RadialGradient-BFOrMAK1.js → RadialGradient-DuSKR8Ds.js} +2 -4
- package/dist/core/{RadialWipe-BYnlbrNm.js → RadialWipe-n8tON7x2.js} +2 -3
- package/dist/core/{RandomBars-B7erRRHx.js → RandomBars-BYouiIgQ.js} +2 -3
- package/dist/core/{ReactionDiffusion-BnY40jHs.js → ReactionDiffusion-CHDd3y2q.js} +2 -5
- package/dist/core/{RectangularCoordinates-D9-3PQAz.js → RectangularCoordinates-CYFfCawa.js} +1 -2
- package/dist/core/{ReflectivePlane-BI-LIR2c.js → ReflectivePlane-DFTl5U9q.js} +2 -3
- package/dist/core/Repeater-CnbzXuAe.js +473 -0
- package/dist/core/{Ring-CvvtJYAf.js → Ring-CGkHVSVd.js} +1 -2
- package/dist/core/{RippleWipe-kAzZWsjR.js → RippleWipe-DLjPzY6u.js} +2 -3
- package/dist/core/{Ripples-BFLep1r1.js → Ripples-C2tITU62.js} +2 -3
- package/dist/core/{RoundedRect-DirNijIY.js → RoundedRect-sfNTUaCY.js} +1 -2
- package/dist/core/{Saturation-CfkRhJpe.js → Saturation-BRkifYWj.js} +1 -3
- package/dist/core/{Scratches-Dchfw1_5.js → Scratches-D87O5C2K.js} +2 -4
- package/dist/core/{Sharpness-DZzAnlsl.js → Sharpness-BGv613Zw.js} +1 -3
- package/dist/core/Shatter-DuyCFU1f.js +328 -0
- package/dist/core/{SimplexNoise-CmV42gYT.js → SimplexNoise-CQJvmqd-.js} +2 -4
- package/dist/core/{SineWave-TqnpIKO4.js → SineWave-BfOgSGMP.js} +2 -3
- package/dist/core/{SliceWipe-Dz8vj6bi.js → SliceWipe-CD_D99sl.js} +1 -2
- package/dist/core/{Smoke-B1TnZnG6.js → Smoke-BDQYKRP1.js} +2 -4
- package/dist/core/{SmokeFill-C8gSZ22X.js → SmokeFill-CPnzQtQv.js} +3 -8
- package/dist/core/{SmokeFlow-dd5uLztm.js → SmokeFlow-BkPMjZq8.js} +2 -4
- package/dist/core/{Solarize-CIQa9pKw.js → Solarize-DSiS32QS.js} +1 -3
- package/dist/core/{SolidColor-DuoQVKGk.js → SolidColor-DEKpgy1c.js} +2 -3
- package/dist/core/Sparkle-BZur6gPW.js +178 -0
- package/dist/core/{Spherize-FWwWEUyE.js → Spherize-D9Yg4n6O.js} +2 -3
- package/dist/core/{Spiral-DI1eG0E3.js → Spiral-BCacfEpT.js} +2 -3
- package/dist/core/{Star-DT-hnlIJ.js → Star-Dnw1ihk7.js} +1 -2
- package/dist/core/{Stone-oW35zD22.js → Stone-Cje-_vAg.js} +1 -3
- package/dist/core/{Strands-asB3fUr9.js → Strands-CFRxS1G_.js} +2 -4
- package/dist/core/{Stretch-Cm_B4WGY.js → Stretch-DXVhfIqO.js} +1 -2
- package/dist/core/{Stripes-BnJiniJY.js → Stripes-CCADWwyq.js} +2 -3
- package/dist/core/{StudioBackground-DwSO5KNV.js → StudioBackground-BlzYNAsu.js} +2 -6
- package/dist/core/{SunBurst-BL-BryZO.js → SunBurst-CmWbI18r.js} +2 -3
- package/dist/core/{Surface3D-DSvh7Zof.js → Surface3D-Dmh98-0V.js} +2 -6
- package/dist/core/{Swirl-BVPy039a.js → Swirl-CzI1qSVc.js} +2 -4
- package/dist/core/{Teardrop-CR1UqYaF.js → Teardrop-D24uulL0.js} +1 -2
- package/dist/core/{Text-fP5temat.js → Text-CrZKvBw6.js} +2 -6
- package/dist/core/{ThinFilm-CTQeVw7E.js → ThinFilm-D7R2dt1O.js} +11 -14
- package/dist/core/{TiltShift-BvYpYELk.js → TiltShift-AMMDZBvf.js} +2 -3
- package/dist/core/{TimeTrail-DqdYuHn7.js → TimeTrail-BCYDP2ep.js} +4 -8
- package/dist/core/{Tint-BXJMHYvg.js → Tint-DHb5wBN5.js} +2 -3
- package/dist/core/{Trapezoid--AgyKOWQ.js → Trapezoid-CL5Fxvq7.js} +1 -2
- package/dist/core/{TriangularGrid-CmDApxz9.js → TriangularGrid-Bp-SJS-H.js} +2 -3
- package/dist/core/{Tritone-DCd_IRp7.js → Tritone-C0nx7OdC.js} +2 -3
- package/dist/core/{Truchet-g1_jcoZ4.js → Truchet-DCetyDaq.js} +2 -3
- package/dist/core/{Twirl-JY-PXDS2.js → Twirl-D_mv9KEi.js} +1 -2
- package/dist/core/{VHS-ZWR6D4Da.js → VHS-Cp9aDjti.js} +2 -3
- package/dist/core/{VenetianBlinds-B7laTyPO.js → VenetianBlinds-DUyvaT5w.js} +2 -3
- package/dist/core/{Vesica-BTNW2p5u.js → Vesica-BpzrTPTA.js} +1 -2
- package/dist/core/{Vibrance-DmhtRT2D.js → Vibrance-DW3J-pvW.js} +1 -3
- package/dist/core/{VideoTexture-DK3EaAHY.js → VideoTexture-zoKsSrex.js} +1 -2
- package/dist/core/{Vignette-hyFfUS20.js → Vignette-KKbP3qdZ.js} +2 -5
- package/dist/core/{Voronoi-DhexPwNM.js → Voronoi-Bp2-U6lm.js} +2 -5
- package/dist/core/Voxels-B3e3LHH5.js +469 -0
- package/dist/core/{Water-BsBnXYYB.js → Water-CoYwvqKx.js} +7 -12
- package/dist/core/{Watercolor-C1HipGGO.js → Watercolor-DUNjSIN1.js} +2 -4
- package/dist/core/{WaveDistortion-VXyHFcJ3.js → WaveDistortion-Dp8ws0z1.js} +1 -2
- package/dist/core/{Waveform-CSP_4nZF.js → Waveform-DDBLB6zu.js} +2 -9
- package/dist/core/{WaveletNoise-CQqAufyv.js → WaveletNoise-CpBkzfRT.js} +2 -4
- package/dist/core/{Weave-DwX8T4_Q.js → Weave-cWkvSEAy.js} +2 -3
- package/dist/core/{WebcamTexture-B4SLwIP1.js → WebcamTexture-D484SXSE.js} +1 -2
- package/dist/core/{Wool-qg-z_TFC.js → Wool-C9L7O9fD.js} +1 -3
- package/dist/core/{WorleyNoise-CjVw20Fl.js → WorleyNoise-B5j5lDQZ.js} +2 -3
- package/dist/core/{ZoomBlur-Lm_pVpMf.js → ZoomBlur-bPC1dBu2.js} +2 -3
- package/dist/core/customShaders.d.ts +71 -0
- package/dist/core/customShaders.d.ts.map +1 -0
- package/dist/core/docs-manifest.json +29177 -0
- package/dist/core/gpu/composer.d.ts +2 -0
- package/dist/core/gpu/composer.d.ts.map +1 -1
- package/dist/core/gpu/contract.d.ts +17 -2
- package/dist/core/gpu/contract.d.ts.map +1 -1
- package/dist/core/gpu/frame.d.ts +5 -2
- package/dist/core/gpu/frame.d.ts.map +1 -1
- package/dist/core/gpu/index.d.ts.map +1 -1
- package/dist/core/gpu/kit/aa.d.ts +1 -1
- package/dist/core/gpu/kit/agents.d.ts +1 -1
- package/dist/core/gpu/kit/blur.d.ts +4 -4
- package/dist/core/gpu/kit/cells.d.ts +3 -3
- package/dist/core/gpu/kit/cellular.d.ts +1 -1
- package/dist/core/gpu/kit/colorOps.d.ts +6 -6
- package/dist/core/gpu/kit/effects/glass.d.ts +2 -2
- package/dist/core/gpu/kit/effects/thinFilm.d.ts +4 -4
- package/dist/core/gpu/kit/fields.d.ts.map +1 -1
- package/dist/core/gpu/kit/host/pointer.d.ts +1 -1
- package/dist/core/gpu/kit/lensParts.d.ts +3 -3
- package/dist/core/gpu/kit/lightfields.d.ts +3 -3
- package/dist/core/gpu/kit/materialParts.d.ts +1 -1
- package/dist/core/gpu/kit/materialParts.d.ts.map +1 -1
- package/dist/core/gpu/kit/media.d.ts +1 -1
- package/dist/core/gpu/kit/media.d.ts.map +1 -1
- package/dist/core/gpu/kit/motionBlur.d.ts +2 -2
- package/dist/core/gpu/kit/noiseColor.d.ts +5 -5
- package/dist/core/gpu/kit/noiseColor.d.ts.map +1 -1
- package/dist/core/gpu/kit/noisePaints.d.ts +1 -1
- package/dist/core/gpu/kit/sdf.d.ts +2 -2
- package/dist/core/gpu/kit/stylizePaints.d.ts +1 -1
- package/dist/core/gpu/kit/stylizePaints.d.ts.map +1 -1
- package/dist/core/gpu/kit/tone.d.ts +1 -1
- package/dist/core/gpu/kit/waves.d.ts +6 -0
- package/dist/core/gpu/kit/waves.d.ts.map +1 -1
- package/dist/core/gpu/passManager.d.ts +1 -1
- package/dist/core/gpu/passManager.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/fluids.d.ts +7 -7
- package/dist/core/gpu/scaffolds/fluids.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/gridKernels.d.ts +8 -8
- package/dist/core/gpu/scaffolds/gridKernels.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/pointwiseFilter.d.ts +5 -5
- package/dist/core/gpu/scaffolds/pointwiseFilter.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/radiance.d.ts +5 -5
- package/dist/core/gpu/scaffolds/radiance.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/rttFilter.d.ts +2 -2
- package/dist/core/gpu/scaffolds/rttFilter.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/sdfShape.d.ts +2 -2
- package/dist/core/gpu/scaffolds/sdfShape.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/uvRemapShader.d.ts +4 -4
- package/dist/core/gpu/support.d.ts +12 -0
- package/dist/core/gpu/support.d.ts.map +1 -1
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +238 -255
- package/dist/core/llms.txt +1558 -0
- package/dist/core/{noiseColor-DuWjYRmO.js → noiseColor-D_bPhJ4m.js} +2 -2
- package/dist/core/presetRenderer.d.ts +4 -0
- package/dist/core/presetRenderer.d.ts.map +1 -1
- package/dist/core/registry.js +204 -248
- package/dist/core/shaderRegistry-BaozBFyh.js +445 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +4 -10
- package/dist/core/shaders/Arc/index.js +4 -6
- package/dist/core/shaders/Ascii/index.d.ts +1 -1
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +4 -11
- package/dist/core/shaders/Aurora/index.js +4 -21
- package/dist/core/shaders/BarShift/index.js +4 -8
- package/dist/core/shaders/BarnDoors/index.js +4 -7
- package/dist/core/shaders/Beam/index.js +4 -11
- package/dist/core/shaders/Bend/index.js +4 -8
- package/dist/core/shaders/Blob/index.js +4 -18
- package/dist/core/shaders/BlockDissolve/index.js +4 -7
- package/dist/core/shaders/BlockNoise/index.d.ts +1 -1
- package/dist/core/shaders/BlockNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/BlockNoise/index.js +5 -14
- package/dist/core/shaders/BlueNoise/index.d.ts +1 -1
- package/dist/core/shaders/BlueNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/BlueNoise/index.js +5 -14
- package/dist/core/shaders/Blur/index.d.ts +1 -1
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +4 -10
- package/dist/core/shaders/Boids/index.js +4 -9
- package/dist/core/shaders/BokehBlur/index.d.ts +1 -1
- package/dist/core/shaders/BokehBlur/index.js +4 -10
- package/dist/core/shaders/BrickPattern/index.d.ts +1 -1
- package/dist/core/shaders/BrickPattern/index.d.ts.map +1 -1
- package/dist/core/shaders/BrickPattern/index.js +4 -13
- package/dist/core/shaders/BrightnessContrast/index.js +4 -7
- package/dist/core/shaders/BrushedMetal/index.js +4 -11
- package/dist/core/shaders/Bulge/index.js +4 -8
- package/dist/core/shaders/CRTScreen/index.d.ts +2 -2
- package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +4 -10
- package/dist/core/shaders/CarbonFiber/index.d.ts +1 -1
- package/dist/core/shaders/CarbonFiber/index.js +4 -11
- package/dist/core/shaders/Chalkboard/index.d.ts +1 -1
- package/dist/core/shaders/Chalkboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Chalkboard/index.js +4 -9
- package/dist/core/shaders/ChannelBlur/index.d.ts +1 -1
- package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +4 -10
- package/dist/core/shaders/CheckerWipe/index.js +4 -7
- package/dist/core/shaders/Checkerboard/index.d.ts +1 -1
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +4 -13
- package/dist/core/shaders/Chevron/index.d.ts +1 -1
- package/dist/core/shaders/Chevron/index.d.ts.map +1 -1
- package/dist/core/shaders/Chevron/index.js +4 -13
- package/dist/core/shaders/ChromaFlow/index.js +4 -8
- package/dist/core/shaders/ChromaticAberration/index.js +4 -11
- package/dist/core/shaders/Chrome/index.d.ts +1 -1
- package/dist/core/shaders/Chrome/index.js +4 -10
- package/dist/core/shaders/Circle/index.js +4 -6
- package/dist/core/shaders/ColorWheel/index.js +4 -11
- package/dist/core/shaders/CompressionArtifacts/index.d.ts +2 -2
- package/dist/core/shaders/CompressionArtifacts/index.d.ts.map +1 -1
- package/dist/core/shaders/CompressionArtifacts/index.js +4 -7
- package/dist/core/shaders/ConcentricSpin/index.js +4 -8
- package/dist/core/shaders/ConicGradient/index.js +4 -11
- package/dist/core/shaders/ContourLines/index.js +4 -6
- package/dist/core/shaders/CornerPin/index.js +4 -8
- package/dist/core/shaders/Crescent/index.js +4 -5
- package/dist/core/shaders/Cross/index.js +4 -5
- package/dist/core/shaders/Crystal/index.js +4 -11
- package/dist/core/shaders/CurlNoise/index.d.ts +1 -1
- package/dist/core/shaders/CurlNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/CurlNoise/index.js +5 -14
- package/dist/core/shaders/CursorRipples/index.js +4 -7
- package/dist/core/shaders/CursorTrail/index.js +4 -7
- package/dist/core/shaders/DataMosh/index.js +4 -7
- package/dist/core/shaders/DiamondGradient/index.js +4 -11
- package/dist/core/shaders/DiamondWipe/index.js +4 -7
- package/dist/core/shaders/DiffuseBlur/index.d.ts +1 -1
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +4 -10
- package/dist/core/shaders/DisplacementMap/index.js +4 -8
- package/dist/core/shaders/Dither/index.d.ts +1 -1
- package/dist/core/shaders/Dither/index.d.ts.map +1 -1
- package/dist/core/shaders/Dither/index.js +4 -13
- package/dist/core/shaders/DotGrid/index.d.ts +2 -2
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +4 -13
- package/dist/core/shaders/DropShadow/index.d.ts +1 -1
- package/dist/core/shaders/DropShadow/index.d.ts.map +1 -1
- package/dist/core/shaders/DropShadow/index.js +4 -10
- package/dist/core/shaders/Duotone/index.js +4 -6
- package/dist/core/shaders/Ellipse/index.js +4 -5
- package/dist/core/shaders/Emboss/index.js +4 -9
- package/dist/core/shaders/Engraving/index.js +4 -9
- package/dist/core/shaders/ErosionNoise/index.d.ts +1 -1
- package/dist/core/shaders/ErosionNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/ErosionNoise/index.js +5 -14
- package/dist/core/shaders/Exposure/index.js +4 -7
- package/dist/core/shaders/FallingLines/index.d.ts +1 -1
- package/dist/core/shaders/FallingLines/index.d.ts.map +1 -1
- package/dist/core/shaders/FallingLines/index.js +4 -13
- package/dist/core/shaders/FilmGrain/index.js +4 -7
- package/dist/core/shaders/FilmStock/index.js +4 -13
- package/dist/core/shaders/Flip/index.js +4 -8
- package/dist/core/shaders/FloatingParticles/index.d.ts +2 -2
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +4 -9
- package/dist/core/shaders/FlowField/index.js +4 -8
- package/dist/core/shaders/Flower/index.js +4 -5
- package/dist/core/shaders/FlowingGradient/index.js +4 -15
- package/dist/core/shaders/FlutedGlass/index.js +4 -11
- package/dist/core/shaders/Fog/index.js +4 -7
- package/dist/core/shaders/Form3D/index.js +4 -7
- package/dist/core/shaders/FractalNoise/index.d.ts +1 -1
- package/dist/core/shaders/FractalNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/FractalNoise/index.js +4 -13
- package/dist/core/shaders/Frost/index.d.ts +1 -1
- package/dist/core/shaders/Frost/index.js +4 -11
- package/dist/core/shaders/GaborNoise/index.d.ts +2 -2
- package/dist/core/shaders/GaborNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/GaborNoise/index.js +5 -14
- package/dist/core/shaders/Glass/index.js +4 -11
- package/dist/core/shaders/GlassTiles/index.d.ts +1 -1
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +4 -8
- package/dist/core/shaders/Glitch/index.d.ts +1 -1
- package/dist/core/shaders/Glitch/index.d.ts.map +1 -1
- package/dist/core/shaders/Glitch/index.js +4 -10
- package/dist/core/shaders/Glow/index.d.ts +1 -1
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +4 -11
- package/dist/core/shaders/Godrays/index.js +4 -12
- package/dist/core/shaders/Goo/index.js +4 -11
- package/dist/core/shaders/GradientMap/index.js +4 -7
- package/dist/core/shaders/Grayscale/index.js +4 -6
- package/dist/core/shaders/Grid/index.d.ts +2 -2
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +4 -13
- package/dist/core/shaders/GridDistortion/index.js +4 -11
- package/dist/core/shaders/Group/index.js +4 -6
- package/dist/core/shaders/HTMLInCanvas/index.js +4 -7
- package/dist/core/shaders/Halftone/index.d.ts +3 -3
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +4 -13
- package/dist/core/shaders/Heart/index.js +4 -5
- package/dist/core/shaders/Heatmap/index.js +4 -11
- package/dist/core/shaders/HexGrid/index.d.ts +2 -2
- package/dist/core/shaders/HexGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/HexGrid/index.js +4 -13
- package/dist/core/shaders/Hologram/index.d.ts +1 -1
- package/dist/core/shaders/Hologram/index.js +4 -10
- package/dist/core/shaders/Holographic/index.js +4 -10
- package/dist/core/shaders/HueShift/index.js +4 -7
- package/dist/core/shaders/ImageTexture/index.js +4 -6
- package/dist/core/shaders/InkFlow/index.d.ts +7 -7
- package/dist/core/shaders/InkFlow/index.js +4 -8
- package/dist/core/shaders/Invert/index.js +4 -6
- package/dist/core/shaders/IrisWipe/index.js +4 -7
- package/dist/core/shaders/Irradiance/index.d.ts +1 -1
- package/dist/core/shaders/Irradiance/index.d.ts.map +1 -1
- package/dist/core/shaders/Irradiance/index.js +4 -13
- package/dist/core/shaders/IsometricCubes/index.d.ts +1 -1
- package/dist/core/shaders/IsometricCubes/index.d.ts.map +1 -1
- package/dist/core/shaders/IsometricCubes/index.js +4 -13
- package/dist/core/shaders/Kaleidoscope/index.js +4 -8
- package/dist/core/shaders/KeyFrames/index.js +4 -10
- package/dist/core/shaders/LensDistortion/index.js +4 -6
- package/dist/core/shaders/LensFlare/index.d.ts +1 -1
- package/dist/core/shaders/LensFlare/index.d.ts.map +1 -1
- package/dist/core/shaders/LensFlare/index.js +4 -12
- package/dist/core/shaders/LightEdge/index.js +4 -10
- package/dist/core/shaders/LightLeak/index.js +4 -12
- package/dist/core/shaders/Line/index.js +4 -10
- package/dist/core/shaders/LinearBlur/index.d.ts +1 -1
- package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearBlur/index.js +4 -10
- package/dist/core/shaders/LinearGradient/index.js +4 -11
- package/dist/core/shaders/LinearWipe/index.js +4 -7
- package/dist/core/shaders/LiquidMetal/index.js +4 -11
- package/dist/core/shaders/Liquify/index.js +4 -10
- package/dist/core/shaders/MagneticFilings/index.js +4 -9
- package/dist/core/shaders/Marble/index.d.ts +1 -1
- package/dist/core/shaders/Marble/index.d.ts.map +1 -1
- package/dist/core/shaders/Marble/index.js +4 -15
- package/dist/core/shaders/MeshGradient/index.js +4 -17
- package/dist/core/shaders/Mirror/index.js +4 -8
- package/dist/core/shaders/MultiPointGradient/index.js +4 -11
- package/dist/core/shaders/Nebula/index.d.ts +3 -3
- package/dist/core/shaders/Nebula/index.js +4 -13
- package/dist/core/shaders/Neon/index.js +4 -9
- package/dist/core/shaders/NoiseDissolve/index.js +4 -7
- package/dist/core/shaders/ObjectTracker/index.d.ts +1 -1
- package/dist/core/shaders/ObjectTracker/index.js +4 -10
- package/dist/core/shaders/Obsidian/index.d.ts +5 -5
- package/dist/core/shaders/Obsidian/index.js +4 -15
- package/dist/core/shaders/PagePeel/index.js +4 -10
- package/dist/core/shaders/Paper/index.d.ts +1 -1
- package/dist/core/shaders/Paper/index.d.ts.map +1 -1
- package/dist/core/shaders/Paper/index.js +4 -8
- package/dist/core/shaders/Parallelogram/index.js +4 -5
- package/dist/core/shaders/ParticleField/index.js +4 -9
- package/dist/core/shaders/ParticleFlow/index.js +4 -10
- package/dist/core/shaders/Particles/index.js +4 -9
- package/dist/core/shaders/PerlinNoise/index.d.ts +2 -2
- package/dist/core/shaders/PerlinNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/PerlinNoise/index.js +5 -14
- package/dist/core/shaders/Perspective/index.js +4 -8
- package/dist/core/shaders/PixelSort/index.js +4 -8
- package/dist/core/shaders/PixelThrow/index.js +4 -8
- package/dist/core/shaders/Pixelate/index.d.ts +1 -1
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +4 -10
- package/dist/core/shaders/Plasma/index.js +4 -11
- package/dist/core/shaders/Plastic/index.js +4 -11
- package/dist/core/shaders/PolarCoordinates/index.js +4 -8
- package/dist/core/shaders/Polygon/index.js +4 -6
- package/dist/core/shaders/Posterize/index.js +4 -6
- package/dist/core/shaders/Prism/index.d.ts +2 -2
- package/dist/core/shaders/Prism/index.js +4 -12
- package/dist/core/shaders/ProgressiveBlur/index.d.ts +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +4 -10
- package/dist/core/shaders/RadialGradient/index.js +4 -11
- package/dist/core/shaders/RadialWipe/index.js +4 -7
- package/dist/core/shaders/RandomBars/index.js +4 -7
- package/dist/core/shaders/ReactionDiffusion/index.js +4 -8
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
- package/dist/core/shaders/ReflectivePlane/index.js +4 -10
- package/dist/core/shaders/Repeater/index.js +4 -5
- package/dist/core/shaders/Ring/index.js +4 -5
- package/dist/core/shaders/RippleWipe/index.js +4 -7
- package/dist/core/shaders/Ripples/index.d.ts +1 -1
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +4 -13
- package/dist/core/shaders/RoundedRect/index.js +4 -5
- package/dist/core/shaders/Saturation/index.js +4 -7
- package/dist/core/shaders/Scratches/index.d.ts +1 -1
- package/dist/core/shaders/Scratches/index.d.ts.map +1 -1
- package/dist/core/shaders/Scratches/index.js +5 -14
- package/dist/core/shaders/Sharpness/index.d.ts +1 -1
- package/dist/core/shaders/Sharpness/index.d.ts.map +1 -1
- package/dist/core/shaders/Sharpness/index.js +4 -11
- package/dist/core/shaders/Shatter/index.js +4 -6
- package/dist/core/shaders/SimplexNoise/index.d.ts +1 -1
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +5 -14
- package/dist/core/shaders/SineWave/index.js +4 -10
- package/dist/core/shaders/SliceWipe/index.js +4 -8
- package/dist/core/shaders/Smoke/index.js +4 -7
- package/dist/core/shaders/SmokeFill/index.js +4 -10
- package/dist/core/shaders/SmokeFlow/index.js +4 -7
- package/dist/core/shaders/Solarize/index.js +4 -7
- package/dist/core/shaders/SolidColor/index.js +4 -11
- package/dist/core/shaders/Sparkle/index.d.ts +57 -0
- package/dist/core/shaders/Sparkle/index.d.ts.map +1 -0
- package/dist/core/shaders/Sparkle/index.js +5 -0
- package/dist/core/shaders/Spherize/index.d.ts +1 -1
- package/dist/core/shaders/Spherize/index.d.ts.map +1 -1
- package/dist/core/shaders/Spherize/index.js +4 -10
- package/dist/core/shaders/Spiral/index.js +4 -11
- package/dist/core/shaders/Star/index.js +4 -5
- package/dist/core/shaders/Stone/index.d.ts +1 -1
- package/dist/core/shaders/Stone/index.d.ts.map +1 -1
- package/dist/core/shaders/Stone/index.js +4 -14
- package/dist/core/shaders/Strands/index.d.ts +1 -1
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +4 -13
- package/dist/core/shaders/Stretch/index.js +4 -8
- package/dist/core/shaders/Stripes/index.d.ts +1 -1
- package/dist/core/shaders/Stripes/index.d.ts.map +1 -1
- package/dist/core/shaders/Stripes/index.js +4 -13
- package/dist/core/shaders/StudioBackground/index.js +4 -14
- package/dist/core/shaders/SunBurst/index.js +4 -12
- package/dist/core/shaders/Surface3D/index.js +4 -8
- package/dist/core/shaders/Swirl/index.js +4 -11
- package/dist/core/shaders/Teardrop/index.js +4 -5
- package/dist/core/shaders/Text/index.js +4 -12
- package/dist/core/shaders/ThinFilm/index.d.ts +8 -8
- package/dist/core/shaders/ThinFilm/index.js +4 -9
- package/dist/core/shaders/TiltShift/index.d.ts +1 -1
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +4 -10
- package/dist/core/shaders/TimeTrail/index.d.ts +2 -2
- package/dist/core/shaders/TimeTrail/index.js +4 -8
- package/dist/core/shaders/Tint/index.js +4 -6
- package/dist/core/shaders/Trapezoid/index.js +4 -5
- package/dist/core/shaders/TriangularGrid/index.d.ts +1 -1
- package/dist/core/shaders/TriangularGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/TriangularGrid/index.js +4 -13
- package/dist/core/shaders/Tritone/index.js +4 -6
- package/dist/core/shaders/Truchet/index.d.ts +1 -1
- package/dist/core/shaders/Truchet/index.d.ts.map +1 -1
- package/dist/core/shaders/Truchet/index.js +4 -13
- package/dist/core/shaders/Twirl/index.js +4 -8
- package/dist/core/shaders/VHS/index.d.ts +2 -2
- package/dist/core/shaders/VHS/index.d.ts.map +1 -1
- package/dist/core/shaders/VHS/index.js +4 -10
- package/dist/core/shaders/VenetianBlinds/index.js +4 -7
- package/dist/core/shaders/Vesica/index.js +4 -5
- package/dist/core/shaders/Vibrance/index.js +4 -7
- package/dist/core/shaders/VideoTexture/index.js +4 -6
- package/dist/core/shaders/Vignette/index.js +4 -8
- package/dist/core/shaders/Voronoi/index.d.ts +1 -1
- package/dist/core/shaders/Voronoi/index.d.ts.map +1 -1
- package/dist/core/shaders/Voronoi/index.js +4 -13
- package/dist/core/shaders/Voxels/index.d.ts +5 -5
- package/dist/core/shaders/Voxels/index.js +4 -14
- package/dist/core/shaders/Water/index.d.ts +3 -3
- package/dist/core/shaders/Water/index.js +4 -11
- package/dist/core/shaders/Watercolor/index.d.ts +1 -1
- package/dist/core/shaders/Watercolor/index.d.ts.map +1 -1
- package/dist/core/shaders/Watercolor/index.js +4 -10
- package/dist/core/shaders/WaveDistortion/index.js +4 -8
- package/dist/core/shaders/Waveform/index.js +4 -16
- package/dist/core/shaders/WaveletNoise/index.d.ts +1 -1
- package/dist/core/shaders/WaveletNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveletNoise/index.js +5 -14
- package/dist/core/shaders/Weave/index.d.ts +1 -1
- package/dist/core/shaders/Weave/index.d.ts.map +1 -1
- package/dist/core/shaders/Weave/index.js +4 -13
- package/dist/core/shaders/WebcamTexture/index.js +4 -6
- package/dist/core/shaders/Wool/index.d.ts +1 -1
- package/dist/core/shaders/Wool/index.d.ts.map +1 -1
- package/dist/core/shaders/Wool/index.js +4 -14
- package/dist/core/shaders/WorleyNoise/index.d.ts +1 -1
- package/dist/core/shaders/WorleyNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/WorleyNoise/index.js +4 -13
- package/dist/core/shaders/ZoomBlur/index.d.ts +1 -1
- package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +4 -10
- package/dist/core/std/effects/blurs.d.ts +656 -138
- package/dist/core/std/effects/blurs.d.ts.map +1 -1
- package/dist/core/std/effects/color.d.ts +209 -32
- package/dist/core/std/effects/color.d.ts.map +1 -1
- package/dist/core/std/effects/edgeGlow.d.ts +86 -17
- package/dist/core/std/effects/edgeGlow.d.ts.map +1 -1
- package/dist/core/std/effects/fracture.d.ts +72 -8
- package/dist/core/std/effects/fracture.d.ts.map +1 -1
- package/dist/core/std/effects/index.d.ts +15 -0
- package/dist/core/std/effects/index.d.ts.map +1 -0
- package/dist/core/std/effects/instances.d.ts +87 -8
- package/dist/core/std/effects/instances.d.ts.map +1 -1
- package/dist/core/std/effects/lens.d.ts +48 -12
- package/dist/core/std/effects/lens.d.ts.map +1 -1
- package/dist/core/std/effects/overlay.d.ts +63 -22
- package/dist/core/std/effects/overlay.d.ts.map +1 -1
- package/dist/core/std/effects/pointerFields.d.ts +45 -20
- package/dist/core/std/effects/pointerFields.d.ts.map +1 -1
- package/dist/core/std/effects/reveal.d.ts +118 -40
- package/dist/core/std/effects/reveal.d.ts.map +1 -1
- package/dist/core/std/effects/stylize.d.ts +139 -70
- package/dist/core/std/effects/stylize.d.ts.map +1 -1
- package/dist/core/std/filter.d.ts +72 -12
- package/dist/core/std/filter.d.ts.map +1 -1
- package/dist/core/std/frames.d.ts +91 -24
- package/dist/core/std/frames.d.ts.map +1 -1
- package/dist/core/std/index.d.ts +46 -8
- package/dist/core/std/index.d.ts.map +1 -1
- package/dist/core/std/index.js +4 -0
- package/dist/core/std/invoke.d.ts +107 -12
- package/dist/core/std/invoke.d.ts.map +1 -1
- package/dist/core/std/lists.d.ts +40 -10
- package/dist/core/std/lists.d.ts.map +1 -1
- package/dist/core/std/lower.d.ts +73 -1
- package/dist/core/std/lower.d.ts.map +1 -1
- package/dist/core/std/mask.d.ts +60 -17
- package/dist/core/std/mask.d.ts.map +1 -1
- package/dist/core/std/math.d.ts +484 -9
- package/dist/core/std/math.d.ts.map +1 -1
- package/dist/core/std/motion.d.ts +130 -10
- package/dist/core/std/motion.d.ts.map +1 -1
- package/dist/core/std/paint/compose.d.ts +57 -16
- package/dist/core/std/paint/compose.d.ts.map +1 -1
- package/dist/core/std/paint/fields.d.ts +378 -95
- package/dist/core/std/paint/fields.d.ts.map +1 -1
- package/dist/core/std/paint/figures.d.ts +32 -17
- package/dist/core/std/paint/figures.d.ts.map +1 -1
- package/dist/core/std/paint/gradients.d.ts +58 -25
- package/dist/core/std/paint/gradients.d.ts.map +1 -1
- package/dist/core/std/paint/light.d.ts +501 -77
- package/dist/core/std/paint/light.d.ts.map +1 -1
- package/dist/core/std/paint/materials.d.ts +678 -151
- package/dist/core/std/paint/materials.d.ts.map +1 -1
- package/dist/core/std/paint/media.d.ts +47 -32
- package/dist/core/std/paint/media.d.ts.map +1 -1
- package/dist/core/std/paint/noise.d.ts +436 -87
- package/dist/core/std/paint/noise.d.ts.map +1 -1
- package/dist/core/std/paint/patterns.d.ts +474 -92
- package/dist/core/std/paint/patterns.d.ts.map +1 -1
- package/dist/core/std/paint/radiance.d.ts +75 -29
- package/dist/core/std/paint/radiance.d.ts.map +1 -1
- package/dist/core/std/paint/volume.d.ts +68 -27
- package/dist/core/std/paint/volume.d.ts.map +1 -1
- package/dist/core/std/paint/voxels.d.ts +46 -26
- package/dist/core/std/paint/voxels.d.ts.map +1 -1
- package/dist/core/std/shape.d.ts +195 -1
- package/dist/core/std/shape.d.ts.map +1 -1
- package/dist/core/std/signal.d.ts +55 -15
- package/dist/core/std/signal.d.ts.map +1 -1
- package/dist/core/std/sim/agentForces.d.ts +441 -99
- package/dist/core/std/sim/agentForces.d.ts.map +1 -1
- package/dist/core/std/sim/agentFrame.d.ts +94 -20
- package/dist/core/std/sim/agentFrame.d.ts.map +1 -1
- package/dist/core/std/sim/agentRender.d.ts +187 -60
- package/dist/core/std/sim/agentRender.d.ts.map +1 -1
- package/dist/core/std/sim/agents.d.ts +99 -28
- package/dist/core/std/sim/agents.d.ts.map +1 -1
- package/dist/core/std/sim/feedback.d.ts +40 -19
- package/dist/core/std/sim/feedback.d.ts.map +1 -1
- package/dist/core/std/sim/fluids.d.ts +127 -63
- package/dist/core/std/sim/fluids.d.ts.map +1 -1
- package/dist/core/std/sim/grids.d.ts +200 -48
- package/dist/core/std/sim/grids.d.ts.map +1 -1
- package/dist/core/std/sim/index.d.ts +14 -0
- package/dist/core/std/sim/index.d.ts.map +1 -0
- package/dist/core/std/sim/shapeFields.d.ts +56 -0
- package/dist/core/std/sim/shapeFields.d.ts.map +1 -1
- package/dist/core/std/sim.d.ts +112 -10
- package/dist/core/std/sim.d.ts.map +1 -1
- package/dist/core/std/slots.d.ts +72 -6
- package/dist/core/std/slots.d.ts.map +1 -1
- package/dist/core/std/types.d.ts +97 -60
- package/dist/core/std/types.d.ts.map +1 -1
- package/dist/core/std/values.d.ts +33 -14
- package/dist/core/std/values.d.ts.map +1 -1
- package/dist/core/std/warps.d.ts +221 -76
- package/dist/core/std/warps.d.ts.map +1 -1
- package/dist/core/std/wgsl.d.ts +115 -0
- package/dist/core/std/wgsl.d.ts.map +1 -0
- package/dist/core/std-ClftfWpF.js +218889 -0
- package/dist/core/{support-GJphyuEe.js → support-D3W86vgR.js} +11 -1
- package/dist/core/telemetry/index.js +1 -1
- package/dist/core/utilities/colorStops.d.ts +2 -2
- package/dist/core/utilities/listProps.d.ts +2 -2
- package/dist/core/utilities/listProps.d.ts.map +1 -1
- package/dist/core/utilities/noiseColor.d.ts +3 -3
- package/dist/core/utilities/transformations/index.js +1 -1
- package/dist/js/bundle.js +182 -180
- package/dist/js/createShader.d.ts.map +1 -1
- package/dist/js/createShader.js +4 -3
- package/dist/js/types.d.ts +5 -0
- package/dist/js/types.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +35 -22
- package/dist/react/CustomShader.js +178 -0
- package/dist/react/Preview.js +1 -0
- package/dist/react/Shader.js +1 -1
- package/dist/react/Sparkle.js +226 -0
- package/dist/react/bundle.js +178 -176
- package/dist/react/components/Sparkle.d.ts +41 -0
- package/dist/react/components/Sparkle.d.ts.map +1 -0
- package/dist/react/engine/CustomShader.d.ts +37 -0
- package/dist/react/engine/CustomShader.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/index.d.ts +5 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -2
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +35 -22
- package/dist/registry.js +410 -158
- package/dist/solid/components/Sparkle.d.ts +38 -0
- package/dist/solid/components/Sparkle.d.ts.map +1 -0
- package/dist/solid/components/Sparkle.js +232 -0
- package/dist/solid/engine/CustomShader.d.ts +35 -0
- package/dist/solid/engine/CustomShader.d.ts.map +1 -0
- package/dist/solid/engine/CustomShader.js +160 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +319 -317
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/index.d.ts +5 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +95 -86
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +35 -22
- package/dist/svelte/components/Sparkle.svelte.d.ts +28 -0
- package/dist/svelte/engine/CustomShader.svelte.d.ts +40 -0
- package/dist/svelte/index.d.ts +4 -0
- package/dist/svelte/index.js +1237 -877
- package/dist/svelte/source/components/Sparkle.svelte +352 -0
- package/dist/svelte/source/engine/CustomShader.svelte +216 -0
- package/dist/svelte/source/engine/Preview.svelte +5 -3
- package/dist/svelte/source/index.js +4 -0
- package/dist/svelte/utils/generatePresetCode.js +35 -22
- package/dist/vue/CustomShader.js +3 -0
- package/dist/vue/CustomShader.vue_vue_type_script_setup_true_lang.js +173 -0
- package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/vue/Sparkle.js +3 -0
- package/dist/vue/Sparkle.vue_vue_type_script_setup_true_lang.js +233 -0
- package/dist/vue/components/Sparkle.vue.d.ts +63 -0
- package/dist/vue/components/Sparkle.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +4 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +4 -2
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +35 -22
- package/package.json +27 -2
- package/dist/core/Irradiance-B36wYze9.js +0 -4191
- package/dist/core/LightEdge-AFfkNhDP.js +0 -2339
- package/dist/core/Repeater-C5LILb_Y.js +0 -762
- package/dist/core/Shatter-Dz3sH2ON.js +0 -1479
- package/dist/core/Voxels-Ca-6rRrz.js +0 -8547
- package/dist/core/agents-CBSp2UK_.js +0 -15709
- package/dist/core/agents-DXoEcto0.js +0 -5357
- package/dist/core/blur-7yjVyMvI.js +0 -8015
- package/dist/core/blurs-d4B9aUyx.js +0 -1751
- package/dist/core/canvasRaster-DDBkrdY8.js +0 -80
- package/dist/core/color-Do6tU0ry.js +0 -3619
- package/dist/core/compose-Dkf3v-xS.js +0 -46
- package/dist/core/device-m0ud8-Fn.js +0 -10
- package/dist/core/feedback-Dro_hxd4.js +0 -46
- package/dist/core/fields-DgADOKsP.js +0 -475
- package/dist/core/figures-B3lUGP8u.js +0 -48
- package/dist/core/filter-BrhpSs3Z.js +0 -23
- package/dist/core/fluids-umEWgdvj.js +0 -226
- package/dist/core/fonts-BUXTd9qb.js +0 -59
- package/dist/core/frames-BLqt7oaW.js +0 -78
- package/dist/core/glass-ABppDbYG.js +0 -2532
- package/dist/core/gradientPaints-5HpJVNfb.js +0 -6564
- package/dist/core/gradients-CIxKrfME.js +0 -159
- package/dist/core/grids-Cv99xcJg.js +0 -151
- package/dist/core/lens-DJQNJKCW.js +0 -352
- package/dist/core/light-D3BIVkxy.js +0 -271
- package/dist/core/lightfields-DvrUaH_6.js +0 -2255
- package/dist/core/lower-Bd2jez_2.js +0 -49452
- package/dist/core/mask-CeSwL79Q.js +0 -28
- package/dist/core/materials-4Oqvm_9m.js +0 -2944
- package/dist/core/math-D864seEs.js +0 -56
- package/dist/core/media-DXUY3ltG.js +0 -832
- package/dist/core/mediaLifecycle-BTPb5i1-.js +0 -320
- package/dist/core/motionBlur-g_WSi2iq.js +0 -6766
- package/dist/core/noise-d7rmP9yc.js +0 -546
- package/dist/core/noisePaints-CfHcXL02.js +0 -3619
- package/dist/core/noiseStylize-CUrW_HiC.js +0 -65
- package/dist/core/overlay-D5w0585O.js +0 -4712
- package/dist/core/patterns-Bg8lSdqH.js +0 -9723
- package/dist/core/pointerFields-CRecZwuZ.js +0 -2339
- package/dist/core/porters-OTkIMOyl.js +0 -30201
- package/dist/core/reveal-CfaAg-rg.js +0 -1688
- package/dist/core/sdf3d-2AWC_wdn.js +0 -21082
- package/dist/core/shaderRegistry-BUvL8ZZS.js +0 -443
- package/dist/core/shape-CAkSlCi8.js +0 -20
- package/dist/core/shapePaints-Bg2UwCZo.js +0 -3354
- package/dist/core/signal-emJuvOI3.js +0 -34
- package/dist/core/slots-BqIef2iV.js +0 -32
- package/dist/core/stylize-DiuoSq16.js +0 -4541
- package/dist/core/tone-BKhfiOBn.js +0 -763
- package/dist/core/warpMaps-Y8xSo-QJ.js +0 -10773
- package/dist/core/warps-P5O3NWLe.js +0 -276
- /package/dist/core/{transformations-CzFmhZww.js → transformations-P50Uo_Ju.js} +0 -0
|
@@ -2,77 +2,95 @@ import { GpuComputeNode, GpuFragmentParams, KitTexture, Expr } from '../../gpu/c
|
|
|
2
2
|
import { DirectionFrame } from '../frames';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* Evaluates an expression only where a condition holds, and a cheap fallback everywhere else.
|
|
6
|
+
*
|
|
7
|
+
* Use it to skip a material's whole body for pixels outside the shape. Any value you build
|
|
8
|
+
* inside `inner` and also read after the guard must be listed in `deps`.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* return guarded(insideShape(field.sdf, field.pxH), vec4(rgb, silhouette(field, u.edgeSoftness)), vec4(0, 0, 0, 0), 'plastic')
|
|
13
|
+
* ```
|
|
14
|
+
* @tip Values first made inside the guard are not visible after it. Put shared locals in `deps`.
|
|
15
|
+
* @see insideShape, silhouette
|
|
12
16
|
*/
|
|
13
17
|
export declare function guarded(cond: Expr, inner: Expr, fallback: Expr, hint?: string, deps?: Expr[]): Expr;
|
|
14
18
|
export { reflect, refract, exp2 } from '../math';
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
19
|
+
/**
|
|
20
|
+
* True inside the shape and up to two pixels outside it.
|
|
21
|
+
*
|
|
22
|
+
* Pass the signed distance and pixel size from `surfaceField`. The two-pixel margin keeps the
|
|
23
|
+
* anti-aliased edge inside the shaded region. The usual condition for `guarded`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* guarded(insideShape(field.sdf, field.pxH), shaded, vec4(0, 0, 0, 0))
|
|
28
|
+
* ```
|
|
29
|
+
* @see guarded, silhouette
|
|
30
|
+
*/
|
|
17
31
|
export declare function insideShape(sdf: Expr, pxH: Expr): Expr;
|
|
18
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* What `shapedSurface` hands your `surface` function: the shape's distance field, sampled and
|
|
34
|
+
* ready to shade.
|
|
35
|
+
*
|
|
36
|
+
* Read the taps through `surfaceField` rather than directly. `volumetric` tells you at build
|
|
37
|
+
* time whether the shape is a 3D one (a sphere, a cube, an extruded SVG) or a flat one.
|
|
38
|
+
*/
|
|
19
39
|
export interface SurfaceFrame {
|
|
20
|
-
/** Placement
|
|
40
|
+
/** Placement coordinates: the shape's own 0–1 square after center, scale and rotation. Absent with `stencil: 'none'`. */
|
|
21
41
|
sdfUV?: Expr;
|
|
22
|
-
/**
|
|
42
|
+
/** The field at this pixel. `.x` is the signed distance (negative inside), `.y/.z` pattern coordinates, `.w` depth. */
|
|
23
43
|
surf0?: Expr;
|
|
24
|
-
/**
|
|
44
|
+
/** The field one step right and one step down, when the stencil took them. */
|
|
25
45
|
surfX?: Expr;
|
|
26
46
|
surfY?: Expr;
|
|
27
|
-
/**
|
|
47
|
+
/** The field one step left and one step up. Only with `stencil: {kind: 'central'}`. */
|
|
28
48
|
surfL?: Expr;
|
|
29
49
|
surfD?: Expr;
|
|
30
|
-
/**
|
|
50
|
+
/** Sample the field at any placement coordinate, at full quality. */
|
|
31
51
|
sampler: (uv: Expr) => Expr;
|
|
32
|
-
/**
|
|
52
|
+
/** Sample the field at any placement coordinate, cheaply. Use it for neighbour taps. */
|
|
33
53
|
gradSampler: (uv: Expr) => Expr;
|
|
34
|
-
/**
|
|
35
|
-
* (the voxel G-buffer's face/cell channels). Aliases `sampler` on the flat paths. */
|
|
54
|
+
/** Sample one texel without filtering, for discrete data packed into the field. */
|
|
36
55
|
texelSampler: (uv: Expr) => Expr;
|
|
37
|
-
/**
|
|
56
|
+
/** True when the shape is 3D or extruded. Known at build time, so you can branch in TypeScript. */
|
|
38
57
|
volumetric: boolean;
|
|
39
|
-
/** `volumetric` as
|
|
58
|
+
/** `volumetric` as a 0/1 number, for use inside an expression. */
|
|
40
59
|
volFlag: Expr;
|
|
41
|
-
/**
|
|
60
|
+
/** True when `.y/.z` already hold the field's gradients instead of pattern coordinates. Skip your own slope taps. */
|
|
42
61
|
bakedGradients: boolean;
|
|
43
|
-
/**
|
|
62
|
+
/** The layer inside, as a texture. Present with `child: 'required'`. */
|
|
44
63
|
childTexture?: KitTexture;
|
|
45
64
|
}
|
|
65
|
+
/** The options `shapedSurface` takes. Only `surface` is required. */
|
|
46
66
|
export interface ShapedSurfaceSpec {
|
|
47
|
-
/**
|
|
67
|
+
/** Bake surface coordinates for 3D shapes so a pattern sticks to them (default 'none'). 'raw' follows the surface without seams, 'triplanar' projects from three sides. */
|
|
48
68
|
pattern?: 'none' | 'raw' | 'triplanar';
|
|
49
|
-
/**
|
|
69
|
+
/** How thickness is measured through a 3D shape (default 'span'). 'firstLobe' measures the front wall only. */
|
|
50
70
|
chord?: 'span' | 'firstLobe';
|
|
51
|
-
/**
|
|
71
|
+
/** Quality of the neighbour taps (default 'fast'). 'same' uses the full-quality sampler for them too. */
|
|
52
72
|
gradSampler?: 'fast' | 'same';
|
|
53
|
-
/**
|
|
73
|
+
/** Let the field carry its own gradients in `.y/.z` (default 'none'). Check `frame.bakedGradients` before taking slopes. */
|
|
54
74
|
bakedGradients?: 'none' | 'volumetric' | 'all';
|
|
55
|
-
/**
|
|
75
|
+
/** Which taps to take for you (default a right-and-down pair, `eps` 0.01 in placement units). 'none' takes none, 'centre' this pixel only, 'central' adds left and up. */
|
|
56
76
|
stencil?: 'none' | 'centre' | {
|
|
57
77
|
kind: 'forward' | 'central';
|
|
58
78
|
eps: number;
|
|
59
79
|
};
|
|
60
80
|
/**
|
|
61
|
-
* Which sampler takes the
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* quality tap inside the branches that need one — the metals' bicubic-per-pixel is 16 texel
|
|
65
|
-
* loads at every canvas pixel on a 3D shape.
|
|
81
|
+
* Which sampler takes the centre tap (default 'quality'). 'fast' is cheaper on 3D shapes
|
|
82
|
+
* when the centre tap only gates coverage and the material takes its own quality tap
|
|
83
|
+
* where it needs one.
|
|
66
84
|
*/
|
|
67
85
|
centreTap?: 'quality' | 'fast';
|
|
68
|
-
/** Displace the
|
|
86
|
+
/** Displace the canvas uv before placement, to wobble or warp the whole shape. */
|
|
69
87
|
placeUV?: (params: GpuFragmentParams) => Expr;
|
|
70
|
-
/**
|
|
88
|
+
/** Require the layer inside and expose it as `frame.childTexture`. Without a child the effect draws nothing. */
|
|
71
89
|
child?: 'required';
|
|
72
|
-
/**
|
|
90
|
+
/** Your material: shade the frame and return the color at this pixel. */
|
|
73
91
|
surface: (frame: SurfaceFrame, params: GpuFragmentParams) => Expr;
|
|
74
92
|
}
|
|
75
|
-
/** The three
|
|
93
|
+
/** The three fields `shapedSurface` returns. Spread them into your definition. */
|
|
76
94
|
export interface ShapedSurfaceEffect {
|
|
77
95
|
extraFields: Record<string, {
|
|
78
96
|
schema: import('typegpu/data').AnyWgslData;
|
|
@@ -83,27 +101,75 @@ export interface ShapedSurfaceEffect {
|
|
|
83
101
|
fragment: (params: GpuFragmentParams) => Expr;
|
|
84
102
|
};
|
|
85
103
|
}
|
|
86
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Turns a shape prop into a surface your material shades.
|
|
106
|
+
*
|
|
107
|
+
* Spread the result into a definition that declares the `center`, `scale`, `rotation` and
|
|
108
|
+
* `shape` props (copy them from any shape effect). Your `surface` function receives a
|
|
109
|
+
* `SurfaceFrame` and returns the color at this pixel. Flat shapes, SVG shapes and 3D shapes
|
|
110
|
+
* all arrive through the same frame.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* ...shapedSurface({
|
|
115
|
+
* pattern: 'raw',
|
|
116
|
+
* surface: (frame, params) => {
|
|
117
|
+
* const u = params.uniforms
|
|
118
|
+
* const field = surfaceField(frame, params, {scale: u.scale})
|
|
119
|
+
* const n = geometricNormal(frame, field, {bevelWidth: u.bevelWidth, bevelShape: u.bevelShape})
|
|
120
|
+
* const key = keyLightAt(direction(u.lightAngle), -0.7)
|
|
121
|
+
* const rgb = mul(u.color.member('rgb'), lambert(n, key.member('L'), {wrap: 0.3}))
|
|
122
|
+
* return guarded(insideShape(field.sdf, field.pxH), vec4(rgb, silhouette(field, u.edgeSoftness)), vec4(0, 0, 0, 0))
|
|
123
|
+
* },
|
|
124
|
+
* }),
|
|
125
|
+
* ```
|
|
126
|
+
* @tip Start from `surfaceField`, end with `guarded` around `insideShape`. Everything between is the look.
|
|
127
|
+
* @see surfaceField, geometricNormal, silhouette, guarded
|
|
128
|
+
*/
|
|
87
129
|
export declare function shapedSurface(spec: ShapedSurfaceSpec): ShapedSurfaceEffect;
|
|
130
|
+
/** The field values a material reads, bound once: the taps, the signed distance and the pixel size. */
|
|
88
131
|
export interface SurfaceField {
|
|
89
|
-
/**
|
|
132
|
+
/** The field at this pixel, and one step right and one step down when the stencil took them. */
|
|
90
133
|
s0: Expr;
|
|
91
134
|
sX?: Expr;
|
|
92
135
|
sY?: Expr;
|
|
93
|
-
/** Signed distance
|
|
136
|
+
/** Signed distance to the shape's edge: negative inside, zero on the edge. */
|
|
94
137
|
sdf: Expr;
|
|
95
|
-
/** One pixel
|
|
138
|
+
/** One pixel, as a fraction of the canvas height. */
|
|
96
139
|
pxH: Expr;
|
|
97
|
-
/**
|
|
140
|
+
/** Canvas width divided by height. */
|
|
98
141
|
aspect: Expr;
|
|
99
142
|
}
|
|
100
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* The first line of a material: the field taps, the signed distance and the pixel size, bound once.
|
|
145
|
+
*
|
|
146
|
+
* Pass `scale` (the shape's scale prop) to divide the distance by it, as the library's metals
|
|
147
|
+
* and plastics do, so edge softness and pixel tests track the shape's size. Leave it out for
|
|
148
|
+
* `continuedField`.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* const field = surfaceField(frame, params, {scale: params.uniforms.scale})
|
|
153
|
+
* ```
|
|
154
|
+
* @see shapedSurface, geometricNormal, silhouette, insideShape
|
|
155
|
+
*/
|
|
101
156
|
export declare function surfaceField(frame: SurfaceFrame, params: GpuFragmentParams, opts?: {
|
|
102
157
|
scale?: Expr;
|
|
103
158
|
}): SurfaceField;
|
|
104
159
|
/**
|
|
105
|
-
* The
|
|
106
|
-
*
|
|
160
|
+
* The surface normal of the shape, whichever kind of shape is active.
|
|
161
|
+
*
|
|
162
|
+
* A 3D shape takes its normal from the marched depth. A flat shape takes a normal that tilts
|
|
163
|
+
* away from the face near the edge, over `bevelWidth` (in the units of `field.sdf`) with the
|
|
164
|
+
* profile `bevelShape` (0 round, 1 machined). `sharpness` clamps the 3D slope (default 5, lower
|
|
165
|
+
* is calmer). `eps` must match the stencil step (default 0.01). Needs a stencil with neighbour taps.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* const n = geometricNormal(frame, field, {bevelWidth: u.bevelWidth, bevelShape: u.bevelShape})
|
|
170
|
+
* ```
|
|
171
|
+
* @tip Add relief with `nudgeNormal` or `tiltNormal` after this, never before.
|
|
172
|
+
* @see marchedNormal, nudgeNormal, tiltNormal, fieldSlope
|
|
107
173
|
*/
|
|
108
174
|
export declare function geometricNormal(frame: SurfaceFrame, field: SurfaceField, opts: {
|
|
109
175
|
bevelWidth: Expr;
|
|
@@ -112,24 +178,92 @@ export declare function geometricNormal(frame: SurfaceFrame, field: SurfaceField
|
|
|
112
178
|
eps?: number;
|
|
113
179
|
hint?: string;
|
|
114
180
|
}): Expr;
|
|
115
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Coordinates for a pattern that sticks to the shape's surface.
|
|
183
|
+
*
|
|
184
|
+
* On a flat shape they are the placement coordinates centred on the shape (0,0 at its centre).
|
|
185
|
+
* On a 3D shape they follow the surface as it rotates, when the effect declares
|
|
186
|
+
* `pattern: 'raw'` or `'triplanar'`.
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* const pat = surfacePattern(frame, field)
|
|
191
|
+
* ```
|
|
192
|
+
* @see shapedSurface, rotationSensor, surfaceNoiseAt
|
|
193
|
+
*/
|
|
116
194
|
export declare function surfacePattern(frame: SurfaceFrame, field: SurfaceField, opts?: {
|
|
117
195
|
uv?: Expr;
|
|
118
196
|
}): Expr;
|
|
119
|
-
/**
|
|
197
|
+
/**
|
|
198
|
+
* The direction the shape's distance grows in: a 2D vector pointing outward at this pixel.
|
|
199
|
+
*
|
|
200
|
+
* Its length is about 1 on a flat shape. `eps` is the tap step (default 0.01) and must match
|
|
201
|
+
* the stencil step.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* const grad = fieldSlope(field)
|
|
206
|
+
* ```
|
|
207
|
+
* @see nearestEdge, geometricNormal, tiltAlong
|
|
208
|
+
*/
|
|
120
209
|
export declare function fieldSlope(field: SurfaceField, eps?: number): Expr;
|
|
121
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* The direction the viewer looks along at this pixel, for reflections that sweep across a face.
|
|
212
|
+
*
|
|
213
|
+
* A unit 3D vector pointing into the canvas. `fov` sets how much it leans off-axis toward
|
|
214
|
+
* the edges (0.6 is the usual value, 0.55 flatter).
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```ts
|
|
218
|
+
* const view = viewRay(params, field)
|
|
219
|
+
* ```
|
|
220
|
+
* @see grazingOf, reflect, studioSoftboxes
|
|
221
|
+
*/
|
|
122
222
|
export declare function viewRay(params: GpuFragmentParams, field: SurfaceField, fov?: number): Expr;
|
|
123
|
-
/**
|
|
223
|
+
/**
|
|
224
|
+
* How edge-on the surface is to the viewer: 0 face-on, 1 grazing.
|
|
225
|
+
*
|
|
226
|
+
* The input the fresnel words take when you have a view ray. Without one, use `grazingFlat`.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```ts
|
|
230
|
+
* const grazing = grazingOf(n, viewRay(params, field))
|
|
231
|
+
* ```
|
|
232
|
+
* @see grazingFlat, fresnelBoost, schlickFresnel
|
|
233
|
+
*/
|
|
124
234
|
export declare function grazingOf(n: Expr, view: Expr): Expr;
|
|
125
|
-
/**
|
|
235
|
+
/**
|
|
236
|
+
* Tilts a normal along and across a direction, for brushed or woven relief.
|
|
237
|
+
*
|
|
238
|
+
* `frame` is a `directionFrame` (from `frames`). `along` and `across` are slope amounts; a
|
|
239
|
+
* few tenths is a visible relief.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts
|
|
243
|
+
* const n = tiltNormal(nGeo, brush, {across: reliefAcross, along: reliefAlong})
|
|
244
|
+
* ```
|
|
245
|
+
* @see nudgeNormal, tiltAlong, grainNoise
|
|
246
|
+
*/
|
|
126
247
|
export declare function tiltNormal(n: Expr, frame: DirectionFrame, slopes: {
|
|
127
248
|
along?: Expr;
|
|
128
249
|
across?: Expr;
|
|
129
250
|
}, hint?: string): Expr;
|
|
130
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* The brightness of a five-light studio seen in a reflected direction.
|
|
253
|
+
*
|
|
254
|
+
* Pass the x and y of a reflected view ray. `rotation` is a `direction()` vector that turns
|
|
255
|
+
* the studio. `keyRadius` sizes the main light (0.16 crisp, 0.42 soft), `drift` slides it,
|
|
256
|
+
* `strength` scales the whole bank and `skyGain` the floor-to-sky gradient behind it (0.3–0.4).
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```ts
|
|
260
|
+
* const env = studioSoftboxes(R.member('x'), R.member('y'), {rotation: direction(u.envRotation), keyRadius: 0.3, drift: 0, strength: u.environment, skyGain: 0.38})
|
|
261
|
+
* ```
|
|
262
|
+
* @tip Smear it with `smearAlong` for a brushed look.
|
|
263
|
+
* @see smearAlong, reflect, viewRay
|
|
264
|
+
*/
|
|
131
265
|
export declare function studioSoftboxes(x: Expr, y: Expr, opts: {
|
|
132
|
-
/**
|
|
266
|
+
/** A `direction()` vector that rotates the studio. */
|
|
133
267
|
rotation: Expr;
|
|
134
268
|
keyRadius: Expr | number;
|
|
135
269
|
drift: Expr | number;
|
|
@@ -137,9 +271,17 @@ export declare function studioSoftboxes(x: Expr, y: Expr, opts: {
|
|
|
137
271
|
skyGain: number;
|
|
138
272
|
}): Expr;
|
|
139
273
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
274
|
+
* One octave of smooth signed noise along and across a direction, for grain.
|
|
275
|
+
*
|
|
276
|
+
* `coords` come from `directionFrame(...).coordsOf(p)`. `freq` sets the feature density per
|
|
277
|
+
* axis (a high across value gives fine streaks). Returns roughly −1 to 1. Sum octaves and
|
|
278
|
+
* apply gains at the call site.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```ts
|
|
282
|
+
* const sheen = grainNoise(brush.coordsOf(pat), {freq: [1.3, 6.5], drift: driftA})
|
|
283
|
+
* ```
|
|
284
|
+
* @see surfaceNoise, tiltNormal, smearAlong
|
|
143
285
|
*/
|
|
144
286
|
export declare function grainNoise(coords: {
|
|
145
287
|
along: Expr;
|
|
@@ -150,9 +292,16 @@ export declare function grainNoise(coords: {
|
|
|
150
292
|
drift?: Expr;
|
|
151
293
|
}): Expr;
|
|
152
294
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
295
|
+
* Blurs any 2D lookup along a direction, for streaked reflections and motion smear.
|
|
296
|
+
*
|
|
297
|
+
* Samples `taps` points (default 9) spread `spread` either side of `center` along the unit
|
|
298
|
+
* vector `axis`, weighted by a bell curve, and sums them. `sample` receives an x and a y.
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```ts
|
|
302
|
+
* const env = smearAlong({center: R, axis: brush.tangent, spread: 0.3}, (x, y) => studioSoftboxes(x, y, studio))
|
|
303
|
+
* ```
|
|
304
|
+
* @see studioSoftboxes, grainNoise
|
|
156
305
|
*/
|
|
157
306
|
export declare function smearAlong(opts: {
|
|
158
307
|
center: Expr;
|
|
@@ -162,22 +311,53 @@ export declare function smearAlong(opts: {
|
|
|
162
311
|
sigma?: number;
|
|
163
312
|
hint?: string;
|
|
164
313
|
}, sample: (x: Expr, y: Expr) => Expr): Expr;
|
|
165
|
-
/**
|
|
314
|
+
/**
|
|
315
|
+
* A 3D light direction from a `direction()` vector and an elevation.
|
|
316
|
+
*
|
|
317
|
+
* `z` is negative for a light on the viewer's side of the surface (−0.6 raking to −0.9
|
|
318
|
+
* frontal). Use it where a word wants a unit light vector. `keyLightAt` also gives the half
|
|
319
|
+
* vector for highlights.
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```ts
|
|
323
|
+
* const L = lightVec3(direction(u.lightAngle), -0.7)
|
|
324
|
+
* ```
|
|
325
|
+
* @see keyLightAt, anisoSpecular, lambert
|
|
326
|
+
*/
|
|
166
327
|
export declare function lightVec3(dir: Expr, z: number, hint?: string): Expr;
|
|
167
|
-
/**
|
|
328
|
+
/**
|
|
329
|
+
* Turns roughness and anisotropy sliders (0–1 each) into the two lobe widths `anisoSpecular` takes.
|
|
330
|
+
*
|
|
331
|
+
* Higher roughness widens the highlight. Higher anisotropy stretches it along the grain and
|
|
332
|
+
* squeezes it across.
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```ts
|
|
336
|
+
* alphas: wardAlphas(u.roughness, u.anisotropy)
|
|
337
|
+
* ```
|
|
338
|
+
* @see anisoSpecular
|
|
339
|
+
*/
|
|
168
340
|
export declare function wardAlphas(roughness: Expr, anisotropy: Expr): {
|
|
169
341
|
along: Expr;
|
|
170
342
|
across: Expr;
|
|
171
343
|
};
|
|
172
344
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
345
|
+
* A highlight stretched along a grain, as on brushed metal or carbon fibre.
|
|
346
|
+
*
|
|
347
|
+
* `tangent` is the 2D grain direction, `light` a unit 3D light vector, `view` the view ray
|
|
348
|
+
* and `alphas` the widths from `wardAlphas`. Pass `gain` or scale the result yourself.
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* ```ts
|
|
352
|
+
* const spec = anisoSpecular({normal: n, tangent: brush.tangent, light: lightVec3(direction(u.lightAngle), -0.7), view, alphas: wardAlphas(rough, aniso), gain: u.specular})
|
|
353
|
+
* ```
|
|
354
|
+
* @see wardAlphas, lightVec3, sharpGlint, dualLobeGlint
|
|
175
355
|
*/
|
|
176
356
|
export declare function anisoSpecular(opts: {
|
|
177
357
|
normal: Expr;
|
|
178
|
-
/** The
|
|
358
|
+
/** The 2D grain direction. */
|
|
179
359
|
tangent: Expr;
|
|
180
|
-
/**
|
|
360
|
+
/** A unit 3D light direction (see `lightVec3`). */
|
|
181
361
|
light: Expr;
|
|
182
362
|
view: Expr;
|
|
183
363
|
alphas: {
|
|
@@ -186,90 +366,349 @@ export declare function anisoSpecular(opts: {
|
|
|
186
366
|
};
|
|
187
367
|
gain?: Expr | number;
|
|
188
368
|
}): Expr;
|
|
189
|
-
/**
|
|
369
|
+
/**
|
|
370
|
+
* Tilts a normal along one 2D direction by a slope amount.
|
|
371
|
+
*
|
|
372
|
+
* `axis` is a unit 2D vector such as `direction()` or `fieldSlope`. A few tenths is a
|
|
373
|
+
* visible tilt.
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```ts
|
|
377
|
+
* const n = tiltAlong(nGeo, weaveDir, mul(crown, 0.3))
|
|
378
|
+
* ```
|
|
379
|
+
* @see tiltNormal, nudgeNormal
|
|
380
|
+
*/
|
|
190
381
|
export declare function tiltAlong(n: Expr, axis: Expr, amount: Expr, hint?: string): Expr;
|
|
191
|
-
/**
|
|
382
|
+
/**
|
|
383
|
+
* A multiplier that brightens grazing edges: 1 face-on, up to `1 + amount` at the rim.
|
|
384
|
+
*
|
|
385
|
+
* `grazing` comes from `grazingOf` or `grazingFlat`. `power` (default 3) sets how tightly
|
|
386
|
+
* the lift hugs the rim.
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* ```ts
|
|
390
|
+
* const lit = mul(env, fresnelBoost(grazingOf(n, view), {amount: 0.6}))
|
|
391
|
+
* ```
|
|
392
|
+
* @see schlickFresnel, grazingOf, grazingFlat
|
|
393
|
+
*/
|
|
192
394
|
export declare function fresnelBoost(grazing: Expr, opts: {
|
|
193
395
|
power?: number;
|
|
194
396
|
amount: Expr | number;
|
|
195
397
|
}): Expr;
|
|
196
|
-
/**
|
|
398
|
+
/**
|
|
399
|
+
* Maps a lighting value (0 dark, 1 light) onto two colors.
|
|
400
|
+
*
|
|
401
|
+
* Takes color props and returns rgb. The final tint of a material lit in grey.
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* ```ts
|
|
405
|
+
* const rgb = tintRamp(lit, u.darkColor, u.lightColor)
|
|
406
|
+
* ```
|
|
407
|
+
* @see neutralTone, cosineRainbow
|
|
408
|
+
*/
|
|
197
409
|
export declare function tintRamp(t: Expr, dark: Expr, light: Expr): Expr;
|
|
198
|
-
/**
|
|
410
|
+
/**
|
|
411
|
+
* The shape's coverage at this pixel: 1 inside, 0 outside, soft across the edge.
|
|
412
|
+
*
|
|
413
|
+
* `edgeSoftness` is the softness prop; at 0 the edge is still anti-aliased over 1.5 pixels.
|
|
414
|
+
* Use it as the alpha of the color you return.
|
|
415
|
+
*
|
|
416
|
+
* @example
|
|
417
|
+
* ```ts
|
|
418
|
+
* return guarded(insideShape(field.sdf, field.pxH), vec4(rgb, silhouette(field, u.edgeSoftness)), vec4(0, 0, 0, 0))
|
|
419
|
+
* ```
|
|
420
|
+
* @see insideShape, guarded
|
|
421
|
+
*/
|
|
199
422
|
export declare function silhouette(field: SurfaceField, edgeSoftness: Expr): Expr;
|
|
200
|
-
/**
|
|
423
|
+
/**
|
|
424
|
+
* Compresses bright color back into range without shifting its hue.
|
|
425
|
+
*
|
|
426
|
+
* The last step of a metal or glass look that adds reflection on top of a base color.
|
|
427
|
+
* `exposureTone` is the cousin for emitted light.
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* ```ts
|
|
431
|
+
* const rgb = neutralTone(mul(env, u.tint.member('rgb')))
|
|
432
|
+
* ```
|
|
433
|
+
* @see exposureTone
|
|
434
|
+
*/
|
|
201
435
|
export declare function neutralTone(rgb: Expr): Expr;
|
|
202
|
-
/**
|
|
436
|
+
/**
|
|
437
|
+
* Tilts a normal by a slope in x and y, turning a height field into relief.
|
|
438
|
+
*
|
|
439
|
+
* Feed it the `dx`/`dy` of `fdSlope` or `perlinSlope`, scaled by how strong you want the
|
|
440
|
+
* relief. Works on a flat `vec3(0, 0, -1)` normal as well as a shape's normal.
|
|
441
|
+
*
|
|
442
|
+
* @example
|
|
443
|
+
* ```ts
|
|
444
|
+
* const n = nudgeNormal(vec3(0, 0, -1), mul(relief.dx, 0.08), mul(relief.dy, 0.08))
|
|
445
|
+
* ```
|
|
446
|
+
* @see fdSlope, perlinSlope, tiltNormal, geometricNormal
|
|
447
|
+
*/
|
|
203
448
|
export declare function nudgeNormal(n: Expr, dx: Expr, dy: Expr, hint?: string): Expr;
|
|
204
|
-
/**
|
|
205
|
-
*
|
|
449
|
+
/**
|
|
450
|
+
* The surface normal of a 3D shape, from the marched depth.
|
|
451
|
+
*
|
|
452
|
+
* Only meaningful when `frame.volumetric` is true. `geometricNormal` chooses between this
|
|
453
|
+
* and the flat-shape normal for you. `sharpness` clamps the slope (default 5; 4 is calmer,
|
|
454
|
+
* 6 crisper).
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```ts
|
|
458
|
+
* const n = frame.volumetric ? marchedNormal(field, 4) : flatNormal
|
|
459
|
+
* ```
|
|
460
|
+
* @see geometricNormal
|
|
461
|
+
*/
|
|
206
462
|
export declare function marchedNormal(field: SurfaceField, sharpness?: number, hint?: string): Expr;
|
|
207
|
-
/**
|
|
208
|
-
*
|
|
463
|
+
/**
|
|
464
|
+
* A key light from an angle: the light direction `.L` and the half vector `.H` for highlights.
|
|
465
|
+
*
|
|
466
|
+
* `dir` is a `direction()` vector (from `frames`). `elevation` is how far the light sits
|
|
467
|
+
* toward the viewer: −0.6 raking, −0.9 frontal. Read `.L` with `member('L')` for `lambert`
|
|
468
|
+
* and `.H` for a glint.
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* ```ts
|
|
472
|
+
* const key = keyLightAt(direction(u.lightAngle), -0.7)
|
|
473
|
+
* ```
|
|
474
|
+
* @tip Elevation is negative in this engine. A positive value lights the surface from behind.
|
|
475
|
+
* @see keyLightXY, lightVec3, lambert, dualLobeGlint, sharpGlint
|
|
476
|
+
*/
|
|
209
477
|
export declare function keyLightAt(dir: Expr, elevation: number, hint?: string): Expr;
|
|
210
|
-
/**
|
|
478
|
+
/**
|
|
479
|
+
* A key light from explicit x and y components, for a second or a crossed light.
|
|
480
|
+
*
|
|
481
|
+
* Same result as `keyLightAt`: `.L` and `.H`.
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```ts
|
|
485
|
+
* const fill = keyLightXY(mul(ly, -1), lx, -0.4, 'fill')
|
|
486
|
+
* ```
|
|
487
|
+
* @see keyLightAt
|
|
488
|
+
*/
|
|
211
489
|
export declare function keyLightXY(x: Expr, y: Expr, elevation: number, hint?: string): Expr;
|
|
212
|
-
/**
|
|
490
|
+
/**
|
|
491
|
+
* How edge-on the surface is to a straight-on viewer: 0 face-on, 1 grazing.
|
|
492
|
+
*
|
|
493
|
+
* Use it when the material has no `viewRay`. The fresnel input for plastics, frost and water.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```ts
|
|
497
|
+
* const grazing = grazingFlat(n)
|
|
498
|
+
* ```
|
|
499
|
+
* @see grazingOf, schlickFresnel, fresnelBoost
|
|
500
|
+
*/
|
|
213
501
|
export declare function grazingFlat(n: Expr): Expr;
|
|
214
|
-
/**
|
|
502
|
+
/**
|
|
503
|
+
* A highlight whose tightness follows a sharpness slider.
|
|
504
|
+
*
|
|
505
|
+
* `ndh` is the dot of the normal and the key light's `.H`. `sharpness` runs 0–1 and slides
|
|
506
|
+
* the exponent from `cfg.x` to `cfg.y` and the gain from `cfg.z` to `cfg.w`. Pass `cfg` as
|
|
507
|
+
* `vec4(soft exponent, sharp exponent, soft gain, sharp gain)`.
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* ```ts
|
|
511
|
+
* const spec = sharpGlint(dot(n, key.member('H')), u.sharpness, vec4(60, 900, 0.4, 1.4))
|
|
512
|
+
* ```
|
|
513
|
+
* @see dualLobeGlint, anisoSpecular, keyLightAt
|
|
514
|
+
*/
|
|
215
515
|
export declare function sharpGlint(ndh: Expr, sharpness: Expr, cfg: Expr): Expr;
|
|
216
|
-
/**
|
|
516
|
+
/**
|
|
517
|
+
* The slope of smooth noise at a point, for wavy or molten relief.
|
|
518
|
+
*
|
|
519
|
+
* Returns a 2D slope scaled by `gain` and clamped to ±4, so relief never spikes into seams.
|
|
520
|
+
* Feed its x and y to `nudgeNormal`.
|
|
521
|
+
*
|
|
522
|
+
* @example
|
|
523
|
+
* ```ts
|
|
524
|
+
* const hg = perlinSlope(pat, 0.62)
|
|
525
|
+
* const n = nudgeNormal(nGeo, mul(hg.member('x'), -0.5), mul(hg.member('y'), -0.5))
|
|
526
|
+
* ```
|
|
527
|
+
* @see nudgeNormal, fdSlope, flowWarp
|
|
528
|
+
*/
|
|
217
529
|
export declare function perlinSlope(q: Expr, gain: Expr | number): Expr;
|
|
218
|
-
/**
|
|
530
|
+
/**
|
|
531
|
+
* How much material the view passes through at this pixel: 0 at the edge, up to about 1.2 deep inside.
|
|
532
|
+
*
|
|
533
|
+
* Multiply by a density prop and feed `beerLambert` for glass, ice and water.
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
* ```ts
|
|
537
|
+
* const thickness = mul(opticalThickness(field, frame), u.density)
|
|
538
|
+
* ```
|
|
539
|
+
* @see beerLambert
|
|
540
|
+
*/
|
|
219
541
|
export declare function opticalThickness(field: SurfaceField, frame: SurfaceFrame): Expr;
|
|
220
|
-
/**
|
|
542
|
+
/**
|
|
543
|
+
* How much light survives a thickness of tinted material, per channel.
|
|
544
|
+
*
|
|
545
|
+
* `absorb` is an rgb absorption; higher absorbs more. Returns rgb transmission 0–1.
|
|
546
|
+
* Multiply the color behind by it.
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* ```ts
|
|
550
|
+
* const transmit = beerLambert(mul(opticalThickness(field, frame), u.density), absorb)
|
|
551
|
+
* ```
|
|
552
|
+
* @see opticalThickness
|
|
553
|
+
*/
|
|
221
554
|
export declare function beerLambert(thickness: Expr, absorb: Expr): Expr;
|
|
222
|
-
/**
|
|
555
|
+
/**
|
|
556
|
+
* A slowly folding 2D offset to add to pattern coordinates, for molten or wind-blown motion.
|
|
557
|
+
*
|
|
558
|
+
* `warpInput` is the pattern coordinate scaled by about 0.6, `flowT` the layer's clock times a
|
|
559
|
+
* speed. Add the result to the coordinate before sampling noise.
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
* ```ts
|
|
563
|
+
* const q = add(pat, mul(flowWarp(mul(pat, 0.6), flowT), u.warp))
|
|
564
|
+
* ```
|
|
565
|
+
* @see surfaceNoiseAt, perlinSlope
|
|
566
|
+
*/
|
|
223
567
|
export declare function flowWarp(warpInput: Expr, flowT: Expr): Expr;
|
|
224
|
-
/**
|
|
568
|
+
/**
|
|
569
|
+
* Smooth signed noise at a 2D point, roughly −1 to 1, with features about one unit wide.
|
|
570
|
+
*
|
|
571
|
+
* The basis for grain, crumple and frost. Scale the inputs to set the feature size.
|
|
572
|
+
*
|
|
573
|
+
* @example
|
|
574
|
+
* ```ts
|
|
575
|
+
* const grain = surfaceNoise(mul(pat.member('x'), 140), mul(pat.member('y'), 140))
|
|
576
|
+
* ```
|
|
577
|
+
* @see surfaceNoiseAt, valueNoise, hashNoise, grainNoise
|
|
578
|
+
*/
|
|
225
579
|
export declare function surfaceNoise(x: Expr | number, y: Expr | number): Expr;
|
|
226
|
-
/**
|
|
580
|
+
/**
|
|
581
|
+
* `surfaceNoise` at a 2D point you already hold.
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ```ts
|
|
585
|
+
* const n = surfaceNoiseAt(mul(pat, 6))
|
|
586
|
+
* ```
|
|
587
|
+
* @see surfaceNoise, volumeNoiseAt, cellNoiseAt
|
|
588
|
+
*/
|
|
227
589
|
export declare function surfaceNoiseAt(p: Expr): Expr;
|
|
228
|
-
/**
|
|
229
|
-
*
|
|
230
|
-
*
|
|
590
|
+
/**
|
|
591
|
+
* Smooth signed noise at a 3D point, roughly −1 to 1.
|
|
592
|
+
*
|
|
593
|
+
* For anything sampled through a body rather than across its surface: gas, smoke,
|
|
594
|
+
* inclusions, density.
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
* ```ts
|
|
598
|
+
* const density = volumeNoiseAt(vec3(pos.member('x'), pos.member('y'), t))
|
|
599
|
+
* ```
|
|
600
|
+
* @see surfaceNoiseAt
|
|
601
|
+
*/
|
|
231
602
|
export declare function volumeNoiseAt(p: Expr): Expr;
|
|
232
|
-
/**
|
|
603
|
+
/**
|
|
604
|
+
* A smooth rainbow color from a value that wraps every 1.
|
|
605
|
+
*
|
|
606
|
+
* `phases` offset the red, green and blue cycles; `[0, 1/3, 2/3]` is the full spectrum. The
|
|
607
|
+
* color behind holographic foil and thin-film iridescence.
|
|
608
|
+
*
|
|
609
|
+
* @example
|
|
610
|
+
* ```ts
|
|
611
|
+
* const rgb = cosineRainbow(mul(grazing, 3), [0, 1 / 3, 2 / 3])
|
|
612
|
+
* ```
|
|
613
|
+
* @see tintRamp
|
|
614
|
+
*/
|
|
233
615
|
export declare function cosineRainbow(t: Expr, phases: [number, number, number]): Expr;
|
|
234
|
-
/**
|
|
616
|
+
/**
|
|
617
|
+
* Cellular noise at a 2D point: 0 at each cell's seed point, rising toward the cell walls.
|
|
618
|
+
*
|
|
619
|
+
* The value is a squared distance in cell units. Use it for facets and cracks, or as the
|
|
620
|
+
* field `fdSlope` differentiates for faceted relief.
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* ```ts
|
|
624
|
+
* const facet = fdSlope(cellNoiseAt, mul(pat, 6), 0.002)
|
|
625
|
+
* ```
|
|
626
|
+
* @see fdSlope, surfaceNoiseAt, pointStars
|
|
627
|
+
*/
|
|
235
628
|
export declare function cellNoiseAt(p: Expr): Expr;
|
|
236
629
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
630
|
+
* The value and slope of any field at a point: `value`, `dx` and `dy`.
|
|
631
|
+
*
|
|
632
|
+
* `sampleAt` is the field as a function of a 2D point, `eps` the tap distance in that point's
|
|
633
|
+
* units (a few thousandths in uv). The bridge from a height field to a normal: feed `dx` and
|
|
634
|
+
* `dy` to `nudgeNormal`.
|
|
635
|
+
*
|
|
636
|
+
* @example
|
|
637
|
+
* ```ts
|
|
638
|
+
* const relief = fdSlope((at) => heightField(params, at), uv, 0.0035)
|
|
639
|
+
* ```
|
|
640
|
+
* @tip Three taps of the field per pixel. Keep the field cheap or `share` it.
|
|
641
|
+
* @see nudgeNormal, perlinSlope, cellNoiseAt
|
|
239
642
|
*/
|
|
240
643
|
export declare function fdSlope(sampleAt: (p: Expr) => Expr, p: Expr, eps: number, hint?: string): {
|
|
241
644
|
value: Expr;
|
|
242
645
|
dx: Expr;
|
|
243
646
|
dy: Expr;
|
|
244
647
|
};
|
|
245
|
-
/**
|
|
648
|
+
/**
|
|
649
|
+
* Random 0–1 per point, with no smoothness between neighbours.
|
|
650
|
+
*
|
|
651
|
+
* For grain, flicker and per-pixel jitter. Feed it large coordinates so every pixel differs.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```ts
|
|
655
|
+
* const grain = hashNoise(mul(uv.member('x'), 991.3), mul(uv.member('y'), 787.7))
|
|
656
|
+
* ```
|
|
657
|
+
* @see interleavedNoise, valueNoise, sensorGrain
|
|
658
|
+
*/
|
|
246
659
|
export declare function hashNoise(x: Expr | number, y: Expr | number): Expr;
|
|
247
660
|
/**
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
661
|
+
* A 0–1 dither pattern over device pixels where neighbours differ as much as possible.
|
|
662
|
+
*
|
|
663
|
+
* Better than `hashNoise` for jittering sample positions, which would otherwise clump into
|
|
664
|
+
* visible grain. `pixel` is the pixel coordinate (uv times the viewport size). `clock`
|
|
665
|
+
* shifts the pattern each frame.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* ```ts
|
|
669
|
+
* const jitter = interleavedNoise(mul(uv, viewport), frame)
|
|
670
|
+
* ```
|
|
671
|
+
* @see hashNoise, sensorGrain
|
|
252
672
|
*/
|
|
253
673
|
export declare function interleavedNoise(pixel: Expr, clock?: Expr | number): Expr;
|
|
254
|
-
/**
|
|
674
|
+
/**
|
|
675
|
+
* Smooth noise 0–1 at a 2D point, softer and blockier than `surfaceNoise`.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* ```ts
|
|
679
|
+
* const wobble = sub(valueNoise(mul(x, 4), mul(y, 3)), 0.5)
|
|
680
|
+
* ```
|
|
681
|
+
* @see surfaceNoise, hashNoise
|
|
682
|
+
*/
|
|
255
683
|
export declare function valueNoise(x: Expr | number, y: Expr | number): Expr;
|
|
256
684
|
/**
|
|
257
|
-
* How
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
685
|
+
* How far a 3D shape has rotated, as a 2D pan you can move content by.
|
|
686
|
+
*
|
|
687
|
+
* Zero on flat shapes and on any shape at rest, growing as the shape turns. Constant across
|
|
688
|
+
* the frame, so it pans a star field or a backdrop without shearing it. Needs `pattern: 'raw'`.
|
|
689
|
+
*
|
|
690
|
+
* @example
|
|
691
|
+
* ```ts
|
|
692
|
+
* const pan = rotationSensor(frame)
|
|
693
|
+
* ```
|
|
694
|
+
* @see shellRefract, surfacePattern
|
|
262
695
|
*/
|
|
263
696
|
export declare function rotationSensor(frame: SurfaceFrame): {
|
|
264
697
|
x: Expr;
|
|
265
698
|
y: Expr;
|
|
266
699
|
};
|
|
267
700
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
701
|
+
* Coordinates for what sits inside a glass shell, bent where the shell curves.
|
|
702
|
+
*
|
|
703
|
+
* Returns `x` and `y` centred on the shape and displaced by the normal's tilt times
|
|
704
|
+
* `amount`, plus the unbent `centered` pair for anything fixed to the container. The bend is
|
|
705
|
+
* strongest at bevels and silhouettes, where real glass bends its interior.
|
|
706
|
+
*
|
|
707
|
+
* @example
|
|
708
|
+
* ```ts
|
|
709
|
+
* const interior = shellRefract(frame, n, u.bend)
|
|
710
|
+
* ```
|
|
711
|
+
* @see rotationSensor, refract
|
|
273
712
|
*/
|
|
274
713
|
export declare function shellRefract(frame: SurfaceFrame, n: Expr, amount: Expr): {
|
|
275
714
|
x: Expr;
|
|
@@ -279,41 +718,67 @@ export declare function shellRefract(frame: SurfaceFrame, n: Expr, amount: Expr)
|
|
|
279
718
|
y: Expr;
|
|
280
719
|
};
|
|
281
720
|
};
|
|
282
|
-
/**
|
|
283
|
-
*
|
|
284
|
-
*
|
|
721
|
+
/**
|
|
722
|
+
* How mirror-like a surface is at this pixel: `r0` face-on, rising to `r0 + gain` at the rim.
|
|
723
|
+
*
|
|
724
|
+
* `grazing` comes from `grazingOf` or `grazingFlat`. Glass is `{r0: 0.04, gain: 0.96}`. Lower
|
|
725
|
+
* the gain to keep the rim from turning into a full mirror over an interior.
|
|
726
|
+
*
|
|
727
|
+
* @example
|
|
728
|
+
* ```ts
|
|
729
|
+
* const fresnel = schlickFresnel(grazingOf(n, view), {gain: 0.6})
|
|
730
|
+
* ```
|
|
731
|
+
* @see fresnelBoost, grazingOf, reflect
|
|
732
|
+
*/
|
|
285
733
|
export declare function schlickFresnel(grazing: Expr, opts: {
|
|
286
734
|
r0?: number;
|
|
287
735
|
gain: Expr | number;
|
|
288
736
|
power?: number;
|
|
289
737
|
}): Expr;
|
|
290
|
-
/**
|
|
291
|
-
*
|
|
738
|
+
/**
|
|
739
|
+
* A brightness factor that shimmers over time, different for each element.
|
|
740
|
+
*
|
|
741
|
+
* Ranges from `1 − 2·amount` to 1. `phase` is a per-element value (a noise or a hash) that
|
|
742
|
+
* keeps the elements out of step; `rate` is how fast, `spread` how differently they flicker.
|
|
743
|
+
*
|
|
744
|
+
* @example
|
|
745
|
+
* ```ts
|
|
746
|
+
* shimmer: (v) => twinkle(t, v, {amount: 0.3, rate: 1.7, spread: 40})
|
|
747
|
+
* ```
|
|
748
|
+
* @see pointStars
|
|
749
|
+
*/
|
|
292
750
|
export declare function twinkle(t: Expr, phase: Expr, opts: {
|
|
293
751
|
amount: Expr;
|
|
294
752
|
rate: number;
|
|
295
753
|
spread: number;
|
|
296
754
|
}): Expr;
|
|
297
755
|
/**
|
|
298
|
-
* A plane of
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
756
|
+
* A plane of sparse glinting points: stars, glitter, dust.
|
|
757
|
+
*
|
|
758
|
+
* `p` is the plane coordinate; scale it to set density. Returns the glint intensity, the slow
|
|
759
|
+
* per-point `variation` field, and `rgb` when `tint` is given. Radii are in the cellular
|
|
760
|
+
* noise's squared-distance units, so they are small (0.004–0.02).
|
|
761
|
+
*
|
|
762
|
+
* @example
|
|
763
|
+
* ```ts
|
|
764
|
+
* const stars = pointStars(mul(pat, 40), {variationFreq: 0.13, radius: [0.004, 0.013], keep: [0.35, 0.75], brightness: [0.3, 1.2], gain: u.stars, tint: {from: [0.72, 0.82, 1], to: [1, 0.92, 0.82], gain: 1.6}})
|
|
765
|
+
* ```
|
|
766
|
+
* @see twinkle, cellNoiseAt
|
|
302
767
|
*/
|
|
303
768
|
export declare function pointStars(p: Expr, opts: {
|
|
304
|
-
/** Frequency of the per-point variation field relative to `p` (slow
|
|
769
|
+
/** Frequency of the per-point variation field relative to `p` (slow, about 0.1). */
|
|
305
770
|
variationFreq: number;
|
|
306
|
-
/** Point radius
|
|
771
|
+
/** Point radius as `[base, jitter]`: base plus variation times jitter. */
|
|
307
772
|
radius: [number, number];
|
|
308
|
-
/**
|
|
773
|
+
/** The band of the variation field that keeps a point at all. Narrower is sparser. */
|
|
309
774
|
keep: [number, number];
|
|
310
|
-
/** Brightness
|
|
775
|
+
/** Brightness as `[base, gain]`: base plus variation squared times gain. */
|
|
311
776
|
brightness: [number, number];
|
|
312
|
-
/**
|
|
777
|
+
/** A per-point shimmer factor built from the variation field (see `twinkle`). */
|
|
313
778
|
shimmer?: (variation: Expr) => Expr;
|
|
314
779
|
/** Overall gain. */
|
|
315
780
|
gain: Expr;
|
|
316
|
-
/**
|
|
781
|
+
/** Color the glints: variation mixes `from` to `to`, scaled by the glint times `gain`. */
|
|
317
782
|
tint?: {
|
|
318
783
|
from: [number, number, number];
|
|
319
784
|
to: [number, number, number];
|
|
@@ -326,21 +791,31 @@ export declare function pointStars(p: Expr, opts: {
|
|
|
326
791
|
rgb?: Expr;
|
|
327
792
|
};
|
|
328
793
|
/**
|
|
329
|
-
* A
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
794
|
+
* A position prop in the shape's own coordinates, so you can compare it with the field.
|
|
795
|
+
*
|
|
796
|
+
* Takes a `transformPosition` prop and applies the same center, scale and rotation the shape
|
|
797
|
+
* has. Distances from it are in placement units, not canvas units.
|
|
798
|
+
*
|
|
799
|
+
* @example
|
|
800
|
+
* ```ts
|
|
801
|
+
* const lightUV = placementPoint(params, params.uniforms.lightPosition)
|
|
802
|
+
* ```
|
|
803
|
+
* @see pointLightFrom, nearestEdge
|
|
333
804
|
*/
|
|
334
805
|
export declare function placementPoint(params: GpuFragmentParams, position: Expr, hint?: string): Expr;
|
|
335
806
|
/**
|
|
336
|
-
* The field
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
807
|
+
* The distance field extended past the edge of an SVG shape's texture.
|
|
808
|
+
*
|
|
809
|
+
* An SVG field stops at its 0–1 square, so a far-reaching glow or shadow would see a plateau
|
|
810
|
+
* beyond it. Returns the extended distance here, an `outward` push to add to any slope taken
|
|
811
|
+
* near the border, and `at(uv)` for the distance anywhere. Pass an unscaled `surfaceField`.
|
|
812
|
+
* Flat and 3D shapes pass through unchanged.
|
|
813
|
+
*
|
|
814
|
+
* @example
|
|
815
|
+
* ```ts
|
|
816
|
+
* const far = continuedField(frame, field, params)
|
|
817
|
+
* ```
|
|
818
|
+
* @see nearestEdge, fieldSlope
|
|
344
819
|
*/
|
|
345
820
|
export declare function continuedField(frame: SurfaceFrame, field: SurfaceField, params: GpuFragmentParams): {
|
|
346
821
|
sdf: Expr;
|
|
@@ -348,18 +823,32 @@ export declare function continuedField(frame: SurfaceFrame, field: SurfaceField,
|
|
|
348
823
|
at: (uv: Expr) => Expr;
|
|
349
824
|
};
|
|
350
825
|
/**
|
|
351
|
-
* The
|
|
352
|
-
*
|
|
353
|
-
*
|
|
826
|
+
* The closest point on the shape's edge to this pixel, and the outward normal there.
|
|
827
|
+
*
|
|
828
|
+
* Where a rim glow or contact shadow comes from for pixels outside the shape. `slope` is
|
|
829
|
+
* `fieldSlope`; its length is guarded.
|
|
830
|
+
*
|
|
831
|
+
* @example
|
|
832
|
+
* ```ts
|
|
833
|
+
* const edge = nearestEdge(frame.sdfUV!, field.sdf, fieldSlope(field))
|
|
834
|
+
* ```
|
|
835
|
+
* @see fieldSlope, pointLightFrom, continuedField
|
|
354
836
|
*/
|
|
355
837
|
export declare function nearestEdge(sdfUV: Expr, sdf: Expr, slope: Expr, hint?: string): {
|
|
356
838
|
point: Expr;
|
|
357
839
|
normal: Expr;
|
|
358
840
|
};
|
|
359
841
|
/**
|
|
360
|
-
* A point light
|
|
361
|
-
*
|
|
362
|
-
*
|
|
842
|
+
* A point light as seen from a point on the shape: the 3D light vector `L`, the 2D direction `toLight` and the `distance`.
|
|
843
|
+
*
|
|
844
|
+
* `position` is in placement coordinates (see `placementPoint`). `height` lifts the light
|
|
845
|
+
* toward the viewer, in the same units. Feed `L` to `lambert` and `distance` to `inverseSquare`.
|
|
846
|
+
*
|
|
847
|
+
* @example
|
|
848
|
+
* ```ts
|
|
849
|
+
* const onBody = pointLightFrom({position: lightUV, height: u.lightHeight}, frame.sdfUV!)
|
|
850
|
+
* ```
|
|
851
|
+
* @see placementPoint, lambert, inverseSquare, keyLightAt
|
|
363
852
|
*/
|
|
364
853
|
export declare function pointLightFrom(light: {
|
|
365
854
|
position: Expr;
|
|
@@ -370,23 +859,54 @@ export declare function pointLightFrom(light: {
|
|
|
370
859
|
distance: Expr;
|
|
371
860
|
};
|
|
372
861
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
862
|
+
* How much a light falls on a surface: 0 facing away, 1 facing it.
|
|
863
|
+
*
|
|
864
|
+
* `normal` and `light` are unit vectors, both 2D or both 3D. `wrap` lets light reach around
|
|
865
|
+
* the shape: 0 is a hard terminator, 1 lights it all the way round.
|
|
866
|
+
*
|
|
867
|
+
* @example
|
|
868
|
+
* ```ts
|
|
869
|
+
* const diffuse = lambert(n, key.member('L'), {wrap: 0.3})
|
|
870
|
+
* ```
|
|
871
|
+
* @see keyLightAt, pointLightFrom, dualLobeGlint
|
|
375
872
|
*/
|
|
376
873
|
export declare function lambert(normal: Expr, light: Expr, opts?: {
|
|
377
874
|
wrap?: Expr | number;
|
|
378
875
|
}): Expr;
|
|
379
|
-
/**
|
|
876
|
+
/**
|
|
877
|
+
* How a point light fades with distance: 1 at the source, half at `range`.
|
|
878
|
+
*
|
|
879
|
+
* @example
|
|
880
|
+
* ```ts
|
|
881
|
+
* const lit = mul(lambert(n, onBody.L), inverseSquare(onBody.distance, u.lightRange))
|
|
882
|
+
* ```
|
|
883
|
+
* @see pointLightFrom, lambert
|
|
884
|
+
*/
|
|
380
885
|
export declare function inverseSquare(distance: Expr, range: Expr | number): Expr;
|
|
381
886
|
/**
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
887
|
+
* Turns light that piles past 1 into a soft burn toward white, like film.
|
|
888
|
+
*
|
|
889
|
+
* Apply it to summed emitted light before output. `neutralTone` is the cousin for a lit,
|
|
890
|
+
* tinted surface.
|
|
891
|
+
*
|
|
892
|
+
* @example
|
|
893
|
+
* ```ts
|
|
894
|
+
* const glow = exposureTone(add(irradiance, emitter))
|
|
895
|
+
* ```
|
|
896
|
+
* @see neutralTone, sensorGrain
|
|
385
897
|
*/
|
|
386
898
|
export declare function exposureTone(rgb: Expr): Expr;
|
|
387
899
|
/**
|
|
388
|
-
*
|
|
389
|
-
*
|
|
900
|
+
* Adds a fine per-pixel brightness jitter, so rendered light reads as photographed.
|
|
901
|
+
*
|
|
902
|
+
* Each pixel is scaled by up to half of `amount` either way. `pixel` is the pixel coordinate
|
|
903
|
+
* (uv times the viewport size); `clock` re-rolls the grain each frame.
|
|
904
|
+
*
|
|
905
|
+
* @example
|
|
906
|
+
* ```ts
|
|
907
|
+
* const rgb = sensorGrain(glow, {amount: 0.08, pixel: mul(uv, viewport), clock: t})
|
|
908
|
+
* ```
|
|
909
|
+
* @see hashNoise, interleavedNoise, exposureTone
|
|
390
910
|
*/
|
|
391
911
|
export declare function sensorGrain(rgb: Expr, opts: {
|
|
392
912
|
amount: Expr | number;
|
|
@@ -394,14 +914,21 @@ export declare function sensorGrain(rgb: Expr, opts: {
|
|
|
394
914
|
clock: Expr | number;
|
|
395
915
|
}): Expr;
|
|
396
916
|
/**
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
917
|
+
* A highlight with a tight hot core and a wide dim halo.
|
|
918
|
+
*
|
|
919
|
+
* `ndh` is the dot of the normal and the key light's `.H`. `core` and `halo` are
|
|
920
|
+
* `[exponent, gain]` pairs. `softness` (0–1, 0.5 neutral) widens or tightens both lobes.
|
|
921
|
+
*
|
|
922
|
+
* @example
|
|
923
|
+
* ```ts
|
|
924
|
+
* const spec = dualLobeGlint(dot(n, key.member('H')), {core: [140, 1.3], halo: [22, 0.14], softness: u.highlightSoftness, gain: u.highlight})
|
|
925
|
+
* ```
|
|
926
|
+
* @see sharpGlint, keyLightAt, lambert
|
|
400
927
|
*/
|
|
401
928
|
export declare function dualLobeGlint(ndh: Expr, opts: {
|
|
402
|
-
/** [exponent, gain] of the hot core lobe. */
|
|
929
|
+
/** `[exponent, gain]` of the hot core lobe. */
|
|
403
930
|
core: [number, number];
|
|
404
|
-
/** [exponent, gain] of the wide halo lobe. */
|
|
931
|
+
/** `[exponent, gain]` of the wide halo lobe. */
|
|
405
932
|
halo: [number, number];
|
|
406
933
|
softness?: Expr;
|
|
407
934
|
gain: Expr;
|