shaders 3.0.448 → 3.0.450
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -2
- package/dist/core/{AngularBlur-xU811GPM.js → AngularBlur-4jt7bNoF.js} +15 -15
- package/dist/core/{Arc-DYvFxtGy.js → Arc-DXIfbBgd.js} +13 -12
- package/dist/core/{Ascii-ChE4BP7J.js → Ascii-GDof03Ca.js} +51 -53
- package/dist/core/{Aurora-BThE6pbb.js → Aurora-CS4vewUW.js} +63 -68
- package/dist/core/{BarShift-DdjkPSk3.js → BarShift-BtnYLQ0B.js} +31 -32
- package/dist/core/{BarnDoors-B_kxVuec.js → BarnDoors-Dw9K-amf.js} +21 -22
- package/dist/core/{Beam-C7zPHuIU.js → Beam-D_cyaMjJ.js} +32 -39
- package/dist/core/{Bend-CFcEjifF.js → Bend-CSs5UIh8.js} +27 -28
- package/dist/core/{Blob-CgUolAhz.js → Blob-h25zA5WH.js} +54 -60
- package/dist/core/{BlockDissolve-CLSxXB4e.js → BlockDissolve-CKN_KvLP.js} +21 -20
- package/dist/core/{BlockNoise-BgEJOicU.js → BlockNoise-DhKyd_F7.js} +16 -14
- package/dist/core/{BlueNoise-BqMtBLxM.js → BlueNoise-Auhzq4x5.js} +12 -10
- package/dist/core/{Blur-Xaa6jVPT.js → Blur-CcxMqYsu.js} +27 -27
- package/dist/core/{Boids-B8QUNxRL.js → Boids-D51U46GF.js} +916 -787
- package/dist/core/{BokehBlur-B5fql96U.js → BokehBlur-Cfaqbh3I.js} +104 -104
- package/dist/core/{BrickPattern-EAD5HD4e.js → BrickPattern-tASwilX0.js} +34 -38
- package/dist/core/{BrightnessContrast-mbv32DkA.js → BrightnessContrast-ZCKqJW7i.js} +9 -10
- package/dist/core/{BrushedMetal-B10fDdGt.js → BrushedMetal-B6gSVB28.js} +81 -84
- package/dist/core/{Bulge-C1Pq4DHk.js → Bulge-dCYtWP4S.js} +19 -19
- package/dist/core/{CRTScreen-Ctx0Mxtb.js → CRTScreen-CVY1lOGL.js} +35 -37
- package/dist/core/{CarbonFiber-DSSARe6R.js → CarbonFiber-Do9EONKv.js} +81 -84
- package/dist/core/{Chalkboard-C7srb54u.js → Chalkboard-0hyyGnYl.js} +59 -61
- package/dist/core/{ChannelBlur-DE3T4-pj.js → ChannelBlur-DcZKCKXi.js} +13 -15
- package/dist/core/{CheckerWipe-Dp49-iaT.js → CheckerWipe-BIE62tJ1.js} +23 -23
- package/dist/core/{Checkerboard-oVWtS0rz.js → Checkerboard-CRnfu63u.js} +31 -31
- package/dist/core/{Chevron-CCD5JTRA.js → Chevron-Ld_v4z9T.js} +20 -20
- package/dist/core/{ChromaFlow-BiE9Mes0.js → ChromaFlow-CTWeauIr.js} +32 -33
- package/dist/core/{ChromaticAberration-XEasUrD3.js → ChromaticAberration-CxuOb68m.js} +13 -13
- package/dist/core/{Circle-CvQ9duDU.js → Circle-XP1B5rsN.js} +14 -13
- package/dist/core/{ColorWheel-CXvfWAjN.js → ColorWheel-CFU_OmOW.js} +30 -34
- package/dist/core/{CompressionArtifacts-BDaP7XI6.js → CompressionArtifacts-Bc9xTdQP.js} +64 -66
- package/dist/core/{ConcentricSpin-D06hFXEb.js → ConcentricSpin-DTJytpAk.js} +39 -41
- package/dist/core/{ConicGradient-Cg6vy3gl.js → ConicGradient-C-4uDmQj.js} +17 -18
- package/dist/core/{ContourLines-Cg2Dlmcr.js → ContourLines-C8p6f-1y.js} +29 -30
- package/dist/core/{CornerPin-wtqiMUCa.js → CornerPin-CB92kX10.js} +55 -57
- package/dist/core/{Crescent-Co__JqEE.js → Crescent-Dk4nlG8T.js} +14 -13
- package/dist/core/{Cross-CFytbdrZ.js → Cross-DsnI1U8g.js} +14 -13
- package/dist/core/{Crystal-U7VqhbHy.js → Crystal-CR_sG2y7.js} +143 -152
- package/dist/core/{CurlNoise-BXWYh1Qi.js → CurlNoise-DJ27ih0F.js} +16 -14
- package/dist/core/{CursorRipples-APbH7SVR.js → CursorRipples-CuO3sZga.js} +59 -58
- package/dist/core/{CursorTrail-D5Fj0wGp.js → CursorTrail-d4xx4QpM.js} +72 -71
- package/dist/core/{DataMosh-CWRLpjU3.js → DataMosh-BhvE-2yC.js} +71 -73
- package/dist/core/{DiamondGradient-C_2VoEiQ.js → DiamondGradient-CtOVKrYf.js} +23 -25
- package/dist/core/{DiamondWipe-BkdNODD1.js → DiamondWipe-D-yiQBVj.js} +22 -22
- package/dist/core/{DiffuseBlur-Dl7S4KBW.js → DiffuseBlur-BDf-Czxz.js} +11 -12
- package/dist/core/{DisplacementMap-lv-qoLem.js → DisplacementMap-B_jf_2lj.js} +26 -26
- package/dist/core/{Dither-B33J_gJU.js → Dither-D3P6EJU8.js} +116 -119
- package/dist/core/{DotGrid-DaOhiRaL.js → DotGrid-BnSVhJlh.js} +37 -39
- package/dist/core/{DropShadow-C5Z2Rs2C.js → DropShadow-BSKVH3n3.js} +37 -37
- package/dist/core/{Duotone-x4cywJbU.js → Duotone-DfjYuK2u.js} +7 -7
- package/dist/core/{Ellipse-CrQ1XYjx.js → Ellipse-D7_1QKaa.js} +13 -12
- package/dist/core/{Emboss-DNwO5JcE.js → Emboss-ZiPslqzl.js} +76 -78
- package/dist/core/{Engraving-FsaRQiyI.js → Engraving-DsfkKajz.js} +57 -59
- package/dist/core/{ErosionNoise-CloHpdFT.js → ErosionNoise-SELArv9H.js} +13 -11
- package/dist/core/{Exposure-mO6KjYvc.js → Exposure-A7WlTOti.js} +4 -5
- package/dist/core/{FallingLines-D_1wHUkx.js → FallingLines-9PRMb_Ou.js} +40 -42
- package/dist/core/{FilmGrain-DDhrsw94.js → FilmGrain-SXzVDesw.js} +17 -18
- package/dist/core/{FilmStock-BaP2aTLu.js → FilmStock-RK4fk4m0.js} +74 -74
- package/dist/core/{Flip-DYuqyJva.js → Flip-DjoNWG4v.js} +10 -12
- package/dist/core/{FloatingParticles-DJwNpHtZ.js → FloatingParticles-D7vUF5g7.js} +637 -451
- package/dist/core/{FlowField-D4iGiDic.js → FlowField-tHrXhd1b.js} +24 -23
- package/dist/core/{Flower-D0MqoayS.js → Flower-BfehbmmG.js} +14 -13
- package/dist/core/{FlowingGradient-9Zu0Pu4a.js → FlowingGradient-BTKjkx5F.js} +38 -39
- package/dist/core/{FlutedGlass-C_clmShu.js → FlutedGlass-uFT7iy_9.js} +43 -43
- package/dist/core/{Fog-C_kY5pWB.js → Fog-Cu1CMATa.js} +172 -171
- package/dist/core/{Form3D-D4aXZGoJ.js → Form3D-D0ji-MeC.js} +259 -267
- package/dist/core/{FractalNoise-mMVLGmIv.js → FractalNoise-D9HYiOdr.js} +30 -28
- package/dist/core/{Frost-M53tZlcf.js → Frost-DQZZxdTk.js} +70 -73
- package/dist/core/{GaborNoise-BhXywN1d.js → GaborNoise-D7BP0K4g.js} +16 -14
- package/dist/core/{Glass-B9D_52op.js → Glass-CzCVnGn-.js} +6 -4
- package/dist/core/{GlassTiles-DIkGYgVE.js → GlassTiles-DJzPPqwz.js} +23 -26
- package/dist/core/{Glitch-CUOJt5VX.js → Glitch-D1Dx8__X.js} +84 -72
- package/dist/core/{Glow-D5AdnLvU.js → Glow-Bd9_o_Kv.js} +76 -77
- package/dist/core/{Godrays-BeQCWVw7.js → Godrays-DRPRWGPm.js} +52 -56
- package/dist/core/{Goo-C0_0QYne.js → Goo-28A_pNBg.js} +64 -65
- package/dist/core/{GradientMap-DOVK05_a.js → GradientMap-D8dv-1AX.js} +47 -50
- package/dist/core/{Grayscale-Uv_6LYA9.js → Grayscale-BlVXBVwW.js} +6 -6
- package/dist/core/{Grid-Dbp4DoXZ.js → Grid-D9vlHvs1.js} +46 -48
- package/dist/core/{GridDistortion-D_21zIrm.js → GridDistortion-BpqDvqj6.js} +63 -62
- package/dist/core/{Group-DXiB5Qrx.js → Group-bwQnJRec.js} +1 -1
- package/dist/core/{HTMLInCanvas-xXPLTYIv.js → HTMLInCanvas-gCf64ozE.js} +1 -1
- package/dist/core/{Halftone-DszIQsyx.js → Halftone-B_WouxiP.js} +59 -62
- package/dist/core/{Heart-COpnSJPD.js → Heart-Bmt2TLNz.js} +12 -11
- package/dist/core/{Heatmap-CMm8SD-P.js → Heatmap-Ruef741_.js} +57 -55
- package/dist/core/{HexGrid-B6wNW-45.js → HexGrid-By9k0YuI.js} +32 -35
- package/dist/core/{Hologram-XejRN51V.js → Hologram-Cf25ONOE.js} +62 -66
- package/dist/core/{Holographic-D1G_Ou1y.js → Holographic-C9RzYykt.js} +58 -61
- package/dist/core/{HueShift-BCDgYfJs.js → HueShift-V3gQVuIo.js} +7 -10
- package/dist/core/{ImageTexture-BE2Jlkg6.js → ImageTexture-DAUR2N5Q.js} +3 -2
- package/dist/core/{InkFlow-DJaJqula.js → InkFlow-DlP1gmr4.js} +156 -156
- package/dist/core/{Invert-DDmITZjt.js → Invert-K648khvD.js} +4 -4
- package/dist/core/{IrisWipe-BFs5DDSa.js → IrisWipe-Clkd_5CA.js} +20 -23
- package/dist/core/{IsometricCubes-ChKqYTIw.js → IsometricCubes-CzfAwpQ5.js} +37 -42
- package/dist/core/{Kaleidoscope-C8_-tC6T.js → Kaleidoscope-B9k6HkNn.js} +21 -21
- package/dist/core/{KeyFrames-xR9ZzHKj.js → KeyFrames-DX6JFhsy.js} +130 -129
- package/dist/core/{LensFlare-DHGNEDIX.js → LensFlare-G73cvrIG.js} +82 -84
- package/dist/core/{LightEdge-DYfhB3-7.js → LightEdge-D3i7HUR9.js} +106 -107
- package/dist/core/{LightLeak-CYjuMURe.js → LightLeak-B8yGreP-.js} +58 -59
- package/dist/core/{LinearBlur-CV7gKYHV.js → LinearBlur-BEzNPe0e.js} +14 -14
- package/dist/core/{LinearGradient-DAzw65UB.js → LinearGradient-XjXyaoii.js} +36 -37
- package/dist/core/{LinearWipe-DoDZF7y0.js → LinearWipe-Doj9aS5n.js} +20 -21
- package/dist/core/{LiquidMetal-C9OxRyE4.js → LiquidMetal-CWV_RQip.js} +70 -73
- package/dist/core/{Liquify-gNsuR7aA.js → Liquify-DWrgFruC.js} +67 -66
- package/dist/core/{MagneticFilings-CQ7zHEow.js → MagneticFilings-Co0V07-1.js} +996 -756
- package/dist/core/{Marble-BSSMSrv8.js → Marble-D13mDBvL.js} +22 -21
- package/dist/core/{Mirror-BZAUA2jk.js → Mirror-DvukM_eG.js} +18 -18
- package/dist/core/{MultiPointGradient-HSfAYB-u.js → MultiPointGradient-CyK_Ty9a.js} +30 -31
- package/dist/core/{Neon-D9d6Osal.js → Neon-DD8qY6H9.js} +102 -113
- package/dist/core/{NoiseDissolve-CnELvUG_.js → NoiseDissolve-CeX3VO8J.js} +23 -22
- package/dist/core/{ObjectTracker-COh35yTh.js → ObjectTracker-BWo8H1kh.js} +3 -3
- package/dist/core/{PagePeel-B6sjmvZ1.js → PagePeel-BL5IeBeD.js} +54 -58
- package/dist/core/{Paper-LfukraJk.js → Paper-BAq9MqtG.js} +16 -15
- package/dist/core/{Parallelogram-DBi0yAG3.js → Parallelogram-DYzFG9ci.js} +14 -13
- package/dist/core/{ParticleField-q7COY9YT.js → ParticleField-Bl4uztO7.js} +1489 -1340
- package/dist/core/{ParticleFlow-DiHWbIon.js → ParticleFlow-RPxLP8HC.js} +1422 -1149
- package/dist/core/{Particles-BFsKUAPx.js → Particles-BDEX4Fw2.js} +866 -656
- package/dist/core/{PerlinNoise-KV2GG0ts.js → PerlinNoise-BtXlaEd8.js} +16 -14
- package/dist/core/{Perspective-CJSrtEy5.js → Perspective-CdU5nAEn.js} +23 -25
- package/dist/core/{PixelSort-WD-Y6ZFu.js → PixelSort-C7TX1ClH.js} +109 -109
- package/dist/core/{PixelThrow-CnOXm7Hv.js → PixelThrow-DpKEZPMK.js} +35 -35
- package/dist/core/{Pixelate-XJI9f1oT.js → Pixelate-C2OQUtqr.js} +19 -19
- package/dist/core/{Plasma-C0dnSaw1.js → Plasma-DLq9HroF.js} +33 -32
- package/dist/core/{Plastic-DBv_6A7q.js → Plastic-C2hiOaXw.js} +82 -84
- package/dist/core/{PolarCoordinates-B8Cq2bzT.js → PolarCoordinates-Bumv-Hi3.js} +16 -18
- package/dist/core/{Polygon-ORM35JKg.js → Polygon-DOpR58g4.js} +16 -17
- package/dist/core/{Posterize-Dn-Vv2S1.js → Posterize-CVNOkDme.js} +5 -8
- package/dist/core/{Prism-CYLsGJHY.js → Prism-CCQ1BsBL.js} +36 -40
- package/dist/core/{ProgressiveBlur-BXUumCm5.js → ProgressiveBlur-Cprr1XSE.js} +63 -65
- package/dist/core/{RadialGradient-j6T56q1W.js → RadialGradient-CsmCSySC.js} +22 -23
- package/dist/core/{RadialWipe-Bz19qvls.js → RadialWipe-BAnsqol4.js} +25 -25
- package/dist/core/{RandomBars-3RlhwDYG.js → RandomBars-DdhtxO8o.js} +23 -23
- package/dist/core/{ReactionDiffusion-DdXavIVw.js → ReactionDiffusion-Bih4xEtV.js} +173 -175
- package/dist/core/{RectangularCoordinates-p3250IKV.js → RectangularCoordinates-CKKA2oY1.js} +14 -14
- package/dist/core/{ReflectivePlane-BOl9AEoO.js → ReflectivePlane-u3Tje37M.js} +35 -37
- package/dist/core/{Repeater-BMXmN95R.js → Repeater-C-agsqBS.js} +2 -2
- package/dist/core/{Ring-DKcROHDs.js → Ring-Cj7bR89h.js} +15 -14
- package/dist/core/{RippleWipe-QH8D0Y-2.js → RippleWipe-VL1MMd5o.js} +24 -27
- package/dist/core/{Ripples-8fFdo6aq.js → Ripples-B88TeopS.js} +18 -21
- package/dist/core/{RoundedRect-Cr76tP9o.js → RoundedRect-jn8_QLrT.js} +14 -13
- package/dist/core/{Saturation-Dqifs1x7.js → Saturation-dCNIhHq2.js} +8 -9
- package/dist/core/{Scratches-sa8JU4Eb.js → Scratches-Dz_1Ptk0.js} +16 -14
- package/dist/core/{Sharpness-IRuPd9nn.js → Sharpness-Bxq4YiRL.js} +21 -22
- package/dist/core/{Shatter-BYaxMvyd.js → Shatter-DsuYUr-1.js} +73 -72
- package/dist/core/{SimplexNoise-C2vmRzgy.js → SimplexNoise-CvalBPNF.js} +19 -17
- package/dist/core/{SineWave-BGAJyGFr.js → SineWave-XPK5BsPB.js} +20 -20
- package/dist/core/{SliceWipe-BOcCk5Se.js → SliceWipe-gSs_VRwf.js} +19 -19
- package/dist/core/{Smoke-B1twbhQ4.js → Smoke-kzRXFLW9.js} +156 -155
- package/dist/core/{SmokeFill-CAayneM2.js → SmokeFill-DQZeqiwX.js} +233 -231
- package/dist/core/{SmokeFlow-Ug8difAz.js → SmokeFlow-n23YvKoI.js} +143 -142
- package/dist/core/{Solarize-205KKROH.js → Solarize-DINiQSz1.js} +12 -14
- package/dist/core/{SolidColor-B4pj8onb.js → SolidColor-Cu_9b_my.js} +1 -1
- package/dist/core/{Spherize-DUQxwwCL.js → Spherize-BLY2eqBV.js} +31 -37
- package/dist/core/{Spiral-DY1c-N4F.js → Spiral-CWCmvI3m.js} +36 -36
- package/dist/core/{Star-DRxNaHHo.js → Star-9WSeF-vW.js} +14 -13
- package/dist/core/{Stone-CUdcvOWd.js → Stone-CVO2Ey8i.js} +2 -2
- package/dist/core/{Strands-CFxYJMFu.js → Strands-D9Sz1vX9.js} +47 -49
- package/dist/core/{Stretch-DYrVdt8A.js → Stretch-DMT2Y6kN.js} +19 -19
- package/dist/core/{Stripes-BvnoWdwn.js → Stripes-DPVbOQkX.js} +39 -39
- package/dist/core/{StudioBackground-srQGUpfZ.js → StudioBackground-5JgYClrr.js} +67 -68
- package/dist/core/{SunBurst-COsVDZ4e.js → SunBurst-Din5CIAU.js} +18 -20
- package/dist/core/{Surface3D-TsGPzdGm.js → Surface3D-CW2ApEgt.js} +1934 -1528
- package/dist/core/{Swirl-nXMWVY2X.js → Swirl-DrchXPfh.js} +18 -21
- package/dist/core/{Teardrop-Bjtkigk4.js → Teardrop-CDt_XA4d.js} +13 -12
- package/dist/core/{Text-BGdsqRl5.js → Text-o_dubJeo.js} +20 -21
- package/dist/core/{ThinFilm-DhMKI5e2.js → ThinFilm-d7IlUY62.js} +59 -67
- package/dist/core/{TiltShift-BwuYyXB6.js → TiltShift-DJVcMb_M.js} +66 -67
- package/dist/core/{TimeTrail-CE2XumxR.js → TimeTrail-D1Gir7BK.js} +1003 -1647
- package/dist/core/{Tint-BTmcGjEl.js → Tint-Cak_PyOJ.js} +25 -26
- package/dist/core/{Trapezoid-CiZCh8QS.js → Trapezoid-DnFhlKCD.js} +14 -13
- package/dist/core/{TriangularGrid-BnQOEljy.js → TriangularGrid-BE9CgVlb.js} +34 -36
- package/dist/core/{Tritone-Ta084wlF.js → Tritone-mqU9b4YZ.js} +7 -10
- package/dist/core/{Truchet-BxCh_IIp.js → Truchet-yLdaw6z4.js} +31 -33
- package/dist/core/{Twirl-Cw4jm59Q.js → Twirl-SA6uh8pI.js} +16 -16
- package/dist/core/{VHS-Nwk0E-tf.js → VHS-Ch-bVeit.js} +68 -69
- package/dist/core/{VenetianBlinds-BZ0sS97G.js → VenetianBlinds-CboEoPIZ.js} +22 -23
- package/dist/core/{Vesica-Cf1KiSzK.js → Vesica-DmJWzk7E.js} +13 -12
- package/dist/core/{Vibrance-qWGvLkrW.js → Vibrance-7rW_G3qT.js} +7 -8
- package/dist/core/{VideoTexture-48ylVDvN.js → VideoTexture-Ctk5_1F8.js} +34 -39
- package/dist/core/{Vignette-CK_Li7v2.js → Vignette-DXtlR5LT.js} +20 -22
- package/dist/core/{Voronoi-DMYFDwIS.js → Voronoi-B0ZrQ6QO.js} +33 -37
- package/dist/core/{Water-D74wbHmn.js → Water-DfwGqSnM.js} +101 -108
- package/dist/core/{Watercolor-zo8-4Vqx.js → Watercolor-BAShYSu7.js} +305 -389
- package/dist/core/{WaveDistortion-BLrvGOzF.js → WaveDistortion-Cj4QBBKm.js} +80 -82
- package/dist/core/{WaveletNoise-a5OpO8-D.js → WaveletNoise-DYiU_ziD.js} +16 -14
- package/dist/core/{Weave-D1D3kuUg.js → Weave-DVefdB9i.js} +28 -31
- package/dist/core/{WebcamTexture-pBETyQYG.js → WebcamTexture-BO9jNxcP.js} +7 -7
- package/dist/core/{Wool-CMnWPdy9.js → Wool-D304TmpD.js} +2 -2
- package/dist/core/{WorleyNoise-BAEo0duh.js → WorleyNoise-B5FBTklZ.js} +69 -70
- package/dist/core/{ZoomBlur-CnBNmcfx.js → ZoomBlur-DxySopLs.js} +12 -12
- package/dist/core/agents-c-JjGH1b.js +1440 -0
- package/dist/core/blur-DKmdsW6d.js +2247 -0
- package/dist/core/compute-BoeIXi0l.js +31 -0
- package/dist/core/dataEncoding-CEmpiitu.js +24 -0
- package/dist/core/device-BODv_4aH.js +10 -0
- package/dist/core/edges-BZUKQxSE.js +29857 -0
- package/dist/core/{glass-sOqjtPJD.js → glass-BVqgjSPg.js} +164 -172
- package/dist/core/gpu/index.d.ts.map +1 -1
- package/dist/core/gpu/kit/agents.d.ts +17 -1
- package/dist/core/gpu/kit/agents.d.ts.map +1 -1
- package/dist/core/gpu/passManager.d.ts +6 -2
- package/dist/core/gpu/passManager.d.ts.map +1 -1
- package/dist/core/gpu/textures.d.ts +2 -2
- package/dist/core/gpu/textures.d.ts.map +1 -1
- package/dist/core/index.js +324 -226
- package/dist/core/media-Ds6MRfGR.js +757 -0
- package/dist/core/noise-Cq0KUOSC.js +12033 -0
- package/dist/core/noiseColor-CQyzqpVZ.js +103 -0
- package/dist/core/{noiseColor-CRpf22bk.js → noiseColor-DjCUZ_8u.js} +2 -2
- package/dist/core/noiseStylize-fKVcJbGK.js +359 -0
- package/dist/core/porters-DogLzpKT.js +991 -0
- package/dist/core/presetRenderer.d.ts.map +1 -1
- package/dist/core/registry.js +208 -199
- package/dist/core/sdf-o99ONcMJ.js +5174 -0
- package/dist/core/shaderRegistry-BSrnuqx-.js +425 -0
- package/dist/core/shaders/AngularBlur/index.js +5 -4
- package/dist/core/shaders/Arc/index.js +7 -4
- package/dist/core/shaders/Ascii/index.js +5 -4
- package/dist/core/shaders/Aurora/index.js +6 -4
- package/dist/core/shaders/BarShift/index.js +5 -4
- package/dist/core/shaders/BarnDoors/index.js +5 -4
- package/dist/core/shaders/Beam/index.js +5 -4
- package/dist/core/shaders/Bend/index.js +5 -4
- package/dist/core/shaders/Blob/index.js +5 -4
- package/dist/core/shaders/BlockDissolve/index.js +6 -4
- package/dist/core/shaders/BlockNoise/index.js +8 -5
- package/dist/core/shaders/BlueNoise/index.js +8 -5
- package/dist/core/shaders/Blur/index.js +6 -4
- package/dist/core/shaders/Boids/index.d.ts +3 -3
- package/dist/core/shaders/Boids/index.d.ts.map +1 -1
- package/dist/core/shaders/Boids/index.js +9 -5
- package/dist/core/shaders/BokehBlur/index.js +6 -4
- package/dist/core/shaders/BrickPattern/index.js +5 -4
- package/dist/core/shaders/BrightnessContrast/index.js +5 -4
- package/dist/core/shaders/BrushedMetal/index.js +11 -6
- package/dist/core/shaders/Bulge/index.js +5 -4
- package/dist/core/shaders/CRTScreen/index.js +5 -4
- package/dist/core/shaders/CarbonFiber/index.js +11 -6
- package/dist/core/shaders/Chalkboard/index.js +5 -4
- package/dist/core/shaders/ChannelBlur/index.js +6 -4
- package/dist/core/shaders/CheckerWipe/index.js +5 -4
- package/dist/core/shaders/Checkerboard/index.js +5 -4
- package/dist/core/shaders/Chevron/index.js +5 -4
- package/dist/core/shaders/ChromaFlow/index.js +6 -4
- package/dist/core/shaders/ChromaticAberration/index.js +5 -4
- package/dist/core/shaders/Circle/index.js +7 -4
- package/dist/core/shaders/ColorWheel/index.js +5 -4
- package/dist/core/shaders/CompressionArtifacts/index.js +5 -4
- package/dist/core/shaders/ConcentricSpin/index.js +5 -4
- package/dist/core/shaders/ConicGradient/index.js +5 -4
- package/dist/core/shaders/ContourLines/index.js +5 -4
- package/dist/core/shaders/CornerPin/index.js +5 -4
- package/dist/core/shaders/Crescent/index.js +7 -4
- package/dist/core/shaders/Cross/index.js +7 -4
- package/dist/core/shaders/Crystal/index.js +11 -6
- package/dist/core/shaders/CurlNoise/index.js +8 -5
- package/dist/core/shaders/CursorRipples/index.js +5 -4
- package/dist/core/shaders/CursorTrail/index.js +5 -4
- package/dist/core/shaders/DataMosh/index.js +5 -4
- package/dist/core/shaders/DiamondGradient/index.js +5 -4
- package/dist/core/shaders/DiamondWipe/index.js +5 -4
- package/dist/core/shaders/DiffuseBlur/index.js +5 -4
- package/dist/core/shaders/DisplacementMap/index.js +5 -4
- package/dist/core/shaders/Dither/index.js +5 -4
- package/dist/core/shaders/DotGrid/index.js +5 -4
- package/dist/core/shaders/DropShadow/index.js +5 -4
- package/dist/core/shaders/Duotone/index.js +5 -4
- package/dist/core/shaders/Ellipse/index.js +7 -4
- package/dist/core/shaders/Emboss/index.js +10 -6
- package/dist/core/shaders/Engraving/index.js +6 -4
- package/dist/core/shaders/ErosionNoise/index.js +8 -5
- package/dist/core/shaders/Exposure/index.js +5 -4
- package/dist/core/shaders/FallingLines/index.js +5 -4
- package/dist/core/shaders/FilmGrain/index.js +5 -4
- package/dist/core/shaders/FilmStock/index.js +6 -4
- package/dist/core/shaders/Flip/index.js +5 -4
- package/dist/core/shaders/FloatingParticles/index.d.ts +9 -4
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +9 -5
- package/dist/core/shaders/FlowField/index.js +6 -4
- package/dist/core/shaders/Flower/index.js +7 -4
- package/dist/core/shaders/FlowingGradient/index.js +6 -4
- package/dist/core/shaders/FlutedGlass/index.js +5 -4
- package/dist/core/shaders/Fog/index.js +5 -4
- package/dist/core/shaders/Form3D/index.js +5 -4
- package/dist/core/shaders/FractalNoise/index.js +7 -4
- package/dist/core/shaders/Frost/index.js +11 -6
- package/dist/core/shaders/GaborNoise/index.js +8 -5
- package/dist/core/shaders/Glass/index.js +11 -6
- package/dist/core/shaders/GlassTiles/index.js +5 -4
- package/dist/core/shaders/Glitch/index.d.ts +1 -1
- package/dist/core/shaders/Glitch/index.d.ts.map +1 -1
- package/dist/core/shaders/Glitch/index.js +5 -4
- package/dist/core/shaders/Glow/index.js +6 -4
- package/dist/core/shaders/Godrays/index.js +5 -4
- package/dist/core/shaders/Goo/index.js +10 -6
- package/dist/core/shaders/GradientMap/index.js +5 -4
- package/dist/core/shaders/Grayscale/index.js +5 -4
- package/dist/core/shaders/Grid/index.js +5 -4
- package/dist/core/shaders/GridDistortion/index.js +5 -4
- package/dist/core/shaders/Group/index.js +5 -4
- package/dist/core/shaders/HTMLInCanvas/index.js +5 -4
- package/dist/core/shaders/Halftone/index.js +5 -4
- package/dist/core/shaders/Heart/index.js +7 -4
- package/dist/core/shaders/Heatmap/index.js +11 -6
- package/dist/core/shaders/HexGrid/index.js +5 -4
- package/dist/core/shaders/Hologram/index.js +11 -6
- package/dist/core/shaders/Holographic/index.js +11 -6
- package/dist/core/shaders/HueShift/index.js +5 -4
- package/dist/core/shaders/ImageTexture/index.js +7 -5
- package/dist/core/shaders/InkFlow/index.js +5 -4
- package/dist/core/shaders/Invert/index.js +5 -4
- package/dist/core/shaders/IrisWipe/index.js +5 -4
- package/dist/core/shaders/IsometricCubes/index.js +5 -4
- package/dist/core/shaders/Kaleidoscope/index.js +5 -4
- package/dist/core/shaders/KeyFrames/index.js +5 -4
- package/dist/core/shaders/LensFlare/index.js +5 -4
- package/dist/core/shaders/LightEdge/index.js +11 -6
- package/dist/core/shaders/LightLeak/index.js +6 -4
- package/dist/core/shaders/LinearBlur/index.js +5 -4
- package/dist/core/shaders/LinearGradient/index.js +5 -4
- package/dist/core/shaders/LinearWipe/index.js +5 -4
- package/dist/core/shaders/LiquidMetal/index.js +11 -6
- package/dist/core/shaders/Liquify/index.js +5 -4
- package/dist/core/shaders/MagneticFilings/index.d.ts +0 -2
- package/dist/core/shaders/MagneticFilings/index.d.ts.map +1 -1
- package/dist/core/shaders/MagneticFilings/index.js +9 -5
- package/dist/core/shaders/Marble/index.js +6 -4
- package/dist/core/shaders/Mirror/index.js +5 -4
- package/dist/core/shaders/MultiPointGradient/index.js +5 -4
- package/dist/core/shaders/Neon/index.js +9 -5
- package/dist/core/shaders/NoiseDissolve/index.js +6 -4
- package/dist/core/shaders/ObjectTracker/index.js +6 -5
- package/dist/core/shaders/PagePeel/index.js +5 -4
- package/dist/core/shaders/Paper/index.js +6 -4
- package/dist/core/shaders/Parallelogram/index.js +7 -4
- package/dist/core/shaders/ParticleField/index.d.ts +10 -5
- package/dist/core/shaders/ParticleField/index.d.ts.map +1 -1
- package/dist/core/shaders/ParticleField/index.js +9 -5
- package/dist/core/shaders/ParticleFlow/index.d.ts +10 -4
- package/dist/core/shaders/ParticleFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ParticleFlow/index.js +9 -5
- package/dist/core/shaders/Particles/index.d.ts +4 -3
- package/dist/core/shaders/Particles/index.d.ts.map +1 -1
- package/dist/core/shaders/Particles/index.js +12 -6
- package/dist/core/shaders/PerlinNoise/index.js +8 -5
- package/dist/core/shaders/Perspective/index.js +5 -4
- package/dist/core/shaders/PixelSort/index.js +5 -4
- package/dist/core/shaders/PixelThrow/index.js +6 -4
- package/dist/core/shaders/Pixelate/index.js +5 -4
- package/dist/core/shaders/Plasma/index.js +6 -4
- package/dist/core/shaders/Plastic/index.js +11 -6
- package/dist/core/shaders/PolarCoordinates/index.js +5 -4
- package/dist/core/shaders/Polygon/index.js +7 -4
- package/dist/core/shaders/Posterize/index.js +5 -4
- package/dist/core/shaders/Prism/index.js +5 -4
- package/dist/core/shaders/ProgressiveBlur/index.js +6 -4
- package/dist/core/shaders/RadialGradient/index.js +5 -4
- package/dist/core/shaders/RadialWipe/index.js +5 -4
- package/dist/core/shaders/RandomBars/index.js +6 -4
- package/dist/core/shaders/ReactionDiffusion/index.js +5 -4
- package/dist/core/shaders/RectangularCoordinates/index.js +5 -4
- package/dist/core/shaders/ReflectivePlane/index.js +6 -4
- package/dist/core/shaders/Repeater/index.js +5 -4
- package/dist/core/shaders/Ring/index.js +7 -4
- package/dist/core/shaders/RippleWipe/index.js +5 -4
- package/dist/core/shaders/Ripples/index.js +5 -4
- package/dist/core/shaders/RoundedRect/index.js +7 -4
- package/dist/core/shaders/Saturation/index.js +5 -4
- package/dist/core/shaders/Scratches/index.js +8 -5
- package/dist/core/shaders/Sharpness/index.js +5 -4
- package/dist/core/shaders/Shatter/index.js +6 -4
- package/dist/core/shaders/SimplexNoise/index.js +7 -4
- package/dist/core/shaders/SineWave/index.js +5 -4
- package/dist/core/shaders/SliceWipe/index.js +5 -4
- package/dist/core/shaders/Smoke/index.js +5 -4
- package/dist/core/shaders/SmokeFill/index.js +10 -6
- package/dist/core/shaders/SmokeFlow/index.js +5 -4
- package/dist/core/shaders/Solarize/index.js +5 -4
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +5 -4
- package/dist/core/shaders/Spiral/index.js +5 -4
- package/dist/core/shaders/Star/index.js +7 -4
- package/dist/core/shaders/Stone/index.js +4 -3
- package/dist/core/shaders/Strands/index.js +5 -4
- package/dist/core/shaders/Stretch/index.js +5 -4
- package/dist/core/shaders/Stripes/index.js +5 -4
- package/dist/core/shaders/StudioBackground/index.js +5 -4
- package/dist/core/shaders/SunBurst/index.js +5 -4
- package/dist/core/shaders/Surface3D/index.d.ts +4 -2
- package/dist/core/shaders/Surface3D/index.d.ts.map +1 -1
- package/dist/core/shaders/Surface3D/index.js +7 -4
- package/dist/core/shaders/Swirl/index.js +5 -4
- package/dist/core/shaders/Teardrop/index.js +7 -4
- package/dist/core/shaders/Text/index.js +6 -5
- package/dist/core/shaders/ThinFilm/index.js +9 -5
- package/dist/core/shaders/TiltShift/index.js +6 -4
- package/dist/core/shaders/TimeTrail/index.d.ts +47 -1
- package/dist/core/shaders/TimeTrail/index.d.ts.map +1 -1
- package/dist/core/shaders/TimeTrail/index.js +7 -5
- package/dist/core/shaders/Tint/index.js +5 -4
- package/dist/core/shaders/Trapezoid/index.js +7 -4
- package/dist/core/shaders/TriangularGrid/index.js +5 -4
- package/dist/core/shaders/Tritone/index.js +5 -4
- package/dist/core/shaders/Truchet/index.js +5 -4
- package/dist/core/shaders/Twirl/index.js +5 -4
- package/dist/core/shaders/VHS/index.js +5 -4
- package/dist/core/shaders/VenetianBlinds/index.js +5 -4
- package/dist/core/shaders/Vesica/index.js +7 -4
- package/dist/core/shaders/Vibrance/index.js +5 -4
- package/dist/core/shaders/VideoTexture/index.js +6 -5
- package/dist/core/shaders/Vignette/index.js +5 -4
- package/dist/core/shaders/Voronoi/index.js +5 -4
- package/dist/core/shaders/Water/index.js +11 -6
- package/dist/core/shaders/Watercolor/index.d.ts +1 -1
- package/dist/core/shaders/Watercolor/index.d.ts.map +1 -1
- package/dist/core/shaders/Watercolor/index.js +6 -4
- package/dist/core/shaders/WaveDistortion/index.js +5 -4
- package/dist/core/shaders/WaveletNoise/index.js +8 -5
- package/dist/core/shaders/Weave/index.js +5 -4
- package/dist/core/shaders/WebcamTexture/index.js +7 -5
- package/dist/core/shaders/Wool/index.js +4 -3
- package/dist/core/shaders/WorleyNoise/index.js +5 -4
- package/dist/core/shaders/ZoomBlur/index.js +5 -4
- package/dist/core/shapeEffectBounds-Dg4GQ5vW.js +19213 -0
- package/dist/core/utilities/transformations/index.js +1 -1
- package/dist/js/bundle.js +188 -184
- package/dist/js/createShader.js +1 -1
- package/dist/react/Shader.js +1 -1
- package/dist/react/bundle.js +197 -193
- package/dist/registry.js +0 -1
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/svelte/index.js +1 -1
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/package.json +1 -1
- package/dist/core/coords-BkIjixe_.js +0 -55724
- package/dist/core/noiseStylize-J6sFKoTh.js +0 -65
- package/dist/core/porters-BmU6G9TR.js +0 -321
- package/dist/core/shaderRegistry-D75z2sND.js +0 -425
- package/dist/core/shapeEffectBounds-PQqKLQXO.js +0 -406
- /package/dist/core/{fonts-DwhbVe2B.js → fonts-v_F1SFl9.js} +0 -0
- /package/dist/core/{naturalSize-Caz3-kRv.js → naturalSize-B679wTgN.js} +0 -0
- /package/dist/core/{transformations-t0d2-uSX.js → transformations-CsPUHppB.js} +0 -0
|
@@ -1,71 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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";
|
|
5
|
+
import { a as transformColor, s as transformEdges } from "./transformations-CsPUHppB.js";
|
|
3
6
|
var WAVE_GRID = 256;
|
|
4
7
|
var WAVE_CELLS = WAVE_GRID * WAVE_GRID;
|
|
5
8
|
var WAVE_MAX = WAVE_GRID - 1;
|
|
6
9
|
var WAVE_HALFEXTENT = 3;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
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);
|
|
9
22
|
var STATE_FORMAT = "rgba16float";
|
|
10
23
|
var DEG_TO_RAD = Math.PI / 180;
|
|
11
24
|
var TWO_PI = Math.PI * 2;
|
|
12
|
-
var S3Params = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(
|
|
13
|
-
amp:
|
|
14
|
-
freq:
|
|
15
|
-
seed:
|
|
16
|
-
edgePin:
|
|
17
|
-
cursorIntensity:
|
|
18
|
-
t:
|
|
19
|
-
aspect:
|
|
20
|
-
focal:
|
|
21
|
-
camPos:
|
|
22
|
-
camForward:
|
|
23
|
-
camRight:
|
|
24
|
-
camUp:
|
|
25
|
-
lighting:
|
|
26
|
-
glossiness:
|
|
27
|
-
highlights:
|
|
28
|
-
lightX:
|
|
29
|
-
lightY:
|
|
30
|
-
lightZ:
|
|
31
|
-
lightColor:
|
|
32
|
-
nearCutoff:
|
|
33
|
-
farCutoff:
|
|
34
|
-
cursorWaveX:
|
|
35
|
-
cursorWaveY:
|
|
36
|
-
mouseSpeed:
|
|
37
|
-
dt:
|
|
38
|
-
decay:
|
|
39
|
-
radius:
|
|
40
|
-
waveSpeed:
|
|
25
|
+
var S3Params = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(struct({
|
|
26
|
+
amp: f32,
|
|
27
|
+
freq: f32,
|
|
28
|
+
seed: f32,
|
|
29
|
+
edgePin: f32,
|
|
30
|
+
cursorIntensity: f32,
|
|
31
|
+
t: f32,
|
|
32
|
+
aspect: f32,
|
|
33
|
+
focal: f32,
|
|
34
|
+
camPos: vec3f,
|
|
35
|
+
camForward: vec3f,
|
|
36
|
+
camRight: vec3f,
|
|
37
|
+
camUp: vec3f,
|
|
38
|
+
lighting: f32,
|
|
39
|
+
glossiness: f32,
|
|
40
|
+
highlights: f32,
|
|
41
|
+
lightX: f32,
|
|
42
|
+
lightY: f32,
|
|
43
|
+
lightZ: f32,
|
|
44
|
+
lightColor: vec3f,
|
|
45
|
+
nearCutoff: f32,
|
|
46
|
+
farCutoff: f32,
|
|
47
|
+
cursorWaveX: f32,
|
|
48
|
+
cursorWaveY: f32,
|
|
49
|
+
mouseSpeed: f32,
|
|
50
|
+
dt: f32,
|
|
51
|
+
decay: f32,
|
|
52
|
+
radius: f32,
|
|
53
|
+
waveSpeed: f32,
|
|
54
|
+
heightEnvelope: f32,
|
|
55
|
+
cursorActive: f32
|
|
41
56
|
}), "S3Params");
|
|
42
|
-
var propagateLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(
|
|
57
|
+
var propagateLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(src_default.bindGroupLayout({
|
|
43
58
|
readSrc: {
|
|
44
|
-
storage:
|
|
59
|
+
storage: arrayOf(f32, WAVE_CELLS),
|
|
45
60
|
access: "readonly"
|
|
46
61
|
},
|
|
47
62
|
writeBuf: {
|
|
48
|
-
storage:
|
|
63
|
+
storage: arrayOf(f32, WAVE_CELLS),
|
|
49
64
|
access: "mutable"
|
|
50
65
|
},
|
|
51
66
|
readBuf: {
|
|
52
|
-
storage:
|
|
67
|
+
storage: arrayOf(f32, WAVE_CELLS),
|
|
53
68
|
access: "mutable"
|
|
54
69
|
},
|
|
55
70
|
params: { uniform: S3Params }
|
|
56
71
|
}), "propagateLayout");
|
|
57
|
-
var computeLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(
|
|
72
|
+
var computeLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(src_default.bindGroupLayout({
|
|
58
73
|
readBuf: {
|
|
59
|
-
storage:
|
|
74
|
+
storage: arrayOf(f32, WAVE_CELLS),
|
|
60
75
|
access: "readonly"
|
|
61
76
|
},
|
|
62
77
|
params: { uniform: S3Params },
|
|
63
|
-
uvMaskTex: { storageTexture:
|
|
64
|
-
litTex: { storageTexture:
|
|
78
|
+
uvMaskTex: { storageTexture: textureStorage2d(STATE_FORMAT, "write-only") },
|
|
79
|
+
litTex: { storageTexture: textureStorage2d(STATE_FORMAT, "write-only") }
|
|
65
80
|
}), "computeLayout");
|
|
66
81
|
function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
67
82
|
const invTotalWeight = 1 / (2 - Math.pow(.5, Math.max(octaveCount, 1) - 1));
|
|
68
|
-
return
|
|
83
|
+
return src_default.fn([vec2f], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((uv) => {
|
|
69
84
|
"use gpu";
|
|
70
85
|
const p = computeLayout.$.params;
|
|
71
86
|
const u = uv.x;
|
|
@@ -73,77 +88,80 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
73
88
|
const amp = p.amp;
|
|
74
89
|
const freq = p.freq;
|
|
75
90
|
const seedU = p.seed;
|
|
76
|
-
let waveVal =
|
|
91
|
+
let waveVal = f32(0);
|
|
77
92
|
if (waveType === 1) {
|
|
78
|
-
let accSin =
|
|
93
|
+
let accSin = f32(0);
|
|
79
94
|
for (let i = 0; i < octaveCount; i++) {
|
|
80
|
-
const iF =
|
|
81
|
-
const scale =
|
|
82
|
-
const weight =
|
|
83
|
-
const cu$1 =
|
|
84
|
-
const su =
|
|
95
|
+
const iF = f32(i);
|
|
96
|
+
const scale = exp2(iF);
|
|
97
|
+
const weight = exp2(__tsover_mul(iF, -1));
|
|
98
|
+
const cu$1 = cos(__tsover_mul(iF, 1.111));
|
|
99
|
+
const su = sin(__tsover_mul(iF, 1.111));
|
|
85
100
|
const ru = __tsover_sub(__tsover_mul(u, cu$1), __tsover_mul(v, su));
|
|
86
101
|
const phase = __tsover_add(__tsover_add(__tsover_mul(__tsover_mul(__tsover_mul(ru, freq), scale), TWO_PI), __tsover_mul(p.t, __tsover_add(1, __tsover_mul(iF, .2)))), __tsover_mul(seedU, __tsover_add(1, __tsover_mul(iF, .5))));
|
|
87
|
-
accSin = __tsover_add(accSin, __tsover_mul(
|
|
102
|
+
accSin = __tsover_add(accSin, __tsover_mul(sin(phase), weight));
|
|
88
103
|
}
|
|
89
104
|
waveVal = __tsover_mul(accSin, invTotalWeight);
|
|
90
105
|
} else if (waveType === 2) {
|
|
91
|
-
let accR =
|
|
106
|
+
let accR = f32(0);
|
|
92
107
|
for (let i = 0; i < octaveCount; i++) {
|
|
93
|
-
const iF =
|
|
94
|
-
const scale =
|
|
95
|
-
const weight =
|
|
96
|
-
const driftX =
|
|
97
|
-
const driftY =
|
|
98
|
-
const coord =
|
|
108
|
+
const iF = f32(i);
|
|
109
|
+
const scale = exp2(iF);
|
|
110
|
+
const weight = exp2(__tsover_mul(iF, -1));
|
|
111
|
+
const driftX = cos(__tsover_mul(iF, 2.39996));
|
|
112
|
+
const driftY = sin(__tsover_mul(iF, 2.39996));
|
|
113
|
+
const coord = vec2f(__tsover_add(__tsover_add(__tsover_mul(__tsover_mul(u, freq), scale), __tsover_mul(p.t, __tsover_mul(driftX, .3))), seedU), __tsover_add(__tsover_add(__tsover_mul(__tsover_mul(v, freq), scale), __tsover_mul(p.t, __tsover_mul(driftY, .3))), __tsover_mul(seedU, .7)));
|
|
99
114
|
accR = __tsover_add(accR, __tsover_mul(mxNoiseFloat2(coord), weight));
|
|
100
115
|
}
|
|
101
116
|
const n = __tsover_mul(accR, invTotalWeight);
|
|
102
|
-
waveVal = __tsover_sub(__tsover_mul(__tsover_sub(1,
|
|
117
|
+
waveVal = __tsover_sub(__tsover_mul(__tsover_sub(1, abs(n)), 2), 1);
|
|
103
118
|
} else {
|
|
104
119
|
const warpFreq = __tsover_mul(freq, .5);
|
|
105
|
-
const wx = mxNoiseFloat2(
|
|
106
|
-
const wy = mxNoiseFloat2(
|
|
120
|
+
const wx = mxNoiseFloat2(vec2f(__tsover_add(__tsover_add(__tsover_mul(u, warpFreq), __tsover_mul(p.t, .1)), seedU), __tsover_add(__tsover_mul(v, warpFreq), __tsover_mul(seedU, 1.3))));
|
|
121
|
+
const wy = mxNoiseFloat2(vec2f(__tsover_add(__tsover_add(__tsover_mul(u, warpFreq), seedU), 17.3), __tsover_add(__tsover_add(__tsover_add(__tsover_mul(v, warpFreq), __tsover_mul(p.t, .07)), seedU), 31.1)));
|
|
107
122
|
const wu = __tsover_add(u, __tsover_mul(wx, .4));
|
|
108
123
|
const wv = __tsover_add(v, __tsover_mul(wy, .4));
|
|
109
|
-
let accW =
|
|
124
|
+
let accW = f32(0);
|
|
110
125
|
for (let i = 0; i < octaveCount; i++) {
|
|
111
|
-
const iF =
|
|
112
|
-
const scale =
|
|
113
|
-
const weight =
|
|
114
|
-
const driftX =
|
|
115
|
-
const driftY =
|
|
116
|
-
const coord =
|
|
126
|
+
const iF = f32(i);
|
|
127
|
+
const scale = exp2(iF);
|
|
128
|
+
const weight = exp2(__tsover_mul(iF, -1));
|
|
129
|
+
const driftX = cos(__tsover_mul(iF, 2.39996));
|
|
130
|
+
const driftY = sin(__tsover_mul(iF, 2.39996));
|
|
131
|
+
const coord = vec2f(__tsover_add(__tsover_add(__tsover_mul(__tsover_mul(wu, freq), scale), __tsover_mul(p.t, __tsover_mul(driftX, .3))), seedU), __tsover_add(__tsover_add(__tsover_mul(__tsover_mul(wv, freq), scale), __tsover_mul(p.t, __tsover_mul(driftY, .3))), __tsover_mul(seedU, .7)));
|
|
117
132
|
accW = __tsover_add(accW, __tsover_mul(mxNoiseFloat2(coord), weight));
|
|
118
133
|
}
|
|
119
134
|
waveVal = __tsover_mul(accW, invTotalWeight);
|
|
120
135
|
}
|
|
121
136
|
const cu = __tsover_mul(__tsover_sub(u, .5), 2);
|
|
122
137
|
const cv = __tsover_mul(__tsover_sub(v, .5), 2);
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
const pinMask = std.mix(d.f32(1), __tsover_sub(1, pinFalloff), p.edgePin);
|
|
138
|
+
const pinFalloff = smoothstep(.6, 1, max(abs(cu), abs(cv)));
|
|
139
|
+
const pinMask = mix(f32(1), __tsover_sub(1, pinFalloff), p.edgePin);
|
|
126
140
|
const baseHeight = __tsover_mul(__tsover_mul(waveVal, amp), pinMask);
|
|
127
141
|
if (cursorEnabled) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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);
|
|
147
165
|
} else return baseHeight;
|
|
148
166
|
}), {
|
|
149
167
|
v: 1,
|
|
@@ -1287,8 +1305,8 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
1287
1305
|
"cursorEnabled",
|
|
1288
1306
|
[0, [
|
|
1289
1307
|
[
|
|
1290
|
-
|
|
1291
|
-
"
|
|
1308
|
+
12,
|
|
1309
|
+
"ripple",
|
|
1292
1310
|
[
|
|
1293
1311
|
6,
|
|
1294
1312
|
[
|
|
@@ -1296,178 +1314,143 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
1296
1314
|
"d",
|
|
1297
1315
|
"f32"
|
|
1298
1316
|
],
|
|
1299
|
-
["
|
|
1317
|
+
[[5, "0"]]
|
|
1300
1318
|
]
|
|
1301
1319
|
],
|
|
1302
1320
|
[
|
|
1303
|
-
|
|
1304
|
-
"waveU",
|
|
1321
|
+
11,
|
|
1305
1322
|
[
|
|
1306
1323
|
1,
|
|
1307
1324
|
[
|
|
1308
|
-
|
|
1325
|
+
7,
|
|
1326
|
+
"p",
|
|
1327
|
+
"cursorActive"
|
|
1328
|
+
],
|
|
1329
|
+
">",
|
|
1330
|
+
[5, "0.5"]
|
|
1331
|
+
],
|
|
1332
|
+
[0, [
|
|
1333
|
+
[
|
|
1334
|
+
13,
|
|
1335
|
+
"H",
|
|
1309
1336
|
[
|
|
1310
|
-
|
|
1337
|
+
6,
|
|
1311
1338
|
[
|
|
1312
1339
|
7,
|
|
1313
|
-
"
|
|
1314
|
-
"
|
|
1340
|
+
"d",
|
|
1341
|
+
"f32"
|
|
1315
1342
|
],
|
|
1316
|
-
"
|
|
1317
|
-
|
|
1318
|
-
],
|
|
1319
|
-
"/",
|
|
1320
|
-
"H"
|
|
1343
|
+
["WAVE_HALFEXTENT"]
|
|
1344
|
+
]
|
|
1321
1345
|
],
|
|
1322
|
-
"+",
|
|
1323
|
-
[5, "0.5"]
|
|
1324
|
-
]
|
|
1325
|
-
],
|
|
1326
|
-
[
|
|
1327
|
-
13,
|
|
1328
|
-
"waveV",
|
|
1329
|
-
[
|
|
1330
|
-
1,
|
|
1331
1346
|
[
|
|
1332
|
-
|
|
1347
|
+
13,
|
|
1348
|
+
"waveU",
|
|
1333
1349
|
[
|
|
1334
1350
|
1,
|
|
1335
1351
|
[
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1352
|
+
1,
|
|
1353
|
+
[
|
|
1354
|
+
1,
|
|
1355
|
+
[
|
|
1356
|
+
7,
|
|
1357
|
+
"uv",
|
|
1358
|
+
"x"
|
|
1359
|
+
],
|
|
1360
|
+
"-",
|
|
1361
|
+
[5, "0.5"]
|
|
1362
|
+
],
|
|
1363
|
+
"/",
|
|
1364
|
+
"H"
|
|
1339
1365
|
],
|
|
1340
|
-
"
|
|
1366
|
+
"+",
|
|
1341
1367
|
[5, "0.5"]
|
|
1342
|
-
]
|
|
1343
|
-
"/",
|
|
1344
|
-
"H"
|
|
1345
|
-
],
|
|
1346
|
-
"+",
|
|
1347
|
-
[5, "0.5"]
|
|
1348
|
-
]
|
|
1349
|
-
],
|
|
1350
|
-
[
|
|
1351
|
-
13,
|
|
1352
|
-
"Nm1",
|
|
1353
|
-
[
|
|
1354
|
-
6,
|
|
1355
|
-
[
|
|
1356
|
-
7,
|
|
1357
|
-
"d",
|
|
1358
|
-
"f32"
|
|
1368
|
+
]
|
|
1359
1369
|
],
|
|
1360
|
-
["WAVE_MAX"]
|
|
1361
|
-
]
|
|
1362
|
-
],
|
|
1363
|
-
[
|
|
1364
|
-
13,
|
|
1365
|
-
"gx",
|
|
1366
|
-
[
|
|
1367
|
-
1,
|
|
1368
1370
|
[
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
7,
|
|
1372
|
-
"std",
|
|
1373
|
-
"clamp"
|
|
1374
|
-
],
|
|
1371
|
+
13,
|
|
1372
|
+
"waveV",
|
|
1375
1373
|
[
|
|
1376
|
-
|
|
1377
|
-
[
|
|
1378
|
-
|
|
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"]
|
|
1379
1392
|
]
|
|
1380
1393
|
],
|
|
1381
|
-
"*",
|
|
1382
|
-
"Nm1"
|
|
1383
|
-
]
|
|
1384
|
-
],
|
|
1385
|
-
[
|
|
1386
|
-
13,
|
|
1387
|
-
"gy",
|
|
1388
|
-
[
|
|
1389
|
-
1,
|
|
1390
1394
|
[
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
7,
|
|
1394
|
-
"std",
|
|
1395
|
-
"clamp"
|
|
1396
|
-
],
|
|
1395
|
+
13,
|
|
1396
|
+
"Nm1",
|
|
1397
1397
|
[
|
|
1398
|
-
|
|
1399
|
-
[
|
|
1400
|
-
|
|
1398
|
+
6,
|
|
1399
|
+
[
|
|
1400
|
+
7,
|
|
1401
|
+
"d",
|
|
1402
|
+
"f32"
|
|
1403
|
+
],
|
|
1404
|
+
["WAVE_MAX"]
|
|
1401
1405
|
]
|
|
1402
1406
|
],
|
|
1403
|
-
"*",
|
|
1404
|
-
"Nm1"
|
|
1405
|
-
]
|
|
1406
|
-
],
|
|
1407
|
-
[
|
|
1408
|
-
13,
|
|
1409
|
-
"ix",
|
|
1410
|
-
[
|
|
1411
|
-
6,
|
|
1412
1407
|
[
|
|
1413
|
-
|
|
1414
|
-
"
|
|
1415
|
-
"u32"
|
|
1416
|
-
],
|
|
1417
|
-
[[
|
|
1418
|
-
6,
|
|
1419
|
-
[
|
|
1420
|
-
7,
|
|
1421
|
-
"std",
|
|
1422
|
-
"clamp"
|
|
1423
|
-
],
|
|
1408
|
+
13,
|
|
1409
|
+
"gx",
|
|
1424
1410
|
[
|
|
1425
|
-
|
|
1426
|
-
[
|
|
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
|
+
"*",
|
|
1427
1426
|
"Nm1"
|
|
1428
1427
|
]
|
|
1429
|
-
]]
|
|
1430
|
-
]
|
|
1431
|
-
],
|
|
1432
|
-
[
|
|
1433
|
-
13,
|
|
1434
|
-
"iy",
|
|
1435
|
-
[
|
|
1436
|
-
6,
|
|
1437
|
-
[
|
|
1438
|
-
7,
|
|
1439
|
-
"d",
|
|
1440
|
-
"u32"
|
|
1441
1428
|
],
|
|
1442
|
-
[
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
7,
|
|
1446
|
-
"std",
|
|
1447
|
-
"clamp"
|
|
1448
|
-
],
|
|
1429
|
+
[
|
|
1430
|
+
13,
|
|
1431
|
+
"gy",
|
|
1449
1432
|
[
|
|
1450
|
-
|
|
1451
|
-
[
|
|
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
|
+
"*",
|
|
1452
1448
|
"Nm1"
|
|
1453
1449
|
]
|
|
1454
|
-
]]
|
|
1455
|
-
]
|
|
1456
|
-
],
|
|
1457
|
-
[
|
|
1458
|
-
13,
|
|
1459
|
-
"ix1",
|
|
1460
|
-
[
|
|
1461
|
-
6,
|
|
1462
|
-
[
|
|
1463
|
-
7,
|
|
1464
|
-
"std",
|
|
1465
|
-
"min"
|
|
1466
1450
|
],
|
|
1467
|
-
[
|
|
1468
|
-
|
|
1451
|
+
[
|
|
1452
|
+
13,
|
|
1469
1453
|
"ix",
|
|
1470
|
-
"+",
|
|
1471
1454
|
[
|
|
1472
1455
|
6,
|
|
1473
1456
|
[
|
|
@@ -1475,33 +1458,24 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
1475
1458
|
"d",
|
|
1476
1459
|
"u32"
|
|
1477
1460
|
],
|
|
1478
|
-
[[
|
|
1461
|
+
[[
|
|
1462
|
+
6,
|
|
1463
|
+
[
|
|
1464
|
+
7,
|
|
1465
|
+
"std",
|
|
1466
|
+
"clamp"
|
|
1467
|
+
],
|
|
1468
|
+
[
|
|
1469
|
+
"gx",
|
|
1470
|
+
[5, "0"],
|
|
1471
|
+
"Nm1"
|
|
1472
|
+
]
|
|
1473
|
+
]]
|
|
1479
1474
|
]
|
|
1480
|
-
], [
|
|
1481
|
-
6,
|
|
1482
|
-
[
|
|
1483
|
-
7,
|
|
1484
|
-
"d",
|
|
1485
|
-
"u32"
|
|
1486
|
-
],
|
|
1487
|
-
["WAVE_MAX"]
|
|
1488
|
-
]]
|
|
1489
|
-
]
|
|
1490
|
-
],
|
|
1491
|
-
[
|
|
1492
|
-
13,
|
|
1493
|
-
"iy1",
|
|
1494
|
-
[
|
|
1495
|
-
6,
|
|
1496
|
-
[
|
|
1497
|
-
7,
|
|
1498
|
-
"std",
|
|
1499
|
-
"min"
|
|
1500
1475
|
],
|
|
1501
|
-
[
|
|
1502
|
-
|
|
1476
|
+
[
|
|
1477
|
+
13,
|
|
1503
1478
|
"iy",
|
|
1504
|
-
"+",
|
|
1505
1479
|
[
|
|
1506
1480
|
6,
|
|
1507
1481
|
[
|
|
@@ -1509,200 +1483,249 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
1509
1483
|
"d",
|
|
1510
1484
|
"u32"
|
|
1511
1485
|
],
|
|
1512
|
-
[[
|
|
1486
|
+
[[
|
|
1487
|
+
6,
|
|
1488
|
+
[
|
|
1489
|
+
7,
|
|
1490
|
+
"std",
|
|
1491
|
+
"clamp"
|
|
1492
|
+
],
|
|
1493
|
+
[
|
|
1494
|
+
"gy",
|
|
1495
|
+
[5, "0"],
|
|
1496
|
+
"Nm1"
|
|
1497
|
+
]
|
|
1498
|
+
]]
|
|
1513
1499
|
]
|
|
1514
|
-
],
|
|
1515
|
-
6,
|
|
1516
|
-
[
|
|
1517
|
-
7,
|
|
1518
|
-
"d",
|
|
1519
|
-
"u32"
|
|
1520
|
-
],
|
|
1521
|
-
["WAVE_MAX"]
|
|
1522
|
-
]]
|
|
1523
|
-
]
|
|
1524
|
-
],
|
|
1525
|
-
[
|
|
1526
|
-
13,
|
|
1527
|
-
"fx",
|
|
1528
|
-
[
|
|
1529
|
-
1,
|
|
1530
|
-
"gx",
|
|
1531
|
-
"-",
|
|
1500
|
+
],
|
|
1532
1501
|
[
|
|
1533
|
-
|
|
1502
|
+
13,
|
|
1503
|
+
"ix1",
|
|
1534
1504
|
[
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
[
|
|
1565
|
-
6,
|
|
1566
|
-
[
|
|
1567
|
-
7,
|
|
1568
|
-
"d",
|
|
1569
|
-
"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
|
+
]
|
|
1570
1534
|
],
|
|
1571
|
-
["WAVE_GRID"]
|
|
1572
|
-
]
|
|
1573
|
-
],
|
|
1574
|
-
[
|
|
1575
|
-
13,
|
|
1576
|
-
"v00",
|
|
1577
|
-
[
|
|
1578
|
-
8,
|
|
1579
1535
|
[
|
|
1580
|
-
|
|
1536
|
+
13,
|
|
1537
|
+
"iy1",
|
|
1581
1538
|
[
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
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
|
+
]
|
|
1587
1568
|
],
|
|
1588
1569
|
[
|
|
1589
|
-
|
|
1570
|
+
13,
|
|
1571
|
+
"fx",
|
|
1590
1572
|
[
|
|
1591
1573
|
1,
|
|
1592
|
-
"
|
|
1593
|
-
"
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
[
|
|
1605
|
-
8,
|
|
1606
|
-
[
|
|
1607
|
-
7,
|
|
1608
|
-
[
|
|
1609
|
-
7,
|
|
1610
|
-
"computeLayout",
|
|
1611
|
-
"$"
|
|
1612
|
-
],
|
|
1613
|
-
"readBuf"
|
|
1574
|
+
"gx",
|
|
1575
|
+
"-",
|
|
1576
|
+
[
|
|
1577
|
+
6,
|
|
1578
|
+
[
|
|
1579
|
+
7,
|
|
1580
|
+
"std",
|
|
1581
|
+
"floor"
|
|
1582
|
+
],
|
|
1583
|
+
["gx"]
|
|
1584
|
+
]
|
|
1585
|
+
]
|
|
1614
1586
|
],
|
|
1615
1587
|
[
|
|
1616
|
-
|
|
1588
|
+
13,
|
|
1589
|
+
"fy",
|
|
1617
1590
|
[
|
|
1618
1591
|
1,
|
|
1619
|
-
"
|
|
1620
|
-
"
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
8,
|
|
1592
|
+
"gy",
|
|
1593
|
+
"-",
|
|
1594
|
+
[
|
|
1595
|
+
6,
|
|
1596
|
+
[
|
|
1597
|
+
7,
|
|
1598
|
+
"std",
|
|
1599
|
+
"floor"
|
|
1600
|
+
],
|
|
1601
|
+
["gy"]
|
|
1602
|
+
]
|
|
1603
|
+
]
|
|
1604
|
+
],
|
|
1633
1605
|
[
|
|
1634
|
-
|
|
1606
|
+
13,
|
|
1607
|
+
"W",
|
|
1635
1608
|
[
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1609
|
+
6,
|
|
1610
|
+
[
|
|
1611
|
+
7,
|
|
1612
|
+
"d",
|
|
1613
|
+
"u32"
|
|
1614
|
+
],
|
|
1615
|
+
["WAVE_GRID"]
|
|
1616
|
+
]
|
|
1641
1617
|
],
|
|
1642
1618
|
[
|
|
1643
|
-
|
|
1619
|
+
13,
|
|
1620
|
+
"v00",
|
|
1644
1621
|
[
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
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
|
+
],
|
|
1660
1645
|
[
|
|
1661
|
-
|
|
1646
|
+
13,
|
|
1647
|
+
"v10",
|
|
1662
1648
|
[
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
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
|
+
]
|
|
1668
1671
|
],
|
|
1669
1672
|
[
|
|
1670
|
-
|
|
1673
|
+
13,
|
|
1674
|
+
"v01",
|
|
1671
1675
|
[
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
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
|
+
]
|
|
1691
1698
|
],
|
|
1692
1699
|
[
|
|
1700
|
+
13,
|
|
1701
|
+
"v11",
|
|
1693
1702
|
[
|
|
1694
|
-
|
|
1703
|
+
8,
|
|
1695
1704
|
[
|
|
1696
1705
|
7,
|
|
1697
|
-
|
|
1698
|
-
|
|
1706
|
+
[
|
|
1707
|
+
7,
|
|
1708
|
+
"computeLayout",
|
|
1709
|
+
"$"
|
|
1710
|
+
],
|
|
1711
|
+
"readBuf"
|
|
1699
1712
|
],
|
|
1700
1713
|
[
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1714
|
+
1,
|
|
1715
|
+
[
|
|
1716
|
+
1,
|
|
1717
|
+
"iy1",
|
|
1718
|
+
"*",
|
|
1719
|
+
"W"
|
|
1720
|
+
],
|
|
1721
|
+
"+",
|
|
1722
|
+
"ix1"
|
|
1704
1723
|
]
|
|
1705
|
-
]
|
|
1724
|
+
]
|
|
1725
|
+
],
|
|
1726
|
+
[
|
|
1727
|
+
13,
|
|
1728
|
+
"waveSample",
|
|
1706
1729
|
[
|
|
1707
1730
|
6,
|
|
1708
1731
|
[
|
|
@@ -1711,34 +1734,63 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
1711
1734
|
"mix"
|
|
1712
1735
|
],
|
|
1713
1736
|
[
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
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"
|
|
1717
1764
|
]
|
|
1718
|
-
]
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
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
|
+
],
|
|
1723
1789
|
[10, [
|
|
1724
1790
|
1,
|
|
1725
1791
|
"baseHeight",
|
|
1726
1792
|
"+",
|
|
1727
|
-
|
|
1728
|
-
1,
|
|
1729
|
-
"waveSample",
|
|
1730
|
-
"*",
|
|
1731
|
-
[
|
|
1732
|
-
1,
|
|
1733
|
-
[
|
|
1734
|
-
7,
|
|
1735
|
-
"p",
|
|
1736
|
-
"cursorIntensity"
|
|
1737
|
-
],
|
|
1738
|
-
"*",
|
|
1739
|
-
[5, "0.05"]
|
|
1740
|
-
]
|
|
1741
|
-
]
|
|
1793
|
+
"ripple"
|
|
1742
1794
|
]]
|
|
1743
1795
|
]],
|
|
1744
1796
|
[0, [[10, "baseHeight"]]]
|
|
@@ -1761,10 +1813,10 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
1761
1813
|
},
|
|
1762
1814
|
externals: () => ({
|
|
1763
1815
|
computeLayout,
|
|
1764
|
-
d,
|
|
1816
|
+
d: data_exports,
|
|
1765
1817
|
waveType,
|
|
1766
1818
|
octaveCount,
|
|
1767
|
-
std,
|
|
1819
|
+
std: std_exports,
|
|
1768
1820
|
TWO_PI,
|
|
1769
1821
|
invTotalWeight,
|
|
1770
1822
|
noise: noise_exports,
|
|
@@ -1776,33 +1828,35 @@ function buildHeightFn(waveType, octaveCount, cursorEnabled) {
|
|
|
1776
1828
|
}) && $.f)({})).$name("surface3dHeight");
|
|
1777
1829
|
}
|
|
1778
1830
|
function makePropagateKernel() {
|
|
1779
|
-
return
|
|
1831
|
+
return src_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
|
|
1780
1832
|
"use gpu";
|
|
1781
|
-
if (cx >
|
|
1833
|
+
if (cx > u32(0) && cx < u32(WAVE_MAX) && cy > u32(0) && cy < u32(WAVE_MAX)) {
|
|
1782
1834
|
const p = propagateLayout.$.params;
|
|
1783
|
-
const gs =
|
|
1835
|
+
const gs = u32(WAVE_GRID);
|
|
1784
1836
|
const idx = __tsover_add(__tsover_mul(cy, gs), cx);
|
|
1785
|
-
const left = propagateLayout.$.readSrc[__tsover_sub(idx,
|
|
1786
|
-
const right = propagateLayout.$.readSrc[__tsover_add(idx,
|
|
1837
|
+
const left = propagateLayout.$.readSrc[__tsover_sub(idx, u32(1))];
|
|
1838
|
+
const right = propagateLayout.$.readSrc[__tsover_add(idx, u32(1))];
|
|
1787
1839
|
const up = propagateLayout.$.readSrc[__tsover_sub(idx, gs)];
|
|
1788
1840
|
const down = propagateLayout.$.readSrc[__tsover_add(idx, gs)];
|
|
1789
1841
|
const center = propagateLayout.$.readSrc[idx];
|
|
1790
1842
|
const sum = __tsover_add(__tsover_add(__tsover_add(left, right), up), down);
|
|
1791
1843
|
const prev = propagateLayout.$.writeBuf[idx];
|
|
1792
|
-
const dampFactor = __tsover_sub(1, __tsover_mul(p.decay,
|
|
1844
|
+
const dampFactor = __tsover_sub(1, __tsover_mul(p.decay, WAVE_DECAY_PER_STEP));
|
|
1793
1845
|
const k2 = __tsover_mul(.5, __tsover_mul(p.waveSpeed, p.waveSpeed));
|
|
1794
1846
|
const lap = __tsover_sub(sum, __tsover_mul(center, 4));
|
|
1795
1847
|
let next = __tsover_mul(__tsover_sub(__tsover_add(__tsover_mul(center, 2), __tsover_mul(lap, k2)), prev), dampFactor);
|
|
1796
|
-
const cellU = __tsover_div(__tsover_add(
|
|
1797
|
-
const cellV = __tsover_div(__tsover_add(
|
|
1848
|
+
const cellU = __tsover_div(__tsover_add(f32(cx), .5), f32(WAVE_GRID));
|
|
1849
|
+
const cellV = __tsover_div(__tsover_add(f32(cy), .5), f32(WAVE_GRID));
|
|
1798
1850
|
const ddx = __tsover_sub(cellU, p.cursorWaveX);
|
|
1799
1851
|
const ddy = __tsover_sub(cellV, p.cursorWaveY);
|
|
1800
1852
|
const distSq = __tsover_add(__tsover_mul(ddx, ddx), __tsover_mul(ddy, ddy));
|
|
1801
1853
|
const influenceRadius = __tsover_mul(p.radius, 3);
|
|
1802
1854
|
if (distSq < __tsover_mul(influenceRadius, influenceRadius) && p.mouseSpeed > .01) {
|
|
1803
|
-
const influence =
|
|
1855
|
+
const influence = exp(__tsover_mul(__tsover_div(distSq, max(__tsover_mul(p.radius, p.radius), f32(1e-4))), -1));
|
|
1804
1856
|
next = __tsover_sub(next, __tsover_mul(__tsover_mul(__tsover_mul(influence, p.mouseSpeed), p.dt), 3));
|
|
1805
1857
|
}
|
|
1858
|
+
const bound = f32(CURSOR_WAVE_BOUND);
|
|
1859
|
+
next = clamp(next, __tsover_mul(bound, -1), bound);
|
|
1806
1860
|
propagateLayout.$.writeBuf[idx] = next;
|
|
1807
1861
|
propagateLayout.$.readBuf[idx] = next;
|
|
1808
1862
|
}
|
|
@@ -2102,7 +2156,7 @@ function makePropagateKernel() {
|
|
|
2102
2156
|
"decay"
|
|
2103
2157
|
],
|
|
2104
2158
|
"*",
|
|
2105
|
-
|
|
2159
|
+
"WAVE_DECAY_PER_STEP"
|
|
2106
2160
|
]
|
|
2107
2161
|
]
|
|
2108
2162
|
],
|
|
@@ -2415,6 +2469,46 @@ function makePropagateKernel() {
|
|
|
2415
2469
|
]
|
|
2416
2470
|
]]]
|
|
2417
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
|
+
],
|
|
2418
2512
|
[
|
|
2419
2513
|
2,
|
|
2420
2514
|
[
|
|
@@ -2458,101 +2552,114 @@ function makePropagateKernel() {
|
|
|
2458
2552
|
"WAVE_MAX",
|
|
2459
2553
|
"propagateLayout",
|
|
2460
2554
|
"WAVE_GRID",
|
|
2461
|
-
"
|
|
2555
|
+
"WAVE_DECAY_PER_STEP",
|
|
2556
|
+
"std",
|
|
2557
|
+
"CURSOR_WAVE_BOUND"
|
|
2462
2558
|
]
|
|
2463
2559
|
},
|
|
2464
2560
|
externals: () => ({
|
|
2465
|
-
d,
|
|
2561
|
+
d: data_exports,
|
|
2466
2562
|
WAVE_MAX,
|
|
2467
2563
|
propagateLayout,
|
|
2468
2564
|
WAVE_GRID,
|
|
2469
|
-
|
|
2565
|
+
WAVE_DECAY_PER_STEP,
|
|
2566
|
+
std: std_exports,
|
|
2567
|
+
CURSOR_WAVE_BOUND
|
|
2470
2568
|
})
|
|
2471
2569
|
}) && $.f)({})).$name("surface3dPropagate");
|
|
2472
2570
|
}
|
|
2473
|
-
function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cursorEnabled) {
|
|
2571
|
+
function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cursorEnabled, computeW = COMPUTE_FALLBACK_W, computeH = COMPUTE_FALLBACK_H) {
|
|
2474
2572
|
const heightFn = buildHeightFn(waveType, octaveCount, cursorEnabled);
|
|
2475
|
-
return
|
|
2573
|
+
return src_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
|
|
2476
2574
|
"use gpu";
|
|
2477
2575
|
const p = computeLayout.$.params;
|
|
2478
|
-
const screenU = __tsover_div(__tsover_add(
|
|
2479
|
-
const screenV = __tsover_div(__tsover_add(
|
|
2576
|
+
const screenU = __tsover_div(__tsover_add(f32(cx), .5), f32(computeW));
|
|
2577
|
+
const screenV = __tsover_div(__tsover_add(f32(cy), .5), f32(computeH));
|
|
2480
2578
|
const ndcX = __tsover_mul(__tsover_mul(__tsover_sub(screenU, .5), 2), p.aspect);
|
|
2481
2579
|
const ndcY = __tsover_mul(__tsover_mul(__tsover_sub(screenV, .5), 2), -1);
|
|
2482
|
-
const rayDir =
|
|
2483
|
-
const
|
|
2484
|
-
const
|
|
2485
|
-
const
|
|
2486
|
-
const
|
|
2487
|
-
const
|
|
2488
|
-
const
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
let
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
const
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2580
|
+
const rayDir = normalize(p.camForward.mul(p.focal).add(p.camRight.mul(ndcX)).add(p.camUp.mul(ndcY)));
|
|
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)));
|
|
2589
|
+
let hit = f32(0);
|
|
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
|
+
}
|
|
2502
2643
|
}
|
|
2503
|
-
prevDiff = diff;
|
|
2504
|
-
}
|
|
2505
|
-
let tLow = __tsover_sub(tMarch, stepSize);
|
|
2506
|
-
let tHigh = tMarch;
|
|
2507
|
-
for (let r = 0; r < REFINE; r++) {
|
|
2508
|
-
const tMid = __tsover_mul(__tsover_add(tLow, tHigh), .5);
|
|
2509
|
-
const pMid = p.camPos.add(rayDir.mul(tMid));
|
|
2510
|
-
if (__tsover_sub(pMid.z, heightFn(d.vec2f(__tsover_add(__tsover_mul(pMid.x, .5), .5), __tsover_add(__tsover_mul(pMid.y, .5), .5)))) > 0) tLow = tMid;
|
|
2511
|
-
else tHigh = tMid;
|
|
2512
2644
|
}
|
|
2513
|
-
const
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
const hitV = __tsover_add(__tsover_mul(hitPos.y, .5), .5);
|
|
2517
|
-
const rawSampleUV = d.vec2f(hitU, __tsover_sub(1, hitV));
|
|
2518
|
-
let finalUV = d.vec2f(rawSampleUV.x, rawSampleUV.y);
|
|
2519
|
-
let outOfBoundsMask = d.f32(1);
|
|
2645
|
+
const rawSampleUV = vec2f(hitU, __tsover_sub(1, hitV));
|
|
2646
|
+
let finalUV = vec2f(rawSampleUV.x, rawSampleUV.y);
|
|
2647
|
+
let outOfBoundsMask = f32(1);
|
|
2520
2648
|
if (edgeMode === 2) finalUV = edgeMirrorUV(rawSampleUV);
|
|
2521
2649
|
else if (edgeMode === 3) finalUV = edgeWrapUV(rawSampleUV);
|
|
2522
2650
|
else if (edgeMode === 1) {
|
|
2523
2651
|
const inside = rawSampleUV.x >= 0 && rawSampleUV.x <= 1 && rawSampleUV.y >= 0 && rawSampleUV.y <= 1;
|
|
2524
|
-
outOfBoundsMask =
|
|
2525
|
-
} else finalUV =
|
|
2526
|
-
|
|
2527
|
-
if (lightingEnabled) {
|
|
2528
|
-
const normalEps = .01;
|
|
2529
|
-
const hC = heightFn(d.vec2f(hitU, hitV));
|
|
2530
|
-
const hR = heightFn(d.vec2f(__tsover_add(hitU, normalEps), hitV));
|
|
2531
|
-
const hUp = heightFn(d.vec2f(hitU, __tsover_add(hitV, normalEps)));
|
|
2532
|
-
const dhdu = __tsover_div(__tsover_sub(hR, hC), normalEps);
|
|
2533
|
-
const dhdv = __tsover_div(__tsover_sub(hUp, hC), normalEps);
|
|
2534
|
-
const nrm = std.normalize(d.vec3f(__tsover_mul(dhdu, -.5), __tsover_mul(dhdv, -.5), 1));
|
|
2535
|
-
const lightDir = std.normalize(d.vec3f(p.lightX, p.lightY, p.lightZ));
|
|
2536
|
-
const viewDir = rayDir.mul(-1);
|
|
2537
|
-
const diffuse = std.clamp(std.dot(nrm, lightDir), 0, 1);
|
|
2538
|
-
const halfVec = std.normalize(lightDir.add(viewDir));
|
|
2539
|
-
const specPow = __tsover_add(__tsover_mul(p.glossiness, 128), 4);
|
|
2540
|
-
const specular = __tsover_mul(std.pow(std.clamp(std.dot(nrm, halfVec), 0, 1), specPow), p.highlights);
|
|
2541
|
-
const ambient = d.vec3f(.4, .4, .4);
|
|
2542
|
-
const tintedDiffuse = p.lightColor.mul(__tsover_mul(diffuse, .6));
|
|
2543
|
-
const tintedSpec = p.lightColor.mul(specular);
|
|
2544
|
-
const totalLight = ambient.add(tintedDiffuse).add(tintedSpec);
|
|
2545
|
-
lit = std.clamp(std.mix(d.vec3f(1, 1, 1), totalLight, p.lighting), d.vec3f(0, 0, 0), d.vec3f(3, 3, 3));
|
|
2546
|
-
}
|
|
2547
|
-
const CUTOFF_RANGE = d.f32(15);
|
|
2652
|
+
outOfBoundsMask = select(f32(0), f32(1), inside);
|
|
2653
|
+
} else finalUV = clamp(rawSampleUV, vec2f(0, 0), vec2f(1, 1));
|
|
2654
|
+
const CUTOFF_RANGE = f32(MARCH_FAR);
|
|
2548
2655
|
const edgeAA = .05;
|
|
2549
2656
|
const nearT = __tsover_mul(p.nearCutoff, CUTOFF_RANGE);
|
|
2550
2657
|
const farT = __tsover_mul(p.farCutoff, CUTOFF_RANGE);
|
|
2551
|
-
const nearMask =
|
|
2552
|
-
const farMask =
|
|
2658
|
+
const nearMask = smoothstep(__tsover_sub(nearT, edgeAA), __tsover_add(nearT, edgeAA), finalT);
|
|
2659
|
+
const farMask = smoothstep(__tsover_add(farT, edgeAA), __tsover_sub(farT, edgeAA), finalT);
|
|
2553
2660
|
const finalMask = __tsover_mul(__tsover_mul(hit, outOfBoundsMask), __tsover_mul(nearMask, farMask));
|
|
2554
|
-
|
|
2555
|
-
|
|
2661
|
+
textureStore(computeLayout.$.uvMaskTex, vec2u(cx, cy), vec4f(finalUV.x, finalUV.y, finalMask, 0));
|
|
2662
|
+
textureStore(computeLayout.$.litTex, vec2u(cx, cy), vec4f(lit, 0));
|
|
2556
2663
|
}), {
|
|
2557
2664
|
v: 1,
|
|
2558
2665
|
name: void 0,
|
|
@@ -2605,7 +2712,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
2605
2712
|
"d",
|
|
2606
2713
|
"f32"
|
|
2607
2714
|
],
|
|
2608
|
-
["
|
|
2715
|
+
["computeW"]
|
|
2609
2716
|
]
|
|
2610
2717
|
]
|
|
2611
2718
|
],
|
|
@@ -2636,7 +2743,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
2636
2743
|
"d",
|
|
2637
2744
|
"f32"
|
|
2638
2745
|
],
|
|
2639
|
-
["
|
|
2746
|
+
["computeH"]
|
|
2640
2747
|
]
|
|
2641
2748
|
]
|
|
2642
2749
|
],
|
|
@@ -2759,113 +2866,241 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
2759
2866
|
],
|
|
2760
2867
|
[
|
|
2761
2868
|
13,
|
|
2762
|
-
"
|
|
2763
|
-
[
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
[5, "6"]
|
|
2869
|
+
"envelope",
|
|
2870
|
+
[
|
|
2871
|
+
7,
|
|
2872
|
+
"p",
|
|
2873
|
+
"heightEnvelope"
|
|
2874
|
+
]
|
|
2769
2875
|
],
|
|
2770
2876
|
[
|
|
2771
2877
|
13,
|
|
2772
|
-
"
|
|
2878
|
+
"dzSign",
|
|
2773
2879
|
[
|
|
2774
2880
|
6,
|
|
2775
2881
|
[
|
|
2776
2882
|
7,
|
|
2777
2883
|
"std",
|
|
2778
|
-
"
|
|
2884
|
+
"select"
|
|
2779
2885
|
],
|
|
2780
|
-
[
|
|
2781
|
-
1,
|
|
2886
|
+
[
|
|
2782
2887
|
[
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2888
|
+
6,
|
|
2889
|
+
[
|
|
2890
|
+
7,
|
|
2891
|
+
"d",
|
|
2892
|
+
"f32"
|
|
2893
|
+
],
|
|
2894
|
+
[[
|
|
2895
|
+
4,
|
|
2896
|
+
"-",
|
|
2897
|
+
[5, "1"]
|
|
2898
|
+
]]
|
|
2786
2899
|
],
|
|
2787
|
-
"*",
|
|
2788
2900
|
[
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
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"]
|
|
2792
2918
|
]
|
|
2793
|
-
]
|
|
2919
|
+
]
|
|
2920
|
+
]
|
|
2921
|
+
],
|
|
2922
|
+
[
|
|
2923
|
+
13,
|
|
2924
|
+
"dzSafe",
|
|
2925
|
+
[
|
|
2926
|
+
1,
|
|
2927
|
+
"dzSign",
|
|
2928
|
+
"*",
|
|
2929
|
+
[
|
|
2794
2930
|
6,
|
|
2795
2931
|
[
|
|
2796
2932
|
7,
|
|
2797
|
-
"
|
|
2798
|
-
"
|
|
2933
|
+
"std",
|
|
2934
|
+
"max"
|
|
2799
2935
|
],
|
|
2800
|
-
[[
|
|
2801
|
-
|
|
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
|
+
]
|
|
2802
2958
|
]
|
|
2803
2959
|
],
|
|
2804
2960
|
[
|
|
2805
2961
|
13,
|
|
2806
|
-
"
|
|
2962
|
+
"tTop",
|
|
2807
2963
|
[
|
|
2808
2964
|
1,
|
|
2809
2965
|
[
|
|
2810
|
-
|
|
2966
|
+
1,
|
|
2967
|
+
"envelope",
|
|
2968
|
+
"-",
|
|
2811
2969
|
[
|
|
2812
2970
|
7,
|
|
2813
|
-
|
|
2814
|
-
|
|
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
|
+
]
|
|
2815
2999
|
],
|
|
2816
|
-
"
|
|
3000
|
+
"-",
|
|
3001
|
+
[
|
|
3002
|
+
7,
|
|
3003
|
+
[
|
|
3004
|
+
7,
|
|
3005
|
+
"p",
|
|
3006
|
+
"camPos"
|
|
3007
|
+
],
|
|
3008
|
+
"z"
|
|
3009
|
+
]
|
|
2817
3010
|
],
|
|
2818
3011
|
"/",
|
|
2819
|
-
"
|
|
3012
|
+
"dzSafe"
|
|
2820
3013
|
]
|
|
2821
3014
|
],
|
|
2822
3015
|
[
|
|
2823
3016
|
13,
|
|
2824
|
-
"
|
|
3017
|
+
"tEnter",
|
|
2825
3018
|
[
|
|
2826
3019
|
6,
|
|
2827
3020
|
[
|
|
2828
3021
|
7,
|
|
2829
3022
|
"std",
|
|
2830
|
-
"
|
|
3023
|
+
"max"
|
|
2831
3024
|
],
|
|
2832
3025
|
[[
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
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
|
+
]]
|
|
2838
3042
|
]
|
|
2839
3043
|
],
|
|
2840
3044
|
[
|
|
2841
3045
|
13,
|
|
2842
|
-
"
|
|
3046
|
+
"tExit",
|
|
2843
3047
|
[
|
|
2844
|
-
|
|
2845
|
-
"marchTotal",
|
|
2846
|
-
"/",
|
|
3048
|
+
6,
|
|
2847
3049
|
[
|
|
3050
|
+
7,
|
|
3051
|
+
"std",
|
|
3052
|
+
"min"
|
|
3053
|
+
],
|
|
3054
|
+
[[
|
|
3055
|
+
6,
|
|
3056
|
+
[
|
|
3057
|
+
7,
|
|
3058
|
+
"std",
|
|
3059
|
+
"max"
|
|
3060
|
+
],
|
|
3061
|
+
["tTop", "tBot"]
|
|
3062
|
+
], [
|
|
2848
3063
|
6,
|
|
2849
3064
|
[
|
|
2850
3065
|
7,
|
|
2851
3066
|
"d",
|
|
2852
3067
|
"f32"
|
|
2853
3068
|
],
|
|
2854
|
-
["
|
|
2855
|
-
]
|
|
3069
|
+
["MARCH_FAR"]
|
|
3070
|
+
]]
|
|
2856
3071
|
]
|
|
2857
3072
|
],
|
|
2858
3073
|
[
|
|
2859
|
-
|
|
2860
|
-
"
|
|
3074
|
+
13,
|
|
3075
|
+
"farPos",
|
|
2861
3076
|
[
|
|
2862
3077
|
6,
|
|
2863
3078
|
[
|
|
2864
3079
|
7,
|
|
2865
|
-
|
|
2866
|
-
|
|
3080
|
+
[
|
|
3081
|
+
7,
|
|
3082
|
+
"p",
|
|
3083
|
+
"camPos"
|
|
3084
|
+
],
|
|
3085
|
+
"add"
|
|
2867
3086
|
],
|
|
2868
|
-
[[
|
|
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
|
+
]]
|
|
2869
3104
|
]
|
|
2870
3105
|
],
|
|
2871
3106
|
[
|
|
@@ -2882,19 +3117,28 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
2882
3117
|
]
|
|
2883
3118
|
],
|
|
2884
3119
|
[
|
|
2885
|
-
|
|
2886
|
-
"
|
|
3120
|
+
12,
|
|
3121
|
+
"finalT",
|
|
2887
3122
|
[
|
|
2888
|
-
|
|
3123
|
+
6,
|
|
2889
3124
|
[
|
|
2890
|
-
|
|
2891
|
-
|
|
3125
|
+
7,
|
|
3126
|
+
"d",
|
|
3127
|
+
"f32"
|
|
3128
|
+
],
|
|
3129
|
+
["MARCH_FAR"]
|
|
3130
|
+
]
|
|
3131
|
+
],
|
|
3132
|
+
[
|
|
3133
|
+
12,
|
|
3134
|
+
"hitU",
|
|
3135
|
+
[
|
|
3136
|
+
1,
|
|
3137
|
+
[
|
|
3138
|
+
1,
|
|
3139
|
+
[
|
|
2892
3140
|
7,
|
|
2893
|
-
|
|
2894
|
-
7,
|
|
2895
|
-
"p",
|
|
2896
|
-
"camPos"
|
|
2897
|
-
],
|
|
3141
|
+
"farPos",
|
|
2898
3142
|
"x"
|
|
2899
3143
|
],
|
|
2900
3144
|
"*",
|
|
@@ -2905,19 +3149,15 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
2905
3149
|
]
|
|
2906
3150
|
],
|
|
2907
3151
|
[
|
|
2908
|
-
|
|
2909
|
-
"
|
|
3152
|
+
12,
|
|
3153
|
+
"hitV",
|
|
2910
3154
|
[
|
|
2911
3155
|
1,
|
|
2912
3156
|
[
|
|
2913
3157
|
1,
|
|
2914
3158
|
[
|
|
2915
3159
|
7,
|
|
2916
|
-
|
|
2917
|
-
7,
|
|
2918
|
-
"p",
|
|
2919
|
-
"camPos"
|
|
2920
|
-
],
|
|
3160
|
+
"farPos",
|
|
2921
3161
|
"y"
|
|
2922
3162
|
],
|
|
2923
3163
|
"*",
|
|
@@ -2929,233 +3169,61 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
2929
3169
|
],
|
|
2930
3170
|
[
|
|
2931
3171
|
12,
|
|
2932
|
-
"
|
|
3172
|
+
"lit",
|
|
2933
3173
|
[
|
|
2934
|
-
|
|
3174
|
+
6,
|
|
2935
3175
|
[
|
|
2936
3176
|
7,
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
"p",
|
|
2940
|
-
"camPos"
|
|
2941
|
-
],
|
|
2942
|
-
"z"
|
|
3177
|
+
"d",
|
|
3178
|
+
"vec3f"
|
|
2943
3179
|
],
|
|
2944
|
-
"-",
|
|
2945
3180
|
[
|
|
2946
|
-
|
|
2947
|
-
"
|
|
2948
|
-
[
|
|
2949
|
-
6,
|
|
2950
|
-
[
|
|
2951
|
-
7,
|
|
2952
|
-
"d",
|
|
2953
|
-
"vec2f"
|
|
2954
|
-
],
|
|
2955
|
-
["u0", "v0"]
|
|
2956
|
-
]]
|
|
3181
|
+
[5, "1"],
|
|
3182
|
+
[5, "1"],
|
|
3183
|
+
[5, "1"]
|
|
2957
3184
|
]
|
|
2958
3185
|
]
|
|
2959
3186
|
],
|
|
2960
3187
|
[
|
|
2961
|
-
|
|
2962
|
-
[
|
|
2963
|
-
12,
|
|
2964
|
-
"s",
|
|
2965
|
-
[5, "0"]
|
|
2966
|
-
],
|
|
3188
|
+
11,
|
|
2967
3189
|
[
|
|
2968
3190
|
1,
|
|
2969
|
-
"
|
|
2970
|
-
"
|
|
2971
|
-
"
|
|
2972
|
-
],
|
|
2973
|
-
[
|
|
2974
|
-
102,
|
|
2975
|
-
"++",
|
|
2976
|
-
"s"
|
|
3191
|
+
"tExit",
|
|
3192
|
+
">",
|
|
3193
|
+
"tEnter"
|
|
2977
3194
|
],
|
|
2978
3195
|
[0, [
|
|
2979
|
-
[
|
|
2980
|
-
2,
|
|
2981
|
-
"tMarch",
|
|
2982
|
-
"=",
|
|
2983
|
-
[
|
|
2984
|
-
1,
|
|
2985
|
-
"tMarch",
|
|
2986
|
-
"+",
|
|
2987
|
-
"stepSize"
|
|
2988
|
-
]
|
|
2989
|
-
],
|
|
2990
3196
|
[
|
|
2991
3197
|
13,
|
|
2992
|
-
"
|
|
3198
|
+
"stepSize",
|
|
2993
3199
|
[
|
|
2994
|
-
|
|
3200
|
+
1,
|
|
2995
3201
|
[
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
"camPos"
|
|
3001
|
-
],
|
|
3002
|
-
"add"
|
|
3202
|
+
1,
|
|
3203
|
+
"tExit",
|
|
3204
|
+
"-",
|
|
3205
|
+
"tEnter"
|
|
3003
3206
|
],
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
[
|
|
3007
|
-
7,
|
|
3008
|
-
"rayDir",
|
|
3009
|
-
"mul"
|
|
3010
|
-
],
|
|
3011
|
-
["tMarch"]
|
|
3012
|
-
]]
|
|
3013
|
-
]
|
|
3014
|
-
],
|
|
3015
|
-
[
|
|
3016
|
-
13,
|
|
3017
|
-
"h",
|
|
3018
|
-
[
|
|
3019
|
-
6,
|
|
3020
|
-
"heightFn",
|
|
3021
|
-
[[
|
|
3207
|
+
"/",
|
|
3208
|
+
[
|
|
3022
3209
|
6,
|
|
3023
3210
|
[
|
|
3024
3211
|
7,
|
|
3025
3212
|
"d",
|
|
3026
|
-
"
|
|
3213
|
+
"f32"
|
|
3027
3214
|
],
|
|
3028
|
-
[
|
|
3029
|
-
1,
|
|
3030
|
-
[
|
|
3031
|
-
1,
|
|
3032
|
-
[
|
|
3033
|
-
7,
|
|
3034
|
-
"pos",
|
|
3035
|
-
"x"
|
|
3036
|
-
],
|
|
3037
|
-
"*",
|
|
3038
|
-
[5, "0.5"]
|
|
3039
|
-
],
|
|
3040
|
-
"+",
|
|
3041
|
-
[5, "0.5"]
|
|
3042
|
-
], [
|
|
3043
|
-
1,
|
|
3044
|
-
[
|
|
3045
|
-
1,
|
|
3046
|
-
[
|
|
3047
|
-
7,
|
|
3048
|
-
"pos",
|
|
3049
|
-
"y"
|
|
3050
|
-
],
|
|
3051
|
-
"*",
|
|
3052
|
-
[5, "0.5"]
|
|
3053
|
-
],
|
|
3054
|
-
"+",
|
|
3055
|
-
[5, "0.5"]
|
|
3056
|
-
]]
|
|
3057
|
-
]]
|
|
3058
|
-
]
|
|
3059
|
-
],
|
|
3060
|
-
[
|
|
3061
|
-
13,
|
|
3062
|
-
"diff",
|
|
3063
|
-
[
|
|
3064
|
-
1,
|
|
3065
|
-
[
|
|
3066
|
-
7,
|
|
3067
|
-
"pos",
|
|
3068
|
-
"z"
|
|
3069
|
-
],
|
|
3070
|
-
"-",
|
|
3071
|
-
"h"
|
|
3072
|
-
]
|
|
3073
|
-
],
|
|
3074
|
-
[
|
|
3075
|
-
11,
|
|
3076
|
-
[
|
|
3077
|
-
3,
|
|
3078
|
-
[
|
|
3079
|
-
1,
|
|
3080
|
-
"diff",
|
|
3081
|
-
"<",
|
|
3082
|
-
[5, "0"]
|
|
3083
|
-
],
|
|
3084
|
-
"&&",
|
|
3085
|
-
[
|
|
3086
|
-
1,
|
|
3087
|
-
"prevDiff",
|
|
3088
|
-
">",
|
|
3089
|
-
[5, "0"]
|
|
3215
|
+
["MARCH_STEPS"]
|
|
3090
3216
|
]
|
|
3091
|
-
]
|
|
3092
|
-
[0, [[
|
|
3093
|
-
2,
|
|
3094
|
-
"hit",
|
|
3095
|
-
"=",
|
|
3096
|
-
[5, "1"]
|
|
3097
|
-
], [17]]]
|
|
3217
|
+
]
|
|
3098
3218
|
],
|
|
3099
3219
|
[
|
|
3100
|
-
|
|
3101
|
-
"
|
|
3102
|
-
"
|
|
3103
|
-
"diff"
|
|
3104
|
-
]
|
|
3105
|
-
]]
|
|
3106
|
-
],
|
|
3107
|
-
[
|
|
3108
|
-
12,
|
|
3109
|
-
"tLow",
|
|
3110
|
-
[
|
|
3111
|
-
1,
|
|
3112
|
-
"tMarch",
|
|
3113
|
-
"-",
|
|
3114
|
-
"stepSize"
|
|
3115
|
-
]
|
|
3116
|
-
],
|
|
3117
|
-
[
|
|
3118
|
-
12,
|
|
3119
|
-
"tHigh",
|
|
3120
|
-
"tMarch"
|
|
3121
|
-
],
|
|
3122
|
-
[
|
|
3123
|
-
14,
|
|
3124
|
-
[
|
|
3125
|
-
12,
|
|
3126
|
-
"r",
|
|
3127
|
-
[5, "0"]
|
|
3128
|
-
],
|
|
3129
|
-
[
|
|
3130
|
-
1,
|
|
3131
|
-
"r",
|
|
3132
|
-
"<",
|
|
3133
|
-
"REFINE"
|
|
3134
|
-
],
|
|
3135
|
-
[
|
|
3136
|
-
102,
|
|
3137
|
-
"++",
|
|
3138
|
-
"r"
|
|
3139
|
-
],
|
|
3140
|
-
[0, [
|
|
3141
|
-
[
|
|
3142
|
-
13,
|
|
3143
|
-
"tMid",
|
|
3144
|
-
[
|
|
3145
|
-
1,
|
|
3146
|
-
[
|
|
3147
|
-
1,
|
|
3148
|
-
"tLow",
|
|
3149
|
-
"+",
|
|
3150
|
-
"tHigh"
|
|
3151
|
-
],
|
|
3152
|
-
"*",
|
|
3153
|
-
[5, "0.5"]
|
|
3154
|
-
]
|
|
3220
|
+
12,
|
|
3221
|
+
"tMarch",
|
|
3222
|
+
"tEnter"
|
|
3155
3223
|
],
|
|
3156
3224
|
[
|
|
3157
3225
|
13,
|
|
3158
|
-
"
|
|
3226
|
+
"pStart",
|
|
3159
3227
|
[
|
|
3160
3228
|
6,
|
|
3161
3229
|
[
|
|
@@ -3174,18 +3242,18 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
3174
3242
|
"rayDir",
|
|
3175
3243
|
"mul"
|
|
3176
3244
|
],
|
|
3177
|
-
["
|
|
3245
|
+
["tEnter"]
|
|
3178
3246
|
]]
|
|
3179
3247
|
]
|
|
3180
3248
|
],
|
|
3181
3249
|
[
|
|
3182
|
-
|
|
3183
|
-
"
|
|
3250
|
+
12,
|
|
3251
|
+
"prevDiff",
|
|
3184
3252
|
[
|
|
3185
3253
|
1,
|
|
3186
3254
|
[
|
|
3187
3255
|
7,
|
|
3188
|
-
"
|
|
3256
|
+
"pStart",
|
|
3189
3257
|
"z"
|
|
3190
3258
|
],
|
|
3191
3259
|
"-",
|
|
@@ -3205,7 +3273,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
3205
3273
|
1,
|
|
3206
3274
|
[
|
|
3207
3275
|
7,
|
|
3208
|
-
"
|
|
3276
|
+
"pStart",
|
|
3209
3277
|
"x"
|
|
3210
3278
|
],
|
|
3211
3279
|
"*",
|
|
@@ -3219,7 +3287,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
3219
3287
|
1,
|
|
3220
3288
|
[
|
|
3221
3289
|
7,
|
|
3222
|
-
"
|
|
3290
|
+
"pStart",
|
|
3223
3291
|
"y"
|
|
3224
3292
|
],
|
|
3225
3293
|
"*",
|
|
@@ -3233,805 +3301,1079 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
3233
3301
|
]
|
|
3234
3302
|
],
|
|
3235
3303
|
[
|
|
3236
|
-
|
|
3304
|
+
14,
|
|
3237
3305
|
[
|
|
3238
|
-
|
|
3239
|
-
"
|
|
3240
|
-
">",
|
|
3306
|
+
12,
|
|
3307
|
+
"s",
|
|
3241
3308
|
[5, "0"]
|
|
3242
3309
|
],
|
|
3243
|
-
[0, [[
|
|
3244
|
-
2,
|
|
3245
|
-
"tLow",
|
|
3246
|
-
"=",
|
|
3247
|
-
"tMid"
|
|
3248
|
-
]]],
|
|
3249
|
-
[0, [[
|
|
3250
|
-
2,
|
|
3251
|
-
"tHigh",
|
|
3252
|
-
"=",
|
|
3253
|
-
"tMid"
|
|
3254
|
-
]]]
|
|
3255
|
-
]
|
|
3256
|
-
]]
|
|
3257
|
-
],
|
|
3258
|
-
[
|
|
3259
|
-
13,
|
|
3260
|
-
"finalT",
|
|
3261
|
-
[
|
|
3262
|
-
1,
|
|
3263
|
-
[
|
|
3264
|
-
1,
|
|
3265
|
-
"tLow",
|
|
3266
|
-
"+",
|
|
3267
|
-
"tHigh"
|
|
3268
|
-
],
|
|
3269
|
-
"*",
|
|
3270
|
-
[5, "0.5"]
|
|
3271
|
-
]
|
|
3272
|
-
],
|
|
3273
|
-
[
|
|
3274
|
-
13,
|
|
3275
|
-
"hitPos",
|
|
3276
|
-
[
|
|
3277
|
-
6,
|
|
3278
|
-
[
|
|
3279
|
-
7,
|
|
3280
3310
|
[
|
|
3281
|
-
|
|
3282
|
-
"
|
|
3283
|
-
"
|
|
3311
|
+
1,
|
|
3312
|
+
"s",
|
|
3313
|
+
"<",
|
|
3314
|
+
"MARCH_STEPS"
|
|
3284
3315
|
],
|
|
3285
|
-
"add"
|
|
3286
|
-
],
|
|
3287
|
-
[[
|
|
3288
|
-
6,
|
|
3289
3316
|
[
|
|
3290
|
-
|
|
3291
|
-
"
|
|
3292
|
-
"
|
|
3317
|
+
102,
|
|
3318
|
+
"++",
|
|
3319
|
+
"s"
|
|
3293
3320
|
],
|
|
3294
|
-
[
|
|
3295
|
-
]]
|
|
3296
|
-
]
|
|
3297
|
-
],
|
|
3298
|
-
[
|
|
3299
|
-
13,
|
|
3300
|
-
"hitU",
|
|
3301
|
-
[
|
|
3302
|
-
1,
|
|
3303
|
-
[
|
|
3304
|
-
1,
|
|
3305
|
-
[
|
|
3306
|
-
7,
|
|
3307
|
-
"hitPos",
|
|
3308
|
-
"x"
|
|
3309
|
-
],
|
|
3310
|
-
"*",
|
|
3311
|
-
[5, "0.5"]
|
|
3312
|
-
],
|
|
3313
|
-
"+",
|
|
3314
|
-
[5, "0.5"]
|
|
3315
|
-
]
|
|
3316
|
-
],
|
|
3317
|
-
[
|
|
3318
|
-
13,
|
|
3319
|
-
"hitV",
|
|
3320
|
-
[
|
|
3321
|
-
1,
|
|
3322
|
-
[
|
|
3323
|
-
1,
|
|
3324
|
-
[
|
|
3325
|
-
7,
|
|
3326
|
-
"hitPos",
|
|
3327
|
-
"y"
|
|
3328
|
-
],
|
|
3329
|
-
"*",
|
|
3330
|
-
[5, "0.5"]
|
|
3331
|
-
],
|
|
3332
|
-
"+",
|
|
3333
|
-
[5, "0.5"]
|
|
3334
|
-
]
|
|
3335
|
-
],
|
|
3336
|
-
[
|
|
3337
|
-
13,
|
|
3338
|
-
"rawSampleUV",
|
|
3339
|
-
[
|
|
3340
|
-
6,
|
|
3341
|
-
[
|
|
3342
|
-
7,
|
|
3343
|
-
"d",
|
|
3344
|
-
"vec2f"
|
|
3345
|
-
],
|
|
3346
|
-
["hitU", [
|
|
3347
|
-
1,
|
|
3348
|
-
[5, "1"],
|
|
3349
|
-
"-",
|
|
3350
|
-
"hitV"
|
|
3351
|
-
]]
|
|
3352
|
-
]
|
|
3353
|
-
],
|
|
3354
|
-
[
|
|
3355
|
-
12,
|
|
3356
|
-
"finalUV",
|
|
3357
|
-
[
|
|
3358
|
-
6,
|
|
3359
|
-
[
|
|
3360
|
-
7,
|
|
3361
|
-
"d",
|
|
3362
|
-
"vec2f"
|
|
3363
|
-
],
|
|
3364
|
-
[[
|
|
3365
|
-
7,
|
|
3366
|
-
"rawSampleUV",
|
|
3367
|
-
"x"
|
|
3368
|
-
], [
|
|
3369
|
-
7,
|
|
3370
|
-
"rawSampleUV",
|
|
3371
|
-
"y"
|
|
3372
|
-
]]
|
|
3373
|
-
]
|
|
3374
|
-
],
|
|
3375
|
-
[
|
|
3376
|
-
12,
|
|
3377
|
-
"outOfBoundsMask",
|
|
3378
|
-
[
|
|
3379
|
-
6,
|
|
3380
|
-
[
|
|
3381
|
-
7,
|
|
3382
|
-
"d",
|
|
3383
|
-
"f32"
|
|
3384
|
-
],
|
|
3385
|
-
[[5, "1"]]
|
|
3386
|
-
]
|
|
3387
|
-
],
|
|
3388
|
-
[
|
|
3389
|
-
11,
|
|
3390
|
-
[
|
|
3391
|
-
1,
|
|
3392
|
-
"edgeMode",
|
|
3393
|
-
"===",
|
|
3394
|
-
[5, "2"]
|
|
3395
|
-
],
|
|
3396
|
-
[0, [[
|
|
3397
|
-
2,
|
|
3398
|
-
"finalUV",
|
|
3399
|
-
"=",
|
|
3400
|
-
[
|
|
3401
|
-
6,
|
|
3402
|
-
[
|
|
3403
|
-
7,
|
|
3404
|
-
"edges",
|
|
3405
|
-
"edgeMirrorUV"
|
|
3406
|
-
],
|
|
3407
|
-
["rawSampleUV"]
|
|
3408
|
-
]
|
|
3409
|
-
]]],
|
|
3410
|
-
[
|
|
3411
|
-
11,
|
|
3412
|
-
[
|
|
3413
|
-
1,
|
|
3414
|
-
"edgeMode",
|
|
3415
|
-
"===",
|
|
3416
|
-
[5, "3"]
|
|
3417
|
-
],
|
|
3418
|
-
[0, [[
|
|
3419
|
-
2,
|
|
3420
|
-
"finalUV",
|
|
3421
|
-
"=",
|
|
3422
|
-
[
|
|
3423
|
-
6,
|
|
3424
|
-
[
|
|
3425
|
-
7,
|
|
3426
|
-
"edges",
|
|
3427
|
-
"edgeWrapUV"
|
|
3428
|
-
],
|
|
3429
|
-
["rawSampleUV"]
|
|
3430
|
-
]
|
|
3431
|
-
]]],
|
|
3432
|
-
[
|
|
3433
|
-
11,
|
|
3434
|
-
[
|
|
3435
|
-
1,
|
|
3436
|
-
"edgeMode",
|
|
3437
|
-
"===",
|
|
3438
|
-
[5, "1"]
|
|
3439
|
-
],
|
|
3440
|
-
[0, [[
|
|
3441
|
-
13,
|
|
3442
|
-
"inside",
|
|
3321
|
+
[0, [
|
|
3443
3322
|
[
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
[
|
|
3448
|
-
3,
|
|
3449
|
-
[
|
|
3450
|
-
1,
|
|
3451
|
-
[
|
|
3452
|
-
7,
|
|
3453
|
-
"rawSampleUV",
|
|
3454
|
-
"x"
|
|
3455
|
-
],
|
|
3456
|
-
">=",
|
|
3457
|
-
[5, "0"]
|
|
3458
|
-
],
|
|
3459
|
-
"&&",
|
|
3460
|
-
[
|
|
3461
|
-
1,
|
|
3462
|
-
[
|
|
3463
|
-
7,
|
|
3464
|
-
"rawSampleUV",
|
|
3465
|
-
"x"
|
|
3466
|
-
],
|
|
3467
|
-
"<=",
|
|
3468
|
-
[5, "1"]
|
|
3469
|
-
]
|
|
3470
|
-
],
|
|
3471
|
-
"&&",
|
|
3472
|
-
[
|
|
3473
|
-
1,
|
|
3474
|
-
[
|
|
3475
|
-
7,
|
|
3476
|
-
"rawSampleUV",
|
|
3477
|
-
"y"
|
|
3478
|
-
],
|
|
3479
|
-
">=",
|
|
3480
|
-
[5, "0"]
|
|
3481
|
-
]
|
|
3482
|
-
],
|
|
3483
|
-
"&&",
|
|
3323
|
+
2,
|
|
3324
|
+
"tMarch",
|
|
3325
|
+
"=",
|
|
3484
3326
|
[
|
|
3485
3327
|
1,
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
"y"
|
|
3490
|
-
],
|
|
3491
|
-
"<=",
|
|
3492
|
-
[5, "1"]
|
|
3328
|
+
"tMarch",
|
|
3329
|
+
"+",
|
|
3330
|
+
"stepSize"
|
|
3493
3331
|
]
|
|
3494
|
-
]
|
|
3495
|
-
], [
|
|
3496
|
-
2,
|
|
3497
|
-
"outOfBoundsMask",
|
|
3498
|
-
"=",
|
|
3332
|
+
],
|
|
3499
3333
|
[
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
7,
|
|
3503
|
-
"std",
|
|
3504
|
-
"select"
|
|
3505
|
-
],
|
|
3334
|
+
13,
|
|
3335
|
+
"pos",
|
|
3506
3336
|
[
|
|
3337
|
+
6,
|
|
3507
3338
|
[
|
|
3508
|
-
|
|
3339
|
+
7,
|
|
3509
3340
|
[
|
|
3510
3341
|
7,
|
|
3511
|
-
"
|
|
3512
|
-
"
|
|
3342
|
+
"p",
|
|
3343
|
+
"camPos"
|
|
3513
3344
|
],
|
|
3514
|
-
|
|
3345
|
+
"add"
|
|
3515
3346
|
],
|
|
3516
|
-
[
|
|
3347
|
+
[[
|
|
3517
3348
|
6,
|
|
3518
3349
|
[
|
|
3519
3350
|
7,
|
|
3520
|
-
"
|
|
3521
|
-
"
|
|
3351
|
+
"rayDir",
|
|
3352
|
+
"mul"
|
|
3522
3353
|
],
|
|
3523
|
-
[
|
|
3524
|
-
]
|
|
3525
|
-
"inside"
|
|
3354
|
+
["tMarch"]
|
|
3355
|
+
]]
|
|
3526
3356
|
]
|
|
3527
|
-
]
|
|
3528
|
-
]]],
|
|
3529
|
-
[0, [[
|
|
3530
|
-
2,
|
|
3531
|
-
"finalUV",
|
|
3532
|
-
"=",
|
|
3357
|
+
],
|
|
3533
3358
|
[
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
7,
|
|
3537
|
-
"std",
|
|
3538
|
-
"clamp"
|
|
3539
|
-
],
|
|
3359
|
+
13,
|
|
3360
|
+
"h",
|
|
3540
3361
|
[
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
[
|
|
3545
|
-
7,
|
|
3546
|
-
"d",
|
|
3547
|
-
"vec2f"
|
|
3548
|
-
],
|
|
3549
|
-
[[5, "0"], [5, "0"]]
|
|
3550
|
-
],
|
|
3551
|
-
[
|
|
3362
|
+
6,
|
|
3363
|
+
"heightFn",
|
|
3364
|
+
[[
|
|
3552
3365
|
6,
|
|
3553
3366
|
[
|
|
3554
3367
|
7,
|
|
3555
3368
|
"d",
|
|
3556
3369
|
"vec2f"
|
|
3557
3370
|
],
|
|
3558
|
-
[[
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
13,
|
|
3594
|
-
"hC",
|
|
3595
|
-
[
|
|
3596
|
-
6,
|
|
3597
|
-
"heightFn",
|
|
3598
|
-
[[
|
|
3599
|
-
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",
|
|
3600
3406
|
[
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
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
|
+
]
|
|
3604
3434
|
],
|
|
3605
|
-
[
|
|
3606
|
-
|
|
3607
|
-
|
|
3435
|
+
[0, [[
|
|
3436
|
+
2,
|
|
3437
|
+
"hit",
|
|
3438
|
+
"=",
|
|
3439
|
+
[5, "1"]
|
|
3440
|
+
], [17]]]
|
|
3441
|
+
],
|
|
3442
|
+
[
|
|
3443
|
+
2,
|
|
3444
|
+
"prevDiff",
|
|
3445
|
+
"=",
|
|
3446
|
+
"diff"
|
|
3447
|
+
]
|
|
3448
|
+
]]
|
|
3608
3449
|
],
|
|
3609
3450
|
[
|
|
3610
|
-
|
|
3611
|
-
"hR",
|
|
3451
|
+
11,
|
|
3612
3452
|
[
|
|
3613
|
-
|
|
3614
|
-
"
|
|
3615
|
-
|
|
3616
|
-
|
|
3453
|
+
1,
|
|
3454
|
+
"hit",
|
|
3455
|
+
">",
|
|
3456
|
+
[5, "0.5"]
|
|
3457
|
+
],
|
|
3458
|
+
[0, [
|
|
3459
|
+
[
|
|
3460
|
+
12,
|
|
3461
|
+
"tLow",
|
|
3617
3462
|
[
|
|
3618
|
-
7,
|
|
3619
|
-
"d",
|
|
3620
|
-
"vec2f"
|
|
3621
|
-
],
|
|
3622
|
-
[[
|
|
3623
3463
|
1,
|
|
3624
|
-
"
|
|
3625
|
-
"
|
|
3626
|
-
"
|
|
3627
|
-
]
|
|
3628
|
-
]
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
"heightFn",
|
|
3637
|
-
[[
|
|
3638
|
-
6,
|
|
3464
|
+
"tMarch",
|
|
3465
|
+
"-",
|
|
3466
|
+
"stepSize"
|
|
3467
|
+
]
|
|
3468
|
+
],
|
|
3469
|
+
[
|
|
3470
|
+
12,
|
|
3471
|
+
"tHigh",
|
|
3472
|
+
"tMarch"
|
|
3473
|
+
],
|
|
3474
|
+
[
|
|
3475
|
+
14,
|
|
3639
3476
|
[
|
|
3640
|
-
|
|
3641
|
-
"
|
|
3642
|
-
"
|
|
3477
|
+
12,
|
|
3478
|
+
"r",
|
|
3479
|
+
[5, "0"]
|
|
3643
3480
|
],
|
|
3644
|
-
[
|
|
3481
|
+
[
|
|
3645
3482
|
1,
|
|
3646
|
-
"
|
|
3647
|
-
"
|
|
3648
|
-
"
|
|
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
|
+
]
|
|
3649
3608
|
]]
|
|
3650
|
-
]]
|
|
3651
|
-
]
|
|
3652
|
-
],
|
|
3653
|
-
[
|
|
3654
|
-
13,
|
|
3655
|
-
"dhdu",
|
|
3656
|
-
[
|
|
3657
|
-
1,
|
|
3658
|
-
[
|
|
3659
|
-
1,
|
|
3660
|
-
"hR",
|
|
3661
|
-
"-",
|
|
3662
|
-
"hC"
|
|
3663
3609
|
],
|
|
3664
|
-
"/",
|
|
3665
|
-
"normalEps"
|
|
3666
|
-
]
|
|
3667
|
-
],
|
|
3668
|
-
[
|
|
3669
|
-
13,
|
|
3670
|
-
"dhdv",
|
|
3671
|
-
[
|
|
3672
|
-
1,
|
|
3673
3610
|
[
|
|
3674
|
-
|
|
3675
|
-
"
|
|
3676
|
-
"
|
|
3677
|
-
|
|
3611
|
+
2,
|
|
3612
|
+
"finalT",
|
|
3613
|
+
"=",
|
|
3614
|
+
[
|
|
3615
|
+
1,
|
|
3616
|
+
[
|
|
3617
|
+
1,
|
|
3618
|
+
"tLow",
|
|
3619
|
+
"+",
|
|
3620
|
+
"tHigh"
|
|
3621
|
+
],
|
|
3622
|
+
"*",
|
|
3623
|
+
[5, "0.5"]
|
|
3624
|
+
]
|
|
3678
3625
|
],
|
|
3679
|
-
"/",
|
|
3680
|
-
"normalEps"
|
|
3681
|
-
]
|
|
3682
|
-
],
|
|
3683
|
-
[
|
|
3684
|
-
13,
|
|
3685
|
-
"nrm",
|
|
3686
|
-
[
|
|
3687
|
-
6,
|
|
3688
3626
|
[
|
|
3689
|
-
|
|
3690
|
-
"
|
|
3691
|
-
|
|
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
|
+
]
|
|
3692
3650
|
],
|
|
3693
|
-
[
|
|
3694
|
-
|
|
3651
|
+
[
|
|
3652
|
+
2,
|
|
3653
|
+
"hitU",
|
|
3654
|
+
"=",
|
|
3695
3655
|
[
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
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
|
+
"=",
|
|
3700
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
|
+
],
|
|
3701
3934
|
[
|
|
3702
|
-
|
|
3703
|
-
"
|
|
3704
|
-
"*",
|
|
3935
|
+
13,
|
|
3936
|
+
"specPow",
|
|
3705
3937
|
[
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3938
|
+
1,
|
|
3939
|
+
[
|
|
3940
|
+
1,
|
|
3941
|
+
[
|
|
3942
|
+
7,
|
|
3943
|
+
"p",
|
|
3944
|
+
"glossiness"
|
|
3945
|
+
],
|
|
3946
|
+
"*",
|
|
3947
|
+
[5, "128"]
|
|
3948
|
+
],
|
|
3949
|
+
"+",
|
|
3950
|
+
[5, "4"]
|
|
3709
3951
|
]
|
|
3710
3952
|
],
|
|
3711
3953
|
[
|
|
3712
|
-
|
|
3713
|
-
"
|
|
3714
|
-
"*",
|
|
3954
|
+
13,
|
|
3955
|
+
"specular",
|
|
3715
3956
|
[
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
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
|
+
]
|
|
3719
3993
|
]
|
|
3720
3994
|
],
|
|
3721
|
-
[5, "1"]
|
|
3722
|
-
]
|
|
3723
|
-
]]
|
|
3724
|
-
]
|
|
3725
|
-
],
|
|
3726
|
-
[
|
|
3727
|
-
13,
|
|
3728
|
-
"lightDir",
|
|
3729
|
-
[
|
|
3730
|
-
6,
|
|
3731
|
-
[
|
|
3732
|
-
7,
|
|
3733
|
-
"std",
|
|
3734
|
-
"normalize"
|
|
3735
|
-
],
|
|
3736
|
-
[[
|
|
3737
|
-
6,
|
|
3738
|
-
[
|
|
3739
|
-
7,
|
|
3740
|
-
"d",
|
|
3741
|
-
"vec3f"
|
|
3742
|
-
],
|
|
3743
|
-
[
|
|
3744
3995
|
[
|
|
3745
|
-
|
|
3746
|
-
"
|
|
3747
|
-
|
|
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
|
+
]
|
|
3748
4011
|
],
|
|
3749
4012
|
[
|
|
3750
|
-
|
|
3751
|
-
"
|
|
3752
|
-
|
|
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
|
+
]
|
|
3753
4033
|
],
|
|
3754
4034
|
[
|
|
3755
|
-
|
|
3756
|
-
"
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
"rayDir",
|
|
3771
|
-
"mul"
|
|
3772
|
-
],
|
|
3773
|
-
[[
|
|
3774
|
-
4,
|
|
3775
|
-
"-",
|
|
3776
|
-
[5, "1"]
|
|
3777
|
-
]]
|
|
3778
|
-
]
|
|
3779
|
-
],
|
|
3780
|
-
[
|
|
3781
|
-
13,
|
|
3782
|
-
"diffuse",
|
|
3783
|
-
[
|
|
3784
|
-
6,
|
|
3785
|
-
[
|
|
3786
|
-
7,
|
|
3787
|
-
"std",
|
|
3788
|
-
"clamp"
|
|
3789
|
-
],
|
|
3790
|
-
[
|
|
3791
|
-
[
|
|
3792
|
-
6,
|
|
3793
|
-
[
|
|
3794
|
-
7,
|
|
3795
|
-
"std",
|
|
3796
|
-
"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
|
+
]
|
|
3797
4050
|
],
|
|
3798
|
-
["nrm", "lightDir"]
|
|
3799
|
-
],
|
|
3800
|
-
[5, "0"],
|
|
3801
|
-
[5, "1"]
|
|
3802
|
-
]
|
|
3803
|
-
]
|
|
3804
|
-
],
|
|
3805
|
-
[
|
|
3806
|
-
13,
|
|
3807
|
-
"halfVec",
|
|
3808
|
-
[
|
|
3809
|
-
6,
|
|
3810
|
-
[
|
|
3811
|
-
7,
|
|
3812
|
-
"std",
|
|
3813
|
-
"normalize"
|
|
3814
|
-
],
|
|
3815
|
-
[[
|
|
3816
|
-
6,
|
|
3817
|
-
[
|
|
3818
|
-
7,
|
|
3819
|
-
"lightDir",
|
|
3820
|
-
"add"
|
|
3821
|
-
],
|
|
3822
|
-
["viewDir"]
|
|
3823
|
-
]]
|
|
3824
|
-
]
|
|
3825
|
-
],
|
|
3826
|
-
[
|
|
3827
|
-
13,
|
|
3828
|
-
"specPow",
|
|
3829
|
-
[
|
|
3830
|
-
1,
|
|
3831
|
-
[
|
|
3832
|
-
1,
|
|
3833
|
-
[
|
|
3834
|
-
7,
|
|
3835
|
-
"p",
|
|
3836
|
-
"glossiness"
|
|
3837
|
-
],
|
|
3838
|
-
"*",
|
|
3839
|
-
[5, "128"]
|
|
3840
|
-
],
|
|
3841
|
-
"+",
|
|
3842
|
-
[5, "4"]
|
|
3843
|
-
]
|
|
3844
|
-
],
|
|
3845
|
-
[
|
|
3846
|
-
13,
|
|
3847
|
-
"specular",
|
|
3848
|
-
[
|
|
3849
|
-
1,
|
|
3850
|
-
[
|
|
3851
|
-
6,
|
|
3852
|
-
[
|
|
3853
|
-
7,
|
|
3854
|
-
"std",
|
|
3855
|
-
"pow"
|
|
3856
|
-
],
|
|
3857
|
-
[[
|
|
3858
|
-
6,
|
|
3859
4051
|
[
|
|
3860
|
-
|
|
3861
|
-
"
|
|
3862
|
-
|
|
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
|
+
]
|
|
3863
4071
|
],
|
|
3864
4072
|
[
|
|
4073
|
+
2,
|
|
4074
|
+
"lit",
|
|
4075
|
+
"=",
|
|
3865
4076
|
[
|
|
3866
4077
|
6,
|
|
3867
4078
|
[
|
|
3868
4079
|
7,
|
|
3869
4080
|
"std",
|
|
3870
|
-
"
|
|
4081
|
+
"clamp"
|
|
3871
4082
|
],
|
|
3872
|
-
[
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
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
|
+
]
|
|
3876
4141
|
]
|
|
3877
|
-
]
|
|
3878
|
-
],
|
|
3879
|
-
"*",
|
|
3880
|
-
[
|
|
3881
|
-
7,
|
|
3882
|
-
"p",
|
|
3883
|
-
"highlights"
|
|
4142
|
+
]]
|
|
3884
4143
|
]
|
|
3885
|
-
]
|
|
3886
|
-
]
|
|
4144
|
+
]]
|
|
4145
|
+
]
|
|
4146
|
+
]]
|
|
4147
|
+
],
|
|
4148
|
+
[
|
|
4149
|
+
13,
|
|
4150
|
+
"rawSampleUV",
|
|
4151
|
+
[
|
|
4152
|
+
6,
|
|
3887
4153
|
[
|
|
3888
|
-
|
|
3889
|
-
"
|
|
3890
|
-
|
|
3891
|
-
6,
|
|
3892
|
-
[
|
|
3893
|
-
7,
|
|
3894
|
-
"d",
|
|
3895
|
-
"vec3f"
|
|
3896
|
-
],
|
|
3897
|
-
[
|
|
3898
|
-
[5, "0.4"],
|
|
3899
|
-
[5, "0.4"],
|
|
3900
|
-
[5, "0.4"]
|
|
3901
|
-
]
|
|
3902
|
-
]
|
|
4154
|
+
7,
|
|
4155
|
+
"d",
|
|
4156
|
+
"vec2f"
|
|
3903
4157
|
],
|
|
4158
|
+
["hitU", [
|
|
4159
|
+
1,
|
|
4160
|
+
[5, "1"],
|
|
4161
|
+
"-",
|
|
4162
|
+
"hitV"
|
|
4163
|
+
]]
|
|
4164
|
+
]
|
|
4165
|
+
],
|
|
4166
|
+
[
|
|
4167
|
+
12,
|
|
4168
|
+
"finalUV",
|
|
4169
|
+
[
|
|
4170
|
+
6,
|
|
3904
4171
|
[
|
|
3905
|
-
|
|
3906
|
-
"
|
|
3907
|
-
|
|
3908
|
-
6,
|
|
3909
|
-
[
|
|
3910
|
-
7,
|
|
3911
|
-
[
|
|
3912
|
-
7,
|
|
3913
|
-
"p",
|
|
3914
|
-
"lightColor"
|
|
3915
|
-
],
|
|
3916
|
-
"mul"
|
|
3917
|
-
],
|
|
3918
|
-
[[
|
|
3919
|
-
1,
|
|
3920
|
-
"diffuse",
|
|
3921
|
-
"*",
|
|
3922
|
-
[5, "0.6"]
|
|
3923
|
-
]]
|
|
3924
|
-
]
|
|
4172
|
+
7,
|
|
4173
|
+
"d",
|
|
4174
|
+
"vec2f"
|
|
3925
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,
|
|
3926
4192
|
[
|
|
3927
|
-
|
|
3928
|
-
"
|
|
3929
|
-
|
|
3930
|
-
6,
|
|
3931
|
-
[
|
|
3932
|
-
7,
|
|
3933
|
-
[
|
|
3934
|
-
7,
|
|
3935
|
-
"p",
|
|
3936
|
-
"lightColor"
|
|
3937
|
-
],
|
|
3938
|
-
"mul"
|
|
3939
|
-
],
|
|
3940
|
-
["specular"]
|
|
3941
|
-
]
|
|
4193
|
+
7,
|
|
4194
|
+
"d",
|
|
4195
|
+
"f32"
|
|
3942
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
|
+
"=",
|
|
3943
4212
|
[
|
|
3944
|
-
|
|
3945
|
-
"totalLight",
|
|
4213
|
+
6,
|
|
3946
4214
|
[
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
],
|
|
3957
|
-
["tintedDiffuse"]
|
|
3958
|
-
],
|
|
3959
|
-
"add"
|
|
3960
|
-
],
|
|
3961
|
-
["tintedSpec"]
|
|
3962
|
-
]
|
|
3963
|
-
],
|
|
4215
|
+
7,
|
|
4216
|
+
"edges",
|
|
4217
|
+
"edgeMirrorUV"
|
|
4218
|
+
],
|
|
4219
|
+
["rawSampleUV"]
|
|
4220
|
+
]
|
|
4221
|
+
]]],
|
|
4222
|
+
[
|
|
4223
|
+
11,
|
|
3964
4224
|
[
|
|
4225
|
+
1,
|
|
4226
|
+
"edgeMode",
|
|
4227
|
+
"===",
|
|
4228
|
+
[5, "3"]
|
|
4229
|
+
],
|
|
4230
|
+
[0, [[
|
|
3965
4231
|
2,
|
|
3966
|
-
"
|
|
4232
|
+
"finalUV",
|
|
3967
4233
|
"=",
|
|
3968
4234
|
[
|
|
3969
4235
|
6,
|
|
3970
4236
|
[
|
|
3971
4237
|
7,
|
|
3972
|
-
"
|
|
3973
|
-
"
|
|
4238
|
+
"edges",
|
|
4239
|
+
"edgeWrapUV"
|
|
3974
4240
|
],
|
|
4241
|
+
["rawSampleUV"]
|
|
4242
|
+
]
|
|
4243
|
+
]]],
|
|
4244
|
+
[
|
|
4245
|
+
11,
|
|
4246
|
+
[
|
|
4247
|
+
1,
|
|
4248
|
+
"edgeMode",
|
|
4249
|
+
"===",
|
|
4250
|
+
[5, "1"]
|
|
4251
|
+
],
|
|
4252
|
+
[0, [[
|
|
4253
|
+
13,
|
|
4254
|
+
"inside",
|
|
3975
4255
|
[
|
|
4256
|
+
3,
|
|
3976
4257
|
[
|
|
3977
|
-
|
|
3978
|
-
[
|
|
3979
|
-
7,
|
|
3980
|
-
"std",
|
|
3981
|
-
"mix"
|
|
3982
|
-
],
|
|
4258
|
+
3,
|
|
3983
4259
|
[
|
|
4260
|
+
3,
|
|
3984
4261
|
[
|
|
3985
|
-
|
|
4262
|
+
1,
|
|
3986
4263
|
[
|
|
3987
4264
|
7,
|
|
3988
|
-
"
|
|
3989
|
-
"
|
|
4265
|
+
"rawSampleUV",
|
|
4266
|
+
"x"
|
|
3990
4267
|
],
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
[5, "1"],
|
|
3994
|
-
[5, "1"]
|
|
3995
|
-
]
|
|
4268
|
+
">=",
|
|
4269
|
+
[5, "0"]
|
|
3996
4270
|
],
|
|
3997
|
-
"
|
|
4271
|
+
"&&",
|
|
3998
4272
|
[
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4273
|
+
1,
|
|
4274
|
+
[
|
|
4275
|
+
7,
|
|
4276
|
+
"rawSampleUV",
|
|
4277
|
+
"x"
|
|
4278
|
+
],
|
|
4279
|
+
"<=",
|
|
4280
|
+
[5, "1"]
|
|
4002
4281
|
]
|
|
4282
|
+
],
|
|
4283
|
+
"&&",
|
|
4284
|
+
[
|
|
4285
|
+
1,
|
|
4286
|
+
[
|
|
4287
|
+
7,
|
|
4288
|
+
"rawSampleUV",
|
|
4289
|
+
"y"
|
|
4290
|
+
],
|
|
4291
|
+
">=",
|
|
4292
|
+
[5, "0"]
|
|
4003
4293
|
]
|
|
4004
4294
|
],
|
|
4295
|
+
"&&",
|
|
4005
4296
|
[
|
|
4006
|
-
|
|
4297
|
+
1,
|
|
4007
4298
|
[
|
|
4008
4299
|
7,
|
|
4009
|
-
"
|
|
4010
|
-
"
|
|
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"]]
|
|
4011
4327
|
],
|
|
4012
4328
|
[
|
|
4013
|
-
|
|
4014
|
-
[
|
|
4015
|
-
|
|
4016
|
-
|
|
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"
|
|
4017
4351
|
],
|
|
4018
4352
|
[
|
|
4019
|
-
|
|
4353
|
+
"rawSampleUV",
|
|
4020
4354
|
[
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4355
|
+
6,
|
|
4356
|
+
[
|
|
4357
|
+
7,
|
|
4358
|
+
"d",
|
|
4359
|
+
"vec2f"
|
|
4360
|
+
],
|
|
4361
|
+
[[5, "0"], [5, "0"]]
|
|
4024
4362
|
],
|
|
4025
4363
|
[
|
|
4026
|
-
|
|
4027
|
-
[
|
|
4028
|
-
|
|
4364
|
+
6,
|
|
4365
|
+
[
|
|
4366
|
+
7,
|
|
4367
|
+
"d",
|
|
4368
|
+
"vec2f"
|
|
4369
|
+
],
|
|
4370
|
+
[[5, "1"], [5, "1"]]
|
|
4029
4371
|
]
|
|
4030
4372
|
]
|
|
4031
4373
|
]
|
|
4032
|
-
]
|
|
4374
|
+
]]]
|
|
4033
4375
|
]
|
|
4034
|
-
]
|
|
4376
|
+
]
|
|
4035
4377
|
],
|
|
4036
4378
|
[
|
|
4037
4379
|
13,
|
|
@@ -4043,7 +4385,7 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
4043
4385
|
"d",
|
|
4044
4386
|
"f32"
|
|
4045
4387
|
],
|
|
4046
|
-
[
|
|
4388
|
+
["MARCH_FAR"]
|
|
4047
4389
|
]
|
|
4048
4390
|
],
|
|
4049
4391
|
[
|
|
@@ -4244,36 +4586,41 @@ function makeComputeKernel(waveType, octaveCount, edgeMode, lightingEnabled, cur
|
|
|
4244
4586
|
"externalNames": [
|
|
4245
4587
|
"computeLayout",
|
|
4246
4588
|
"d",
|
|
4247
|
-
"
|
|
4248
|
-
"
|
|
4589
|
+
"computeW",
|
|
4590
|
+
"computeH",
|
|
4249
4591
|
"std",
|
|
4592
|
+
"MARCH_FAR",
|
|
4593
|
+
"MARCH_STEPS",
|
|
4250
4594
|
"heightFn",
|
|
4595
|
+
"MARCH_REFINE",
|
|
4596
|
+
"lightingEnabled",
|
|
4251
4597
|
"edgeMode",
|
|
4252
|
-
"edges"
|
|
4253
|
-
"lightingEnabled"
|
|
4598
|
+
"edges"
|
|
4254
4599
|
]
|
|
4255
4600
|
},
|
|
4256
4601
|
externals: () => ({
|
|
4257
4602
|
computeLayout,
|
|
4258
|
-
d,
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
std,
|
|
4603
|
+
d: data_exports,
|
|
4604
|
+
computeW,
|
|
4605
|
+
computeH,
|
|
4606
|
+
std: std_exports,
|
|
4607
|
+
MARCH_FAR,
|
|
4608
|
+
MARCH_STEPS,
|
|
4262
4609
|
heightFn,
|
|
4610
|
+
MARCH_REFINE,
|
|
4611
|
+
lightingEnabled,
|
|
4263
4612
|
edgeMode,
|
|
4264
|
-
edges: edges_exports
|
|
4265
|
-
lightingEnabled
|
|
4613
|
+
edges: edges_exports
|
|
4266
4614
|
})
|
|
4267
4615
|
}) && $.f)({})).$name("surface3dRaymarch");
|
|
4268
4616
|
}
|
|
4269
|
-
const surface3dCompose =
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
],
|
|
4617
|
+
const surface3dCompose = src_default.fn([
|
|
4618
|
+
vec4f,
|
|
4619
|
+
vec3f,
|
|
4620
|
+
f32
|
|
4621
|
+
], vec4f)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((childColor, lit, mask) => {
|
|
4274
4622
|
"use gpu";
|
|
4275
|
-
|
|
4276
|
-
return d.vec4f(finalRgb, __tsover_mul(childColor.w, mask));
|
|
4623
|
+
return vec4f(clamp(childColor.xyz.mul(lit), vec3f(0, 0, 0), vec3f(1, 1, 1)), __tsover_mul(childColor.w, mask));
|
|
4277
4624
|
}), {
|
|
4278
4625
|
v: 1,
|
|
4279
4626
|
name: void 0,
|
|
@@ -4365,8 +4712,8 @@ const surface3dCompose = tgpu.fn([
|
|
|
4365
4712
|
"externalNames": ["std", "d"]
|
|
4366
4713
|
},
|
|
4367
4714
|
externals: () => ({
|
|
4368
|
-
std,
|
|
4369
|
-
d
|
|
4715
|
+
std: std_exports,
|
|
4716
|
+
d: data_exports
|
|
4370
4717
|
})
|
|
4371
4718
|
}) && $.f)({}));
|
|
4372
4719
|
const componentDefinition = {
|
|
@@ -4429,7 +4776,7 @@ const componentDefinition = {
|
|
|
4429
4776
|
},
|
|
4430
4777
|
octaves: {
|
|
4431
4778
|
default: 2,
|
|
4432
|
-
|
|
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: [
|
|
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: [
|
|
5059
|
+
size: [computeW, computeH],
|
|
4704
5060
|
format: STATE_FORMAT
|
|
4705
5061
|
}).$usage("storage", "sampled"), "litTex");
|
|
4706
5062
|
onCleanup(() => {
|
|
@@ -4709,9 +5065,9 @@ const componentDefinition = {
|
|
|
4709
5065
|
});
|
|
4710
5066
|
const uvMaskMap = registerComputeTexture(uvMaskTex);
|
|
4711
5067
|
const litMap = registerComputeTexture(litTex);
|
|
4712
|
-
const bufferA = createStateBuffer(root,
|
|
4713
|
-
const bufferB = createStateBuffer(root,
|
|
4714
|
-
const readBuf = createStateBuffer(root,
|
|
5068
|
+
const bufferA = createStateBuffer(root, f32, WAVE_CELLS);
|
|
5069
|
+
const bufferB = createStateBuffer(root, f32, WAVE_CELLS);
|
|
5070
|
+
const readBuf = createStateBuffer(root, f32, WAVE_CELLS);
|
|
4715
5071
|
const paramsU = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(root.createUniform(S3Params), "paramsU");
|
|
4716
5072
|
let curW = Math.max(1, Math.round(dimensions.width));
|
|
4717
5073
|
let curH = Math.max(1, Math.round(dimensions.height));
|
|
@@ -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: [
|
|
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
|
-
|
|
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,36 +5205,85 @@ 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
|
|
4853
|
-
freq
|
|
4854
|
-
seed
|
|
4855
|
-
edgePin
|
|
4856
|
-
cursorIntensity
|
|
5226
|
+
amp,
|
|
5227
|
+
freq,
|
|
5228
|
+
seed,
|
|
5229
|
+
edgePin,
|
|
5230
|
+
cursorIntensity,
|
|
4857
5231
|
t: animT,
|
|
4858
5232
|
aspect,
|
|
4859
5233
|
focal,
|
|
4860
|
-
camPos:
|
|
4861
|
-
camForward:
|
|
4862
|
-
camRight:
|
|
4863
|
-
camUp:
|
|
4864
|
-
lighting
|
|
4865
|
-
glossiness
|
|
4866
|
-
highlights
|
|
4867
|
-
lightX
|
|
4868
|
-
lightY
|
|
4869
|
-
lightZ
|
|
4870
|
-
lightColor:
|
|
4871
|
-
nearCutoff
|
|
4872
|
-
farCutoff
|
|
4873
|
-
cursorWaveX
|
|
4874
|
-
cursorWaveY
|
|
5234
|
+
camPos: vec3f(camPos[0], camPos[1], camPos[2]),
|
|
5235
|
+
camForward: vec3f(fwd[0], fwd[1], fwd[2]),
|
|
5236
|
+
camRight: vec3f(camRight[0], camRight[1], camRight[2]),
|
|
5237
|
+
camUp: vec3f(camUp[0], camUp[1], camUp[2]),
|
|
5238
|
+
lighting,
|
|
5239
|
+
glossiness,
|
|
5240
|
+
highlights,
|
|
5241
|
+
lightX,
|
|
5242
|
+
lightY,
|
|
5243
|
+
lightZ,
|
|
5244
|
+
lightColor: vec3f(lc?.x ?? 1, lc?.y ?? 1, lc?.z ?? 1),
|
|
5245
|
+
nearCutoff,
|
|
5246
|
+
farCutoff,
|
|
5247
|
+
cursorWaveX,
|
|
5248
|
+
cursorWaveY,
|
|
4875
5249
|
mouseSpeed,
|
|
4876
5250
|
dt: .016,
|
|
4877
|
-
decay:
|
|
5251
|
+
decay: WAVE_DECAY,
|
|
4878
5252
|
radius: .025,
|
|
4879
|
-
waveSpeed
|
|
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
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
if (
|
|
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];
|