1import{J as Ze,k as Je,K as $e,l as Qe,n as He,C as $,o as et,P as tt,ao as at,Y as ot,D as nt,M as Ae,ap as rt,p as it,S as lt,aq as st,V as z,a as ct,$ as ut,u as ft,F as _t,x as pt,ar as dt,as as vt,at as mt}from"./sS18b-GV.js";import{R as gt,O as ht}from"./CSfhW5sp.js";import{R as yt,E as wt,S as Ct,O as Mt}from"./59GsLwVW.js";import{_ as bt}from"./DlAUqK2U.js";import{o as xt,c as Dt,y as At,z as Tt,g as It}from"./W0D3MKqO.js";const St={__name:"StudioChromaKnotScene",setup(kt){const fe=It(null);let S,R,E,J,ae,F;const Y=new Ze;return xt(()=>{const k=fe.value;if(!k)return;Y.connect(document),Y.reset(),S=new Je({antialias:!0}),S.setPixelRatio(window.devicePixelRatio),S.setSize(k.clientWidth,k.clientHeight),S.shadowMap.enabled=!0,S.shadowMap.type=$e,S.toneMapping=Qe,S.toneMappingExposure=1,k.appendChild(S.domElement);const j=(()=>{const a=(u,m,h)=>u<m?m:u>h?h:u;let o=.5,l=.5,n=.5,r=.5,i=0,c=0,v=0,_=!1,d=0,C=.5,D=.5,f=-10;const p=new Array(16).fill(.5),A=.18,y=2.5;return{trail:p,get x(){return n},get y(){return r},get vx(){return i},get vy(){return c},get strength(){return v},get clickX(){return C},get clickY(){return D},get lastClickTime(){return f},setTarget(u,m){o=u,l=m,_=!0},setAbsent(){_=!1},setClick(u,m,h){C=u,D=m,f=h},update(u){const m=Math.min(Math.max(u,0),.1),h=1-Math.pow(1-A,m*60),V=n+(o-n)*h,L=r+(l-r)*h;m>0&&(i+=(a((V-n)/m,-1,1)-i)*h,c+=(a((L-r)/m,-1,1)-c)*h),n=V,r=L,v+=((_?1:0)-v)*Math.min(1,y*m),d+=m,d>=.04&&(d=0,p.pop(),p.pop(),p.unshift(n,r))},attach(u){const m=L=>{const M=u.getBoundingClientRect();!M.width||!M.height||j.setTarget((L.clientX-M.left)/M.width,1-(L.clientY-M.top)/M.height)},h=()=>j.setAbsent(),V=L=>{const M=u.getBoundingClientRect();!M.width||!M.height||j.setClick((L.clientX-M.left)/M.width,1-(L.clientY-M.top)/M.height,performance.now()/1e3)};return u.addEventListener("pointermove",m,{passive:!0}),u.addEventListener("pointerleave",h,{passive:!0}),u.addEventListener("pointerdown",V,{passive:!0}),()=>{u.removeEventListener("pointermove",m),u.removeEventListener("pointerleave",h),u.removeEventListener("pointerdown",V)}}}})(),oe=(()=>{const o=new pt,l=new z,n=new Map;let r=null,i=null,c=-10;const v=_=>{let d=n.get(_.uuid);return d||(d={uv:new z(.5,.5),strength:0,seen:!1,clock:0,trail:Array.from({length:8},()=>new z(.5,.5)),clickUv:new z(.5,.5),clickTime:-10},n.set(_.uuid,d)),d};return{resolve(_,d,C){if(r=null,i=null,!_||C.strength<=.001)return;l.set(C.x*2-1,C.y*2-1),o.setFromCamera(l,_);const D=o.intersectObjects(d,!0)[0];D&&D.uv&&D.object&&D.object.isMesh&&(r=D.object,i=D.uv)},apply(_,d,C){if(!_)return;const D=Array.isArray(_.material)?_.material:[_.material],f=v(_),p=_===r?i:null,A=Math.min(Math.max(d,0),.1);if(p&&(f.uv.copy(p),f.seen=!0),f.strength+=((p?C.strength:0)-f.strength)*Math.min(1,2.5*A),f.clock+=A,f.clock>=.04&&(f.clock=0,p)){for(let y=7;y>0;y--)f.trail[y].copy(f.trail[y-1]);f.trail[0].copy(p)}p&&C.lastClickTime!==c&&(f.clickUv.copy(f.uv),f.clickTime=C.lastClickTime);for(const y of D){const u=y&&y.uniforms;if(u){if(u.u_mouse&&f.seen&&u.u_mouse.value.copy(f.uv),u.u_mouseVelocity&&u.u_mouseVelocity.value.set(C.vx*f.strength,C.vy*f.strength),u.u_mouseStrength&&(u.u_mouseStrength.value=f.strength),u.u_mouseTrail){const m=u.u_mouseTrail.value;for(let h=0;h<m.length;h++)m[h].copy(f.trail[h])}u.u_clickPosition&&u.u_clickPosition.value.copy(f.clickUv),u.u_lastClickTime&&(u.u_lastClickTime.value=f.clickTime)}}},endFrame(_){c=_.lastClickTime}}})();j.attach(S.domElement),R=new He,R.background=new $("#060608");{const e=new et(S),t=new gt;R.environment=e.fromScene(t,.04).texture,"environmentIntensity"in R&&(R.environmentIntensity=.3),t.traverse(a=>{a.geometry&&a.geometry.dispose();const o=a.material;Array.isArray(o)?o.forEach(l=>l.dispose()):o&&o.dispose()}),e.dispose()}E=new tt(60,k.clientWidth/k.clientHeight,.1,1e3),E.position.set(.10344878137111657,7.010433995904668,.005705992608116929),J=new ht(E,S.domElement),J.target.set(.10344878137111657,1.2999728277430829,-4468558983616866e-21),J.enableDamping=!0,J.update();function ne(e,t){var a=t&&t.isColor?t:new $;if(typeof e!="string"||e.charAt(0)!=="#")return a;var o=e.slice(1);o.length===3&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]);var l=parseInt(o.slice(0,6),16);return isFinite(l)&&(a.r=(l>>16&255)/255,a.g=(l>>8&255)/255,a.b=(l&255)/255),a}function Te(e,t,a){var o=e.shadow;if(!(!o||!e.target)&&(e.userData.shadowCoverage=t,e.userData.shadowNormalBias=a,!o.__spcShadowCoverageFit)){o.__spcShadowCoverageFit=!0;var l=o.updateMatrices;o.updateMatrices=function(n){var r=n.userData.shadowCoverage;(typeof r!="number"||!isFinite(r)||r<=0)&&(r=20);var i=n.userData.shadowNormalBias;(typeof i!="number"||!isFinite(i))&&(i=.02);var c=r/20,v=n.matrixWorld.elements,_=n.target.matrixWorld.elements,d=v[12]-_[12],C=v[13]-_[13],D=v[14]-_[14],f=Math.sqrt(d*d+C*C+D*D),p=this.camera,A,y;return n.isDirectionalLight?(A=Math.min(.5*c,f-r),y=Math.max(100*c,f+r),(p.right!==r||p.near!==A||p.far!==y)&&(p.left=-r,p.right=r,p.top=r,p.bottom=-r,p.near=A,p.far=y,p.updateProjectionMatrix())):(y=n.distance>0?n.distance:Math.max(500*c,f+r),A=Math.min(.5*c,Math.max(.5,f/10),y/2),(p.near!==A||p.far!==y)&&(p.near=A,p.far=y,p.updateProjectionMatrix())),this.normalBias=i*c,l.call(this,n)}}}const P=Object.create(null),_e=Object.create(null),Ie=new at(.5,.5,1,64,16,!1),Se=new ot({color:new $("#151518"),roughness:.5,metalness:0,
1clearcoat:0,clearcoatRoughness:.1,transmission:0,ior:1.5,thickness:0,emissive:new $("#000000"),emissiveIntensity:1,sheen:0,sheenColor:new $("#000000"),sheenRoughness:1,iridescence:0,iridescenceIOR:1.3,iridescenceThicknessRange:[100,400],anisotropy:0,anisotropyRotation:0,opacity:1,aoMapIntensity:1,displacementScale:.1,side:nt}),G=new Ae(Ie,Se);G.position.set(0,.07,0),G.scale.set(2.6,.14,2.6),G.castShadow=!0,G.receiveShadow=!0,G.userData.shaderStudioId="obj_1789740963548_dw6zit8",G.userData.spcBillboard=!1,P.obj_1789740963548_dw6zit8=G,R.add(G);const ke=new rt(.5,.21,300,48,2,3),Pe=(()=>{new it;const e=new lt({vertexShader:`precision highp float; 2 3varying vec2 vUv; 4varying vec3 vViewNormal; 5 6void main() { 7 vUv = uv; 8 vViewNormal = normalize(normalMatrix * normal); 9 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 10}`,fragmentShader:`precision highp float; 11 12// Standard uniforms 13uniform float u_time; 14uniform vec2 u_resolution; 15uniform vec2 u_mouse; 16uniform float u_audioHigh; 17uniform float u_audioMid; 18uniform float u_audioBass; 19uniform float u_audioLevel; 20 21// Custom uniforms 22uniform float u_node_node_1789733088394_31_value; 23uniform float u_node_node_1789733088396_35_value; 24uniform vec3 u_node_node_1789732888021_13_color; 25uniform vec3 u_node_node_1789732888022_20_color; 26uniform vec3 u_node_node_1789732888021_15_vector; 27uniform float u_node_node_1789732888022_18_value; 28uniform vec3 u_node_node_1789732988337_28_color; 29uniform float u_node_node_1789732988336_24_value; 30 31varying vec2 vUv; 32varying vec3 vViewNormal; 33 34// Helper functions 35 36float fresnelEffect(vec3 viewDir, vec3 normal, float power) { 37 return pow(1.0 - abs(dot(viewDir, normal)), power); 38} 39 40 41void main() { 42 vec2 uv = vUv; 43 44 // Time 45 46 float time_4 = u_time * 1.0 + 0.0; 47 float time_time_0 = time_4; 48 float time_sin_1 = sin(time_4); 49 float time_cos_2 = cos(time_4); 50 float time_fract_3 = fract(time_4); 51 52 53 // UV Coordinates 54 55 vec2 uv_uv_5 = vUv; 56 vec2 uv_centered_6 = (vUv - 0.5) * u_resolution / min(u_resolution.x, u_resolution.y); 57 vec2 uv_aspect_7 = (vUv - 0.5) * vec2(u_resolution.x / u_resolution.y, 1.0); 58 float uv_u_8 = vUv.x; 59 float uv_v_9 = vUv.y; 60 61 62 // Float 63 float float_value_10 = u_node_node_1789733088394_31_value; 64 65 // Multiply 66 float multiply_result_11 = uv_v_9 * float_value_10; 67 68 // Add 69 float add_result_12 = multiply_result_11 + time_time_0; 70 71 // Sine 72 float sin_result_13 = sin(add_result_12); 73 74 // Float 75 float float_value_14 = u_node_node_1789733088396_35_value; 76 77 // Multiply 78 float multiply_result_15 = sin_result_13 * float_value_14; 79 80 // Add 81 float add_result_16 = uv_u_8 + multiply_result_15; 82 83 // Combine Vec2 84 vec2 combine_vec2_result_17 = vec2(add_result_16, uv_v_9); 85 86 // Waves 87 88 float waves_value_18 = sin(combine_vec2_result_17.x * 50.0 + time_time_0 * 0.9) * 1.0 * 0.5 + 0.5; 89 vec3 waves_color_19 = vec3(waves_value_18); 90 91 92 // Color Ramp 93 94 vec3 ramp_color_20 = (waves_value_18 < 1.0 ? mix(vec3(0.011764705882352941, 0.011764705882352941, 0.011764705882352941), vec3(1.0, 0.6039215686274509, 0.16470588235294117), clamp((waves_value_18 - 0.62) / max(1.0 - 0.62, 0.0001), 0.0, 1.0)) : vec3(1.0, 0.6039215686274509, 0.16470588235294117)); 95 float ramp_alpha_21 = clamp(waves_value_18, 0.0, 1.0); 96 97 98 // Color 99 100 vec3 color_color_22 = u_node_node_1789732888021_13_color; 101 vec3 color_rgb_23 = u_node_node_1789732888021_13_color; 102 float color_r_24 = u_node_node_1789732888021_13_color.r; 103 float color_g_25 = u_node_node_1789732888021_13_color.g; 104 float color_b_26 = u_node_node_1789732888021_13_color.b; 105 106 107 // View Normal 108 vec3 view_normal_xyz_27 = normalize(vViewNormal); 109 110 // Fresnel 111 float fresnel_result_28 = fresnelEffect(vec3(0.0, 0.0, 1.0), view_normal_xyz_27, 2.0); 112 113 // Multiply 114 vec3 multiply_result_29 = color_rgb_23 * vec3(fresnel_result_28); 115 116 // Add 117 vec3 add_result_30 = ramp_color_20 + multiply_result_29; 118 119 // Color 120 121 vec3 color_color_31 = u_node_node_1789732888022_20_color; 122 vec3 color_rgb_32 = u_node_node_1789732888022_20_color; 123 float color_r_33 = u_node_node_1789732888022_20_color.r; 124 float color_g_34 = u_node_node_1789732888022_20_color.g; 125 float color_b_35 = u_node_node_1789732888022_20_color.b; 126 127 128 // Vector 3D 129 130 vec3 vec3_vector_36 = u_node_node_1789732888021_15_vector; 131 float vec3_x_37 = u_node_node_1789732888021_15_vector.x; 132 float vec3_y_38 = u_node_node_1789732888021_15_vector.y; 133 float vec3_z_39 = u_node_node_1789732888021_15_vector.z; 134 135 136 // Dot Product
137 float dot_dot_40 = dot(view_normal_xyz_27, vec3_vector_36); 138 139 // Saturate 140 float saturate_result_41 = clamp(dot_dot_40, 0.0, 1.0); 141 142 // Float 143 float float_value_42 = u_node_node_1789732888022_18_value; 144 145 // Power 146 float power_result_43 = pow(abs(saturate_result_41), float_value_42); 147 148 // Multiply 149 vec3 multiply_result_44 = color_rgb_32 * vec3(power_result_43); 150 151 // Add 152 vec3 add_result_45 = add_result_30 + multiply_result_44; 153 154 // Color 155 156 vec3 color_color_46 = u_node_node_1789732988337_28_color; 157 vec3 color_rgb_47 = u_node_node_1789732988337_28_color; 158 float color_r_48 = u_node_node_1789732988337_28_color.r; 159 float color_g_49 = u_node_node_1789732988337_28_color.g; 160 float color_b_50 = u_node_node_1789732988337_28_color.b; 161 162 163 // Float 164 float float_value_51 = u_node_node_1789732988336_24_value; 165 166 // Multiply 167 vec2 multiply_result_52 = combine_vec2_result_17 * vec2(float_value_51); 168 169 // Waves 170 171 float waves_value_53 = sin(multiply_result_52.x * 50.2655 + time_time_0 * 1.3) * 1.0 * 0.5 + 0.5; 172 vec3 waves_color_54 = vec3(waves_value_53); 173 174 175 // Smoothstep 176 float smoothstep_result_55 = smoothstep(0.9, 1.0, waves_value_53); 177 178 // Multiply 179 vec3 multiply_result_56 = color_rgb_47 * vec3(smoothstep_result_55); 180 181 // Add 182 vec3 add_result_57 = add_result_45 + multiply_result_56; 183 184 // Material Output 185 186 vec3 finalColor = add_result_57 + ramp_color_20 * 0.3; 187 float finalAlpha = 1.0; 188 gl_FragColor = vec4(finalColor, finalAlpha); 189 190 191}`,uniforms:{u_time:{value:0},u_resolution:{value:new z(1,1)},u_mouse:{value:new z(.5,.5)},u_mouseVelocity:{value:new z},u_mouseStrength:{value:0},u_mouseTrail:{value:Array.from({length:8},()=>new z(.5,.5))},u_scrollVelocity:{value:0},u_gyro:{value:new ct},u_clickPosition:{value:new z(.5,.5)},u_lastClickTime:{value:-10},u_node_node_1789733088394_31_value:{value:12.566},u_node_node_1789733088396_35_value:{value:.02},u_node_node_1789732888021_13_color:{value:ne("#6f8f8a")},u_node_node_1789732888022_20_color:{value:ne("#ffe2b0")},u_node_node_1789732888021_15_vector:{value:[.4,.6,.7]},u_node_node_1789732888022_18_value:{value:48},u_node_node_1789732988337_28_color:{value:ne("#c9803a")},u_node_node_1789732988336_24_value:{value:3}},side:st});return e.userData.spcDisplayReferred=!0,e})(),x=new Ae(ke,Pe);x.position.set(0,1.3,0),x.rotation.set(.20943951023931953,0,0),x.scale.set(1.3,1.3,1.3),x.castShadow=!0,x.receiveShadow=!0,x.userData.shaderStudioId="obj_1789818590747_kqpzkej",x.userData.spcBillboard=!1,P.obj_1789818590747_kqpzkej=x,R.add(x);const Q=new ut("#ffffff",.6);Q.userData.shaderStudioId="obj_1789740854406_5b8qn7l",_e.obj_1789740854406_5b8qn7l=Q,P.obj_1789740854406_5b8qn7l=Q,R.add(Q);const B=new ft("#ffffff",.8);B.position.set(10,20,10),B.castShadow=!0,B.shadow.mapSize.setScalar(2048),B.shadow.bias=-.001,Te(B,20,.02),B.userData.shaderStudioId="obj_1789740854406_1r4stm6",_e.obj_1789740854406_1r4stm6=B,P.obj_1789740854406_1r4stm6=B,R.add(B);const pe=new yt(R,E);F=new wt(S),F.addPass(pe);const re=new Ct({uniforms:{tDiffuse:{value:null},uResolution:{value:new z(k.clientWidth,k.clientHeight)},uGrainIntensity:{value:0},uGrainSize:{value:1.5},uVignetteIntensity:{value:.3},uVignetteRadius:{value:.78}},vertexShader:`varying vec2 vUv; 192void main() { 193 vUv = uv; 194 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 195}`,fragmentShader:`uniform sampler2D tDiffuse; 196uniform vec2 uResolution; 197uniform float uGrainIntensity; 198uniform float uGrainSize; 199uniform float uVignetteIntensity; 200uniform float uVignetteRadius; 201varying vec2 vUv; 202 203float randomNoise(vec2 coordinate) { 204 return fract(sin(dot(coordinate, vec2(12.9898, 78.233))) * 43758.5453); 205} 206 207void main() { 208 vec4 source = texture2D(tDiffuse, vUv); 209 vec2 cell = floor(gl_FragCoord.xy / max(uGrainSize, 1.0)); 210 float grain = (randomNoise(cell) - 0.5) * uGrainIntensity; 211 float distanceFromCentre = distance(vUv, vec2(0.5)); 212 float vignette = smoothstep(uVignetteRadius, 0.9, distanceFromCentre) * uVignetteIntensity; 213 vec3 color = source.rgb + grain; 214 color *= 1.0 - vignette; 215 gl_FragColor = vec4(max(color, vec3(0.0)), source.a); 216}`});F.addPass(re);const de=new Mt,Fe=(function(t,a,o,l,n,r,i){const c={tFrame:{value:null},tDepth:{value:null},tRaw:{value:null},tRawDepth:{value:null},tBypass:{value:null},tBypassDepth:{value:null},hasBackdrop:{value:0},hasRaw:{value:0},rawPrecorrected:{value:0},hasBypass:{value:0},toneMappingExposure:{value:1},fogMode:{value:0},fogColor:{value:new t.Color},fogNear:{value:0},fogFar:{value:0},fogDensity:{value:0},cameraNear:{value:0},cameraFar:{value:0},orthographicCamera:{value:0}},v=new t.RawShaderMaterial({vertexShader:i.vertex,fragmentShader:i.capture,uniforms:c,depthTest:!1,depthWrite:!1}),_=new t.RawShaderMaterial({vertexShader:i.vertex,fragmentShader:i.linearize,uniforms:c,depthTest:!1,depthWrite:!1}),d=new t.BufferGeometry;d.setAttribute("position",new t.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),d.setAttribute("uv",new t.Float32BufferAttribute([0,2,0,0,2,0],2));
216const C=new t.Mesh(d,v),D=new t.OrthographicCamera(-1,1,1,-1,0,1),f=new t.MeshBasicMaterial({visible:!1}),p=new t.Color,A=new Map,y=[];let u=!1,m=!1,h=null;n.uniforms.tDisplayCorrection={value:null},n.uniforms.displayCorrectionWeight={value:0},n.material.fragmentShader=i.output,n.material.needsUpdate=!0;for(const s of[a.renderTarget1,a.renderTarget2])s.depthTexture??=new t.DepthTexture(s.width,s.height);function V(s,g,T,w=!1){let b=A.get(s);return b?(b.width!==g||b.height!==T)&&b.setSize(g,T):(b=new t.WebGLRenderTarget(g,T,{type:t.HalfFloatType,depthBuffer:w,stencilBuffer:!1,depthTexture:w?new t.DepthTexture(g,T):null}),A.set(s,b)),b}function L(s,g,T){const w=s.getRenderTarget(),b=s.autoClear;try{s.autoClear=!1,s.setRenderTarget(T),C.material=g,s.render(C,D)}finally{s.setRenderTarget(w),s.autoClear=b}}function M(s){return!s||!s.visible?0:s.userData?.spcDisplayReferred?1:s.toneMapped===!1?s.isShaderMaterial?1:2:0}function xe(s,g,T,w){const b=V(w,g.width,g.height,!0),W=s.getRenderTarget(),X=o.background,K=o.overri
216deMaterial,ee=s.autoClear,O=s.shadowMap.autoUpdate,te=s.shadowMap.needsUpdate,I=s.getClearAlpha();s.getClearColor(p);const Z=[];try{for(const U of T){const N=U.material;Z.push([U,N]),U.material=Array.isArray(N)?N.map(De=>M(De)===w?De:f):M(N)===w?N:f}o.background=null,o.overrideMaterial=null,s.shadowMap.autoUpdate=!1,s.shadowMap.needsUpdate=!1,s.autoClear=!0,s.setClearColor(0,0),s.setRenderTarget(b),s.render(o,l)}finally{for(const[U,N]of Z)U.material=N;o.background=X,o.overrideMaterial=K,s.setClearColor(p,I),s.setRenderTarget(W),s.autoClear=ee,s.shadowMap.autoUpdate=O,s.shadowMap.needsUpdate=te}return b}function Ye(s,g,T=!1){const w=o.background,b=!!w&&(w.isColor||w.isTexture&&!w.isCubeTexture&&w.mapping!==t.CubeUVReflectionMapping&&w.mapping!==t.EquirectangularReflectionMapping&&w.mapping!==t.EquirectangularRefractionMapping&&w.colorSpace===t.SRGBColorSpace),W=[];let X=!1,K=!1,ee=!1;o.traverseVisible(I=>{if(!I.material||(W.push(I),!I.layers.test(l.layers)))return;const Z=Array.isArray(I.material)?I.material:[I.material];for(const U of Z){const N=M(U);X||=N===1,K||=N===2,ee||=N===0&&!!U&&U.visible&&U.fog===!1}});const O=ee?null:o.fog;if(c.hasRaw.value=X?1:0,c.rawPrecorrected.value=T&&X?1:0,u=!!g.depthTexture&&(b||X||K||!!O),n.uniforms.displayCorrectionWeight.value=u?1:0,!u)return;if(h!==s.toneMapping){h=s.toneMapping,v.defines={};const I=["Linear","Reinhard","Cineon","ACESFilmic","AgX","Neutral","Custom"],Z=["LINEAR","REINHARD","CINEON","ACES_FILMIC","AGX","NEUTRAL","CUSTOM"];I.forEach((U,N)=>{h===t[U+"ToneMapping"]&&(v.defines[Z[N]+"_TONE_MAPPING"]="")}),v.needsUpdate=!0}if(c.toneMappingExposure.value=s.toneMappingExposure,c.tFrame.value=g.texture,c.tDepth.value=g.depthTexture,c.hasBackdrop.value=b?1:0,c.hasBypass.value=K?1:0,c.fogMode.value=O?O.isFogExp2?2:1:0,O&&(c.fogColor.value.copy(O.color),c.fogNear.value=O.near??0,c.fogFar.value=O.far??0,c.fogDensity.value=O.density??0,c.cameraNear.value=l.near,c.cameraFar.value=l.far,c.orthographicCamera.value=l.isOrthographicCamera?1:0),X){const I=xe(s,g,W,1);c.tRaw.value=I.texture,c.tRawDepth.value=I.depthTexture}if(K){const I=xe(s,g,W,2);c.tBypass.value=I.texture,c.tBypassDepth.value=I.depthTexture}const te=V("correction0",g.width,g.height);L(s,v,te),n.uniforms.tDisplayCorrection.value=te.texture}function Ke(s,g){const T={needsSwap:!1,clear:!1,renderToScreen:!1,get enabled(){return!m&&n.enabled},set enabled(w){},setSize(){},dispose(){},render(w,b,W){g(w,b,W)}};return y.push(T),a.insertPass(T,a.passes.indexOf(s)+1),T}let ue;return ue=Ke(r.scenePass,(s,g,T)=>{Ye(s,T,!!g),ue.needsSwap=u&&c.hasRaw.value>.5&&!!g,ue.needsSwap&&L(s,_,g)}),{dispose(){if(!m){m=!0;for(const s of y)a.removePass(s);for(const s of A.values())s.dispose();A.clear(),d.dispose(),v.dispose(),_.dispose(),f.dispose(),n.uniforms.tDisplayCorrection.value=null,n.uniforms.displayCorrectionWeight.value=0}}}}),Ne={output:` 217 218 precision highp float; 219 220 uniform sampler2D tDiffuse; 221uniform sampler2D tDisplayCorrection; 222uniform float displayCorrectionWeight; 223 224 #include <tonemapping_pars_fragment> 225 #include <colorspace_pars_fragment> 226 227 varying vec2 vUv; 228 229 void main() { 230 231 gl_FragColor = texture2D( tDiffuse, vUv ); 232 233 // tone mapping 234 235 #ifdef LINEAR_TONE_MAPPING 236 237 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 238 239 #elif defined( REINHARD_TONE_MAPPING ) 240 241 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 242 243 #elif defined( CINEON_TONE_MAPPING ) 244 245 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 246 247 #elif defined( ACES_FILMIC_TONE_MAPPING ) 248 249 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 250 251 #elif defined( AGX_TONE_MAPPING ) 252 253 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 254 255 #elif defined( NEUTRAL_TONE_MAPPING ) 256 257 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 258 259 #elif defined( CUSTOM_TONE_MAPPING ) 260 261 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 262 263 #endif 264 265 gl_FragColor.rgb += displayCorrectionWeight * texture2D(tDisplayCorrection, vUv).rgb; 266// color space 267 268 #ifdef SRGB_TRANSFER 269 270 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 271 272 #endif 273 274 }`,vertex:`precision highp float; 275attribute vec3 position; 276attribute vec2 uv; 277varying vec2 vUv; 278void main() { vUv = uv;
278 gl_Position = vec4(position, 1.0); }`,capture:`precision highp float; 279varying vec2 vUv; 280uniform sampler2D tFrame; 281uniform sampler2D tDepth; 282uniform sampler2D tRaw; 283uniform sampler2D tRawDepth; 284uniform sampler2D tBypass; 285uniform sampler2D tBypassDepth; 286uniform float hasBackdrop; 287uniform float hasRaw; 288uniform float rawPrecorrected; 289uniform float hasBypass; 290uniform float fogMode; 291uniform vec3 fogColor; 292uniform float fogNear; 293uniform float fogFar; 294uniform float fogDensity; 295uniform float cameraNear; 296uniform float cameraFar; 297uniform float orthographicCamera; 298#include <tonemapping_pars_fragment> 299#include <colorspace_pars_fragment> 300 301vec3 mapColor(vec3 color) { 302 #ifdef LINEAR_TONE_MAPPING 303 return LinearToneMapping(color); 304 #elif defined(REINHARD_TONE_MAPPING) 305 return ReinhardToneMapping(color); 306 #elif defined(CINEON_TONE_MAPPING) 307 return CineonToneMapping(color); 308 #elif defined(ACES_FILMIC_TONE_MAPPING) 309 return ACESFilmicToneMapping(color); 310 #elif defined(AGX_TONE_MAPPING) 311 return AgXToneMapping(color); 312 #elif defined(NEUTRAL_TONE_MAPPING) 313 return NeutralToneMapping(color); 314 #elif defined(CUSTOM_TONE_MAPPING) 315 return CustomToneMapping(color); 316 #else 317 return color; 318 #endif 319} 320vec3 toLinear(vec3 color) { 321 color = clamp(color, 0.0, 1.0); 322 return mix(pow(color * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), color * 0.0773993808, vec3(lessThanEqual(color, vec3(0.04045)))); 323} 324vec3 toDisplay(vec3 color) { 325 return sRGBTransferOETF(vec4(color, 1.0)).rgb; 326} 327// three's fog_fragment, driven by the depth the scene pass wrote. The depth to 328// view-Z formulas are packing's, written out because that chunk needs GLSL 3 329// (modf) and this shader is GLSL 1. 330float fogAmount(float depth) { 331 float viewZ = orthographicCamera > 0.5 332 ? depth * (cameraNear - cameraFar) - cameraNear 333 : (cameraNear * cameraFar) / ((cameraFar - cameraNear) * depth - cameraFar); 334 if (fogMode > 1.5) return 1.0 - exp(-fogDensity * fogDensity * viewZ * viewZ); 335 return smoothstep(fogNear, fogFar, -viewZ); 336} 337void main() { 338 float depth = texture2D(tDepth, vUv).r; 339 vec3 correction = vec3(0.0); 340 if (depth >= 1.0) { 341 if (hasBackdrop > 0.0) { 342 vec3 color = texture2D(tFrame, vUv).rgb; 343 correction = color - mapColor(color); 344 } 345 } else if (fogMode > 0.5) { 346 float fogFactor = fogAmount(depth); 347 if (fogFactor > 0.0) { 348 // Here the fog was mixed in linear light and is about to be tone-mapped. 349 // The canvas path tone-maps and encodes the surface first, then mixes in 350 // the picked fog colour, so recover the surface and rebuild that result. 351 vec3 color = texture2D(tFrame, vUv).rgb; 352 vec3 surface = max((color - fogFactor * fogColor) / max(1.0 - fogFactor, 0.0001), vec3(0.0)); 353 vec3 canvas = mix(toDisplay(mapColor(surface)), toDisplay(fogColor), fogFactor); 354 correction = toLinear(canvas) - mapColor(color); 355 } 356 } 357 if (hasRaw > 0.0) { 358 vec4 color = texture2D(tRaw, vUv); 359 if (color.a > 0.0 && texture2D(tRawDepth, vUv).r <= depth + 0.0000001) { 360 // When the linearize pass has already put this pixel's linear value in 361 // the frame (so bloom thresholds real light), the output still tone-maps 362 // whatever the frame holds. Undo exactly that, or every post effect 363 // would tone-map a display-authored shader and shift its colours. 364 vec3 linear = toLinear(color.rgb); 365 vec3 framed = rawPrecorrected > 0.5 ? linear : color.rgb; 366 correction = color.a * (linear - mapColor(framed)); 367 } 368 } 369 if (hasBypass > 0.0) { 370 vec4 color = texture2D(tBypass, vUv); 371 if (color.a > 0.0 && texture2D(tBypassDepth, vUv).r <= depth + 0.0000001) { 372 correction = color.a * (color.rgb - mapColor(color.rgb)); 373 } 374 } 375 gl_FragColor = vec4(correction, 1.0); 376}`,linearize:`precision highp float; 377varying vec2 vUv; 378uniform sampler2D tFrame; 379uniform sampler2D tDepth; 380uniform sampler2D tRaw; 381uniform sampler2D tRawDepth; 382uniform float hasRaw; 383vec3 toLinear(vec3 color) { 384 color = clamp(color, 0.0, 1.0); 385 return mix(pow(color * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), color * 0.0773993808, vec3(lessThanEqual(color, vec3(0.04045)))); 386} 387void main() { 388 vec4 frame = texture2D(tFrame, vUv); 389 if (hasRaw > 0.0) { 390 vec4 raw = texture2D(tRaw, vUv); 391 if (raw.a > 0.0 && texture2D(tRawDepth, vUv).r <= texture2D(tDepth, vUv).r + 0.0000001) { 392 frame.rgb = mix(frame.rgb, toLinear(raw.rgb), raw.a); 393 } 394 } 395 gl_FragColor = frame; 396}`};F.addPass(de);const Re=Fe(_t,F,R,E,de,{scenePass:pe},Ne),Ue=F.dispose.bind(F);F.dispose=()=>{Re.dispose(),Ue()};const ve=new Map,Le=[{obj:P.obj_1789818590747_kqpzkej,objectId:"obj_1789818590747_kqpzkej",partName:null,timelineClipI
396d:null,prop:"rotation",axis:"y",keyframes:[{time:0,value:0,easing:"linear"},{time:24,value:6.283185307179586,easing:"linear"}]}],ie={obj_1789818590747_kqpzkej:"loop"},le={},q=Object.create(null),H=Object.create(null);let me=0,ge=0,he=0;const ye=[];function Oe(e,t){if(t==="position.x")return e.position.x;if(t==="position.y")return e.position.y;if(t==="position.z")return e.position.z;if(t==="rotation.x")return e.rotation.x;if(t==="rotation.y")return e.rotation.y;if(t==="rotation.z")return e.rotation.z;if(t==="scale.x")return e.scale.x;if(t==="scale.y")return e.scale.y;if(t==="scale.z")return e.scale.z;if(t==="visible")return e.visible;if(t==="material.opacity"){var a=null;return e.traverse(function(o){!a&&o.isMesh&&o.material&&!Array.isArray(o.material)&&(a=o.material)}),a?a.opacity:null}return null}function ze(e,t,a){if(t==="position.x"){e.position.x=a;return}if(t==="position.y"){e.position.y=a;return}if(t==="position.z"){e.position.z=a;return}if(t==="rotation.x"){e.rotation.x=a;return}if(t==="rotation.y"){e.rotation.y=a;return}if(t==="rotation.z"){e.rotation.z=a;return}if(t==="scale.x"){e.scale.x=Math.max(a,.001);return}if(t==="scale.y"){e.scale.y=Math.max(a,.001);return}if(t==="scale.z"){e.scale.z=Math.max(a,.001);return}if(t==="visible"){e.visible=!!a;return}if(t==="material.opacity"){var o=null;e.traverse(function(l){!o&&l.isMesh&&l.material&&!Array.isArray(l.material)&&(o=l.material)}),o&&(o.opacity=a,o.transparent=!0,o.needsUpdate=!0)}}function Ee(e,t){var a=null;e.traverse(function(o){!a&&o.isMesh&&o.material&&!Array.isArray(o.material)&&(a=o.material)}),a&&(t.materialColor!==void 0&&a.color&&a.color.set(t.materialColor),t.materialRoughness!==void 0&&"roughness"in a&&(a.roughness=t.materialRoughness),t.materialMetalness!==void 0&&"metalness"in a&&(a.metalness=t.materialMetalness),t.materialOpacity!==void 0&&(a.opacity=t.materialOpacity,a.transparent=!0),a.needsUpdate=!0)}function je(e){return e.targets&&e.targets.length>0?e.targets:typeof e.timelineClipId>"u"?[{objectId:e.targetObjectId,action:e.action,seekTime:e.seekTime,delay:e.delay,clipName:e.clipName}]:[{objectId:e.targetObjectId,action:e.action,seekTime:e.seekTime,delay:e.delay,clipName:e.clipName,timelineClipId:e.timelineClipId}]}function Be(e){if(!e.conditions||!e.conditions.length)return!0;for(var t=0;t<e.conditions.length;t++){var a=e.conditions[t],o=a.objectId||e.targetObjectId,l=P[o];if(a.type==="object-visible"){if(!(l&&l.visible))return!1}else if(a.type==="animation-state"){var n=q[o],r=n?n.playing:!1;if(r!==(a.state==="playing"))return!1}else if(a.type==="property-equals"&&(!l||!a.propertyPath||Oe(l,a.propertyPath)!==a.value))return!1}return!0}function se(e,t){if(!(typeof modelMixers>"u")){var a=modelMixers[e];if(!(!a||!a.clips||!a.clips.length)){for(var o=null,l=0;l<a.clips.length;l++)if(a.clips[l].name===t){o=a.clips[l];break}o||(o=a.clips[0]),a.action&&a.action.stop();var n=a.clipPlayback.loop,r=n==="once"?dt:n==="pingpong"?vt:mt,i=a.mixer.clipAction(o);i.setLoop(r,n==="once"?1:1/0),i.clampWhenFinished=n==="once",i.timeScale=a.clipPlayback.timeScale,i.reset(),i.paused=!a.playing,i.play(),a.mixer.update(0),a.action=i}}}function Ge(e,t){var a=P[t.objectId],o=typeof t.timelineClipId<"u"?t.timelineClipId:e.timelineClipId;if(t.action==="seek"){var l=t.clipName!=null?t.clipName:e.clipName;l&&typeof modelMixers<"u"&&modelMixers[t.objectId]&&se(t.objectId,l),qe(t.objectId,t.seekTime!=null?t.seekTime:e.seekTime||0,o)}else if(t.action==="toggle-visibility")a&&(a.visible=!a.visible);else if(t.action==="set-property")a&&e.propertyPath!==void 0&&e.propertyValue!==void 0&&ze(a,e.propertyPath,e.propertyValue);else if(t.action==="set-material")a&&Ee(a,e);else if(t.action==="play-sound")e.sound&&spcSceneAudio().fireCue(e.sound);else{var n=t.clipName!=null?t.clipName:e.clipName;typeof modelMixers<"u"&&n&&modelMixers[t.objectId]&&se(t.objectId,n),Me(t.objectId,t.action,o,n)}}function we(e){window.dispatchEvent(new CustomEvent("spc:object-animation-finished",{detail:{objectId:e}})),Ve(e,"animation-end")}function Ve(e,t){for(var a=0;a<ye.length;a++){var o=ye[a];if(o.enabled!==!1&&!(o.__spcLayerId&&Array.isArray(window.__spcActiveLayerIds)&&window.__spcActiveLayerIds.indexOf(o.__spcLayerId)===-1)&&!(o.__spcSectionId&&window.__spcActiveSectionId&&o.__spcSectionId!==window.__spcActiveSectionId)&&!(o.__spcExperienceId&&window.__spcActiveExperienceId&&o.__spcExperienceId!==window.__spcActiveExperienceId)&&o.event===t&&!(o.sourceObjectId!=="scene"&&o.sourceObjectId!==e)){var l=performance.now();if(!(o.cooldown&&o._lastFired&&l-o._lastFired<o.cooldown*1e3)&&Be(o)){o._lastFired=l;for(var n=je(o),r=0;r<n.length;r++)(function(i){var c=(i.delay!=null?i.delay:o.delay)||0,v=function(){Ge(o,i)};c>0?setTimeout(v,c*1e3):v()})(n[r])}}}}function Ce(e,t){var a=q[e];if(!a)return!1;if(t!=null){var o=le[t];if(!o||o.objectId!==e)return!1}
396return a.timelineClipId!==t&&(a.timelineClipId=t||null,a.time=0),t&&(a.driven=!0),!0}function ce(e,t){var a=t&&t.timelineClipId?le[t.timelineClipId]:null;return Math.max(0,a&&a.objectId===e?a.duration:24)}function qe(e,t){var a=arguments[2],o=H[e];o&&(o.time=Math.max(0,t),o.playing=!1);var l=q[e];if(l&&!(a!==void 0&&!Ce(e,a))){l.driven||(l.driven=!0,l.time=0);var n=ce(e,l);l.time=Math.max(0,Math.min(t,n)),l.playing=!1}}function Me(e,t){var a=arguments[2],o=arguments[3],l=arguments[4]!==!1;l&&typeof P<"u"&&P[e]&&P[e].traverse&&P[e].traverse(function(_){_.userData&&_.userData.objectId&&_.userData.objectId!==e&&Me(_.userData.objectId,t,void 0,o,!1)});var n=q[e];if(!(n&&a!==void 0&&!Ce(e,a))){o&&typeof modelMixers<"u"&&modelMixers[e]&&se(e,o);var r=H[e];if(r&&(t==="pause"?r.playing=!1:t==="restart"||t==="loop"?(r.time=0,r.playing=!0):t==="reverse"?r.playing=!0:t==="toggle"?r.playing=!r.playing:r.playing=!0),!!n){if(!n.driven){n.driven=!0;var i=ie[e]||"loop";n.time=i==="once"?he:ge}var c=ie[e]==="loop",v=n.timelineClipId?le[n.timelineClipId]:null;if(v&&(c=v.loop),t==="pause"){n.playing=!1;return}if(t==="restart"){n.time=0,n.playing=!0,n.looping=c,n.reverse=!1;return}if(t==="loop"){n.time=0,n.playing=!0,n.looping=!0,n.reverse=!1;return}if(t==="reverse"){n.reverse=!n.reverse,n.playing=!0;return}if(t==="toggle"){n.playing=!n.playing;return}n.looping=c,n.reverse=!1,n.time>=ce(e,n)&&(n.time=0),n.playing=!0}}}function We(e,t){return e=Math.max(0,Math.min(1,e)),t==="easeIn"?e*e:t==="easeOut"?1-(1-e)*(1-e):t==="easeInOut"?e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2:e}function Xe(e,t){const a=e.keyframes;if(a.length===0)return null;if(a.length===1||t<=a[0].time)return a[0].value;if(t>=a[a.length-1].time)return a[a.length-1].value;for(let o=0;o<a.length-1;o++){const l=a[o],n=a[o+1];if(t>=l.time&&t<=n.time){const r=n.time-l.time;if(r<=0)return n.value;const i=(t-l.time)/r,c=We(i,n.easing||"linear");return l.value+(n.value-l.value)*c}}return a[a.length-1].value}{const e=P.obj_1789818590747_kqpzkej;e&&ve.set(e,{position:e.position.clone(),rotation:e.rotation.clone(),scale:e.scale.clone()})}function be(){ae=requestAnimationFrame(be),Y.update();const e=Y.getElapsed(),t=Y.getDelta();j.update(t),oe.resolve(E,R.children,j),x&&x.material.uniforms&&(x.material.uniforms.u_time&&(x.material.uniforms.u_time.value=e),x.material.uniforms.u_resolution&&x.material.uniforms.u_resolution.value.set(k.clientWidth,k.clientHeight),oe.apply(x,t,j)),oe.endFrame(j),J.update();{const n=Math.max(0,e-me);me=e;for(const r in q){const i=q[r];if(!i.playing||!i.driven)continue;const c=ce(r,i);c<=0||(i.reverse?(i.time-=n,i.time<=0&&(i.looping?i.time=c+i.time%c:(i.time=0,i.playing=!1,we(r)))):(i.time+=n,i.time>=c&&(i.looping?i.time=i.time%c:(i.time=c,i.playing=!1,we(r)))))}for(const r in H){const i=H[r];i.playing&&(i.time+=n)}}for(const[n,r]of ve.entries())n.position.copy(r.position),n.rotation.copy(r.rotation),n.scale.copy(r.scale);const a=24,o=e%a,l=Math.min(e,a);ge=o,he=l;for(const n of Le){const r=ie[n.objectId]||"loop",i=q[n.objectId],c=i&&i.timelineClipId?i.timelineClipId:null;if(n.timelineClipId!==c||!n.obj)continue;const _=i&&i.driven?i.time:r==="once"?l:r==="click"||r==="scroll"?i?i.time:0:o,d=Xe(n,_);d!==null&&(n.obj[n.prop][n.axis]=n.prop==="scale"?Math.max(d,.001):d)}Object.keys(P).forEach(n=>{const r=P[n];r&&r.userData&&r.userData.spcBillboard&&(r.lookAt(E.position),r.rotateY(Math.PI))}),F.render()}be(),new ResizeObserver(()=>{const e=k.clientWidth,t=k.clientHeight;E.aspect=e/t,E.updateProjectionMatrix(),S.setSize(e,t),F&&F.setSize(e,t),re&&re.uniforms.uResolution.value.set(e,t)}).observe(k)}),Dt(()=>{ae&&cancelAnimationFrame(ae),Y.dispose(),S?.dispose(),F&&F.dispose()}),(k,j)=>(At(),Tt("div",{ref_key:"containerRef",ref:fe,class:"three-scene",style:{width:"100%",height:"100%"}},null,512))}},Ot=bt(St,[["__scopeId","data-v-49fabb9e"]]);export{Ot as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.