mirror of
https://github.com/samvallad33/vestige.git
synced 2026-07-26 23:51:02 +02:00
Turn all 17 sparse organs from text-on-black voids into full-bleed, moving, bioluminescent WebGPU fields. Each cell maps to a real backend fact; verified live on the real brain with a decoded fill% + motion + zero-error probe. Foundation: one reusable LivingFieldPass (src/lib/observatory/field/) does splat -> separable-blur (render passes) -> membrane base coat -> HDR cells with orbital drift and a CPU pick-mirror. Each organ writes a ~20-line data->cells mapper (cell-layout.ts: layoutGalaxy / layoutRings / FIELD_HUE). Organs brought alive (fill% before -> after, all zero WebGPU errors): stats 0.8->80.9, observatory 10.8->81.4, graph 12.3->82.4, memories ->78.4, blackbox 18.2->83.3, contradictions 1.6->69.6, dreams 0.3->64.5, settings 2.7->76.4, reasoning 2.7->39.2, patterns 7.1->45.6, activation 10->64.9, feed ->89, explore ->83.3, intentions ->66.6, importance ->73.7, memory-prs ->74.4, schedule ->37.1. Backend surfaces: add api.memoryChangelog() + ChangelogResponse; surface suppress/unsuppress on the memories field (shift/alt-click -> scar). Tests: palace-launch-gate now asserts fillPct>30 + isAnimating (not just non-black), with a longer settle for reasoning's deep_reference and a raised timeout for the curated tour. all-routes-smoke treats settings as the WebGPU field it now is. Gates green: check 0/0, build ok, palace-launch-gate 22/22 + tour, all-routes-smoke 20/20. Protected work untouched: MemoryCinema, graph/cinema, observatory scene shaders, node-renderer, palace-map. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2 lines
4.7 KiB
JavaScript
2 lines
4.7 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CkiUhdKe.js","./Bo4EDkTQ.js","./CGq8RnJq.js","./W8qDZJD6.js","./Bzak7iHL.js","./DAau0uzT.js","./Ccqjq5DS.js","./DqfV0sZu.js","./uCQU803Y.js","./DGM4cicq.js","./DV6OI5iy.js","./D35IQVqe.js","./Ch9vNiEl.js","./DY7cP31Q.js","./HFGAk8XQ.js","./BMB5u1EX.js","../assets/cognitive-palette.BALpZUFZ.css","./BKh9s_e0.js","./CcUbQ_Wl.js","../assets/ObservatoryStage.CKoSQgn0.css","./Cqk6fVmx.js","./yYBa834L.js","./C2CaJvaA.js"])))=>i.map(i=>d[i]);
|
|
var x=Object.defineProperty;var C=(m,t,e)=>t in m?x(m,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[t]=e;var i=(m,t,e)=>C(m,typeof t!="symbol"?t+"":t,e);import{_ as d}from"./Dp1pzeXC.js";import{V as p,M as w,a as T}from"./Bo4EDkTQ.js";const f=new p(0,0,0),R=30,l=44;function S(){return typeof navigator<"u"&&"gpu"in navigator}class V{constructor(t){i(this,"container");i(this,"deps");i(this,"renderer");i(this,"scene");i(this,"camera");i(this,"storm");i(this,"post",null);i(this,"booted",!1);i(this,"target",new p(0,0,0));i(this,"flythrough",0);i(this,"prevCamPos",new p);i(this,"camVel",new p);this.container=t}get cameraRef(){return this.camera}async boot(){if(this.booted)return;if(!S())throw new Error("WebGPU not supported");const t=await d(()=>import("./CkiUhdKe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),e=await d(()=>import("./Cqk6fVmx.js"),__vite__mapDeps([20,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),s=await d(()=>import("./yYBa834L.js"),__vite__mapDeps([21,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url),{SemanticComputeStorm:a}=await d(async()=>{const{SemanticComputeStorm:n}=await import("./C2CaJvaA.js");return{SemanticComputeStorm:n}},__vite__mapDeps([22,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url);if(this.deps={WebGPURenderer:t.WebGPURenderer,PostProcessing:t.PostProcessing,StormCtor:a,tsl:e,bloomMod:s},!t.WebGPURenderer||!t.Scene||!t.PerspectiveCamera||!t.Color)throw new Error("[cinema] three/webgpu is missing expected exports");const h=Math.max(1,this.container.clientWidth),c=Math.max(1,this.container.clientHeight);this.scene=new t.Scene,this.scene.background=new t.Color(131594),this.camera=new t.PerspectiveCamera(60,h/c,.1,2e3),this.camera.position.set(0,18,60);const o=new this.deps.WebGPURenderer({antialias:!0,alpha:!1});o.setPixelRatio(Math.min(window.devicePixelRatio,2)),o.setSize(h,c),await o.init(),this.container.appendChild(o.domElement),this.renderer=o,this.storm=new this.deps.StormCtor(o,this.scene,{});try{const{pass:n,mrt:b,output:g,emissive:_}=this.deps.tsl,r=n(this.scene,this.camera);if(typeof(r==null?void 0:r.setMRT)!="function"||typeof(r==null?void 0:r.getTextureNode)!="function")throw new Error("three/tsl pass() API mismatch — setMRT/getTextureNode missing");r.setMRT(b({output:g,emissive:_}));const M=r.getTextureNode("output"),P=r.getTextureNode("emissive"),v=this.deps.bloomMod.bloom(P,.6,.65,.35),u=new this.deps.PostProcessing(o);u.outputNode=M.add(v),this.post=u}catch(n){console.warn("[cinema] selective bloom unavailable, rendering without MRT:",n),this.post=null}this.booted=!0}transitionTo(t,e,s="II",a=99){this.booted&&this.storm.transitionTo(t,f,s,a)}dreamBeat(){this.booted&&this.storm.dreamBeat()}setFlythrough(t){this.flythrough=w.clamp(t,0,1),this.booted&&this.storm.setStreak(t)}setStreak(t){this.booted&&this.storm.setStreak(t)}setCameraVel(t){this.booted&&this.storm.setCameraVel(t)}async render(t){if(!this.booted)return;this.camVel.copy(this.camera.position).sub(this.prevCamPos).divideScalar(Math.max(t,.001)),this.prevCamPos.copy(this.camera.position);const e=w.lerp(R,6,this.flythrough),s=this.camera.position.length();if(s<e||s>l||!Number.isFinite(s)){const n=Math.min(l,Math.max(e,s||l));s>.001?this.camera.position.setLength(n):this.camera.position.set(0,12,n)}this.camera.lookAt(f);const a=this.camVel.clone().applyMatrix3(new T().setFromMatrix4(this.camera.matrixWorldInverse)).negate();this.storm.setCameraVel(a);const h=this.camera.position.length(),c=this.camera.fov*Math.PI/180,o=Math.tan(c/2)*h*.82;this.storm.setContainRadius(o),await this.storm.update(t),this.post?await this.post.renderAsync():await this.renderer.renderAsync(this.scene,this.camera)}resize(){if(!this.booted)return;const t=Math.max(1,this.container.clientWidth),e=Math.max(1,this.container.clientHeight);this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e)}dispose(){var t,e,s,a,h;this.booted&&((t=this.storm)==null||t.dispose(),(s=(e=this.renderer)==null?void 0:e.dispose)==null||s.call(e),(h=(a=this.renderer)==null?void 0:a.domElement)!=null&&h.parentNode&&this.renderer.domElement.parentNode.removeChild(this.renderer.domElement),this.booted=!1)}}export{V as CinemaSandbox,S as isWebGPUSupported};
|