add water shader and deformation, update force field shader

This commit is contained in:
Brian Beck 2025-12-05 15:44:35 -08:00
parent 4fc405ac4b
commit 996c289032
25 changed files with 753 additions and 324 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42585,t=>{"use strict";t.s(["WaterBlock",()=>u,"WaterMaterial",()=>o]);var e=t.i(43476),a=t.i(71645),r=t.i(47071),i=t.i(90072),s=t.i(12979),l=t.i(62395),n=t.i(75567);function o(t){let{surfaceTexture:a,attach:l}=t,o=(0,s.textureToUrl)(a),u=(0,r.useTexture)(o,t=>(0,n.setupColor)(t));return(0,e.jsx)("meshStandardMaterial",{attach:l,map:u,transparent:!0,opacity:.8,side:i.DoubleSide})}let u=(0,a.memo)(function(t){var r;let{object:s}=t,n=(0,a.useMemo)(()=>(0,l.getPosition)(s),[s]),u=(0,a.useMemo)(()=>(0,l.getRotation)(s),[s]),[c,d,m]=(0,a.useMemo)(()=>(0,l.getScale)(s),[s]),p=null!=(r=(0,l.getProperty)(s,"surfaceTexture"))?r:"liquidTiles/BlueWater",h=(0,a.useMemo)(()=>{let t=new i.BoxGeometry(c,d,m);t.translate(c/2,d/2,m/2);let e=t.getAttribute("uv"),a=e.array,r=[[c/32,d/32],[c/32,d/32],[m/32,c/32],[m/32,c/32],[m/32,d/32],[m/32,d/32]];for(let t=0;t<6;t++){let[e,i]=r[t],s=4*t*2;for(let t=0;t<4;t++)a[s+2*t]*=e,a[s+2*t+1]*=i}return e.needsUpdate=!0,t},[c,d,m]);return(0,a.useEffect)(()=>()=>{h.dispose()},[h]),(0,e.jsxs)("mesh",{position:n,quaternion:u,geometry:h,children:[(0,e.jsx)("meshStandardMaterial",{attach:"material-0",transparent:!0,opacity:0}),(0,e.jsx)("meshStandardMaterial",{attach:"material-1",transparent:!0,opacity:0}),(0,e.jsx)(a.Suspense,{fallback:(0,e.jsx)("meshStandardMaterial",{attach:"material-2",color:"blue",transparent:!0,opacity:.3,side:i.DoubleSide}),children:(0,e.jsx)(o,{attach:"material-2",surfaceTexture:p})}),(0,e.jsx)("meshStandardMaterial",{attach:"material-3",transparent:!0,opacity:0}),(0,e.jsx)("meshStandardMaterial",{attach:"material-4",transparent:!0,opacity:0}),(0,e.jsx)("meshStandardMaterial",{attach:"material-5",transparent:!0,opacity:0})]})})}]);

File diff suppressed because one or more lines are too long