shaders 3.0.449 → 3.0.451

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/core/{AngularBlur-DU1WmNHt.js → AngularBlur-4jt7bNoF.js} +1 -1
  3. package/dist/core/{Arc-C8QmYsiZ.js → Arc-DXIfbBgd.js} +2 -2
  4. package/dist/core/{Ascii-BaQ6MZTc.js → Ascii-GDof03Ca.js} +1 -1
  5. package/dist/core/{Aurora-B6lOg6M4.js → Aurora-CS4vewUW.js} +3 -3
  6. package/dist/core/{BarShift-CFK-CzF9.js → BarShift-BtnYLQ0B.js} +2 -2
  7. package/dist/core/{BarnDoors-DWs_0xtH.js → BarnDoors-Dw9K-amf.js} +1 -1
  8. package/dist/core/{Beam-Cgc4EYnj.js → Beam-D_cyaMjJ.js} +1 -1
  9. package/dist/core/{Bend-oof5pE1H.js → Bend-CSs5UIh8.js} +1 -1
  10. package/dist/core/{Blob-cfvDCv0i.js → Blob-h25zA5WH.js} +2 -2
  11. package/dist/core/{BlockDissolve-C7yJzYGZ.js → BlockDissolve-CKN_KvLP.js} +2 -2
  12. package/dist/core/{BlockNoise-DaM9YDAH.js → BlockNoise-DhKyd_F7.js} +5 -5
  13. package/dist/core/{BlueNoise-BMMRTsMw.js → BlueNoise-Auhzq4x5.js} +4 -4
  14. package/dist/core/{Blur-Be7sX4v9.js → Blur-CcxMqYsu.js} +3 -3
  15. package/dist/core/{Boids-C9S69THK.js → Boids-D51U46GF.js} +783 -656
  16. package/dist/core/{BokehBlur-DSkKZ_yy.js → BokehBlur-Cfaqbh3I.js} +3 -3
  17. package/dist/core/{BrickPattern-BY7h4hyx.js → BrickPattern-tASwilX0.js} +2 -2
  18. package/dist/core/{BrightnessContrast-DFc0gSUv.js → BrightnessContrast-ZCKqJW7i.js} +1 -1
  19. package/dist/core/{BrushedMetal-B06tUygH.js → BrushedMetal-B6gSVB28.js} +6 -6
  20. package/dist/core/{Bulge-BpSOQfH0.js → Bulge-dCYtWP4S.js} +1 -1
  21. package/dist/core/{CRTScreen-DdGcEvk2.js → CRTScreen-CVY1lOGL.js} +1 -1
  22. package/dist/core/{CarbonFiber-Dy7Osb3V.js → CarbonFiber-Do9EONKv.js} +5 -5
  23. package/dist/core/{Chalkboard-wRYj23wL.js → Chalkboard-0hyyGnYl.js} +1 -1
  24. package/dist/core/{ChannelBlur-DKD9GUpc.js → ChannelBlur-DcZKCKXi.js} +2 -2
  25. package/dist/core/{CheckerWipe-D0WmsSKg.js → CheckerWipe-BIE62tJ1.js} +1 -1
  26. package/dist/core/{Checkerboard-2sQYJks9.js → Checkerboard-CRnfu63u.js} +1 -1
  27. package/dist/core/{Chevron-D3oPw2-i.js → Chevron-Ld_v4z9T.js} +2 -2
  28. package/dist/core/{ChromaFlow-px9KG_h6.js → ChromaFlow-CTWeauIr.js} +1 -1
  29. package/dist/core/{ChromaticAberration-DLFROPJV.js → ChromaticAberration-CxuOb68m.js} +1 -1
  30. package/dist/core/{Circle-0CqIPN3a.js → Circle-XP1B5rsN.js} +2 -2
  31. package/dist/core/{ColorWheel-CMtn8slz.js → ColorWheel-CFU_OmOW.js} +2 -2
  32. package/dist/core/{CompressionArtifacts-D7dpVg47.js → CompressionArtifacts-Bc9xTdQP.js} +2 -2
  33. package/dist/core/{ConcentricSpin-BPk-_egF.js → ConcentricSpin-DTJytpAk.js} +2 -2
  34. package/dist/core/{ConicGradient-B-tEhmfR.js → ConicGradient-C-4uDmQj.js} +2 -2
  35. package/dist/core/{ContourLines-BlgCWFSy.js → ContourLines-C8p6f-1y.js} +1 -1
  36. package/dist/core/{CornerPin-DB3G2i_y.js → CornerPin-CB92kX10.js} +1 -1
  37. package/dist/core/{Crescent-CFzPQKll.js → Crescent-Dk4nlG8T.js} +2 -2
  38. package/dist/core/{Cross-Cstl9nDg.js → Cross-DsnI1U8g.js} +2 -2
  39. package/dist/core/{Crystal-CEeqF1Xa.js → Crystal-CR_sG2y7.js} +5 -5
  40. package/dist/core/{CurlNoise-uvTKk4Wa.js → CurlNoise-DJ27ih0F.js} +5 -5
  41. package/dist/core/{CursorRipples-B46VApbY.js → CursorRipples-CuO3sZga.js} +2 -2
  42. package/dist/core/{CursorTrail-DzYRTzzA.js → CursorTrail-d4xx4QpM.js} +3 -3
  43. package/dist/core/{DataMosh-Ysev5-c_.js → DataMosh-BhvE-2yC.js} +2 -2
  44. package/dist/core/{DiamondGradient-pTOwPuAl.js → DiamondGradient-CtOVKrYf.js} +2 -2
  45. package/dist/core/{DiamondWipe-D6u1P2xH.js → DiamondWipe-D-yiQBVj.js} +1 -1
  46. package/dist/core/{DiffuseBlur-BX0cfwyh.js → DiffuseBlur-BDf-Czxz.js} +1 -1
  47. package/dist/core/{DisplacementMap-DMNivtcV.js → DisplacementMap-B_jf_2lj.js} +1 -1
  48. package/dist/core/{Dither-Cxu-hSc_.js → Dither-D3P6EJU8.js} +1 -1
  49. package/dist/core/{DotGrid-CbNHebie.js → DotGrid-BnSVhJlh.js} +2 -2
  50. package/dist/core/{DropShadow-DFyuEA17.js → DropShadow-BSKVH3n3.js} +1 -1
  51. package/dist/core/{Duotone-CgueO-jZ.js → Duotone-DfjYuK2u.js} +1 -1
  52. package/dist/core/{Ellipse-DxRnSw__.js → Ellipse-D7_1QKaa.js} +2 -2
  53. package/dist/core/{Emboss-BJxzjZmZ.js → Emboss-ZiPslqzl.js} +4 -4
  54. package/dist/core/{Engraving-DmQCj8vU.js → Engraving-DsfkKajz.js} +2 -2
  55. package/dist/core/{ErosionNoise-7ekcAfBb.js → ErosionNoise-SELArv9H.js} +4 -4
  56. package/dist/core/{Exposure-avEereLn.js → Exposure-A7WlTOti.js} +1 -1
  57. package/dist/core/{FallingLines-BINyHi3N.js → FallingLines-9PRMb_Ou.js} +2 -2
  58. package/dist/core/{FilmGrain-B-pZBxiK.js → FilmGrain-SXzVDesw.js} +1 -1
  59. package/dist/core/{FilmStock-BJfso8f3.js → FilmStock-RK4fk4m0.js} +3 -3
  60. package/dist/core/{Flip-Dbwe0zh8.js → Flip-DjoNWG4v.js} +1 -1
  61. package/dist/core/{FloatingParticles-CoQ01il5.js → FloatingParticles-D7vUF5g7.js} +550 -367
  62. package/dist/core/{FlowField-CU6S3Jar.js → FlowField-tHrXhd1b.js} +3 -3
  63. package/dist/core/{Flower-R7HIopNH.js → Flower-BfehbmmG.js} +2 -2
  64. package/dist/core/{FlowingGradient-D66Y9Wgq.js → FlowingGradient-BTKjkx5F.js} +3 -3
  65. package/dist/core/{FlutedGlass-WAaeW92l.js → FlutedGlass-uFT7iy_9.js} +2 -2
  66. package/dist/core/{Fog-BChoF6fi.js → Fog-Cu1CMATa.js} +2 -2
  67. package/dist/core/{Form3D-DajWNpAi.js → Form3D-D0ji-MeC.js} +2 -2
  68. package/dist/core/{FractalNoise-DIrQ3eQj.js → FractalNoise-D9HYiOdr.js} +4 -4
  69. package/dist/core/{Frost-B_3JSI2H.js → Frost-DQZZxdTk.js} +6 -6
  70. package/dist/core/{GaborNoise-4FWeA9yr.js → GaborNoise-D7BP0K4g.js} +5 -5
  71. package/dist/core/{Glass-wOhmSf3v.js → Glass-CzCVnGn-.js} +5 -5
  72. package/dist/core/{GlassTiles-DgdAiEuy.js → GlassTiles-DJzPPqwz.js} +1 -1
  73. package/dist/core/{Glitch-BOiywFUR.js → Glitch-D1Dx8__X.js} +28 -11
  74. package/dist/core/{Glow-C2cEWdNE.js → Glow-Bd9_o_Kv.js} +3 -3
  75. package/dist/core/{Godrays-DAZB2GSn.js → Godrays-DRPRWGPm.js} +2 -2
  76. package/dist/core/{Goo-B_WAqWYW.js → Goo-28A_pNBg.js} +5 -5
  77. package/dist/core/{GradientMap-DxsOInED.js → GradientMap-D8dv-1AX.js} +1 -1
  78. package/dist/core/{Grayscale-DSHs9mZd.js → Grayscale-BlVXBVwW.js} +1 -1
  79. package/dist/core/{Grid-aO3wzf4X.js → Grid-D9vlHvs1.js} +1 -1
  80. package/dist/core/{GridDistortion-DsHsHda7.js → GridDistortion-BpqDvqj6.js} +2 -2
  81. package/dist/core/{Group-CCcDbysC.js → Group-bwQnJRec.js} +1 -1
  82. package/dist/core/{HTMLInCanvas-B2OooKKr.js → HTMLInCanvas-gCf64ozE.js} +1 -1
  83. package/dist/core/{Halftone-3a3rz4ln.js → Halftone-B_WouxiP.js} +1 -1
  84. package/dist/core/{Heart-CzO0_GoB.js → Heart-Bmt2TLNz.js} +2 -2
  85. package/dist/core/{Heatmap-DPtUc8YG.js → Heatmap-Ruef741_.js} +6 -6
  86. package/dist/core/{HexGrid-CN5A0m5j.js → HexGrid-By9k0YuI.js} +1 -1
  87. package/dist/core/{Hologram-DoKRhChe.js → Hologram-Cf25ONOE.js} +6 -6
  88. package/dist/core/{Holographic-BWyW5z_h.js → Holographic-C9RzYykt.js} +6 -6
  89. package/dist/core/{HueShift-C0p8EGk-.js → HueShift-V3gQVuIo.js} +1 -1
  90. package/dist/core/{ImageTexture-BnwkbXAW.js → ImageTexture-DAUR2N5Q.js} +2 -2
  91. package/dist/core/{InkFlow-BH86usRX.js → InkFlow-DlP1gmr4.js} +2 -2
  92. package/dist/core/{Invert-BIjy9ddK.js → Invert-K648khvD.js} +1 -1
  93. package/dist/core/{IrisWipe-lpU7lucQ.js → IrisWipe-Clkd_5CA.js} +1 -1
  94. package/dist/core/{IsometricCubes-CIieztxI.js → IsometricCubes-CzfAwpQ5.js} +1 -1
  95. package/dist/core/{Kaleidoscope-CUMvqmfN.js → Kaleidoscope-B9k6HkNn.js} +1 -1
  96. package/dist/core/{KeyFrames-mI1J02zX.js → KeyFrames-DX6JFhsy.js} +2 -2
  97. package/dist/core/LensDistortion-DG4VHEXV.js +435 -0
  98. package/dist/core/{LensFlare-ChQK_hJN.js → LensFlare-DO5lm--6.js} +2 -2
  99. package/dist/core/{LightEdge-Rg-zMpGb.js → LightEdge-CxWsQwpZ.js} +6 -6
  100. package/dist/core/{LightLeak-D1CxVo9A.js → LightLeak-tGJW6l2_.js} +3 -3
  101. package/dist/core/{LinearBlur-DJBkHfs8.js → LinearBlur-OmZcUden.js} +1 -1
  102. package/dist/core/{LinearGradient-DCRYBS4Q.js → LinearGradient-DDqFujWC.js} +2 -2
  103. package/dist/core/{LinearWipe-Cxfs1tIO.js → LinearWipe-BzthBFNb.js} +1 -1
  104. package/dist/core/{LiquidMetal-oscNnbsr.js → LiquidMetal-DpRAJ5Ne.js} +6 -6
  105. package/dist/core/{Liquify-CJwl6Wef.js → Liquify-BVzmuY6D.js} +2 -2
  106. package/dist/core/{MagneticFilings-DAOFLjAQ.js → MagneticFilings-BP1KyU2C.js} +893 -653
  107. package/dist/core/{Marble-Cr4Iaq38.js → Marble-abj97ioG.js} +3 -3
  108. package/dist/core/{Mirror-BwOuv3TP.js → Mirror-BYqbXWUj.js} +1 -1
  109. package/dist/core/{MultiPointGradient-CSowH0-7.js → MultiPointGradient-DZZSkiDv.js} +1 -1
  110. package/dist/core/{Neon-CPIvbGSB.js → Neon-DD8qY6H9.js} +4 -4
  111. package/dist/core/{NoiseDissolve-ByahROgQ.js → NoiseDissolve-DSkh5NdD.js} +2 -2
  112. package/dist/core/{ObjectTracker-DMCr6kHz.js → ObjectTracker-DvQF31-0.js} +2 -2
  113. package/dist/core/{PagePeel-Coq0hc8R.js → PagePeel-DWtgqWdt.js} +1 -1
  114. package/dist/core/{Paper-CLlhc3fn.js → Paper-DGzZsv79.js} +2 -2
  115. package/dist/core/{Parallelogram-Be8RQBV7.js → Parallelogram-Ce0Pg7DX.js} +2 -2
  116. package/dist/core/{ParticleField-DDO-Tk9X.js → ParticleField-CgCOigET.js} +1375 -1230
  117. package/dist/core/{ParticleFlow-B89PWVem.js → ParticleFlow-CRQhvYQx.js} +1264 -993
  118. package/dist/core/{Particles-D8rP46SB.js → Particles-fKk9qTkl.js} +681 -469
  119. package/dist/core/{PerlinNoise-_whB3Y3m.js → PerlinNoise-DIFK1BpN.js} +5 -5
  120. package/dist/core/{Perspective-BJuQWHOr.js → Perspective-CDNz_7y5.js} +1 -1
  121. package/dist/core/{PixelSort-CJfXD6g0.js → PixelSort-sgh5ghCc.js} +2 -2
  122. package/dist/core/{PixelThrow-BaTI5PzH.js → PixelThrow-CXtB4Am2.js} +1 -1
  123. package/dist/core/{Pixelate-D7Dto_8I.js → Pixelate-BSOzwVHo.js} +1 -1
  124. package/dist/core/{Plasma-DWIDcCnn.js → Plasma-G6Hl__3L.js} +3 -3
  125. package/dist/core/{Plastic-CWAOd2i9.js → Plastic-B6F2WeaX.js} +6 -6
  126. package/dist/core/{PolarCoordinates-DQM3dLK3.js → PolarCoordinates-Bi99omfI.js} +1 -1
  127. package/dist/core/{Polygon-CFmLohBu.js → Polygon-BFxoe-Fg.js} +2 -2
  128. package/dist/core/{Posterize-B8PHXwhy.js → Posterize-DxiCXLUL.js} +1 -1
  129. package/dist/core/{Prism-C5VS4TLU.js → Prism-D6J-acZf.js} +2 -2
  130. package/dist/core/{ProgressiveBlur-BcGcteLH.js → ProgressiveBlur-Bko6UMxQ.js} +3 -3
  131. package/dist/core/{RadialGradient-D3UoKiGu.js → RadialGradient-B_Dgxs9_.js} +2 -2
  132. package/dist/core/{RadialWipe-DXfAH0Ug.js → RadialWipe-U9n5aeiJ.js} +1 -1
  133. package/dist/core/{RandomBars-BVsp1Q7v.js → RandomBars-U_zpGDJh.js} +2 -2
  134. package/dist/core/{ReactionDiffusion-DknxOF-o.js → ReactionDiffusion-I9xj-iK_.js} +2 -2
  135. package/dist/core/{RectangularCoordinates-DFQm4y6H.js → RectangularCoordinates-DX6wutjX.js} +1 -1
  136. package/dist/core/{ReflectivePlane-BDlGBzo1.js → ReflectivePlane-DU9pf-7H.js} +3 -3
  137. package/dist/core/{Repeater-DHW6eDAm.js → Repeater-kCIaHHFy.js} +1 -1
  138. package/dist/core/{Ring-3brC5en8.js → Ring-B_tYq3KV.js} +2 -2
  139. package/dist/core/{RippleWipe-DQfXGjRv.js → RippleWipe-DCgZZ4VT.js} +1 -1
  140. package/dist/core/{Ripples-DajR3Cl5.js → Ripples-BDhMh7XC.js} +2 -2
  141. package/dist/core/{RoundedRect-CfkYNmkV.js → RoundedRect-9b3REf2d.js} +2 -2
  142. package/dist/core/{Saturation-BPTssGSs.js → Saturation-CcblT031.js} +1 -1
  143. package/dist/core/{Scratches-A-AyASZm.js → Scratches-Rzk27V6D.js} +5 -5
  144. package/dist/core/{Sharpness-Di39DpCB.js → Sharpness-ClLOnNR8.js} +1 -1
  145. package/dist/core/{Shatter-CWf3HtjN.js → Shatter-CLI896c7.js} +2 -2
  146. package/dist/core/{SimplexNoise-DpZ2jtdk.js → SimplexNoise-98RPhPzU.js} +4 -4
  147. package/dist/core/{SineWave-CZuksvHn.js → SineWave-BZPrTdYD.js} +2 -2
  148. package/dist/core/{SliceWipe-BwL2D3HR.js → SliceWipe-BR5Qr38C.js} +1 -1
  149. package/dist/core/{Smoke-BsUkbTI1.js → Smoke-DoW6Brlo.js} +3 -3
  150. package/dist/core/{SmokeFill-CaDMgNW-.js → SmokeFill-CXHhKX8u.js} +5 -5
  151. package/dist/core/{SmokeFlow-CLfsAbPS.js → SmokeFlow-mRJ_JcnZ.js} +3 -3
  152. package/dist/core/{Solarize-ALjXXAf0.js → Solarize-BNCG4TCa.js} +1 -1
  153. package/dist/core/{Spherize-SBfCc9Wk.js → Spherize-6d5WZIZV.js} +1 -1
  154. package/dist/core/{Spiral-iRrT222n.js → Spiral-IOZ-Zm0_.js} +2 -2
  155. package/dist/core/{Star-DL3d_HqY.js → Star-D9txpy4P.js} +2 -2
  156. package/dist/core/{Stone-OTsCM-rr.js → Stone-H2qLOvGJ.js} +2 -2
  157. package/dist/core/{Strands-DjoQgGnd.js → Strands-Db6_uJAi.js} +2 -2
  158. package/dist/core/{Stretch-CdzhxnbM.js → Stretch-BIFeD7-1.js} +1 -1
  159. package/dist/core/{Stripes-CsBgKYdp.js → Stripes-5YZhE4bc.js} +2 -2
  160. package/dist/core/{StudioBackground-D8EdrLg5.js → StudioBackground-B16ICQTt.js} +2 -2
  161. package/dist/core/{SunBurst-ErBFL-nF.js → SunBurst-DSUFLqjC.js} +2 -2
  162. package/dist/core/{Surface3D-CLjX61TZ.js → Surface3D-BoliMAeJ.js} +1826 -1420
  163. package/dist/core/{Swirl-DDQif_lC.js → Swirl-CozBN2cj.js} +2 -2
  164. package/dist/core/{Teardrop-CvpdElTs.js → Teardrop-D8uqqHu8.js} +2 -2
  165. package/dist/core/{Text-vyzeMvhl.js → Text-Dka9dwCa.js} +2 -2
  166. package/dist/core/{ThinFilm-CbkMTbD2.js → ThinFilm-d7IlUY62.js} +4 -4
  167. package/dist/core/{TiltShift-BVMyB8lF.js → TiltShift-CNc1M7bT.js} +3 -3
  168. package/dist/core/{TimeTrail-CuFGvzFi.js → TimeTrail-BFuqrI-l.js} +1058 -1699
  169. package/dist/core/{Tint-C6zMMsYH.js → Tint-BzCm1m93.js} +1 -1
  170. package/dist/core/{Trapezoid-kFuxWONU.js → Trapezoid-Dc6dpnCU.js} +2 -2
  171. package/dist/core/{TriangularGrid-FIrpI_qE.js → TriangularGrid-BMemTQ8X.js} +2 -2
  172. package/dist/core/{Tritone-DyLGtOug.js → Tritone-XnyfjYXL.js} +1 -1
  173. package/dist/core/{Truchet-B4NI56Zz.js → Truchet-DUbAZPvr.js} +1 -1
  174. package/dist/core/{Twirl-CuzhWXfj.js → Twirl-Dj6ZOh7V.js} +1 -1
  175. package/dist/core/{VHS-DYbzndAZ.js → VHS-DcN38Sa-.js} +1 -1
  176. package/dist/core/{VenetianBlinds-DVopy3xp.js → VenetianBlinds-Dsix9S6Y.js} +1 -1
  177. package/dist/core/{Vesica-Cd-XyG3F.js → Vesica-BvLPrNBY.js} +2 -2
  178. package/dist/core/{Vibrance-CvXatkfO.js → Vibrance-B3F1IOJC.js} +1 -1
  179. package/dist/core/{VideoTexture-C5PS6Vly.js → VideoTexture-rZnbkY1j.js} +1 -1
  180. package/dist/core/{Vignette-DtBpWWxW.js → Vignette-D747S9Un.js} +1 -1
  181. package/dist/core/{Voronoi-CRH2cGlR.js → Voronoi-tdjJp1Yz.js} +2 -2
  182. package/dist/core/{Water-CneenzRZ.js → Water-wnYFmeVF.js} +6 -6
  183. package/dist/core/{Watercolor-B343pgM-.js → Watercolor-DlrWTnkX.js} +267 -350
  184. package/dist/core/{WaveDistortion-DHz1FxLT.js → WaveDistortion-11QwOfVR.js} +2 -2
  185. package/dist/core/{WaveletNoise-CsLE9gbM.js → WaveletNoise-DWOzHG3M.js} +5 -5
  186. package/dist/core/{Weave-CQEF71nr.js → Weave-CdGwj7cZ.js} +1 -1
  187. package/dist/core/{WebcamTexture-BcsYFM_g.js → WebcamTexture-CihYSbzd.js} +2 -2
  188. package/dist/core/{Wool-BFSicimy.js → Wool-DKCBMabi.js} +2 -2
  189. package/dist/core/{WorleyNoise-BKq3es5v.js → WorleyNoise-BjD32UOl.js} +2 -2
  190. package/dist/core/{ZoomBlur-Bu1SlmS2.js → ZoomBlur-BnRTijPn.js} +1 -1
  191. package/dist/core/{agents-Bv3--qPL.js → agents-c-JjGH1b.js} +446 -3
  192. package/dist/core/{blur-tvWOoxKt.js → blur-DKmdsW6d.js} +2 -2
  193. package/dist/core/{compute-BjeJ0sIA.js → compute-BoeIXi0l.js} +1 -1
  194. package/dist/core/{edges-BXNBKxSN.js → edges-BZUKQxSE.js} +1 -1
  195. package/dist/core/{glass-IfoQ8Prf.js → glass-BVqgjSPg.js} +1 -1
  196. package/dist/core/gpu/index.d.ts.map +1 -1
  197. package/dist/core/gpu/kit/agents.d.ts +17 -1
  198. package/dist/core/gpu/kit/agents.d.ts.map +1 -1
  199. package/dist/core/gpu/passManager.d.ts +6 -2
  200. package/dist/core/gpu/passManager.d.ts.map +1 -1
  201. package/dist/core/gpu/textures.d.ts +2 -2
  202. package/dist/core/gpu/textures.d.ts.map +1 -1
  203. package/dist/core/index.js +229 -209
  204. package/dist/core/{media-B9BNeMPu.js → media-Ds6MRfGR.js} +1 -1
  205. package/dist/core/{noise-wTSHXgFz.js → noise-Cq0KUOSC.js} +1 -1
  206. package/dist/core/{noiseColor-CPakiKNF.js → noiseColor-CQyzqpVZ.js} +2 -2
  207. package/dist/core/{noiseColor-DscZM9CO.js → noiseColor-DjCUZ_8u.js} +1 -1
  208. package/dist/core/{noiseStylize-BXpflWPW.js → noiseStylize-fKVcJbGK.js} +2 -2
  209. package/dist/core/{porters-DBK1Aipq.js → porters-DogLzpKT.js} +1 -1
  210. package/dist/core/presetRenderer.d.ts.map +1 -1
  211. package/dist/core/registry.js +205 -204
  212. package/dist/core/{sdf-R0EN3EvS.js → sdf-o99ONcMJ.js} +1 -1
  213. package/dist/core/shaderRegistry-CkDrffEe.js +427 -0
  214. package/dist/core/shaderRegistry.d.ts.map +1 -1
  215. package/dist/core/shaders/AngularBlur/index.js +4 -4
  216. package/dist/core/shaders/Arc/index.js +5 -5
  217. package/dist/core/shaders/Ascii/index.js +4 -4
  218. package/dist/core/shaders/Aurora/index.js +5 -5
  219. package/dist/core/shaders/BarShift/index.js +4 -4
  220. package/dist/core/shaders/BarnDoors/index.js +4 -4
  221. package/dist/core/shaders/Beam/index.js +4 -4
  222. package/dist/core/shaders/Bend/index.js +4 -4
  223. package/dist/core/shaders/Blob/index.js +4 -4
  224. package/dist/core/shaders/BlockDissolve/index.js +5 -5
  225. package/dist/core/shaders/BlockNoise/index.js +7 -7
  226. package/dist/core/shaders/BlueNoise/index.js +7 -7
  227. package/dist/core/shaders/Blur/index.js +5 -5
  228. package/dist/core/shaders/Boids/index.d.ts +3 -3
  229. package/dist/core/shaders/Boids/index.d.ts.map +1 -1
  230. package/dist/core/shaders/Boids/index.js +8 -7
  231. package/dist/core/shaders/BokehBlur/index.js +5 -5
  232. package/dist/core/shaders/BrickPattern/index.js +4 -4
  233. package/dist/core/shaders/BrightnessContrast/index.js +4 -4
  234. package/dist/core/shaders/BrushedMetal/index.js +8 -8
  235. package/dist/core/shaders/Bulge/index.js +4 -4
  236. package/dist/core/shaders/CRTScreen/index.js +4 -4
  237. package/dist/core/shaders/CarbonFiber/index.js +8 -8
  238. package/dist/core/shaders/Chalkboard/index.js +4 -4
  239. package/dist/core/shaders/ChannelBlur/index.js +5 -5
  240. package/dist/core/shaders/CheckerWipe/index.js +4 -4
  241. package/dist/core/shaders/Checkerboard/index.js +4 -4
  242. package/dist/core/shaders/Chevron/index.js +4 -4
  243. package/dist/core/shaders/ChromaFlow/index.js +4 -4
  244. package/dist/core/shaders/ChromaticAberration/index.js +4 -4
  245. package/dist/core/shaders/Circle/index.js +5 -5
  246. package/dist/core/shaders/ColorWheel/index.js +4 -4
  247. package/dist/core/shaders/CompressionArtifacts/index.js +4 -4
  248. package/dist/core/shaders/ConcentricSpin/index.js +4 -4
  249. package/dist/core/shaders/ConicGradient/index.js +4 -4
  250. package/dist/core/shaders/ContourLines/index.js +4 -4
  251. package/dist/core/shaders/CornerPin/index.js +4 -4
  252. package/dist/core/shaders/Crescent/index.js +5 -5
  253. package/dist/core/shaders/Cross/index.js +5 -5
  254. package/dist/core/shaders/Crystal/index.js +8 -8
  255. package/dist/core/shaders/CurlNoise/index.js +7 -7
  256. package/dist/core/shaders/CursorRipples/index.js +4 -4
  257. package/dist/core/shaders/CursorTrail/index.js +4 -4
  258. package/dist/core/shaders/DataMosh/index.js +4 -4
  259. package/dist/core/shaders/DiamondGradient/index.js +4 -4
  260. package/dist/core/shaders/DiamondWipe/index.js +4 -4
  261. package/dist/core/shaders/DiffuseBlur/index.js +4 -4
  262. package/dist/core/shaders/DisplacementMap/index.js +4 -4
  263. package/dist/core/shaders/Dither/index.js +4 -4
  264. package/dist/core/shaders/DotGrid/index.js +4 -4
  265. package/dist/core/shaders/DropShadow/index.js +4 -4
  266. package/dist/core/shaders/Duotone/index.js +4 -4
  267. package/dist/core/shaders/Ellipse/index.js +5 -5
  268. package/dist/core/shaders/Emboss/index.js +7 -7
  269. package/dist/core/shaders/Engraving/index.js +5 -5
  270. package/dist/core/shaders/ErosionNoise/index.js +7 -7
  271. package/dist/core/shaders/Exposure/index.js +4 -4
  272. package/dist/core/shaders/FallingLines/index.js +4 -4
  273. package/dist/core/shaders/FilmGrain/index.js +4 -4
  274. package/dist/core/shaders/FilmStock/index.js +5 -5
  275. package/dist/core/shaders/Flip/index.js +4 -4
  276. package/dist/core/shaders/FloatingParticles/index.d.ts +9 -4
  277. package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
  278. package/dist/core/shaders/FloatingParticles/index.js +8 -7
  279. package/dist/core/shaders/FlowField/index.js +5 -5
  280. package/dist/core/shaders/Flower/index.js +5 -5
  281. package/dist/core/shaders/FlowingGradient/index.js +5 -5
  282. package/dist/core/shaders/FlutedGlass/index.js +4 -4
  283. package/dist/core/shaders/Fog/index.js +4 -4
  284. package/dist/core/shaders/Form3D/index.js +4 -4
  285. package/dist/core/shaders/FractalNoise/index.js +6 -6
  286. package/dist/core/shaders/Frost/index.js +8 -8
  287. package/dist/core/shaders/GaborNoise/index.js +7 -7
  288. package/dist/core/shaders/Glass/index.js +8 -8
  289. package/dist/core/shaders/GlassTiles/index.js +4 -4
  290. package/dist/core/shaders/Glitch/index.d.ts +1 -1
  291. package/dist/core/shaders/Glitch/index.d.ts.map +1 -1
  292. package/dist/core/shaders/Glitch/index.js +4 -4
  293. package/dist/core/shaders/Glow/index.js +5 -5
  294. package/dist/core/shaders/Godrays/index.js +4 -4
  295. package/dist/core/shaders/Goo/index.js +7 -7
  296. package/dist/core/shaders/GradientMap/index.js +4 -4
  297. package/dist/core/shaders/Grayscale/index.js +4 -4
  298. package/dist/core/shaders/Grid/index.js +4 -4
  299. package/dist/core/shaders/GridDistortion/index.js +4 -4
  300. package/dist/core/shaders/Group/index.js +4 -4
  301. package/dist/core/shaders/HTMLInCanvas/index.js +4 -4
  302. package/dist/core/shaders/Halftone/index.js +4 -4
  303. package/dist/core/shaders/Heart/index.js +5 -5
  304. package/dist/core/shaders/Heatmap/index.js +8 -8
  305. package/dist/core/shaders/HexGrid/index.js +4 -4
  306. package/dist/core/shaders/Hologram/index.js +8 -8
  307. package/dist/core/shaders/Holographic/index.js +8 -8
  308. package/dist/core/shaders/HueShift/index.js +4 -4
  309. package/dist/core/shaders/ImageTexture/index.js +5 -5
  310. package/dist/core/shaders/InkFlow/index.js +4 -4
  311. package/dist/core/shaders/Invert/index.js +4 -4
  312. package/dist/core/shaders/IrisWipe/index.js +4 -4
  313. package/dist/core/shaders/IsometricCubes/index.js +4 -4
  314. package/dist/core/shaders/Kaleidoscope/index.js +4 -4
  315. package/dist/core/shaders/KeyFrames/index.js +4 -4
  316. package/dist/core/shaders/LensDistortion/index.d.ts +123 -0
  317. package/dist/core/shaders/LensDistortion/index.d.ts.map +1 -0
  318. package/dist/core/shaders/LensDistortion/index.js +8 -0
  319. package/dist/core/shaders/LensFlare/index.js +4 -4
  320. package/dist/core/shaders/LightEdge/index.js +8 -8
  321. package/dist/core/shaders/LightLeak/index.js +5 -5
  322. package/dist/core/shaders/LinearBlur/index.js +4 -4
  323. package/dist/core/shaders/LinearGradient/index.js +4 -4
  324. package/dist/core/shaders/LinearWipe/index.js +4 -4
  325. package/dist/core/shaders/LiquidMetal/index.js +8 -8
  326. package/dist/core/shaders/Liquify/index.js +4 -4
  327. package/dist/core/shaders/MagneticFilings/index.d.ts +0 -2
  328. package/dist/core/shaders/MagneticFilings/index.d.ts.map +1 -1
  329. package/dist/core/shaders/MagneticFilings/index.js +8 -7
  330. package/dist/core/shaders/Marble/index.js +5 -5
  331. package/dist/core/shaders/Mirror/index.js +4 -4
  332. package/dist/core/shaders/MultiPointGradient/index.js +4 -4
  333. package/dist/core/shaders/Neon/index.js +6 -6
  334. package/dist/core/shaders/NoiseDissolve/index.js +5 -5
  335. package/dist/core/shaders/ObjectTracker/index.js +5 -5
  336. package/dist/core/shaders/PagePeel/index.js +4 -4
  337. package/dist/core/shaders/Paper/index.js +5 -5
  338. package/dist/core/shaders/Parallelogram/index.js +5 -5
  339. package/dist/core/shaders/ParticleField/index.d.ts +10 -5
  340. package/dist/core/shaders/ParticleField/index.d.ts.map +1 -1
  341. package/dist/core/shaders/ParticleField/index.js +7 -7
  342. package/dist/core/shaders/ParticleFlow/index.d.ts +10 -4
  343. package/dist/core/shaders/ParticleFlow/index.d.ts.map +1 -1
  344. package/dist/core/shaders/ParticleFlow/index.js +8 -7
  345. package/dist/core/shaders/Particles/index.d.ts +4 -3
  346. package/dist/core/shaders/Particles/index.d.ts.map +1 -1
  347. package/dist/core/shaders/Particles/index.js +9 -9
  348. package/dist/core/shaders/PerlinNoise/index.js +7 -7
  349. package/dist/core/shaders/Perspective/index.js +4 -4
  350. package/dist/core/shaders/PixelSort/index.js +4 -4
  351. package/dist/core/shaders/PixelThrow/index.js +4 -4
  352. package/dist/core/shaders/Pixelate/index.js +4 -4
  353. package/dist/core/shaders/Plasma/index.js +5 -5
  354. package/dist/core/shaders/Plastic/index.js +8 -8
  355. package/dist/core/shaders/PolarCoordinates/index.js +4 -4
  356. package/dist/core/shaders/Polygon/index.js +5 -5
  357. package/dist/core/shaders/Posterize/index.js +4 -4
  358. package/dist/core/shaders/Prism/index.js +4 -4
  359. package/dist/core/shaders/ProgressiveBlur/index.js +5 -5
  360. package/dist/core/shaders/RadialGradient/index.js +4 -4
  361. package/dist/core/shaders/RadialWipe/index.js +4 -4
  362. package/dist/core/shaders/RandomBars/index.js +5 -5
  363. package/dist/core/shaders/ReactionDiffusion/index.js +4 -4
  364. package/dist/core/shaders/RectangularCoordinates/index.js +4 -4
  365. package/dist/core/shaders/ReflectivePlane/index.js +5 -5
  366. package/dist/core/shaders/Repeater/index.js +4 -4
  367. package/dist/core/shaders/Ring/index.js +5 -5
  368. package/dist/core/shaders/RippleWipe/index.js +4 -4
  369. package/dist/core/shaders/Ripples/index.js +4 -4
  370. package/dist/core/shaders/RoundedRect/index.js +5 -5
  371. package/dist/core/shaders/Saturation/index.js +4 -4
  372. package/dist/core/shaders/Scratches/index.js +7 -7
  373. package/dist/core/shaders/Sharpness/index.js +4 -4
  374. package/dist/core/shaders/Shatter/index.js +4 -4
  375. package/dist/core/shaders/SimplexNoise/index.js +6 -6
  376. package/dist/core/shaders/SineWave/index.js +4 -4
  377. package/dist/core/shaders/SliceWipe/index.js +4 -4
  378. package/dist/core/shaders/Smoke/index.js +4 -4
  379. package/dist/core/shaders/SmokeFill/index.js +7 -7
  380. package/dist/core/shaders/SmokeFlow/index.js +4 -4
  381. package/dist/core/shaders/Solarize/index.js +4 -4
  382. package/dist/core/shaders/SolidColor/index.js +1 -1
  383. package/dist/core/shaders/Spherize/index.js +4 -4
  384. package/dist/core/shaders/Spiral/index.js +4 -4
  385. package/dist/core/shaders/Star/index.js +5 -5
  386. package/dist/core/shaders/Stone/index.js +4 -4
  387. package/dist/core/shaders/Strands/index.js +4 -4
  388. package/dist/core/shaders/Stretch/index.js +4 -4
  389. package/dist/core/shaders/Stripes/index.js +4 -4
  390. package/dist/core/shaders/StudioBackground/index.js +4 -4
  391. package/dist/core/shaders/SunBurst/index.js +4 -4
  392. package/dist/core/shaders/Surface3D/index.d.ts +4 -2
  393. package/dist/core/shaders/Surface3D/index.d.ts.map +1 -1
  394. package/dist/core/shaders/Surface3D/index.js +6 -5
  395. package/dist/core/shaders/Swirl/index.js +4 -4
  396. package/dist/core/shaders/Teardrop/index.js +5 -5
  397. package/dist/core/shaders/Text/index.js +5 -5
  398. package/dist/core/shaders/ThinFilm/index.js +6 -6
  399. package/dist/core/shaders/TiltShift/index.js +5 -5
  400. package/dist/core/shaders/TimeTrail/index.d.ts +47 -1
  401. package/dist/core/shaders/TimeTrail/index.d.ts.map +1 -1
  402. package/dist/core/shaders/TimeTrail/index.js +6 -5
  403. package/dist/core/shaders/Tint/index.js +4 -4
  404. package/dist/core/shaders/Trapezoid/index.js +5 -5
  405. package/dist/core/shaders/TriangularGrid/index.js +4 -4
  406. package/dist/core/shaders/Tritone/index.js +4 -4
  407. package/dist/core/shaders/Truchet/index.js +4 -4
  408. package/dist/core/shaders/Twirl/index.js +4 -4
  409. package/dist/core/shaders/VHS/index.js +4 -4
  410. package/dist/core/shaders/VenetianBlinds/index.js +4 -4
  411. package/dist/core/shaders/Vesica/index.js +5 -5
  412. package/dist/core/shaders/Vibrance/index.js +4 -4
  413. package/dist/core/shaders/VideoTexture/index.js +4 -4
  414. package/dist/core/shaders/Vignette/index.js +4 -4
  415. package/dist/core/shaders/Voronoi/index.js +4 -4
  416. package/dist/core/shaders/Water/index.js +8 -8
  417. package/dist/core/shaders/Watercolor/index.d.ts +1 -1
  418. package/dist/core/shaders/Watercolor/index.d.ts.map +1 -1
  419. package/dist/core/shaders/Watercolor/index.js +5 -4
  420. package/dist/core/shaders/WaveDistortion/index.js +4 -4
  421. package/dist/core/shaders/WaveletNoise/index.js +7 -7
  422. package/dist/core/shaders/Weave/index.js +4 -4
  423. package/dist/core/shaders/WebcamTexture/index.js +5 -5
  424. package/dist/core/shaders/Wool/index.js +4 -4
  425. package/dist/core/shaders/WorleyNoise/index.js +4 -4
  426. package/dist/core/shaders/ZoomBlur/index.js +4 -4
  427. package/dist/core/{shapeEffectBounds-CtKwBX8c.js → shapeEffectBounds-Dg4GQ5vW.js} +3 -3
  428. package/dist/js/bundle.js +174 -174
  429. package/dist/js/createShader.js +1 -1
  430. package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
  431. package/dist/js/utils/generatePresetCode.js +27 -0
  432. package/dist/react/LensDistortion.js +226 -0
  433. package/dist/react/Preview.js +1 -0
  434. package/dist/react/Shader.js +1 -1
  435. package/dist/react/bundle.js +160 -160
  436. package/dist/react/components/LensDistortion.d.ts +54 -0
  437. package/dist/react/components/LensDistortion.d.ts.map +1 -0
  438. package/dist/react/engine/Preview.d.ts.map +1 -1
  439. package/dist/react/index.d.ts +1 -0
  440. package/dist/react/index.d.ts.map +1 -1
  441. package/dist/react/index.js +2 -1
  442. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  443. package/dist/react/utils/generatePresetCode.js +27 -0
  444. package/dist/registry.js +585 -1
  445. package/dist/solid/components/LensDistortion.d.ts +51 -0
  446. package/dist/solid/components/LensDistortion.d.ts.map +1 -0
  447. package/dist/solid/components/LensDistortion.js +232 -0
  448. package/dist/solid/engine/Preview.d.ts.map +1 -1
  449. package/dist/solid/engine/Preview.js +193 -191
  450. package/dist/solid/engine/Shader.js +1 -1
  451. package/dist/solid/index.d.ts +1 -0
  452. package/dist/solid/index.d.ts.map +1 -1
  453. package/dist/solid/index.js +194 -192
  454. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  455. package/dist/solid/utils/generatePresetCode.js +27 -0
  456. package/dist/svelte/components/LensDistortion.svelte.d.ts +41 -0
  457. package/dist/svelte/index.d.ts +1 -0
  458. package/dist/svelte/index.js +2751 -2544
  459. package/dist/svelte/source/components/LensDistortion.svelte +365 -0
  460. package/dist/svelte/source/engine/Preview.svelte +2 -0
  461. package/dist/svelte/source/index.js +1 -0
  462. package/dist/svelte/utils/generatePresetCode.js +27 -0
  463. package/dist/vue/LensDistortion.js +3 -0
  464. package/dist/vue/LensDistortion.vue_vue_type_script_setup_true_lang.js +244 -0
  465. package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
  466. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  467. package/dist/vue/components/LensDistortion.vue.d.ts +76 -0
  468. package/dist/vue/components/LensDistortion.vue.d.ts.map +1 -0
  469. package/dist/vue/index.d.ts +1 -0
  470. package/dist/vue/index.d.ts.map +1 -1
  471. package/dist/vue/index.js +2 -1
  472. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  473. package/dist/vue/utils/generatePresetCode.js +27 -0
  474. package/package.json +9 -1
  475. package/dist/core/shaderRegistry-CcvE7wN0.js +0 -425
  476. /package/dist/core/{SolidColor-Cu_9b_my.js → SolidColor-dYxjV0YF.js} +0 -0
  477. /package/dist/core/{fonts-v_F1SFl9.js → fonts-DFuXI3Hk.js} +0 -0
@@ -1,13 +1,24 @@
1
- import { $t as vec2f, At as pow, Ct as floor, Dt as min, Et as max, Gt as textureStorage2d, It as sin, Lt as smoothstep, N as unpremultiplyAlpha, Ot as mix, St as exp2, Ut as arrayOf, Vt as data_exports, Xt as struct, _t as clamp, an as f32, at as textureStore, bt as dot, d as ZERO, et as src_default, i as edgeMirrorUV, in as vec4f, kt as normalize, mt as abs, nn as vec3f, nt as std_exports, o as edgeWrapUV, p as call, pt as select, s as edges_exports, sn as u32, tn as vec2u, vt as cos, xt as exp, y as vec4 } from "./edges-BXNBKxSN.js";
2
- import { p as noise_exports, u as mxNoiseFloat2 } from "./noise-wTSHXgFz.js";
3
- import { n as createGuardedCompute, r as createStateBuffer } from "./compute-BjeJ0sIA.js";
1
+ import { At as mix, Ct as exp, Gt as arrayOf, Mt as pow, N as unpremultiplyAlpha, Ot as max, Qt as struct, Rt as sin, St as dot, Tt as floor, Ut as data_exports, bt as cos, d as ZERO, et as src_default, ht as abs, i as edgeMirrorUV, in as vec3f, jt as normalize, kt as min, ln as u32, mt as select, nt as std_exports, o as edgeWrapUV, on as vec4f, ot as textureStore, p as call, qt as textureStorage2d, rn as vec2u, s as edges_exports, sn as f32, tn as vec2f, wt as exp2, y as vec4, yt as clamp, zt as smoothstep } from "./edges-BZUKQxSE.js";
2
+ import { p as noise_exports, u as mxNoiseFloat2 } from "./noise-Cq0KUOSC.js";
3
+ import { n as createGuardedCompute, r as createStateBuffer } from "./compute-BoeIXi0l.js";
4
+ import { t as isMobileGpuViewport } from "./device-BODv_4aH.js";
4
5
  import { a as transformColor, s as transformEdges } from "./transformations-CsPUHppB.js";
5
6
  var WAVE_GRID = 256;
6
7
  var WAVE_CELLS = WAVE_GRID * WAVE_GRID;
7
8
  var WAVE_MAX = WAVE_GRID - 1;
8
9
  var WAVE_HALFEXTENT = 3;
9
- var COMPUTE_W = 1600;
10
- var COMPUTE_H = 900;
10
+ var COMPUTE_MAX = isMobileGpuViewport() ? 960 : 1600;
11
+ var COMPUTE_FALLBACK_W = 1600;
12
+ var COMPUTE_FALLBACK_H = 900;
13
+ var MARCH_STEPS = isMobileGpuViewport() ? 12 : 16;
14
+ var MARCH_REFINE = 6;
15
+ var MARCH_FAR = 15;
16
+ var HEIGHT_SLAB_PAD = .02;
17
+ var CURSOR_WAVE_BOUND = 6;
18
+ var WAVE_DECAY = 10;
19
+ var WAVE_DECAY_PER_STEP = .004;
20
+ var WAVE_DAMP = 1 - WAVE_DECAY * WAVE_DECAY_PER_STEP;
21
+ var WAVE_SETTLE_MS = WAVE_DAMP >= 1 ? Infinity : Math.min(3e4, Math.log(1e-6) / Math.log(Math.max(WAVE_DAMP, .001)) * 16.67);
11
22
  var STATE_FORMAT = "rgba16float";
12
23
  var DEG_TO_RAD = Math.PI / 180;
13
24
  var TWO_PI = Math.PI * 2;
@@ -39,7 +50,9 @@ var S3Params = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(s
39
50
  dt: f32,
40
51
  decay: f32,
41
52
  radius: f32,
42
- waveSpeed: f32
53
+ waveSpeed: f32,
54
+ heightEnvelope: f32,
55
+ cursorActive: f32
43
56
  }), "S3Params");
44
57
  var propagateLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(src_default.bindGroupLayout({
45
58
  readSrc: {
@@ -126,25 +139,29 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
126
139
  const pinMask = mix(f32(1), __tsover_sub(1, pinFalloff), p.edgePin);
127
140
  const baseHeight = __tsover_mul(__tsover_mul(waveVal, amp), pinMask);
128
141
  if (cursorEnabled) {
129
- const H = f32(WAVE_HALFEXTENT);
130
- const waveU = __tsover_add(__tsover_div(__tsover_sub(uv.x, .5), H), .5);
131
- const waveV = __tsover_add(__tsover_div(__tsover_sub(uv.y, .5), H), .5);
132
- const Nm1 = f32(WAVE_MAX);
133
- const gx = __tsover_mul(clamp(waveU, 0, 1), Nm1);
134
- const gy = __tsover_mul(clamp(waveV, 0, 1), Nm1);
135
- const ix = u32(clamp(gx, 0, Nm1));
136
- const iy = u32(clamp(gy, 0, Nm1));
137
- const ix1 = min(__tsover_add(ix, u32(1)), u32(WAVE_MAX));
138
- const iy1 = min(__tsover_add(iy, u32(1)), u32(WAVE_MAX));
139
- const fx = __tsover_sub(gx, floor(gx));
140
- const fy = __tsover_sub(gy, floor(gy));
141
- const W = u32(WAVE_GRID);
142
- const v00 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy, W), ix)];
143
- const v10 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy, W), ix1)];
144
- const v01 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy1, W), ix)];
145
- const v11 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy1, W), ix1)];
146
- const waveSample = mix(mix(v00, v10, fx), mix(v01, v11, fx), fy);
147
- return __tsover_add(baseHeight, __tsover_mul(waveSample, __tsover_mul(p.cursorIntensity, .05)));
142
+ let ripple = f32(0);
143
+ if (p.cursorActive > .5) {
144
+ const H = f32(WAVE_HALFEXTENT);
145
+ const waveU = __tsover_add(__tsover_div(__tsover_sub(uv.x, .5), H), .5);
146
+ const waveV = __tsover_add(__tsover_div(__tsover_sub(uv.y, .5), H), .5);
147
+ const Nm1 = f32(WAVE_MAX);
148
+ const gx = __tsover_mul(clamp(waveU, 0, 1), Nm1);
149
+ const gy = __tsover_mul(clamp(waveV, 0, 1), Nm1);
150
+ const ix = u32(clamp(gx, 0, Nm1));
151
+ const iy = u32(clamp(gy, 0, Nm1));
152
+ const ix1 = min(__tsover_add(ix, u32(1)), u32(WAVE_MAX));
153
+ const iy1 = min(__tsover_add(iy, u32(1)), u32(WAVE_MAX));
154
+ const fx = __tsover_sub(gx, floor(gx));
155
+ const fy = __tsover_sub(gy, floor(gy));
156
+ const W = u32(WAVE_GRID);
157
+ const v00 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy, W), ix)];
158
+ const v10 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy, W), ix1)];
159
+ const v01 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy1, W), ix)];
160
+ const v11 = computeLayout.$.readBuf[__tsover_add(__tsover_mul(iy1, W), ix1)];
161
+ const waveSample = mix(mix(v00, v10, fx), mix(v01, v11, fx), fy);
162
+ ripple = __tsover_mul(waveSample, __tsover_mul(p.cursorIntensity, .05));
163
+ }
164
+ return __tsover_add(baseHeight, ripple);
148
165
  } else return baseHeight;
149
166
  }), {
150
167
  v: 1,
@@ -1288,8 +1305,8 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
1288
1305
  "cursorEnabled",
1289
1306
  [0, [
1290
1307
  [
1291
- 13,
1292
- "H",
1308
+ 12,
1309
+ "ripple",
1293
1310
  [
1294
1311
  6,
1295
1312
  [
@@ -1297,178 +1314,143 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
1297
1314
  "d",
1298
1315
  "f32"
1299
1316
  ],
1300
- ["WAVE_HALFEXTENT"]
1317
+ [[5, "0"]]
1301
1318
  ]
1302
1319
  ],
1303
1320
  [
1304
- 13,
1305
- "waveU",
1321
+ 11,
1306
1322
  [
1307
1323
  1,
1308
1324
  [
1309
- 1,
1325
+ 7,
1326
+ "p",
1327
+ "cursorActive"
1328
+ ],
1329
+ ">",
1330
+ [5, "0.5"]
1331
+ ],
1332
+ [0, [
1333
+ [
1334
+ 13,
1335
+ "H",
1310
1336
  [
1311
- 1,
1337
+ 6,
1312
1338
  [
1313
1339
  7,
1314
- "uv",
1315
- "x"
1340
+ "d",
1341
+ "f32"
1316
1342
  ],
1317
- "-",
1318
- [5, "0.5"]
1319
- ],
1320
- "/",
1321
- "H"
1343
+ ["WAVE_HALFEXTENT"]
1344
+ ]
1322
1345
  ],
1323
- "+",
1324
- [5, "0.5"]
1325
- ]
1326
- ],
1327
- [
1328
- 13,
1329
- "waveV",
1330
- [
1331
- 1,
1332
1346
  [
1333
- 1,
1347
+ 13,
1348
+ "waveU",
1334
1349
  [
1335
1350
  1,
1336
1351
  [
1337
- 7,
1338
- "uv",
1339
- "y"
1352
+ 1,
1353
+ [
1354
+ 1,
1355
+ [
1356
+ 7,
1357
+ "uv",
1358
+ "x"
1359
+ ],
1360
+ "-",
1361
+ [5, "0.5"]
1362
+ ],
1363
+ "/",
1364
+ "H"
1340
1365
  ],
1341
- "-",
1366
+ "+",
1342
1367
  [5, "0.5"]
1343
- ],
1344
- "/",
1345
- "H"
1346
- ],
1347
- "+",
1348
- [5, "0.5"]
1349
- ]
1350
- ],
1351
- [
1352
- 13,
1353
- "Nm1",
1354
- [
1355
- 6,
1356
- [
1357
- 7,
1358
- "d",
1359
- "f32"
1368
+ ]
1360
1369
  ],
1361
- ["WAVE_MAX"]
1362
- ]
1363
- ],
1364
- [
1365
- 13,
1366
- "gx",
1367
- [
1368
- 1,
1369
1370
  [
1370
- 6,
1371
- [
1372
- 7,
1373
- "std",
1374
- "clamp"
1375
- ],
1371
+ 13,
1372
+ "waveV",
1376
1373
  [
1377
- "waveU",
1378
- [5, "0"],
1379
- [5, "1"]
1374
+ 1,
1375
+ [
1376
+ 1,
1377
+ [
1378
+ 1,
1379
+ [
1380
+ 7,
1381
+ "uv",
1382
+ "y"
1383
+ ],
1384
+ "-",
1385
+ [5, "0.5"]
1386
+ ],
1387
+ "/",
1388
+ "H"
1389
+ ],
1390
+ "+",
1391
+ [5, "0.5"]
1380
1392
  ]
1381
1393
  ],
1382
- "*",
1383
- "Nm1"
1384
- ]
1385
- ],
1386
- [
1387
- 13,
1388
- "gy",
1389
- [
1390
- 1,
1391
1394
  [
1392
- 6,
1393
- [
1394
- 7,
1395
- "std",
1396
- "clamp"
1397
- ],
1395
+ 13,
1396
+ "Nm1",
1398
1397
  [
1399
- "waveV",
1400
- [5, "0"],
1401
- [5, "1"]
1398
+ 6,
1399
+ [
1400
+ 7,
1401
+ "d",
1402
+ "f32"
1403
+ ],
1404
+ ["WAVE_MAX"]
1402
1405
  ]
1403
1406
  ],
1404
- "*",
1405
- "Nm1"
1406
- ]
1407
- ],
1408
- [
1409
- 13,
1410
- "ix",
1411
- [
1412
- 6,
1413
1407
  [
1414
- 7,
1415
- "d",
1416
- "u32"
1417
- ],
1418
- [[
1419
- 6,
1420
- [
1421
- 7,
1422
- "std",
1423
- "clamp"
1424
- ],
1408
+ 13,
1409
+ "gx",
1425
1410
  [
1426
- "gx",
1427
- [5, "0"],
1411
+ 1,
1412
+ [
1413
+ 6,
1414
+ [
1415
+ 7,
1416
+ "std",
1417
+ "clamp"
1418
+ ],
1419
+ [
1420
+ "waveU",
1421
+ [5, "0"],
1422
+ [5, "1"]
1423
+ ]
1424
+ ],
1425
+ "*",
1428
1426
  "Nm1"
1429
1427
  ]
1430
- ]]
1431
- ]
1432
- ],
1433
- [
1434
- 13,
1435
- "iy",
1436
- [
1437
- 6,
1438
- [
1439
- 7,
1440
- "d",
1441
- "u32"
1442
1428
  ],
1443
- [[
1444
- 6,
1445
- [
1446
- 7,
1447
- "std",
1448
- "clamp"
1449
- ],
1429
+ [
1430
+ 13,
1431
+ "gy",
1450
1432
  [
1451
- "gy",
1452
- [5, "0"],
1433
+ 1,
1434
+ [
1435
+ 6,
1436
+ [
1437
+ 7,
1438
+ "std",
1439
+ "clamp"
1440
+ ],
1441
+ [
1442
+ "waveV",
1443
+ [5, "0"],
1444
+ [5, "1"]
1445
+ ]
1446
+ ],
1447
+ "*",
1453
1448
  "Nm1"
1454
1449
  ]
1455
- ]]
1456
- ]
1457
- ],
1458
- [
1459
- 13,
1460
- "ix1",
1461
- [
1462
- 6,
1463
- [
1464
- 7,
1465
- "std",
1466
- "min"
1467
1450
  ],
1468
- [[
1469
- 1,
1451
+ [
1452
+ 13,
1470
1453
  "ix",
1471
- "+",
1472
1454
  [
1473
1455
  6,
1474
1456
  [
@@ -1476,33 +1458,24 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
1476
1458
  "d",
1477
1459
  "u32"
1478
1460
  ],
1479
- [[5, "1"]]
1461
+ [[
1462
+ 6,
1463
+ [
1464
+ 7,
1465
+ "std",
1466
+ "clamp"
1467
+ ],
1468
+ [
1469
+ "gx",
1470
+ [5, "0"],
1471
+ "Nm1"
1472
+ ]
1473
+ ]]
1480
1474
  ]
1481
- ], [
1482
- 6,
1483
- [
1484
- 7,
1485
- "d",
1486
- "u32"
1487
- ],
1488
- ["WAVE_MAX"]
1489
- ]]
1490
- ]
1491
- ],
1492
- [
1493
- 13,
1494
- "iy1",
1495
- [
1496
- 6,
1497
- [
1498
- 7,
1499
- "std",
1500
- "min"
1501
1475
  ],
1502
- [[
1503
- 1,
1476
+ [
1477
+ 13,
1504
1478
  "iy",
1505
- "+",
1506
1479
  [
1507
1480
  6,
1508
1481
  [
@@ -1510,200 +1483,249 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
1510
1483
  "d",
1511
1484
  "u32"
1512
1485
  ],
1513
- [[5, "1"]]
1486
+ [[
1487
+ 6,
1488
+ [
1489
+ 7,
1490
+ "std",
1491
+ "clamp"
1492
+ ],
1493
+ [
1494
+ "gy",
1495
+ [5, "0"],
1496
+ "Nm1"
1497
+ ]
1498
+ ]]
1514
1499
  ]
1515
- ], [
1516
- 6,
1517
- [
1518
- 7,
1519
- "d",
1520
- "u32"
1521
- ],
1522
- ["WAVE_MAX"]
1523
- ]]
1524
- ]
1525
- ],
1526
- [
1527
- 13,
1528
- "fx",
1529
- [
1530
- 1,
1531
- "gx",
1532
- "-",
1500
+ ],
1533
1501
  [
1534
- 6,
1502
+ 13,
1503
+ "ix1",
1535
1504
  [
1536
- 7,
1537
- "std",
1538
- "floor"
1539
- ],
1540
- ["gx"]
1541
- ]
1542
- ]
1543
- ],
1544
- [
1545
- 13,
1546
- "fy",
1547
- [
1548
- 1,
1549
- "gy",
1550
- "-",
1551
- [
1552
- 6,
1553
- [
1554
- 7,
1555
- "std",
1556
- "floor"
1557
- ],
1558
- ["gy"]
1559
- ]
1560
- ]
1561
- ],
1562
- [
1563
- 13,
1564
- "W",
1565
- [
1566
- 6,
1567
- [
1568
- 7,
1569
- "d",
1570
- "u32"
1505
+ 6,
1506
+ [
1507
+ 7,
1508
+ "std",
1509
+ "min"
1510
+ ],
1511
+ [[
1512
+ 1,
1513
+ "ix",
1514
+ "+",
1515
+ [
1516
+ 6,
1517
+ [
1518
+ 7,
1519
+ "d",
1520
+ "u32"
1521
+ ],
1522
+ [[5, "1"]]
1523
+ ]
1524
+ ], [
1525
+ 6,
1526
+ [
1527
+ 7,
1528
+ "d",
1529
+ "u32"
1530
+ ],
1531
+ ["WAVE_MAX"]
1532
+ ]]
1533
+ ]
1571
1534
  ],
1572
- ["WAVE_GRID"]
1573
- ]
1574
- ],
1575
- [
1576
- 13,
1577
- "v00",
1578
- [
1579
- 8,
1580
1535
  [
1581
- 7,
1536
+ 13,
1537
+ "iy1",
1582
1538
  [
1583
- 7,
1584
- "computeLayout",
1585
- "$"
1586
- ],
1587
- "readBuf"
1539
+ 6,
1540
+ [
1541
+ 7,
1542
+ "std",
1543
+ "min"
1544
+ ],
1545
+ [[
1546
+ 1,
1547
+ "iy",
1548
+ "+",
1549
+ [
1550
+ 6,
1551
+ [
1552
+ 7,
1553
+ "d",
1554
+ "u32"
1555
+ ],
1556
+ [[5, "1"]]
1557
+ ]
1558
+ ], [
1559
+ 6,
1560
+ [
1561
+ 7,
1562
+ "d",
1563
+ "u32"
1564
+ ],
1565
+ ["WAVE_MAX"]
1566
+ ]]
1567
+ ]
1588
1568
  ],
1589
1569
  [
1590
- 1,
1570
+ 13,
1571
+ "fx",
1591
1572
  [
1592
1573
  1,
1593
- "iy",
1594
- "*",
1595
- "W"
1596
- ],
1597
- "+",
1598
- "ix"
1599
- ]
1600
- ]
1601
- ],
1602
- [
1603
- 13,
1604
- "v10",
1605
- [
1606
- 8,
1607
- [
1608
- 7,
1609
- [
1610
- 7,
1611
- "computeLayout",
1612
- "$"
1613
- ],
1614
- "readBuf"
1574
+ "gx",
1575
+ "-",
1576
+ [
1577
+ 6,
1578
+ [
1579
+ 7,
1580
+ "std",
1581
+ "floor"
1582
+ ],
1583
+ ["gx"]
1584
+ ]
1585
+ ]
1615
1586
  ],
1616
1587
  [
1617
- 1,
1588
+ 13,
1589
+ "fy",
1618
1590
  [
1619
1591
  1,
1620
- "iy",
1621
- "*",
1622
- "W"
1623
- ],
1624
- "+",
1625
- "ix1"
1626
- ]
1627
- ]
1628
- ],
1629
- [
1630
- 13,
1631
- "v01",
1632
- [
1633
- 8,
1592
+ "gy",
1593
+ "-",
1594
+ [
1595
+ 6,
1596
+ [
1597
+ 7,
1598
+ "std",
1599
+ "floor"
1600
+ ],
1601
+ ["gy"]
1602
+ ]
1603
+ ]
1604
+ ],
1634
1605
  [
1635
- 7,
1606
+ 13,
1607
+ "W",
1636
1608
  [
1637
- 7,
1638
- "computeLayout",
1639
- "$"
1640
- ],
1641
- "readBuf"
1609
+ 6,
1610
+ [
1611
+ 7,
1612
+ "d",
1613
+ "u32"
1614
+ ],
1615
+ ["WAVE_GRID"]
1616
+ ]
1642
1617
  ],
1643
1618
  [
1644
- 1,
1619
+ 13,
1620
+ "v00",
1645
1621
  [
1646
- 1,
1647
- "iy1",
1648
- "*",
1649
- "W"
1650
- ],
1651
- "+",
1652
- "ix"
1653
- ]
1654
- ]
1655
- ],
1656
- [
1657
- 13,
1658
- "v11",
1659
- [
1660
- 8,
1622
+ 8,
1623
+ [
1624
+ 7,
1625
+ [
1626
+ 7,
1627
+ "computeLayout",
1628
+ "$"
1629
+ ],
1630
+ "readBuf"
1631
+ ],
1632
+ [
1633
+ 1,
1634
+ [
1635
+ 1,
1636
+ "iy",
1637
+ "*",
1638
+ "W"
1639
+ ],
1640
+ "+",
1641
+ "ix"
1642
+ ]
1643
+ ]
1644
+ ],
1661
1645
  [
1662
- 7,
1646
+ 13,
1647
+ "v10",
1663
1648
  [
1664
- 7,
1665
- "computeLayout",
1666
- "$"
1667
- ],
1668
- "readBuf"
1649
+ 8,
1650
+ [
1651
+ 7,
1652
+ [
1653
+ 7,
1654
+ "computeLayout",
1655
+ "$"
1656
+ ],
1657
+ "readBuf"
1658
+ ],
1659
+ [
1660
+ 1,
1661
+ [
1662
+ 1,
1663
+ "iy",
1664
+ "*",
1665
+ "W"
1666
+ ],
1667
+ "+",
1668
+ "ix1"
1669
+ ]
1670
+ ]
1669
1671
  ],
1670
1672
  [
1671
- 1,
1673
+ 13,
1674
+ "v01",
1672
1675
  [
1673
- 1,
1674
- "iy1",
1675
- "*",
1676
- "W"
1677
- ],
1678
- "+",
1679
- "ix1"
1680
- ]
1681
- ]
1682
- ],
1683
- [
1684
- 13,
1685
- "waveSample",
1686
- [
1687
- 6,
1688
- [
1689
- 7,
1690
- "std",
1691
- "mix"
1676
+ 8,
1677
+ [
1678
+ 7,
1679
+ [
1680
+ 7,
1681
+ "computeLayout",
1682
+ "$"
1683
+ ],
1684
+ "readBuf"
1685
+ ],
1686
+ [
1687
+ 1,
1688
+ [
1689
+ 1,
1690
+ "iy1",
1691
+ "*",
1692
+ "W"
1693
+ ],
1694
+ "+",
1695
+ "ix"
1696
+ ]
1697
+ ]
1692
1698
  ],
1693
1699
  [
1700
+ 13,
1701
+ "v11",
1694
1702
  [
1695
- 6,
1703
+ 8,
1696
1704
  [
1697
1705
  7,
1698
- "std",
1699
- "mix"
1706
+ [
1707
+ 7,
1708
+ "computeLayout",
1709
+ "$"
1710
+ ],
1711
+ "readBuf"
1700
1712
  ],
1701
1713
  [
1702
- "v00",
1703
- "v10",
1704
- "fx"
1714
+ 1,
1715
+ [
1716
+ 1,
1717
+ "iy1",
1718
+ "*",
1719
+ "W"
1720
+ ],
1721
+ "+",
1722
+ "ix1"
1705
1723
  ]
1706
- ],
1724
+ ]
1725
+ ],
1726
+ [
1727
+ 13,
1728
+ "waveSample",
1707
1729
  [
1708
1730
  6,
1709
1731
  [
@@ -1712,34 +1734,63 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
1712
1734
  "mix"
1713
1735
  ],
1714
1736
  [
1715
- "v01",
1716
- "v11",
1717
- "fx"
1737
+ [
1738
+ 6,
1739
+ [
1740
+ 7,
1741
+ "std",
1742
+ "mix"
1743
+ ],
1744
+ [
1745
+ "v00",
1746
+ "v10",
1747
+ "fx"
1748
+ ]
1749
+ ],
1750
+ [
1751
+ 6,
1752
+ [
1753
+ 7,
1754
+ "std",
1755
+ "mix"
1756
+ ],
1757
+ [
1758
+ "v01",
1759
+ "v11",
1760
+ "fx"
1761
+ ]
1762
+ ],
1763
+ "fy"
1718
1764
  ]
1719
- ],
1720
- "fy"
1721
- ]
1722
- ]
1723
- ],
1765
+ ]
1766
+ ],
1767
+ [
1768
+ 2,
1769
+ "ripple",
1770
+ "=",
1771
+ [
1772
+ 1,
1773
+ "waveSample",
1774
+ "*",
1775
+ [
1776
+ 1,
1777
+ [
1778
+ 7,
1779
+ "p",
1780
+ "cursorIntensity"
1781
+ ],
1782
+ "*",
1783
+ [5, "0.05"]
1784
+ ]
1785
+ ]
1786
+ ]
1787
+ ]]
1788
+ ],
1724
1789
  [10, [
1725
1790
  1,
1726
1791
  "baseHeight",
1727
1792
  "+",
1728
- [
1729
- 1,
1730
- "waveSample",
1731
- "*",
1732
- [
1733
- 1,
1734
- [
1735
- 7,
1736
- "p",
1737
- "cursorIntensity"
1738
- ],
1739
- "*",
1740
- [5, "0.05"]
1741
- ]
1742
- ]
1793
+ "ripple"
1743
1794
  ]]
1744
1795
  ]],
1745
1796
  [0, [[10, "baseHeight"]]]
@@ -1790,7 +1841,7 @@ function makePropagateKernel() {
1790
1841
  const center = propagateLayout.$.readSrc[idx];
1791
1842
  const sum = __tsover_add(__tsover_add(__tsover_add(left, right), up), down);
1792
1843
  const prev = propagateLayout.$.writeBuf[idx];
1793
- const dampFactor = __tsover_sub(1, __tsover_mul(p.decay, .004));
1844
+ const dampFactor = __tsover_sub(1, __tsover_mul(p.decay, WAVE_DECAY_PER_STEP));
1794
1845
  const k2 = __tsover_mul(.5, __tsover_mul(p.waveSpeed, p.waveSpeed));
1795
1846
  const lap = __tsover_sub(sum, __tsover_mul(center, 4));
1796
1847
  let next = __tsover_mul(__tsover_sub(__tsover_add(__tsover_mul(center, 2), __tsover_mul(lap, k2)), prev), dampFactor);
@@ -1804,6 +1855,8 @@ function makePropagateKernel() {
1804
1855
  const influence = exp(__tsover_mul(__tsover_div(distSq, max(__tsover_mul(p.radius, p.radius), f32(1e-4))), -1));
1805
1856
  next = __tsover_sub(next, __tsover_mul(__tsover_mul(__tsover_mul(influence, p.mouseSpeed), p.dt), 3));
1806
1857
  }
1858
+ const bound = f32(CURSOR_WAVE_BOUND);
1859
+ next = clamp(next, __tsover_mul(bound, -1), bound);
1807
1860
  propagateLayout.$.writeBuf[idx] = next;
1808
1861
  propagateLayout.$.readBuf[idx] = next;
1809
1862
  }
@@ -2103,7 +2156,7 @@ function makePropagateKernel() {
2103
2156
  "decay"
2104
2157
  ],
2105
2158
  "*",
2106
- [5, "0.004"]
2159
+ "WAVE_DECAY_PER_STEP"
2107
2160
  ]
2108
2161
  ]
2109
2162
  ],
@@ -2416,6 +2469,46 @@ function makePropagateKernel() {
2416
2469
  ]
2417
2470
  ]]]
2418
2471
  ],
2472
+ [
2473
+ 13,
2474
+ "bound",
2475
+ [
2476
+ 6,
2477
+ [
2478
+ 7,
2479
+ "d",
2480
+ "f32"
2481
+ ],
2482
+ ["CURSOR_WAVE_BOUND"]
2483
+ ]
2484
+ ],
2485
+ [
2486
+ 2,
2487
+ "next",
2488
+ "=",
2489
+ [
2490
+ 6,
2491
+ [
2492
+ 7,
2493
+ "std",
2494
+ "clamp"
2495
+ ],
2496
+ [
2497
+ "next",
2498
+ [
2499
+ 1,
2500
+ "bound",
2501
+ "*",
2502
+ [
2503
+ 4,
2504
+ "-",
2505
+ [5, "1"]
2506
+ ]
2507
+ ],
2508
+ "bound"
2509
+ ]
2510
+ ]
2511
+ ],
2419
2512
  [
2420
2513
  2,
2421
2514
  [
@@ -2459,7 +2552,9 @@ function makePropagateKernel() {
2459
2552
  "WAVE_MAX",
2460
2553
  "propagateLayout",
2461
2554
  "WAVE_GRID",
2462
- "std"
2555
+ "WAVE_DECAY_PER_STEP",
2556
+ "std",
2557
+ "CURSOR_WAVE_BOUND"
2463
2558
  ]
2464
2559
  },
2465
2560
  externals: () => ({
@@ -2467,54 +2562,86 @@ function makePropagateKernel() {
2467
2562
  WAVE_MAX,
2468
2563
  propagateLayout,
2469
2564
  WAVE_GRID,
2470
- std: std_exports
2565
+ WAVE_DECAY_PER_STEP,
2566
+ std: std_exports,
2567
+ CURSOR_WAVE_BOUND
2471
2568
  })
2472
2569
  }) && $.f)({})).$name("surface3dPropagate");
2473
2570
  }
2474
- function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cursorEnabled) {
2571
+ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cursorEnabled, computeW = COMPUTE_FALLBACK_W, computeH = COMPUTE_FALLBACK_H) {
2475
2572
  const heightFn = buildHeightFn(waveType, octaveCount, cursorEnabled);
2476
2573
  return src_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
2477
2574
  "use gpu";
2478
2575
  const p = computeLayout.$.params;
2479
- const screenU = __tsover_div(__tsover_add(f32(cx), .5), f32(COMPUTE_W));
2480
- const screenV = __tsover_div(__tsover_add(f32(cy), .5), f32(COMPUTE_H));
2576
+ const screenU = __tsover_div(__tsover_add(f32(cx), .5), f32(computeW));
2577
+ const screenV = __tsover_div(__tsover_add(f32(cy), .5), f32(computeH));
2481
2578
  const ndcX = __tsover_mul(__tsover_mul(__tsover_sub(screenU, .5), 2), p.aspect);
2482
2579
  const ndcY = __tsover_mul(__tsover_mul(__tsover_sub(screenV, .5), 2), -1);
2483
2580
  const rayDir = normalize(p.camForward.mul(p.focal).add(p.camRight.mul(ndcX)).add(p.camUp.mul(ndcY)));
2484
- const STEPS = 32;
2485
- const REFINE = 6;
2486
- const rayDownComp = max(__tsover_mul(rayDir.z, -1), f32(.05));
2487
- const tToBase = __tsover_div(p.camPos.z, rayDownComp);
2488
- const marchTotal = min(__tsover_add(tToBase, 1.5), 15);
2489
- const stepSize = __tsover_div(marchTotal, f32(STEPS));
2490
- let tMarch = f32(0);
2581
+ const envelope = p.heightEnvelope;
2582
+ const dzSign = select(f32(-1), f32(1), rayDir.z >= 0);
2583
+ const dzSafe = __tsover_mul(dzSign, max(abs(rayDir.z), f32(1e-6)));
2584
+ const tTop = __tsover_div(__tsover_sub(envelope, p.camPos.z), dzSafe);
2585
+ const tBot = __tsover_div(__tsover_sub(__tsover_mul(envelope, -1), p.camPos.z), dzSafe);
2586
+ const tEnter = max(min(tTop, tBot), f32(0));
2587
+ const tExit = min(max(tTop, tBot), f32(MARCH_FAR));
2588
+ const farPos = p.camPos.add(rayDir.mul(f32(MARCH_FAR)));
2491
2589
  let hit = f32(0);
2492
- const u0 = __tsover_add(__tsover_mul(p.camPos.x, .5), .5);
2493
- const v0 = __tsover_add(__tsover_mul(p.camPos.y, .5), .5);
2494
- let prevDiff = __tsover_sub(p.camPos.z, heightFn(vec2f(u0, v0)));
2495
- for (let s = 0; s < STEPS; s++) {
2496
- tMarch = __tsover_add(tMarch, stepSize);
2497
- const pos = p.camPos.add(rayDir.mul(tMarch));
2498
- const h = heightFn(vec2f(__tsover_add(__tsover_mul(pos.x, .5), .5), __tsover_add(__tsover_mul(pos.y, .5), .5)));
2499
- const diff = __tsover_sub(pos.z, h);
2500
- if (diff < 0 && prevDiff > 0) {
2501
- hit = 1;
2502
- break;
2590
+ let finalT = f32(MARCH_FAR);
2591
+ let hitU = __tsover_add(__tsover_mul(farPos.x, .5), .5);
2592
+ let hitV = __tsover_add(__tsover_mul(farPos.y, .5), .5);
2593
+ let lit = vec3f(1, 1, 1);
2594
+ if (tExit > tEnter) {
2595
+ const stepSize = __tsover_div(__tsover_sub(tExit, tEnter), f32(MARCH_STEPS));
2596
+ let tMarch = tEnter;
2597
+ const pStart = p.camPos.add(rayDir.mul(tEnter));
2598
+ let prevDiff = __tsover_sub(pStart.z, heightFn(vec2f(__tsover_add(__tsover_mul(pStart.x, .5), .5), __tsover_add(__tsover_mul(pStart.y, .5), .5))));
2599
+ for (let s = 0; s < MARCH_STEPS; s++) {
2600
+ tMarch = __tsover_add(tMarch, stepSize);
2601
+ const pos = p.camPos.add(rayDir.mul(tMarch));
2602
+ const h = heightFn(vec2f(__tsover_add(__tsover_mul(pos.x, .5), .5), __tsover_add(__tsover_mul(pos.y, .5), .5)));
2603
+ const diff = __tsover_sub(pos.z, h);
2604
+ if (diff < 0 && prevDiff > 0) {
2605
+ hit = 1;
2606
+ break;
2607
+ }
2608
+ prevDiff = diff;
2609
+ }
2610
+ if (hit > .5) {
2611
+ let tLow = __tsover_sub(tMarch, stepSize);
2612
+ let tHigh = tMarch;
2613
+ for (let r = 0; r < MARCH_REFINE; r++) {
2614
+ const tMid = __tsover_mul(__tsover_add(tLow, tHigh), .5);
2615
+ const pMid = p.camPos.add(rayDir.mul(tMid));
2616
+ if (__tsover_sub(pMid.z, heightFn(vec2f(__tsover_add(__tsover_mul(pMid.x, .5), .5), __tsover_add(__tsover_mul(pMid.y, .5), .5)))) > 0) tLow = tMid;
2617
+ else tHigh = tMid;
2618
+ }
2619
+ finalT = __tsover_mul(__tsover_add(tLow, tHigh), .5);
2620
+ const hitPos = p.camPos.add(rayDir.mul(finalT));
2621
+ hitU = __tsover_add(__tsover_mul(hitPos.x, .5), .5);
2622
+ hitV = __tsover_add(__tsover_mul(hitPos.y, .5), .5);
2623
+ if (lightingEnabled) {
2624
+ const normalEps = .01;
2625
+ const hC = heightFn(vec2f(hitU, hitV));
2626
+ const hR = heightFn(vec2f(__tsover_add(hitU, normalEps), hitV));
2627
+ const hUp = heightFn(vec2f(hitU, __tsover_add(hitV, normalEps)));
2628
+ const dhdu = __tsover_div(__tsover_sub(hR, hC), normalEps);
2629
+ const dhdv = __tsover_div(__tsover_sub(hUp, hC), normalEps);
2630
+ const nrm = normalize(vec3f(__tsover_mul(dhdu, -.5), __tsover_mul(dhdv, -.5), 1));
2631
+ const lightDir = normalize(vec3f(p.lightX, p.lightY, p.lightZ));
2632
+ const viewDir = rayDir.mul(-1);
2633
+ const diffuse = clamp(dot(nrm, lightDir), 0, 1);
2634
+ const halfVec = normalize(lightDir.add(viewDir));
2635
+ const specPow = __tsover_add(__tsover_mul(p.glossiness, 128), 4);
2636
+ const specular = __tsover_mul(pow(clamp(dot(nrm, halfVec), 0, 1), specPow), p.highlights);
2637
+ const ambient = vec3f(.4, .4, .4);
2638
+ const tintedDiffuse = p.lightColor.mul(__tsover_mul(diffuse, .6));
2639
+ const tintedSpec = p.lightColor.mul(specular);
2640
+ const totalLight = ambient.add(tintedDiffuse).add(tintedSpec);
2641
+ lit = clamp(mix(vec3f(1, 1, 1), totalLight, p.lighting), vec3f(0, 0, 0), vec3f(3, 3, 3));
2642
+ }
2503
2643
  }
2504
- prevDiff = diff;
2505
- }
2506
- let tLow = __tsover_sub(tMarch, stepSize);
2507
- let tHigh = tMarch;
2508
- for (let r = 0; r < REFINE; r++) {
2509
- const tMid = __tsover_mul(__tsover_add(tLow, tHigh), .5);
2510
- const pMid = p.camPos.add(rayDir.mul(tMid));
2511
- if (__tsover_sub(pMid.z, heightFn(vec2f(__tsover_add(__tsover_mul(pMid.x, .5), .5), __tsover_add(__tsover_mul(pMid.y, .5), .5)))) > 0) tLow = tMid;
2512
- else tHigh = tMid;
2513
2644
  }
2514
- const finalT = __tsover_mul(__tsover_add(tLow, tHigh), .5);
2515
- const hitPos = p.camPos.add(rayDir.mul(finalT));
2516
- const hitU = __tsover_add(__tsover_mul(hitPos.x, .5), .5);
2517
- const hitV = __tsover_add(__tsover_mul(hitPos.y, .5), .5);
2518
2645
  const rawSampleUV = vec2f(hitU, __tsover_sub(1, hitV));
2519
2646
  let finalUV = vec2f(rawSampleUV.x, rawSampleUV.y);
2520
2647
  let outOfBoundsMask = f32(1);
@@ -2524,28 +2651,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
2524
2651
  const inside = rawSampleUV.x >= 0 && rawSampleUV.x <= 1 && rawSampleUV.y >= 0 && rawSampleUV.y <= 1;
2525
2652
  outOfBoundsMask = select(f32(0), f32(1), inside);
2526
2653
  } else finalUV = clamp(rawSampleUV, vec2f(0, 0), vec2f(1, 1));
2527
- let lit = vec3f(1, 1, 1);
2528
- if (lightingEnabled) {
2529
- const normalEps = .01;
2530
- const hC = heightFn(vec2f(hitU, hitV));
2531
- const hR = heightFn(vec2f(__tsover_add(hitU, normalEps), hitV));
2532
- const hUp = heightFn(vec2f(hitU, __tsover_add(hitV, normalEps)));
2533
- const dhdu = __tsover_div(__tsover_sub(hR, hC), normalEps);
2534
- const dhdv = __tsover_div(__tsover_sub(hUp, hC), normalEps);
2535
- const nrm = normalize(vec3f(__tsover_mul(dhdu, -.5), __tsover_mul(dhdv, -.5), 1));
2536
- const lightDir = normalize(vec3f(p.lightX, p.lightY, p.lightZ));
2537
- const viewDir = rayDir.mul(-1);
2538
- const diffuse = clamp(dot(nrm, lightDir), 0, 1);
2539
- const halfVec = normalize(lightDir.add(viewDir));
2540
- const specPow = __tsover_add(__tsover_mul(p.glossiness, 128), 4);
2541
- const specular = __tsover_mul(pow(clamp(dot(nrm, halfVec), 0, 1), specPow), p.highlights);
2542
- const ambient = vec3f(.4, .4, .4);
2543
- const tintedDiffuse = p.lightColor.mul(__tsover_mul(diffuse, .6));
2544
- const tintedSpec = p.lightColor.mul(specular);
2545
- const totalLight = ambient.add(tintedDiffuse).add(tintedSpec);
2546
- lit = clamp(mix(vec3f(1, 1, 1), totalLight, p.lighting), vec3f(0, 0, 0), vec3f(3, 3, 3));
2547
- }
2548
- const CUTOFF_RANGE = f32(15);
2654
+ const CUTOFF_RANGE = f32(MARCH_FAR);
2549
2655
  const edgeAA = .05;
2550
2656
  const nearT = __tsover_mul(p.nearCutoff, CUTOFF_RANGE);
2551
2657
  const farT = __tsover_mul(p.farCutoff, CUTOFF_RANGE);
@@ -2606,7 +2712,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
2606
2712
  "d",
2607
2713
  "f32"
2608
2714
  ],
2609
- ["COMPUTE_W"]
2715
+ ["computeW"]
2610
2716
  ]
2611
2717
  ]
2612
2718
  ],
@@ -2637,7 +2743,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
2637
2743
  "d",
2638
2744
  "f32"
2639
2745
  ],
2640
- ["COMPUTE_H"]
2746
+ ["computeH"]
2641
2747
  ]
2642
2748
  ]
2643
2749
  ],
@@ -2760,113 +2866,241 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
2760
2866
  ],
2761
2867
  [
2762
2868
  13,
2763
- "STEPS",
2764
- [5, "32"]
2765
- ],
2766
- [
2767
- 13,
2768
- "REFINE",
2769
- [5, "6"]
2869
+ "envelope",
2870
+ [
2871
+ 7,
2872
+ "p",
2873
+ "heightEnvelope"
2874
+ ]
2770
2875
  ],
2771
2876
  [
2772
2877
  13,
2773
- "rayDownComp",
2878
+ "dzSign",
2774
2879
  [
2775
2880
  6,
2776
2881
  [
2777
2882
  7,
2778
2883
  "std",
2779
- "max"
2884
+ "select"
2780
2885
  ],
2781
- [[
2782
- 1,
2886
+ [
2783
2887
  [
2784
- 7,
2785
- "rayDir",
2786
- "z"
2888
+ 6,
2889
+ [
2890
+ 7,
2891
+ "d",
2892
+ "f32"
2893
+ ],
2894
+ [[
2895
+ 4,
2896
+ "-",
2897
+ [5, "1"]
2898
+ ]]
2787
2899
  ],
2788
- "*",
2789
2900
  [
2790
- 4,
2791
- "-",
2792
- [5, "1"]
2901
+ 6,
2902
+ [
2903
+ 7,
2904
+ "d",
2905
+ "f32"
2906
+ ],
2907
+ [[5, "1"]]
2908
+ ],
2909
+ [
2910
+ 1,
2911
+ [
2912
+ 7,
2913
+ "rayDir",
2914
+ "z"
2915
+ ],
2916
+ ">=",
2917
+ [5, "0"]
2793
2918
  ]
2794
- ], [
2919
+ ]
2920
+ ]
2921
+ ],
2922
+ [
2923
+ 13,
2924
+ "dzSafe",
2925
+ [
2926
+ 1,
2927
+ "dzSign",
2928
+ "*",
2929
+ [
2795
2930
  6,
2796
2931
  [
2797
2932
  7,
2798
- "d",
2799
- "f32"
2933
+ "std",
2934
+ "max"
2800
2935
  ],
2801
- [[5, "0.05"]]
2802
- ]]
2936
+ [[
2937
+ 6,
2938
+ [
2939
+ 7,
2940
+ "std",
2941
+ "abs"
2942
+ ],
2943
+ [[
2944
+ 7,
2945
+ "rayDir",
2946
+ "z"
2947
+ ]]
2948
+ ], [
2949
+ 6,
2950
+ [
2951
+ 7,
2952
+ "d",
2953
+ "f32"
2954
+ ],
2955
+ [[5, "0.000001"]]
2956
+ ]]
2957
+ ]
2803
2958
  ]
2804
2959
  ],
2805
2960
  [
2806
2961
  13,
2807
- "tToBase",
2962
+ "tTop",
2808
2963
  [
2809
2964
  1,
2810
2965
  [
2811
- 7,
2966
+ 1,
2967
+ "envelope",
2968
+ "-",
2812
2969
  [
2813
2970
  7,
2814
- "p",
2815
- "camPos"
2971
+ [
2972
+ 7,
2973
+ "p",
2974
+ "camPos"
2975
+ ],
2976
+ "z"
2977
+ ]
2978
+ ],
2979
+ "/",
2980
+ "dzSafe"
2981
+ ]
2982
+ ],
2983
+ [
2984
+ 13,
2985
+ "tBot",
2986
+ [
2987
+ 1,
2988
+ [
2989
+ 1,
2990
+ [
2991
+ 1,
2992
+ "envelope",
2993
+ "*",
2994
+ [
2995
+ 4,
2996
+ "-",
2997
+ [5, "1"]
2998
+ ]
2816
2999
  ],
2817
- "z"
3000
+ "-",
3001
+ [
3002
+ 7,
3003
+ [
3004
+ 7,
3005
+ "p",
3006
+ "camPos"
3007
+ ],
3008
+ "z"
3009
+ ]
2818
3010
  ],
2819
3011
  "/",
2820
- "rayDownComp"
3012
+ "dzSafe"
2821
3013
  ]
2822
3014
  ],
2823
3015
  [
2824
3016
  13,
2825
- "marchTotal",
3017
+ "tEnter",
2826
3018
  [
2827
3019
  6,
2828
3020
  [
2829
3021
  7,
2830
3022
  "std",
2831
- "min"
3023
+ "max"
2832
3024
  ],
2833
3025
  [[
2834
- 1,
2835
- "tToBase",
2836
- "+",
2837
- [5, "1.5"]
2838
- ], [5, "15"]]
3026
+ 6,
3027
+ [
3028
+ 7,
3029
+ "std",
3030
+ "min"
3031
+ ],
3032
+ ["tTop", "tBot"]
3033
+ ], [
3034
+ 6,
3035
+ [
3036
+ 7,
3037
+ "d",
3038
+ "f32"
3039
+ ],
3040
+ [[5, "0"]]
3041
+ ]]
2839
3042
  ]
2840
3043
  ],
2841
3044
  [
2842
3045
  13,
2843
- "stepSize",
3046
+ "tExit",
2844
3047
  [
2845
- 1,
2846
- "marchTotal",
2847
- "/",
3048
+ 6,
2848
3049
  [
3050
+ 7,
3051
+ "std",
3052
+ "min"
3053
+ ],
3054
+ [[
3055
+ 6,
3056
+ [
3057
+ 7,
3058
+ "std",
3059
+ "max"
3060
+ ],
3061
+ ["tTop", "tBot"]
3062
+ ], [
2849
3063
  6,
2850
3064
  [
2851
3065
  7,
2852
3066
  "d",
2853
3067
  "f32"
2854
3068
  ],
2855
- ["STEPS"]
2856
- ]
3069
+ ["MARCH_FAR"]
3070
+ ]]
2857
3071
  ]
2858
3072
  ],
2859
3073
  [
2860
- 12,
2861
- "tMarch",
3074
+ 13,
3075
+ "farPos",
2862
3076
  [
2863
3077
  6,
2864
3078
  [
2865
3079
  7,
2866
- "d",
2867
- "f32"
3080
+ [
3081
+ 7,
3082
+ "p",
3083
+ "camPos"
3084
+ ],
3085
+ "add"
2868
3086
  ],
2869
- [[5, "0"]]
3087
+ [[
3088
+ 6,
3089
+ [
3090
+ 7,
3091
+ "rayDir",
3092
+ "mul"
3093
+ ],
3094
+ [[
3095
+ 6,
3096
+ [
3097
+ 7,
3098
+ "d",
3099
+ "f32"
3100
+ ],
3101
+ ["MARCH_FAR"]
3102
+ ]]
3103
+ ]]
2870
3104
  ]
2871
3105
  ],
2872
3106
  [
@@ -2883,19 +3117,28 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
2883
3117
  ]
2884
3118
  ],
2885
3119
  [
2886
- 13,
2887
- "u0",
3120
+ 12,
3121
+ "finalT",
2888
3122
  [
2889
- 1,
3123
+ 6,
3124
+ [
3125
+ 7,
3126
+ "d",
3127
+ "f32"
3128
+ ],
3129
+ ["MARCH_FAR"]
3130
+ ]
3131
+ ],
3132
+ [
3133
+ 12,
3134
+ "hitU",
3135
+ [
3136
+ 1,
2890
3137
  [
2891
3138
  1,
2892
3139
  [
2893
3140
  7,
2894
- [
2895
- 7,
2896
- "p",
2897
- "camPos"
2898
- ],
3141
+ "farPos",
2899
3142
  "x"
2900
3143
  ],
2901
3144
  "*",
@@ -2906,19 +3149,15 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
2906
3149
  ]
2907
3150
  ],
2908
3151
  [
2909
- 13,
2910
- "v0",
3152
+ 12,
3153
+ "hitV",
2911
3154
  [
2912
3155
  1,
2913
3156
  [
2914
3157
  1,
2915
3158
  [
2916
3159
  7,
2917
- [
2918
- 7,
2919
- "p",
2920
- "camPos"
2921
- ],
3160
+ "farPos",
2922
3161
  "y"
2923
3162
  ],
2924
3163
  "*",
@@ -2930,233 +3169,61 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
2930
3169
  ],
2931
3170
  [
2932
3171
  12,
2933
- "prevDiff",
3172
+ "lit",
2934
3173
  [
2935
- 1,
3174
+ 6,
2936
3175
  [
2937
3176
  7,
2938
- [
2939
- 7,
2940
- "p",
2941
- "camPos"
2942
- ],
2943
- "z"
3177
+ "d",
3178
+ "vec3f"
2944
3179
  ],
2945
- "-",
2946
3180
  [
2947
- 6,
2948
- "heightFn",
2949
- [[
2950
- 6,
2951
- [
2952
- 7,
2953
- "d",
2954
- "vec2f"
2955
- ],
2956
- ["u0", "v0"]
2957
- ]]
3181
+ [5, "1"],
3182
+ [5, "1"],
3183
+ [5, "1"]
2958
3184
  ]
2959
3185
  ]
2960
3186
  ],
2961
3187
  [
2962
- 14,
2963
- [
2964
- 12,
2965
- "s",
2966
- [5, "0"]
2967
- ],
3188
+ 11,
2968
3189
  [
2969
3190
  1,
2970
- "s",
2971
- "<",
2972
- "STEPS"
2973
- ],
2974
- [
2975
- 102,
2976
- "++",
2977
- "s"
3191
+ "tExit",
3192
+ ">",
3193
+ "tEnter"
2978
3194
  ],
2979
3195
  [0, [
2980
- [
2981
- 2,
2982
- "tMarch",
2983
- "=",
2984
- [
2985
- 1,
2986
- "tMarch",
2987
- "+",
2988
- "stepSize"
2989
- ]
2990
- ],
2991
3196
  [
2992
3197
  13,
2993
- "pos",
3198
+ "stepSize",
2994
3199
  [
2995
- 6,
3200
+ 1,
2996
3201
  [
2997
- 7,
2998
- [
2999
- 7,
3000
- "p",
3001
- "camPos"
3002
- ],
3003
- "add"
3202
+ 1,
3203
+ "tExit",
3204
+ "-",
3205
+ "tEnter"
3004
3206
  ],
3005
- [[
3006
- 6,
3007
- [
3008
- 7,
3009
- "rayDir",
3010
- "mul"
3011
- ],
3012
- ["tMarch"]
3013
- ]]
3014
- ]
3015
- ],
3016
- [
3017
- 13,
3018
- "h",
3019
- [
3020
- 6,
3021
- "heightFn",
3022
- [[
3207
+ "/",
3208
+ [
3023
3209
  6,
3024
3210
  [
3025
3211
  7,
3026
3212
  "d",
3027
- "vec2f"
3213
+ "f32"
3028
3214
  ],
3029
- [[
3030
- 1,
3031
- [
3032
- 1,
3033
- [
3034
- 7,
3035
- "pos",
3036
- "x"
3037
- ],
3038
- "*",
3039
- [5, "0.5"]
3040
- ],
3041
- "+",
3042
- [5, "0.5"]
3043
- ], [
3044
- 1,
3045
- [
3046
- 1,
3047
- [
3048
- 7,
3049
- "pos",
3050
- "y"
3051
- ],
3052
- "*",
3053
- [5, "0.5"]
3054
- ],
3055
- "+",
3056
- [5, "0.5"]
3057
- ]]
3058
- ]]
3059
- ]
3060
- ],
3061
- [
3062
- 13,
3063
- "diff",
3064
- [
3065
- 1,
3066
- [
3067
- 7,
3068
- "pos",
3069
- "z"
3070
- ],
3071
- "-",
3072
- "h"
3073
- ]
3074
- ],
3075
- [
3076
- 11,
3077
- [
3078
- 3,
3079
- [
3080
- 1,
3081
- "diff",
3082
- "<",
3083
- [5, "0"]
3084
- ],
3085
- "&&",
3086
- [
3087
- 1,
3088
- "prevDiff",
3089
- ">",
3090
- [5, "0"]
3215
+ ["MARCH_STEPS"]
3091
3216
  ]
3092
- ],
3093
- [0, [[
3094
- 2,
3095
- "hit",
3096
- "=",
3097
- [5, "1"]
3098
- ], [17]]]
3217
+ ]
3099
3218
  ],
3100
3219
  [
3101
- 2,
3102
- "prevDiff",
3103
- "=",
3104
- "diff"
3105
- ]
3106
- ]]
3107
- ],
3108
- [
3109
- 12,
3110
- "tLow",
3111
- [
3112
- 1,
3113
- "tMarch",
3114
- "-",
3115
- "stepSize"
3116
- ]
3117
- ],
3118
- [
3119
- 12,
3120
- "tHigh",
3121
- "tMarch"
3122
- ],
3123
- [
3124
- 14,
3125
- [
3126
- 12,
3127
- "r",
3128
- [5, "0"]
3129
- ],
3130
- [
3131
- 1,
3132
- "r",
3133
- "<",
3134
- "REFINE"
3135
- ],
3136
- [
3137
- 102,
3138
- "++",
3139
- "r"
3140
- ],
3141
- [0, [
3142
- [
3143
- 13,
3144
- "tMid",
3145
- [
3146
- 1,
3147
- [
3148
- 1,
3149
- "tLow",
3150
- "+",
3151
- "tHigh"
3152
- ],
3153
- "*",
3154
- [5, "0.5"]
3155
- ]
3220
+ 12,
3221
+ "tMarch",
3222
+ "tEnter"
3156
3223
  ],
3157
3224
  [
3158
3225
  13,
3159
- "pMid",
3226
+ "pStart",
3160
3227
  [
3161
3228
  6,
3162
3229
  [
@@ -3175,18 +3242,18 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
3175
3242
  "rayDir",
3176
3243
  "mul"
3177
3244
  ],
3178
- ["tMid"]
3245
+ ["tEnter"]
3179
3246
  ]]
3180
3247
  ]
3181
3248
  ],
3182
3249
  [
3183
- 13,
3184
- "dMid",
3250
+ 12,
3251
+ "prevDiff",
3185
3252
  [
3186
3253
  1,
3187
3254
  [
3188
3255
  7,
3189
- "pMid",
3256
+ "pStart",
3190
3257
  "z"
3191
3258
  ],
3192
3259
  "-",
@@ -3206,7 +3273,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
3206
3273
  1,
3207
3274
  [
3208
3275
  7,
3209
- "pMid",
3276
+ "pStart",
3210
3277
  "x"
3211
3278
  ],
3212
3279
  "*",
@@ -3220,7 +3287,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
3220
3287
  1,
3221
3288
  [
3222
3289
  7,
3223
- "pMid",
3290
+ "pStart",
3224
3291
  "y"
3225
3292
  ],
3226
3293
  "*",
@@ -3234,805 +3301,1079 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
3234
3301
  ]
3235
3302
  ],
3236
3303
  [
3237
- 11,
3304
+ 14,
3238
3305
  [
3239
- 1,
3240
- "dMid",
3241
- ">",
3306
+ 12,
3307
+ "s",
3242
3308
  [5, "0"]
3243
3309
  ],
3244
- [0, [[
3245
- 2,
3246
- "tLow",
3247
- "=",
3248
- "tMid"
3249
- ]]],
3250
- [0, [[
3251
- 2,
3252
- "tHigh",
3253
- "=",
3254
- "tMid"
3255
- ]]]
3256
- ]
3257
- ]]
3258
- ],
3259
- [
3260
- 13,
3261
- "finalT",
3262
- [
3263
- 1,
3264
- [
3265
- 1,
3266
- "tLow",
3267
- "+",
3268
- "tHigh"
3269
- ],
3270
- "*",
3271
- [5, "0.5"]
3272
- ]
3273
- ],
3274
- [
3275
- 13,
3276
- "hitPos",
3277
- [
3278
- 6,
3279
- [
3280
- 7,
3281
3310
  [
3282
- 7,
3283
- "p",
3284
- "camPos"
3311
+ 1,
3312
+ "s",
3313
+ "<",
3314
+ "MARCH_STEPS"
3285
3315
  ],
3286
- "add"
3287
- ],
3288
- [[
3289
- 6,
3290
3316
  [
3291
- 7,
3292
- "rayDir",
3293
- "mul"
3317
+ 102,
3318
+ "++",
3319
+ "s"
3294
3320
  ],
3295
- ["finalT"]
3296
- ]]
3297
- ]
3298
- ],
3299
- [
3300
- 13,
3301
- "hitU",
3302
- [
3303
- 1,
3304
- [
3305
- 1,
3306
- [
3307
- 7,
3308
- "hitPos",
3309
- "x"
3310
- ],
3311
- "*",
3312
- [5, "0.5"]
3313
- ],
3314
- "+",
3315
- [5, "0.5"]
3316
- ]
3317
- ],
3318
- [
3319
- 13,
3320
- "hitV",
3321
- [
3322
- 1,
3323
- [
3324
- 1,
3325
- [
3326
- 7,
3327
- "hitPos",
3328
- "y"
3329
- ],
3330
- "*",
3331
- [5, "0.5"]
3332
- ],
3333
- "+",
3334
- [5, "0.5"]
3335
- ]
3336
- ],
3337
- [
3338
- 13,
3339
- "rawSampleUV",
3340
- [
3341
- 6,
3342
- [
3343
- 7,
3344
- "d",
3345
- "vec2f"
3346
- ],
3347
- ["hitU", [
3348
- 1,
3349
- [5, "1"],
3350
- "-",
3351
- "hitV"
3352
- ]]
3353
- ]
3354
- ],
3355
- [
3356
- 12,
3357
- "finalUV",
3358
- [
3359
- 6,
3360
- [
3361
- 7,
3362
- "d",
3363
- "vec2f"
3364
- ],
3365
- [[
3366
- 7,
3367
- "rawSampleUV",
3368
- "x"
3369
- ], [
3370
- 7,
3371
- "rawSampleUV",
3372
- "y"
3373
- ]]
3374
- ]
3375
- ],
3376
- [
3377
- 12,
3378
- "outOfBoundsMask",
3379
- [
3380
- 6,
3381
- [
3382
- 7,
3383
- "d",
3384
- "f32"
3385
- ],
3386
- [[5, "1"]]
3387
- ]
3388
- ],
3389
- [
3390
- 11,
3391
- [
3392
- 1,
3393
- "edgeMode",
3394
- "===",
3395
- [5, "2"]
3396
- ],
3397
- [0, [[
3398
- 2,
3399
- "finalUV",
3400
- "=",
3401
- [
3402
- 6,
3403
- [
3404
- 7,
3405
- "edges",
3406
- "edgeMirrorUV"
3407
- ],
3408
- ["rawSampleUV"]
3409
- ]
3410
- ]]],
3411
- [
3412
- 11,
3413
- [
3414
- 1,
3415
- "edgeMode",
3416
- "===",
3417
- [5, "3"]
3418
- ],
3419
- [0, [[
3420
- 2,
3421
- "finalUV",
3422
- "=",
3423
- [
3424
- 6,
3425
- [
3426
- 7,
3427
- "edges",
3428
- "edgeWrapUV"
3429
- ],
3430
- ["rawSampleUV"]
3431
- ]
3432
- ]]],
3433
- [
3434
- 11,
3435
- [
3436
- 1,
3437
- "edgeMode",
3438
- "===",
3439
- [5, "1"]
3440
- ],
3441
- [0, [[
3442
- 13,
3443
- "inside",
3321
+ [0, [
3444
3322
  [
3445
- 3,
3446
- [
3447
- 3,
3448
- [
3449
- 3,
3450
- [
3451
- 1,
3452
- [
3453
- 7,
3454
- "rawSampleUV",
3455
- "x"
3456
- ],
3457
- ">=",
3458
- [5, "0"]
3459
- ],
3460
- "&&",
3461
- [
3462
- 1,
3463
- [
3464
- 7,
3465
- "rawSampleUV",
3466
- "x"
3467
- ],
3468
- "<=",
3469
- [5, "1"]
3470
- ]
3471
- ],
3472
- "&&",
3473
- [
3474
- 1,
3475
- [
3476
- 7,
3477
- "rawSampleUV",
3478
- "y"
3479
- ],
3480
- ">=",
3481
- [5, "0"]
3482
- ]
3483
- ],
3484
- "&&",
3323
+ 2,
3324
+ "tMarch",
3325
+ "=",
3485
3326
  [
3486
3327
  1,
3487
- [
3488
- 7,
3489
- "rawSampleUV",
3490
- "y"
3491
- ],
3492
- "<=",
3493
- [5, "1"]
3328
+ "tMarch",
3329
+ "+",
3330
+ "stepSize"
3494
3331
  ]
3495
- ]
3496
- ], [
3497
- 2,
3498
- "outOfBoundsMask",
3499
- "=",
3332
+ ],
3500
3333
  [
3501
- 6,
3502
- [
3503
- 7,
3504
- "std",
3505
- "select"
3506
- ],
3334
+ 13,
3335
+ "pos",
3507
3336
  [
3337
+ 6,
3508
3338
  [
3509
- 6,
3339
+ 7,
3510
3340
  [
3511
3341
  7,
3512
- "d",
3513
- "f32"
3342
+ "p",
3343
+ "camPos"
3514
3344
  ],
3515
- [[5, "0"]]
3345
+ "add"
3516
3346
  ],
3517
- [
3347
+ [[
3518
3348
  6,
3519
3349
  [
3520
3350
  7,
3521
- "d",
3522
- "f32"
3351
+ "rayDir",
3352
+ "mul"
3523
3353
  ],
3524
- [[5, "1"]]
3525
- ],
3526
- "inside"
3354
+ ["tMarch"]
3355
+ ]]
3527
3356
  ]
3528
- ]
3529
- ]]],
3530
- [0, [[
3531
- 2,
3532
- "finalUV",
3533
- "=",
3357
+ ],
3534
3358
  [
3535
- 6,
3536
- [
3537
- 7,
3538
- "std",
3539
- "clamp"
3540
- ],
3359
+ 13,
3360
+ "h",
3541
3361
  [
3542
- "rawSampleUV",
3543
- [
3544
- 6,
3545
- [
3546
- 7,
3547
- "d",
3548
- "vec2f"
3549
- ],
3550
- [[5, "0"], [5, "0"]]
3551
- ],
3552
- [
3362
+ 6,
3363
+ "heightFn",
3364
+ [[
3553
3365
  6,
3554
3366
  [
3555
3367
  7,
3556
3368
  "d",
3557
3369
  "vec2f"
3558
3370
  ],
3559
- [[5, "1"], [5, "1"]]
3560
- ]
3561
- ]
3562
- ]
3563
- ]]]
3564
- ]
3565
- ]
3566
- ],
3567
- [
3568
- 12,
3569
- "lit",
3570
- [
3571
- 6,
3572
- [
3573
- 7,
3574
- "d",
3575
- "vec3f"
3576
- ],
3577
- [
3578
- [5, "1"],
3579
- [5, "1"],
3580
- [5, "1"]
3581
- ]
3582
- ]
3583
- ],
3584
- [
3585
- 11,
3586
- "lightingEnabled",
3587
- [0, [
3588
- [
3589
- 13,
3590
- "normalEps",
3591
- [5, "0.01"]
3592
- ],
3593
- [
3594
- 13,
3595
- "hC",
3596
- [
3597
- 6,
3598
- "heightFn",
3599
- [[
3600
- 6,
3371
+ [[
3372
+ 1,
3373
+ [
3374
+ 1,
3375
+ [
3376
+ 7,
3377
+ "pos",
3378
+ "x"
3379
+ ],
3380
+ "*",
3381
+ [5, "0.5"]
3382
+ ],
3383
+ "+",
3384
+ [5, "0.5"]
3385
+ ], [
3386
+ 1,
3387
+ [
3388
+ 1,
3389
+ [
3390
+ 7,
3391
+ "pos",
3392
+ "y"
3393
+ ],
3394
+ "*",
3395
+ [5, "0.5"]
3396
+ ],
3397
+ "+",
3398
+ [5, "0.5"]
3399
+ ]]
3400
+ ]]
3401
+ ]
3402
+ ],
3403
+ [
3404
+ 13,
3405
+ "diff",
3601
3406
  [
3602
- 7,
3603
- "d",
3604
- "vec2f"
3407
+ 1,
3408
+ [
3409
+ 7,
3410
+ "pos",
3411
+ "z"
3412
+ ],
3413
+ "-",
3414
+ "h"
3415
+ ]
3416
+ ],
3417
+ [
3418
+ 11,
3419
+ [
3420
+ 3,
3421
+ [
3422
+ 1,
3423
+ "diff",
3424
+ "<",
3425
+ [5, "0"]
3426
+ ],
3427
+ "&&",
3428
+ [
3429
+ 1,
3430
+ "prevDiff",
3431
+ ">",
3432
+ [5, "0"]
3433
+ ]
3605
3434
  ],
3606
- ["hitU", "hitV"]
3607
- ]]
3608
- ]
3435
+ [0, [[
3436
+ 2,
3437
+ "hit",
3438
+ "=",
3439
+ [5, "1"]
3440
+ ], [17]]]
3441
+ ],
3442
+ [
3443
+ 2,
3444
+ "prevDiff",
3445
+ "=",
3446
+ "diff"
3447
+ ]
3448
+ ]]
3609
3449
  ],
3610
3450
  [
3611
- 13,
3612
- "hR",
3451
+ 11,
3613
3452
  [
3614
- 6,
3615
- "heightFn",
3616
- [[
3617
- 6,
3453
+ 1,
3454
+ "hit",
3455
+ ">",
3456
+ [5, "0.5"]
3457
+ ],
3458
+ [0, [
3459
+ [
3460
+ 12,
3461
+ "tLow",
3618
3462
  [
3619
- 7,
3620
- "d",
3621
- "vec2f"
3622
- ],
3623
- [[
3624
3463
  1,
3625
- "hitU",
3626
- "+",
3627
- "normalEps"
3628
- ], "hitV"]
3629
- ]]
3630
- ]
3631
- ],
3632
- [
3633
- 13,
3634
- "hUp",
3635
- [
3636
- 6,
3637
- "heightFn",
3638
- [[
3639
- 6,
3464
+ "tMarch",
3465
+ "-",
3466
+ "stepSize"
3467
+ ]
3468
+ ],
3469
+ [
3470
+ 12,
3471
+ "tHigh",
3472
+ "tMarch"
3473
+ ],
3474
+ [
3475
+ 14,
3640
3476
  [
3641
- 7,
3642
- "d",
3643
- "vec2f"
3477
+ 12,
3478
+ "r",
3479
+ [5, "0"]
3644
3480
  ],
3645
- ["hitU", [
3481
+ [
3646
3482
  1,
3647
- "hitV",
3648
- "+",
3649
- "normalEps"
3483
+ "r",
3484
+ "<",
3485
+ "MARCH_REFINE"
3486
+ ],
3487
+ [
3488
+ 102,
3489
+ "++",
3490
+ "r"
3491
+ ],
3492
+ [0, [
3493
+ [
3494
+ 13,
3495
+ "tMid",
3496
+ [
3497
+ 1,
3498
+ [
3499
+ 1,
3500
+ "tLow",
3501
+ "+",
3502
+ "tHigh"
3503
+ ],
3504
+ "*",
3505
+ [5, "0.5"]
3506
+ ]
3507
+ ],
3508
+ [
3509
+ 13,
3510
+ "pMid",
3511
+ [
3512
+ 6,
3513
+ [
3514
+ 7,
3515
+ [
3516
+ 7,
3517
+ "p",
3518
+ "camPos"
3519
+ ],
3520
+ "add"
3521
+ ],
3522
+ [[
3523
+ 6,
3524
+ [
3525
+ 7,
3526
+ "rayDir",
3527
+ "mul"
3528
+ ],
3529
+ ["tMid"]
3530
+ ]]
3531
+ ]
3532
+ ],
3533
+ [
3534
+ 13,
3535
+ "dMid",
3536
+ [
3537
+ 1,
3538
+ [
3539
+ 7,
3540
+ "pMid",
3541
+ "z"
3542
+ ],
3543
+ "-",
3544
+ [
3545
+ 6,
3546
+ "heightFn",
3547
+ [[
3548
+ 6,
3549
+ [
3550
+ 7,
3551
+ "d",
3552
+ "vec2f"
3553
+ ],
3554
+ [[
3555
+ 1,
3556
+ [
3557
+ 1,
3558
+ [
3559
+ 7,
3560
+ "pMid",
3561
+ "x"
3562
+ ],
3563
+ "*",
3564
+ [5, "0.5"]
3565
+ ],
3566
+ "+",
3567
+ [5, "0.5"]
3568
+ ], [
3569
+ 1,
3570
+ [
3571
+ 1,
3572
+ [
3573
+ 7,
3574
+ "pMid",
3575
+ "y"
3576
+ ],
3577
+ "*",
3578
+ [5, "0.5"]
3579
+ ],
3580
+ "+",
3581
+ [5, "0.5"]
3582
+ ]]
3583
+ ]]
3584
+ ]
3585
+ ]
3586
+ ],
3587
+ [
3588
+ 11,
3589
+ [
3590
+ 1,
3591
+ "dMid",
3592
+ ">",
3593
+ [5, "0"]
3594
+ ],
3595
+ [0, [[
3596
+ 2,
3597
+ "tLow",
3598
+ "=",
3599
+ "tMid"
3600
+ ]]],
3601
+ [0, [[
3602
+ 2,
3603
+ "tHigh",
3604
+ "=",
3605
+ "tMid"
3606
+ ]]]
3607
+ ]
3650
3608
  ]]
3651
- ]]
3652
- ]
3653
- ],
3654
- [
3655
- 13,
3656
- "dhdu",
3657
- [
3658
- 1,
3659
- [
3660
- 1,
3661
- "hR",
3662
- "-",
3663
- "hC"
3664
3609
  ],
3665
- "/",
3666
- "normalEps"
3667
- ]
3668
- ],
3669
- [
3670
- 13,
3671
- "dhdv",
3672
- [
3673
- 1,
3674
3610
  [
3675
- 1,
3676
- "hUp",
3677
- "-",
3678
- "hC"
3611
+ 2,
3612
+ "finalT",
3613
+ "=",
3614
+ [
3615
+ 1,
3616
+ [
3617
+ 1,
3618
+ "tLow",
3619
+ "+",
3620
+ "tHigh"
3621
+ ],
3622
+ "*",
3623
+ [5, "0.5"]
3624
+ ]
3679
3625
  ],
3680
- "/",
3681
- "normalEps"
3682
- ]
3683
- ],
3684
- [
3685
- 13,
3686
- "nrm",
3687
- [
3688
- 6,
3689
3626
  [
3690
- 7,
3691
- "std",
3692
- "normalize"
3627
+ 13,
3628
+ "hitPos",
3629
+ [
3630
+ 6,
3631
+ [
3632
+ 7,
3633
+ [
3634
+ 7,
3635
+ "p",
3636
+ "camPos"
3637
+ ],
3638
+ "add"
3639
+ ],
3640
+ [[
3641
+ 6,
3642
+ [
3643
+ 7,
3644
+ "rayDir",
3645
+ "mul"
3646
+ ],
3647
+ ["finalT"]
3648
+ ]]
3649
+ ]
3693
3650
  ],
3694
- [[
3695
- 6,
3651
+ [
3652
+ 2,
3653
+ "hitU",
3654
+ "=",
3696
3655
  [
3697
- 7,
3698
- "d",
3699
- "vec3f"
3700
- ],
3656
+ 1,
3657
+ [
3658
+ 1,
3659
+ [
3660
+ 7,
3661
+ "hitPos",
3662
+ "x"
3663
+ ],
3664
+ "*",
3665
+ [5, "0.5"]
3666
+ ],
3667
+ "+",
3668
+ [5, "0.5"]
3669
+ ]
3670
+ ],
3671
+ [
3672
+ 2,
3673
+ "hitV",
3674
+ "=",
3701
3675
  [
3676
+ 1,
3677
+ [
3678
+ 1,
3679
+ [
3680
+ 7,
3681
+ "hitPos",
3682
+ "y"
3683
+ ],
3684
+ "*",
3685
+ [5, "0.5"]
3686
+ ],
3687
+ "+",
3688
+ [5, "0.5"]
3689
+ ]
3690
+ ],
3691
+ [
3692
+ 11,
3693
+ "lightingEnabled",
3694
+ [0, [
3695
+ [
3696
+ 13,
3697
+ "normalEps",
3698
+ [5, "0.01"]
3699
+ ],
3700
+ [
3701
+ 13,
3702
+ "hC",
3703
+ [
3704
+ 6,
3705
+ "heightFn",
3706
+ [[
3707
+ 6,
3708
+ [
3709
+ 7,
3710
+ "d",
3711
+ "vec2f"
3712
+ ],
3713
+ ["hitU", "hitV"]
3714
+ ]]
3715
+ ]
3716
+ ],
3717
+ [
3718
+ 13,
3719
+ "hR",
3720
+ [
3721
+ 6,
3722
+ "heightFn",
3723
+ [[
3724
+ 6,
3725
+ [
3726
+ 7,
3727
+ "d",
3728
+ "vec2f"
3729
+ ],
3730
+ [[
3731
+ 1,
3732
+ "hitU",
3733
+ "+",
3734
+ "normalEps"
3735
+ ], "hitV"]
3736
+ ]]
3737
+ ]
3738
+ ],
3739
+ [
3740
+ 13,
3741
+ "hUp",
3742
+ [
3743
+ 6,
3744
+ "heightFn",
3745
+ [[
3746
+ 6,
3747
+ [
3748
+ 7,
3749
+ "d",
3750
+ "vec2f"
3751
+ ],
3752
+ ["hitU", [
3753
+ 1,
3754
+ "hitV",
3755
+ "+",
3756
+ "normalEps"
3757
+ ]]
3758
+ ]]
3759
+ ]
3760
+ ],
3761
+ [
3762
+ 13,
3763
+ "dhdu",
3764
+ [
3765
+ 1,
3766
+ [
3767
+ 1,
3768
+ "hR",
3769
+ "-",
3770
+ "hC"
3771
+ ],
3772
+ "/",
3773
+ "normalEps"
3774
+ ]
3775
+ ],
3776
+ [
3777
+ 13,
3778
+ "dhdv",
3779
+ [
3780
+ 1,
3781
+ [
3782
+ 1,
3783
+ "hUp",
3784
+ "-",
3785
+ "hC"
3786
+ ],
3787
+ "/",
3788
+ "normalEps"
3789
+ ]
3790
+ ],
3791
+ [
3792
+ 13,
3793
+ "nrm",
3794
+ [
3795
+ 6,
3796
+ [
3797
+ 7,
3798
+ "std",
3799
+ "normalize"
3800
+ ],
3801
+ [[
3802
+ 6,
3803
+ [
3804
+ 7,
3805
+ "d",
3806
+ "vec3f"
3807
+ ],
3808
+ [
3809
+ [
3810
+ 1,
3811
+ "dhdu",
3812
+ "*",
3813
+ [
3814
+ 4,
3815
+ "-",
3816
+ [5, "0.5"]
3817
+ ]
3818
+ ],
3819
+ [
3820
+ 1,
3821
+ "dhdv",
3822
+ "*",
3823
+ [
3824
+ 4,
3825
+ "-",
3826
+ [5, "0.5"]
3827
+ ]
3828
+ ],
3829
+ [5, "1"]
3830
+ ]
3831
+ ]]
3832
+ ]
3833
+ ],
3834
+ [
3835
+ 13,
3836
+ "lightDir",
3837
+ [
3838
+ 6,
3839
+ [
3840
+ 7,
3841
+ "std",
3842
+ "normalize"
3843
+ ],
3844
+ [[
3845
+ 6,
3846
+ [
3847
+ 7,
3848
+ "d",
3849
+ "vec3f"
3850
+ ],
3851
+ [
3852
+ [
3853
+ 7,
3854
+ "p",
3855
+ "lightX"
3856
+ ],
3857
+ [
3858
+ 7,
3859
+ "p",
3860
+ "lightY"
3861
+ ],
3862
+ [
3863
+ 7,
3864
+ "p",
3865
+ "lightZ"
3866
+ ]
3867
+ ]
3868
+ ]]
3869
+ ]
3870
+ ],
3871
+ [
3872
+ 13,
3873
+ "viewDir",
3874
+ [
3875
+ 6,
3876
+ [
3877
+ 7,
3878
+ "rayDir",
3879
+ "mul"
3880
+ ],
3881
+ [[
3882
+ 4,
3883
+ "-",
3884
+ [5, "1"]
3885
+ ]]
3886
+ ]
3887
+ ],
3888
+ [
3889
+ 13,
3890
+ "diffuse",
3891
+ [
3892
+ 6,
3893
+ [
3894
+ 7,
3895
+ "std",
3896
+ "clamp"
3897
+ ],
3898
+ [
3899
+ [
3900
+ 6,
3901
+ [
3902
+ 7,
3903
+ "std",
3904
+ "dot"
3905
+ ],
3906
+ ["nrm", "lightDir"]
3907
+ ],
3908
+ [5, "0"],
3909
+ [5, "1"]
3910
+ ]
3911
+ ]
3912
+ ],
3913
+ [
3914
+ 13,
3915
+ "halfVec",
3916
+ [
3917
+ 6,
3918
+ [
3919
+ 7,
3920
+ "std",
3921
+ "normalize"
3922
+ ],
3923
+ [[
3924
+ 6,
3925
+ [
3926
+ 7,
3927
+ "lightDir",
3928
+ "add"
3929
+ ],
3930
+ ["viewDir"]
3931
+ ]]
3932
+ ]
3933
+ ],
3702
3934
  [
3703
- 1,
3704
- "dhdu",
3705
- "*",
3935
+ 13,
3936
+ "specPow",
3706
3937
  [
3707
- 4,
3708
- "-",
3709
- [5, "0.5"]
3938
+ 1,
3939
+ [
3940
+ 1,
3941
+ [
3942
+ 7,
3943
+ "p",
3944
+ "glossiness"
3945
+ ],
3946
+ "*",
3947
+ [5, "128"]
3948
+ ],
3949
+ "+",
3950
+ [5, "4"]
3710
3951
  ]
3711
3952
  ],
3712
3953
  [
3713
- 1,
3714
- "dhdv",
3715
- "*",
3954
+ 13,
3955
+ "specular",
3716
3956
  [
3717
- 4,
3718
- "-",
3719
- [5, "0.5"]
3957
+ 1,
3958
+ [
3959
+ 6,
3960
+ [
3961
+ 7,
3962
+ "std",
3963
+ "pow"
3964
+ ],
3965
+ [[
3966
+ 6,
3967
+ [
3968
+ 7,
3969
+ "std",
3970
+ "clamp"
3971
+ ],
3972
+ [
3973
+ [
3974
+ 6,
3975
+ [
3976
+ 7,
3977
+ "std",
3978
+ "dot"
3979
+ ],
3980
+ ["nrm", "halfVec"]
3981
+ ],
3982
+ [5, "0"],
3983
+ [5, "1"]
3984
+ ]
3985
+ ], "specPow"]
3986
+ ],
3987
+ "*",
3988
+ [
3989
+ 7,
3990
+ "p",
3991
+ "highlights"
3992
+ ]
3720
3993
  ]
3721
3994
  ],
3722
- [5, "1"]
3723
- ]
3724
- ]]
3725
- ]
3726
- ],
3727
- [
3728
- 13,
3729
- "lightDir",
3730
- [
3731
- 6,
3732
- [
3733
- 7,
3734
- "std",
3735
- "normalize"
3736
- ],
3737
- [[
3738
- 6,
3739
- [
3740
- 7,
3741
- "d",
3742
- "vec3f"
3743
- ],
3744
- [
3745
3995
  [
3746
- 7,
3747
- "p",
3748
- "lightX"
3996
+ 13,
3997
+ "ambient",
3998
+ [
3999
+ 6,
4000
+ [
4001
+ 7,
4002
+ "d",
4003
+ "vec3f"
4004
+ ],
4005
+ [
4006
+ [5, "0.4"],
4007
+ [5, "0.4"],
4008
+ [5, "0.4"]
4009
+ ]
4010
+ ]
3749
4011
  ],
3750
4012
  [
3751
- 7,
3752
- "p",
3753
- "lightY"
4013
+ 13,
4014
+ "tintedDiffuse",
4015
+ [
4016
+ 6,
4017
+ [
4018
+ 7,
4019
+ [
4020
+ 7,
4021
+ "p",
4022
+ "lightColor"
4023
+ ],
4024
+ "mul"
4025
+ ],
4026
+ [[
4027
+ 1,
4028
+ "diffuse",
4029
+ "*",
4030
+ [5, "0.6"]
4031
+ ]]
4032
+ ]
3754
4033
  ],
3755
4034
  [
3756
- 7,
3757
- "p",
3758
- "lightZ"
3759
- ]
3760
- ]
3761
- ]]
3762
- ]
3763
- ],
3764
- [
3765
- 13,
3766
- "viewDir",
3767
- [
3768
- 6,
3769
- [
3770
- 7,
3771
- "rayDir",
3772
- "mul"
3773
- ],
3774
- [[
3775
- 4,
3776
- "-",
3777
- [5, "1"]
3778
- ]]
3779
- ]
3780
- ],
3781
- [
3782
- 13,
3783
- "diffuse",
3784
- [
3785
- 6,
3786
- [
3787
- 7,
3788
- "std",
3789
- "clamp"
3790
- ],
3791
- [
3792
- [
3793
- 6,
3794
- [
3795
- 7,
3796
- "std",
3797
- "dot"
4035
+ 13,
4036
+ "tintedSpec",
4037
+ [
4038
+ 6,
4039
+ [
4040
+ 7,
4041
+ [
4042
+ 7,
4043
+ "p",
4044
+ "lightColor"
4045
+ ],
4046
+ "mul"
4047
+ ],
4048
+ ["specular"]
4049
+ ]
3798
4050
  ],
3799
- ["nrm", "lightDir"]
3800
- ],
3801
- [5, "0"],
3802
- [5, "1"]
3803
- ]
3804
- ]
3805
- ],
3806
- [
3807
- 13,
3808
- "halfVec",
3809
- [
3810
- 6,
3811
- [
3812
- 7,
3813
- "std",
3814
- "normalize"
3815
- ],
3816
- [[
3817
- 6,
3818
- [
3819
- 7,
3820
- "lightDir",
3821
- "add"
3822
- ],
3823
- ["viewDir"]
3824
- ]]
3825
- ]
3826
- ],
3827
- [
3828
- 13,
3829
- "specPow",
3830
- [
3831
- 1,
3832
- [
3833
- 1,
3834
- [
3835
- 7,
3836
- "p",
3837
- "glossiness"
3838
- ],
3839
- "*",
3840
- [5, "128"]
3841
- ],
3842
- "+",
3843
- [5, "4"]
3844
- ]
3845
- ],
3846
- [
3847
- 13,
3848
- "specular",
3849
- [
3850
- 1,
3851
- [
3852
- 6,
3853
- [
3854
- 7,
3855
- "std",
3856
- "pow"
3857
- ],
3858
- [[
3859
- 6,
3860
4051
  [
3861
- 7,
3862
- "std",
3863
- "clamp"
4052
+ 13,
4053
+ "totalLight",
4054
+ [
4055
+ 6,
4056
+ [
4057
+ 7,
4058
+ [
4059
+ 6,
4060
+ [
4061
+ 7,
4062
+ "ambient",
4063
+ "add"
4064
+ ],
4065
+ ["tintedDiffuse"]
4066
+ ],
4067
+ "add"
4068
+ ],
4069
+ ["tintedSpec"]
4070
+ ]
3864
4071
  ],
3865
4072
  [
4073
+ 2,
4074
+ "lit",
4075
+ "=",
3866
4076
  [
3867
4077
  6,
3868
4078
  [
3869
4079
  7,
3870
4080
  "std",
3871
- "dot"
4081
+ "clamp"
3872
4082
  ],
3873
- ["nrm", "halfVec"]
3874
- ],
3875
- [5, "0"],
3876
- [5, "1"]
4083
+ [
4084
+ [
4085
+ 6,
4086
+ [
4087
+ 7,
4088
+ "std",
4089
+ "mix"
4090
+ ],
4091
+ [
4092
+ [
4093
+ 6,
4094
+ [
4095
+ 7,
4096
+ "d",
4097
+ "vec3f"
4098
+ ],
4099
+ [
4100
+ [5, "1"],
4101
+ [5, "1"],
4102
+ [5, "1"]
4103
+ ]
4104
+ ],
4105
+ "totalLight",
4106
+ [
4107
+ 7,
4108
+ "p",
4109
+ "lighting"
4110
+ ]
4111
+ ]
4112
+ ],
4113
+ [
4114
+ 6,
4115
+ [
4116
+ 7,
4117
+ "d",
4118
+ "vec3f"
4119
+ ],
4120
+ [
4121
+ [5, "0"],
4122
+ [5, "0"],
4123
+ [5, "0"]
4124
+ ]
4125
+ ],
4126
+ [
4127
+ 6,
4128
+ [
4129
+ 7,
4130
+ "d",
4131
+ "vec3f"
4132
+ ],
4133
+ [
4134
+ [5, "3"],
4135
+ [5, "3"],
4136
+ [5, "3"]
4137
+ ]
4138
+ ]
4139
+ ]
4140
+ ]
3877
4141
  ]
3878
- ], "specPow"]
3879
- ],
3880
- "*",
3881
- [
3882
- 7,
3883
- "p",
3884
- "highlights"
4142
+ ]]
3885
4143
  ]
3886
- ]
3887
- ],
4144
+ ]]
4145
+ ]
4146
+ ]]
4147
+ ],
4148
+ [
4149
+ 13,
4150
+ "rawSampleUV",
4151
+ [
4152
+ 6,
3888
4153
  [
3889
- 13,
3890
- "ambient",
3891
- [
3892
- 6,
3893
- [
3894
- 7,
3895
- "d",
3896
- "vec3f"
3897
- ],
3898
- [
3899
- [5, "0.4"],
3900
- [5, "0.4"],
3901
- [5, "0.4"]
3902
- ]
3903
- ]
4154
+ 7,
4155
+ "d",
4156
+ "vec2f"
3904
4157
  ],
4158
+ ["hitU", [
4159
+ 1,
4160
+ [5, "1"],
4161
+ "-",
4162
+ "hitV"
4163
+ ]]
4164
+ ]
4165
+ ],
4166
+ [
4167
+ 12,
4168
+ "finalUV",
4169
+ [
4170
+ 6,
3905
4171
  [
3906
- 13,
3907
- "tintedDiffuse",
3908
- [
3909
- 6,
3910
- [
3911
- 7,
3912
- [
3913
- 7,
3914
- "p",
3915
- "lightColor"
3916
- ],
3917
- "mul"
3918
- ],
3919
- [[
3920
- 1,
3921
- "diffuse",
3922
- "*",
3923
- [5, "0.6"]
3924
- ]]
3925
- ]
4172
+ 7,
4173
+ "d",
4174
+ "vec2f"
3926
4175
  ],
4176
+ [[
4177
+ 7,
4178
+ "rawSampleUV",
4179
+ "x"
4180
+ ], [
4181
+ 7,
4182
+ "rawSampleUV",
4183
+ "y"
4184
+ ]]
4185
+ ]
4186
+ ],
4187
+ [
4188
+ 12,
4189
+ "outOfBoundsMask",
4190
+ [
4191
+ 6,
3927
4192
  [
3928
- 13,
3929
- "tintedSpec",
3930
- [
3931
- 6,
3932
- [
3933
- 7,
3934
- [
3935
- 7,
3936
- "p",
3937
- "lightColor"
3938
- ],
3939
- "mul"
3940
- ],
3941
- ["specular"]
3942
- ]
4193
+ 7,
4194
+ "d",
4195
+ "f32"
3943
4196
  ],
4197
+ [[5, "1"]]
4198
+ ]
4199
+ ],
4200
+ [
4201
+ 11,
4202
+ [
4203
+ 1,
4204
+ "edgeMode",
4205
+ "===",
4206
+ [5, "2"]
4207
+ ],
4208
+ [0, [[
4209
+ 2,
4210
+ "finalUV",
4211
+ "=",
3944
4212
  [
3945
- 13,
3946
- "totalLight",
4213
+ 6,
3947
4214
  [
3948
- 6,
3949
- [
3950
- 7,
3951
- [
3952
- 6,
3953
- [
3954
- 7,
3955
- "ambient",
3956
- "add"
3957
- ],
3958
- ["tintedDiffuse"]
3959
- ],
3960
- "add"
3961
- ],
3962
- ["tintedSpec"]
3963
- ]
3964
- ],
4215
+ 7,
4216
+ "edges",
4217
+ "edgeMirrorUV"
4218
+ ],
4219
+ ["rawSampleUV"]
4220
+ ]
4221
+ ]]],
4222
+ [
4223
+ 11,
3965
4224
  [
4225
+ 1,
4226
+ "edgeMode",
4227
+ "===",
4228
+ [5, "3"]
4229
+ ],
4230
+ [0, [[
3966
4231
  2,
3967
- "lit",
4232
+ "finalUV",
3968
4233
  "=",
3969
4234
  [
3970
4235
  6,
3971
4236
  [
3972
4237
  7,
3973
- "std",
3974
- "clamp"
4238
+ "edges",
4239
+ "edgeWrapUV"
3975
4240
  ],
4241
+ ["rawSampleUV"]
4242
+ ]
4243
+ ]]],
4244
+ [
4245
+ 11,
4246
+ [
4247
+ 1,
4248
+ "edgeMode",
4249
+ "===",
4250
+ [5, "1"]
4251
+ ],
4252
+ [0, [[
4253
+ 13,
4254
+ "inside",
3976
4255
  [
4256
+ 3,
3977
4257
  [
3978
- 6,
3979
- [
3980
- 7,
3981
- "std",
3982
- "mix"
3983
- ],
4258
+ 3,
3984
4259
  [
4260
+ 3,
3985
4261
  [
3986
- 6,
4262
+ 1,
3987
4263
  [
3988
4264
  7,
3989
- "d",
3990
- "vec3f"
4265
+ "rawSampleUV",
4266
+ "x"
3991
4267
  ],
3992
- [
3993
- [5, "1"],
3994
- [5, "1"],
3995
- [5, "1"]
3996
- ]
4268
+ ">=",
4269
+ [5, "0"]
3997
4270
  ],
3998
- "totalLight",
4271
+ "&&",
3999
4272
  [
4000
- 7,
4001
- "p",
4002
- "lighting"
4273
+ 1,
4274
+ [
4275
+ 7,
4276
+ "rawSampleUV",
4277
+ "x"
4278
+ ],
4279
+ "<=",
4280
+ [5, "1"]
4003
4281
  ]
4282
+ ],
4283
+ "&&",
4284
+ [
4285
+ 1,
4286
+ [
4287
+ 7,
4288
+ "rawSampleUV",
4289
+ "y"
4290
+ ],
4291
+ ">=",
4292
+ [5, "0"]
4004
4293
  ]
4005
4294
  ],
4295
+ "&&",
4006
4296
  [
4007
- 6,
4297
+ 1,
4008
4298
  [
4009
4299
  7,
4010
- "d",
4011
- "vec3f"
4300
+ "rawSampleUV",
4301
+ "y"
4302
+ ],
4303
+ "<=",
4304
+ [5, "1"]
4305
+ ]
4306
+ ]
4307
+ ], [
4308
+ 2,
4309
+ "outOfBoundsMask",
4310
+ "=",
4311
+ [
4312
+ 6,
4313
+ [
4314
+ 7,
4315
+ "std",
4316
+ "select"
4317
+ ],
4318
+ [
4319
+ [
4320
+ 6,
4321
+ [
4322
+ 7,
4323
+ "d",
4324
+ "f32"
4325
+ ],
4326
+ [[5, "0"]]
4012
4327
  ],
4013
4328
  [
4014
- [5, "0"],
4015
- [5, "0"],
4016
- [5, "0"]
4017
- ]
4329
+ 6,
4330
+ [
4331
+ 7,
4332
+ "d",
4333
+ "f32"
4334
+ ],
4335
+ [[5, "1"]]
4336
+ ],
4337
+ "inside"
4338
+ ]
4339
+ ]
4340
+ ]]],
4341
+ [0, [[
4342
+ 2,
4343
+ "finalUV",
4344
+ "=",
4345
+ [
4346
+ 6,
4347
+ [
4348
+ 7,
4349
+ "std",
4350
+ "clamp"
4018
4351
  ],
4019
4352
  [
4020
- 6,
4353
+ "rawSampleUV",
4021
4354
  [
4022
- 7,
4023
- "d",
4024
- "vec3f"
4355
+ 6,
4356
+ [
4357
+ 7,
4358
+ "d",
4359
+ "vec2f"
4360
+ ],
4361
+ [[5, "0"], [5, "0"]]
4025
4362
  ],
4026
4363
  [
4027
- [5, "3"],
4028
- [5, "3"],
4029
- [5, "3"]
4364
+ 6,
4365
+ [
4366
+ 7,
4367
+ "d",
4368
+ "vec2f"
4369
+ ],
4370
+ [[5, "1"], [5, "1"]]
4030
4371
  ]
4031
4372
  ]
4032
4373
  ]
4033
- ]
4374
+ ]]]
4034
4375
  ]
4035
- ]]
4376
+ ]
4036
4377
  ],
4037
4378
  [
4038
4379
  13,
@@ -4044,7 +4385,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
4044
4385
  "d",
4045
4386
  "f32"
4046
4387
  ],
4047
- [[5, "15"]]
4388
+ ["MARCH_FAR"]
4048
4389
  ]
4049
4390
  ],
4050
4391
  [
@@ -4245,25 +4586,31 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
4245
4586
  "externalNames": [
4246
4587
  "computeLayout",
4247
4588
  "d",
4248
- "COMPUTE_W",
4249
- "COMPUTE_H",
4589
+ "computeW",
4590
+ "computeH",
4250
4591
  "std",
4592
+ "MARCH_FAR",
4593
+ "MARCH_STEPS",
4251
4594
  "heightFn",
4595
+ "MARCH_REFINE",
4596
+ "lightingEnabled",
4252
4597
  "edgeMode",
4253
- "edges",
4254
- "lightingEnabled"
4598
+ "edges"
4255
4599
  ]
4256
4600
  },
4257
4601
  externals: () => ({
4258
4602
  computeLayout,
4259
4603
  d: data_exports,
4260
- COMPUTE_W,
4261
- COMPUTE_H,
4604
+ computeW,
4605
+ computeH,
4262
4606
  std: std_exports,
4607
+ MARCH_FAR,
4608
+ MARCH_STEPS,
4263
4609
  heightFn,
4610
+ MARCH_REFINE,
4611
+ lightingEnabled,
4264
4612
  edgeMode,
4265
- edges: edges_exports,
4266
- lightingEnabled
4613
+ edges: edges_exports
4267
4614
  })
4268
4615
  }) && $.f)({})).$name("surface3dRaymarch");
4269
4616
  }
@@ -4429,7 +4776,7 @@ const componentDefinition = {
4429
4776
  },
4430
4777
  octaves: {
4431
4778
  default: 2,
4432
- compileTime: true,
4779
+ compileTimeWhen: (prev, next) => Math.max(1, Math.floor(prev)) !== Math.max(1, Math.floor(next)),
4433
4780
  description: "Detail octaves",
4434
4781
  ui: {
4435
4782
  type: "range",
@@ -4695,12 +5042,21 @@ const componentDefinition = {
4695
5042
  const edgeMode = getCpuValue("edges") ?? 2;
4696
5043
  const lightingEnabled = (getCpuValue("lighting") ?? 30) >= .01;
4697
5044
  const cursorEnabled = (getCpuValue("cursorIntensity") ?? 1) >= .01;
5045
+ const canvasW = Math.round(dimensions.width);
5046
+ const canvasH = Math.round(dimensions.height);
5047
+ let computeW = Math.min(COMPUTE_MAX, COMPUTE_FALLBACK_W);
5048
+ let computeH = Math.min(Math.round(COMPUTE_MAX * COMPUTE_FALLBACK_H / COMPUTE_FALLBACK_W), COMPUTE_FALLBACK_H);
5049
+ if (canvasW >= 16 && canvasH >= 16) {
5050
+ const fit = Math.min(1, COMPUTE_MAX / Math.max(canvasW, canvasH));
5051
+ computeW = Math.max(16, Math.round(canvasW * fit));
5052
+ computeH = Math.max(16, Math.round(canvasH * fit));
5053
+ }
4698
5054
  const uvMaskTex = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(root.createTexture({
4699
- size: [COMPUTE_W, COMPUTE_H],
5055
+ size: [computeW, computeH],
4700
5056
  format: STATE_FORMAT
4701
5057
  }).$usage("storage", "sampled"), "uvMaskTex");
4702
5058
  const litTex = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(root.createTexture({
4703
- size: [COMPUTE_W, COMPUTE_H],
5059
+ size: [computeW, computeH],
4704
5060
  format: STATE_FORMAT
4705
5061
  }).$usage("storage", "sampled"), "litTex");
4706
5062
  onCleanup(() => {
@@ -4719,7 +5075,7 @@ const componentDefinition = {
4719
5075
  curW = Math.max(1, Math.round(width));
4720
5076
  curH = Math.max(1, Math.round(height));
4721
5077
  });
4722
- const computeKernel = makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cursorEnabled);
5078
+ const computeKernel = makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cursorEnabled, computeW, computeH);
4723
5079
  const computeBg = root.createBindGroup(computeLayout, {
4724
5080
  readBuf,
4725
5081
  params: paramsU.buffer,
@@ -4749,7 +5105,7 @@ const componentDefinition = {
4749
5105
  },
4750
5106
  externals: () => ({ computeKernel })
4751
5107
  }) && $.f)({}), {
4752
- size: [COMPUTE_W, COMPUTE_H],
5108
+ size: [computeW, computeH],
4753
5109
  bindGroup: computeBg
4754
5110
  });
4755
5111
  const propagate = cursorEnabled ? makePropagateKernel() : null;
@@ -4794,7 +5150,8 @@ const componentDefinition = {
4794
5150
  let lastTime = Date.now();
4795
5151
  let lastActiveTime = Date.now();
4796
5152
  let animT = 0;
4797
- const writeParams = (fp, mouseSpeed) => {
5153
+ let lastSig = null;
5154
+ const writeParams = (fp, mouseSpeed, cursorActive) => {
4798
5155
  const aspect = Math.max(1, curW) / Math.max(1, curH);
4799
5156
  const tilt = (getCpuValue("tilt") ?? 35) * DEG_TO_RAD;
4800
5157
  const roll = (getCpuValue("roll") ?? 0) * DEG_TO_RAD;
@@ -4848,12 +5205,29 @@ const componentDefinition = {
4848
5205
  const cursorWorldUVx = cWX0 * .5 + .5;
4849
5206
  const cursorWorldUVy = cWY0 * .5 + .5;
4850
5207
  const lc = getCpuValue("lightColor");
5208
+ const amp = getCpuValue("amplitude") ?? .3;
5209
+ const cursorIntensity = getCpuValue("cursorIntensity") ?? 1;
5210
+ const freq = getCpuValue("frequency") ?? 1.5;
5211
+ const seed = getCpuValue("seed") ?? 0;
5212
+ const edgePin = getCpuValue("edgePinning") ?? 0;
5213
+ const lighting = (getCpuValue("lighting") ?? 30) * .035;
5214
+ const glossiness = (getCpuValue("glossiness") ?? 0) * .01;
5215
+ const highlights = (getCpuValue("highlights") ?? 15) * .04;
5216
+ const lightX = getCpuValue("lightX") ?? .4;
5217
+ const lightY = getCpuValue("lightY") ?? -.6;
5218
+ const lightZ = getCpuValue("lightZ") ?? .7;
5219
+ const nearCutoff = getCpuValue("nearCutoff") ?? 0;
5220
+ const farCutoff = getCpuValue("farCutoff") ?? 1;
5221
+ const waveSpeed = getCpuValue("cursorSpeed") ?? .5;
5222
+ const cursorWaveX = (cursorWorldUVx - .5) / WAVE_HALFEXTENT + .5;
5223
+ const cursorWaveY = (cursorWorldUVy - .5) / WAVE_HALFEXTENT + .5;
5224
+ const heightEnvelope = amp + HEIGHT_SLAB_PAD + (cursorActive > 0 ? cursorIntensity * .05 * CURSOR_WAVE_BOUND : 0);
4851
5225
  paramsU.write({
4852
- amp: getCpuValue("amplitude") ?? .3,
4853
- freq: getCpuValue("frequency") ?? 1.5,
4854
- seed: getCpuValue("seed") ?? 0,
4855
- edgePin: getCpuValue("edgePinning") ?? 0,
4856
- cursorIntensity: getCpuValue("cursorIntensity") ?? 1,
5226
+ amp,
5227
+ freq,
5228
+ seed,
5229
+ edgePin,
5230
+ cursorIntensity,
4857
5231
  t: animT,
4858
5232
  aspect,
4859
5233
  focal,
@@ -4861,23 +5235,55 @@ const componentDefinition = {
4861
5235
  camForward: vec3f(fwd[0], fwd[1], fwd[2]),
4862
5236
  camRight: vec3f(camRight[0], camRight[1], camRight[2]),
4863
5237
  camUp: vec3f(camUp[0], camUp[1], camUp[2]),
4864
- lighting: (getCpuValue("lighting") ?? 30) * .035,
4865
- glossiness: (getCpuValue("glossiness") ?? 0) * .01,
4866
- highlights: (getCpuValue("highlights") ?? 15) * .04,
4867
- lightX: getCpuValue("lightX") ?? .4,
4868
- lightY: getCpuValue("lightY") ?? -.6,
4869
- lightZ: getCpuValue("lightZ") ?? .7,
5238
+ lighting,
5239
+ glossiness,
5240
+ highlights,
5241
+ lightX,
5242
+ lightY,
5243
+ lightZ,
4870
5244
  lightColor: vec3f(lc?.x ?? 1, lc?.y ?? 1, lc?.z ?? 1),
4871
- nearCutoff: getCpuValue("nearCutoff") ?? 0,
4872
- farCutoff: getCpuValue("farCutoff") ?? 1,
4873
- cursorWaveX: (cursorWorldUVx - .5) / WAVE_HALFEXTENT + .5,
4874
- cursorWaveY: (cursorWorldUVy - .5) / WAVE_HALFEXTENT + .5,
5245
+ nearCutoff,
5246
+ farCutoff,
5247
+ cursorWaveX,
5248
+ cursorWaveY,
4875
5249
  mouseSpeed,
4876
5250
  dt: .016,
4877
- decay: 10,
5251
+ decay: WAVE_DECAY,
4878
5252
  radius: .025,
4879
- waveSpeed: getCpuValue("cursorSpeed") ?? .5
5253
+ waveSpeed,
5254
+ heightEnvelope,
5255
+ cursorActive
4880
5256
  });
5257
+ return [
5258
+ amp,
5259
+ freq,
5260
+ seed,
5261
+ edgePin,
5262
+ cursorIntensity,
5263
+ animT,
5264
+ aspect,
5265
+ tilt,
5266
+ roll,
5267
+ camHeight,
5268
+ zoom,
5269
+ lighting,
5270
+ glossiness,
5271
+ highlights,
5272
+ lightX,
5273
+ lightY,
5274
+ lightZ,
5275
+ lc?.x ?? 1,
5276
+ lc?.y ?? 1,
5277
+ lc?.z ?? 1,
5278
+ nearCutoff,
5279
+ farCutoff,
5280
+ cursorWaveX,
5281
+ cursorWaveY,
5282
+ mouseSpeed,
5283
+ waveSpeed,
5284
+ heightEnvelope,
5285
+ cursorActive
5286
+ ].join(",");
4881
5287
  };
4882
5288
  return {
4883
5289
  outputs: {
@@ -4898,11 +5304,11 @@ const componentDefinition = {
4898
5304
  prevPy = py;
4899
5305
  if (mouseSpeed > .01) lastActiveTime = now;
4900
5306
  animT += dt * (getCpuValue("speed") ?? .5);
4901
- writeParams(fp, mouseSpeed);
4902
- if (!cursorEnabled || !propagatePass) return [computePass];
4903
- const dampFactor = 1 - 10 * .004;
4904
- const settleTime = dampFactor >= 1 ? Infinity : Math.min(3e4, Math.log(1e-6) / Math.log(Math.max(dampFactor, .001)) * 16.67);
4905
- if (now - lastActiveTime > settleTime && mouseSpeed < .01) return [computePass];
5307
+ const waveSettled = !cursorEnabled || !propagatePass || now - lastActiveTime > WAVE_SETTLE_MS && mouseSpeed < .01;
5308
+ const sig = writeParams(fp, mouseSpeed, waveSettled ? 0 : 1);
5309
+ if (waveSettled && sig === lastSig) return [];
5310
+ lastSig = sig;
5311
+ if (waveSettled || !propagatePass) return [computePass];
4906
5312
  const prop = direction === 0 ? propagatePass.with(propBgAB) : propagatePass.with(propBgBA);
4907
5313
  direction = 1 - direction;
4908
5314
  return [prop, computePass];