mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-04-26 23:05:43 +00:00
397 lines
845 KiB
JavaScript
397 lines
845 KiB
JavaScript
|
|
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66936,(e,t,n)=>{"use strict";function i(e,t){var n=e.length;for(e.push(t);0<n;){var i=n-1>>>1,r=e[i];if(0<s(r,t))e[i]=t,e[n]=r,n=i;else break}}function r(e){return 0===e.length?null:e[0]}function a(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var i=0,r=e.length,a=r>>>1;i<a;){var o=2*(i+1)-1,l=e[o],u=o+1,c=e[u];if(0>s(l,n))u<r&&0>s(c,l)?(e[i]=c,e[u]=n,i=u):(e[i]=l,e[o]=n,i=o);else if(u<r&&0>s(c,n))e[i]=c,e[u]=n,i=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,_=!1,y=!1,x="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,S="u">typeof setImmediate?setImmediate:null;function M(e){for(var t=r(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,i(h,t);else break;t=r(d)}}function T(e){if(_=!1,M(e),!v)if(null!==r(h))v=!0,w||(w=!0,o());else{var t=r(d);null!==t&&N(T,t.startTime-e)}}var w=!1,E=-1,A=5,C=-1;function R(){return!!y||!(n.unstable_now()-C<A)}function P(){if(y=!1,w){var e=n.unstable_now();C=e;var t=!0;try{e:{v=!1,_&&(_=!1,b(E),E=-1),g=!0;var i=m;try{t:{for(M(e),f=r(h);null!==f&&!(f.expirationTime>e&&R());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,M(e),t=!0;break t}f===r(h)&&a(h),M(e)}else a(h);f=r(h)}if(null!==f)t=!0;else{var u=r(d);null!==u&&N(T,u.startTime-e),t=!1}}break e}finally{f=null,m=i,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof S)o=function(){S(P)};else if("u">typeof MessageChannel){var I=new MessageChannel,L=I.port2;I.port1.onmessage=P,o=function(){L.postMessage(null)}}else o=function(){x(P,0)};function N(e,t){E=x(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<e?Math.floor(1e3/e):5},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_next=function(e){switch(m){case 1:case 2:case 3:var t=3;break;default:t=m}var n=m;m=t;try{return e()}finally{m=n}},n.unstable_requestPaint=function(){y=!0},n.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=m;m=e;try{return t()}finally{m=n}},n.unstable_scheduleCallback=function(e,t,a){var s=n.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?s+a:s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=0x3fffffff;break;case 4:l=1e4;break;default:l=5e3}return l=a+l,e={id:p++,callback:t,priorityLevel:e,startTime:a,expirationTime:l,sortIndex:-1},a>s?(e.sortIndex=a,i(d,e),null===r(h)&&e===r(d)&&(_?(b(E),E=-1):_=!0,N(T,a-s))):(e.sortIndex=l,i(h,e),v||g||(v=!0,w||(w=!0,o()))),e},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},89499,(e,t,n)=>{"use strict";t.exports=e.r(66936)},40859,90072,8560,46791,e=>{"use strict";let t,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g,v,_;var y,x,b,S,M,T,w=e.i(47167),E=e.i(71645);let A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},C={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},R="attached",P="detached",I="srgb",L="srgb-linear",N="linear",U="srgb",D="300 es",O={COMPUTE:"compute",RENDER:"render"},F={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},z={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",E
|
||
|
|
|
||
|
|
varying vec3 vWorldDirection;
|
||
|
|
|
||
|
|
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
||
|
|
|
||
|
|
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
||
|
|
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
|
||
|
|
}
|
||
|
|
`,fragmentShader:`
|
||
|
|
|
||
|
|
uniform sampler2D tEquirect;
|
||
|
|
|
||
|
|
varying vec3 vWorldDirection;
|
||
|
|
|
||
|
|
#include <common>
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec3 direction = normalize( vWorldDirection );
|
||
|
|
|
||
|
|
vec2 sampleUV = equirectUv( direction );
|
||
|
|
|
||
|
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
||
|
|
|
||
|
|
}
|
||
|
|
`},i=new nE(5,5,5),r=new nI({name:"CubemapFromEquirect",uniforms:nA(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let a=new nT(i,r),s=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new nF(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){let r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}class nk extends tC{constructor(){super(),this.isGroup=!0,this.type="Group"}}let nV={type:"move"};class nH{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new nk,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new nk,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ef,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ef),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new nk,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ef,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ef),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let i of(a=!0,e.hand.values())){let e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}let i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(i=t.getPose(e.targetRaySpace,n))&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(nV)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new nk;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class nG{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new tq(e),this.density=t}clone(){return new nG(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class nW{co
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
uniform sampler2D envMap;
|
||
|
|
uniform int samples;
|
||
|
|
uniform float weights[ n ];
|
||
|
|
uniform bool latitudinal;
|
||
|
|
uniform float dTheta;
|
||
|
|
uniform float mipInt;
|
||
|
|
uniform vec3 poleAxis;
|
||
|
|
|
||
|
|
#define ENVMAP_TYPE_CUBE_UV
|
||
|
|
#include <cube_uv_reflection_fragment>
|
||
|
|
|
||
|
|
vec3 getSample( float theta, vec3 axis ) {
|
||
|
|
|
||
|
|
float cosTheta = cos( theta );
|
||
|
|
// Rodrigues' axis-angle rotation
|
||
|
|
vec3 sampleDirection = vOutputDirection * cosTheta
|
||
|
|
+ cross( axis, vOutputDirection ) * sin( theta )
|
||
|
|
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
|
||
|
|
|
||
|
|
return bilinearCubeUV( envMap, sampleDirection, mipInt );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
|
||
|
|
|
||
|
|
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
|
||
|
|
|
||
|
|
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
axis = normalize( axis );
|
||
|
|
|
||
|
|
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
||
|
|
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
|
||
|
|
|
||
|
|
for ( int i = 1; i < n; i++ ) {
|
||
|
|
|
||
|
|
if ( i >= samples ) {
|
||
|
|
|
||
|
|
break;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
float theta = dTheta * float( i );
|
||
|
|
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
|
||
|
|
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
`,blending:0,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(a=i,new nI({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:lE(),fragmentShader:`
|
||
|
|
|
||
|
|
precision highp float;
|
||
|
|
precision highp int;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
uniform sampler2D envMap;
|
||
|
|
uniform float roughness;
|
||
|
|
uniform float mipInt;
|
||
|
|
|
||
|
|
#define ENVMAP_TYPE_CUBE_UV
|
||
|
|
#include <cube_uv_reflection_fragment>
|
||
|
|
|
||
|
|
#define PI 3.14159265359
|
||
|
|
|
||
|
|
// Van der Corput radical inverse
|
||
|
|
float radicalInverse_VdC(uint bits) {
|
||
|
|
bits = (bits << 16u) | (bits >> 16u);
|
||
|
|
bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
|
||
|
|
bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
|
||
|
|
bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
|
||
|
|
bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
|
||
|
|
return float(bits) * 2.3283064365386963e-10; // / 0x100000000
|
||
|
|
}
|
||
|
|
|
||
|
|
// Hammersley sequence
|
||
|
|
vec2 hammersley(uint i, uint N) {
|
||
|
|
return vec2(float(i) / float(N), radicalInverse_VdC(i));
|
||
|
|
}
|
||
|
|
|
||
|
|
// GGX VNDF importance sampling (Eric Heitz 2018)
|
||
|
|
// "Sampling the GGX Distribution of Visible Normals"
|
||
|
|
// https://jcgt.org/published/0007/04/01/
|
||
|
|
vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
|
||
|
|
float alpha = roughness * roughness;
|
||
|
|
|
||
|
|
// Section 3.2: Transform view direction to hemisphere configuration
|
||
|
|
vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z));
|
||
|
|
|
||
|
|
// Section 4.1: Orthonormal basis
|
||
|
|
float lensq = Vh.x * Vh.x + Vh.y * Vh.y;
|
||
|
|
vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0);
|
||
|
|
vec3 T2 = cross(Vh, T1);
|
||
|
|
|
||
|
|
// Section 4.2: Parameterization of projected area
|
||
|
|
float r = sqrt(Xi.x);
|
||
|
|
float phi = 2.0 * PI * Xi.y;
|
||
|
|
float t1 = r * cos(phi);
|
||
|
|
float t2 = r * sin(phi);
|
||
|
|
float s = 0.5 * (1.0 + Vh.z);
|
||
|
|
t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
|
||
|
|
|
||
|
|
// Section 4.3: Reprojection onto hemisphere
|
||
|
|
vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh;
|
||
|
|
|
||
|
|
// Section 3.4: Transform back to ellipsoid configuration
|
||
|
|
return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
vec3 N = normalize(vOutputDirection);
|
||
|
|
vec3 V = N; // Assume view direction equals normal for pre-filtering
|
||
|
|
|
||
|
|
vec3 prefilteredColor = vec3(0.0);
|
||
|
|
float totalWeight = 0.0;
|
||
|
|
|
||
|
|
// For very low roughness, just sample the environment directly
|
||
|
|
if (roughness < 0.001) {
|
||
|
|
gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Tangent space basis for VNDF sampling
|
||
|
|
vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
||
|
|
vec3 tangent = normalize(cross(up, N));
|
||
|
|
vec3 bitangent = cross(N, tangent);
|
||
|
|
|
||
|
|
for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
|
||
|
|
vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
|
||
|
|
|
||
|
|
// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
|
||
|
|
vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
|
||
|
|
|
||
|
|
// Transform H back to world space
|
||
|
|
vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
|
||
|
|
vec3 L = normalize(2.0 * dot(V, H) * H - V);
|
||
|
|
|
||
|
|
float NdotL = max(dot(N, L), 0.0);
|
||
|
|
|
||
|
|
if(NdotL > 0.0) {
|
||
|
|
// Sample environment at fixed mip level
|
||
|
|
// VNDF importance sampling handles the distribution filtering
|
||
|
|
vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
|
||
|
|
|
||
|
|
// Weight by NdotL for the split-sum approximation
|
||
|
|
// VNDF PDF naturally accounts for the visible microfacet distribution
|
||
|
|
prefilteredColor += sampleColor * NdotL;
|
||
|
|
totalWeight += NdotL;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if (totalWeight > 0.0) {
|
||
|
|
prefilteredColor = prefilteredColor / totalWeight;
|
||
|
|
}
|
||
|
|
|
||
|
|
gl_FragColor = vec4(prefilteredColor, 1.0);
|
||
|
|
}
|
||
|
|
`,blending:0,depthTest:!1,depthWrite:!1}))}return i}_compileMaterial(e){let t=new nT(new nd,e);this._renderer.compile(t,lf)}_sceneToCubeUV(e,t,n,i,r){let a=new nO(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.toneMapping;l.getClearColor(lm),l.toneMapping=0,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(i),l.clearDepth(),l.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new nT(new nE,new tK({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1})));let h=this._backgroundBox,d=h.material,p=!1,f=e.background;f?f.isColor&&(d.color.copy(f),e.background=null,p=!0):(d.color.copy(lm),p=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x+o[t],r.y,r.z)):1===n?(a.up.set(0,0,s[t]),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y+o[t],r.z)):(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y,r.z+o[t]));let u=this._cubeSize;lM(i,n*u,t>2?u:0,u,u),l.setRenderTarget(i),p&&l.render(h,a),l.render(e,a)}l.toneMapping=c,l.autoClear=u,e.background=f}_textureToCubeUV(e,t){let n=this._renderer,i=301===e.mapping||302===e.mapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=lw()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=lT());let r=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=r,r.uniforms.envMap.value=e;let s=this._cubeSize;lM(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,lf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let i=this._lodMeshes.length;for(let t=1;t<i;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let i=this._renderer,r=this._pingPongRenderTarget,a=this._ggxMaterial,s=this._lodMeshes[n];s.material=a;let o=a.uniforms,l=n/(this._lodMeshes.length-1),u=t/(this._lodMeshes.length-1),c=Math.sqrt(l*l-u*u),{_lodMax:h}=this,d=this._sizeLods[n],p=3*d*(n>h-4?n-h+4:0),f=4*(this._cubeSize-d);o.envMap.value=e.texture,o.roughness.value=c*(0+1.25*l),o.mipInt.value=h-t,lM(r,p,f,3*d,2*d),i.setRenderTarget(r),i.render(s,lf),o.envMap.value=r.texture,o.roughness.value=0,o.mipInt.value=h-n,lM(e,p,f,3*d,2*d),i.setRenderTarget(e),i.render(s,lf)}_blur(e,t,n,i,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&K("blur direction must be either latitudinal or longitudinal!");let u=this._lodMeshes[i];u.material=l;let c=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20;f>20&&J(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);let m=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<f&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;c.envMap.value=e.texture,c.samples.value=f,c.weights.value=m,c.latitudinal.value="latitudinal"===a,s&&(c.poleAxis.value=s);let{_lodMax:v}=this;c.dTheta.value=d,c.mipInt.value=v-n;let _=this._sizeLods[i],y=4*(this._cubeSize-_);lM(t,3*_*(i>v-4?i-v+4:0),y,3*_,2*_),o.setRenderTarget(t),o.render(u,lf)}}function lS(e,t,n){let i=new eN(e,t,n);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function lM(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function lT(){return new nI({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:lE(),fragmentShader:`
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
uniform sampler2D envMap;
|
||
|
|
|
||
|
|
#include <common>
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec3 outputDirection = normalize( vOutputDirection );
|
||
|
|
vec2 uv = equirectUv( outputDirection );
|
||
|
|
|
||
|
|
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
||
|
|
|
||
|
|
}
|
||
|
|
`,blending:0,depthTest:!1,depthWrite:!1})}function lw(){return new nI({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lE(),fragmentShader:`
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
uniform float flipEnvMap;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
uniform samplerCube envMap;
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
|
||
|
|
|
||
|
|
}
|
||
|
|
`,blending:0,depthTest:!1,depthWrite:!1})}function lE(){return`
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
attribute float faceIndex;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
// RH coordinate system; PMREM face-indexing convention
|
||
|
|
vec3 getDirection( vec2 uv, float face ) {
|
||
|
|
|
||
|
|
uv = 2.0 * uv - 1.0;
|
||
|
|
|
||
|
|
vec3 direction = vec3( uv, 1.0 );
|
||
|
|
|
||
|
|
if ( face == 0.0 ) {
|
||
|
|
|
||
|
|
direction = direction.zyx; // ( 1, v, u ) pos x
|
||
|
|
|
||
|
|
} else if ( face == 1.0 ) {
|
||
|
|
|
||
|
|
direction = direction.xzy;
|
||
|
|
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
|
||
|
|
|
||
|
|
} else if ( face == 2.0 ) {
|
||
|
|
|
||
|
|
direction.x *= -1.0; // ( -u, v, 1 ) pos z
|
||
|
|
|
||
|
|
} else if ( face == 3.0 ) {
|
||
|
|
|
||
|
|
direction = direction.zyx;
|
||
|
|
direction.xz *= -1.0; // ( -1, v, -u ) neg x
|
||
|
|
|
||
|
|
} else if ( face == 4.0 ) {
|
||
|
|
|
||
|
|
direction = direction.xzy;
|
||
|
|
direction.xy *= -1.0; // ( -u, -1, v ) neg y
|
||
|
|
|
||
|
|
} else if ( face == 5.0 ) {
|
||
|
|
|
||
|
|
direction.z *= -1.0; // ( u, v, -1 ) neg z
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return direction;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vOutputDirection = getDirection( uv, faceIndex );
|
||
|
|
gl_Position = vec4( position, 1.0 );
|
||
|
|
|
||
|
|
}
|
||
|
|
`}function lA(e){let t=new WeakMap,n=null;function i(e){let n=e.target;n.removeEventListener("dispose",i);let r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping,s=303===a||304===a,o=301===a||302===a;if(s||o){let a=t.get(r),l=void 0!==a?a.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new lb(e)),(a=s?n.fromEquirectangular(r,a):n.fromCubemap(r,a)).texture.pmremVersion=r.pmremVersion,t.set(r,a),a.texture;{if(void 0!==a)return a.texture;let l=r.image;return s&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new lb(e)),(a=s?n.fromEquirectangular(r):n.fromCubemap(r)).texture.pmremVersion=r.pmremVersion,t.set(r,a),r.addEventListener("dispose",i),a.texture):null}}}return r},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function lC(e){let t={};function n(n){if(void 0!==t[n])return t[n];let i=e.getExtension(n);return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){let t=n(e);return null===t&&$("WebGLRenderer: "+e+" extension not supported."),t}}}function lR(e,t,n,i){let r={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete r[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){let n=[],i=e.index,r=e.attributes.position,s=0;if(null!==i){let e=i.array;s=i.version;for(let t=0,i=e.length;t<i;t+=3){let i=e[t+0],r=e[t+1],a=e[t+2];n.push(i,r,r,a,a,i)}}else{if(void 0===r)return;let e=r.array;s=r.version;for(let t=0,i=e.length/3-1;t<i;t+=3){let e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}let o=new(B(n)?nn:ne)(n,1);o.version=s;let l=a.get(e);l&&t.remove(l),a.set(e,o)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",s),r[t.id]=!0,n.memory.geometries++),t},update:function(n){let i=n.attributes;for(let n in i)t.update(i[n],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){let t=a.get(e);if(t){let n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return a.get(e)}}}function lP(e,t,n){let i,r,a;function s(t,s,o){0!==o&&(e.drawElementsInstanced(i,s,r,t*a,o),n.update(s,i,o))}this.setMode=function(e){i=e},this.setIndex=function(e){r=e.type,a=e.bytesPerElement},this.render=function(t,s){e.drawElements(i,s,r,t*a),n.update(s,i,1)},this.renderInstances=s,this.renderMultiDraw=function(e,a,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,a,0,r,e,0,s);let o=0;for(let e=0;e<s;e++)o+=a[e];n.update(o,i,1)},this.renderMultiDrawInstances=function(e,o,l,u){if(0===l)return;let c=t.get("WEBGL_multi_draw");if(null===c)for(let t=0;t<e.length;t++)s(e[t]/a,o[t],u[t]);else{c.multiDrawElementsInstancedWEBGL(i,o,0,r,e,0,u,0,l);let t=0;for(let e=0;e<l;e++)t+=o[e]*u[e];n.update(t,i,1)}}}function lI(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,i,r){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=n/3*r;break;case e.LINES:t.lines+=n/2*r;break;case e.LINE_STRIP:t.lines+=r*(n-1);break;case e.LINE_LOOP:t.lines+=r*n;break;case e.POINTS:t.points+=r*n;break;default:K("WebGLInfo: Unknown draw mode:",i)}}}}function lL(e,t,n){let i=new WeakMap,r=new eI;return{update:function(a,s,o){let l=a.morphTargetInfluences,u=s.morphAttributes.position||s.morphAttributes.normal||s.morphAttributes.color,c=void 0!==u?u.length:0,h=i.get(s);if(void 0===h||h.count!==c){void 0!==h&&h.texture.dispose();let e=void 0!==s.morphAttributes.position,n=void 0!==s.morphAttributes.normal,a=void 0!==s.morphAttributes.color,o=s.morphAttributes.positi
|
||
|
|
precision highp float;
|
||
|
|
|
||
|
|
uniform mat4 modelViewMatrix;
|
||
|
|
uniform mat4 projectionMatrix;
|
||
|
|
|
||
|
|
attribute vec3 position;
|
||
|
|
attribute vec2 uv;
|
||
|
|
|
||
|
|
varying vec2 vUv;
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
vUv = uv;
|
||
|
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
||
|
|
}`,fragmentShader:`
|
||
|
|
precision highp float;
|
||
|
|
|
||
|
|
uniform sampler2D tDiffuse;
|
||
|
|
|
||
|
|
varying vec2 vUv;
|
||
|
|
|
||
|
|
#include <tonemapping_pars_fragment>
|
||
|
|
#include <colorspace_pars_fragment>
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
gl_FragColor = texture2D( tDiffuse, vUv );
|
||
|
|
|
||
|
|
#ifdef LINEAR_TONE_MAPPING
|
||
|
|
gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
|
||
|
|
#elif defined( REINHARD_TONE_MAPPING )
|
||
|
|
gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
|
||
|
|
#elif defined( CINEON_TONE_MAPPING )
|
||
|
|
gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
|
||
|
|
#elif defined( ACES_FILMIC_TONE_MAPPING )
|
||
|
|
gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
|
||
|
|
#elif defined( AGX_TONE_MAPPING )
|
||
|
|
gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
|
||
|
|
#elif defined( NEUTRAL_TONE_MAPPING )
|
||
|
|
gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
|
||
|
|
#elif defined( CUSTOM_TONE_MAPPING )
|
||
|
|
gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#ifdef SRGB_TRANSFER
|
||
|
|
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
||
|
|
#endif
|
||
|
|
}`,depthTest:!1,depthWrite:!1}),c=new nT(l,u),h=new sx(-1,1,1,-1,0,1),d=null,p=null,f=!1,m=null,g=[],v=!1;this.setSize=function(e,t){s.setSize(e,t),o.setSize(e,t);for(let n=0;n<g.length;n++){let i=g[n];i.setSize&&i.setSize(e,t)}},this.setEffects=function(e){v=(g=e).length>0&&!0===g[0].isRenderPass;let t=s.width,n=s.height;for(let e=0;e<g.length;e++){let i=g[e];i.setSize&&i.setSize(t,n)}},this.begin=function(e,t){if(f||0===e.toneMapping&&0===g.length)return!1;if(m=t,null!==t){let e=t.width,n=t.height;(s.width!==e||s.height!==n)&&this.setSize(e,n)}return!1===v&&e.setRenderTarget(s),a=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=a,f=!0;let n=s,i=o;for(let r=0;r<g.length;r++){let a=g[r];if(!1!==a.enabled&&(a.render(e,i,n,t),!1!==a.needsSwap)){let e=n;n=i,i=e}}if(d!==e.outputColorSpace||p!==e.toneMapping){d=e.outputColorSpace,p=e.toneMapping,u.defines={},eb.getTransfer(d)===U&&(u.defines.SRGB_TRANSFER="");let t=lU[p];t&&(u.defines[t]=""),u.needsUpdate=!0}u.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(m),e.render(c,h),m=null,f=!1},this.isCompositing=function(){return f},this.dispose=function(){s.dispose(),o.dispose(),l.dispose(),u.dispose()}}let lO=new eP,lF=new rb(1,1),lz=new eU,lB=new eO,lk=new nz,lV=[],lH=[],lG=new Float32Array(16),lW=new Float32Array(9),lj=new Float32Array(4);function lX(e,t,n){let i=e[0];if(i<=0||i>0)return e;let r=t*n,a=lV[r];if(void 0===a&&(a=new Float32Array(r),lV[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function lq(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function lY(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function lZ(e,t){let n=lH[t];void 0===n&&(n=new Int32Array(t),lH[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function lJ(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function lK(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(lq(n,t))return;e.uniform2fv(this.addr,t),lY(n,t)}}function l$(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(lq(n,t))return;e.uniform3fv(this.addr,t),lY(n,t)}}function lQ(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(lq(n,t))return;e.uniform4fv(this.addr,t),lY(n,t)}}function l0(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(lq(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),lY(n,t)}else{if(lq(n,i))return;lj.set(i),e.uniformMatrix2fv(this.addr,!1,lj),lY(n,i)}}function l1(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(lq(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),lY(n,t)}else{if(lq(n,i))return;lW.set(i),e.uniformMatrix3fv(this.addr,!1,lW),lY(n,i)}}function l2(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(lq(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),lY(n,t)}else{if(lq(n,i))return;lG.set(i),e.uniformMatrix4fv(this.addr,!1,lG),lY(n,i)}}function l3(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function l4(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(lq(n,t))return;e.uniform2iv(this.addr,t),lY(n,t)}}function l5(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(lq(n,t))return;e.uniform3iv(this.addr,t),lY(n,t)}}function l6(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(lq(n,t))return;e.uniform4iv(this.addr,t),lY(n,t)}}function l8(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}func
|
||
|
|
precision ${e.precision} int;
|
||
|
|
precision ${e.precision} sampler2D;
|
||
|
|
precision ${e.precision} samplerCube;
|
||
|
|
precision ${e.precision} sampler3D;
|
||
|
|
precision ${e.precision} sampler2DArray;
|
||
|
|
precision ${e.precision} sampler2DShadow;
|
||
|
|
precision ${e.precision} samplerCubeShadow;
|
||
|
|
precision ${e.precision} sampler2DArrayShadow;
|
||
|
|
precision ${e.precision} isampler2D;
|
||
|
|
precision ${e.precision} isampler3D;
|
||
|
|
precision ${e.precision} isamplerCube;
|
||
|
|
precision ${e.precision} isampler2DArray;
|
||
|
|
precision ${e.precision} usampler2D;
|
||
|
|
precision ${e.precision} usampler3D;
|
||
|
|
precision ${e.precision} usamplerCube;
|
||
|
|
precision ${e.precision} usampler2DArray;
|
||
|
|
`;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}let uq={1:"SHADOWMAP_TYPE_PCF",3:"SHADOWMAP_TYPE_VSM"},uY={301:"ENVMAP_TYPE_CUBE",302:"ENVMAP_TYPE_CUBE",306:"ENVMAP_TYPE_CUBE_UV"},uZ={302:"ENVMAP_MODE_REFRACTION"},uJ={0:"ENVMAP_BLENDING_MULTIPLY",1:"ENVMAP_BLENDING_MIX",2:"ENVMAP_BLENDING_ADD"};function uK(e,t,n,i){var r,a;let s,o,l,u,c=e.getContext(),h=n.defines,d=n.vertexShader,p=n.fragmentShader,f=uq[n.shadowMapType]||"SHADOWMAP_TYPE_BASIC",m=!1===n.envMap?"ENVMAP_TYPE_CUBE":uY[n.envMapMode]||"ENVMAP_TYPE_CUBE",g=!1===n.envMap?"ENVMAP_MODE_REFLECTION":uZ[n.envMapMode]||"ENVMAP_MODE_REFLECTION",v=!1===n.envMap?"ENVMAP_BLENDING_NONE":uJ[n.combine]||"ENVMAP_BLENDING_NONE",_=function(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let n=Math.log2(t)-2;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:1/t,maxMip:n}}(n),y=[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(uO).join("\n"),x=function(e){let t=[];for(let n in e){let i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(h),b=c.createProgram(),S=n.glslVersion?"#version "+n.glslVersion+"\n":"";if(n.isRawShaderMaterial)(s=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(uO).join("\n")).length>0&&(s+="\n"),(o=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(uO).join("\n")).length>0&&(o+="\n");else{let e,t,i,l,u;s=[uX(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#defi
|
||
|
|
return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );
|
||
|
|
}`),(eb.getLuminanceCoefficients(uD),i=uD.x.toFixed(4),l=uD.y.toFixed(4),u=uD.z.toFixed(4),`float luminance( const in vec3 rgb ) {
|
||
|
|
const vec3 weights = vec3( ${i}, ${l}, ${u} );
|
||
|
|
return dot( weights, rgb );
|
||
|
|
}`),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(uO).join("\n")}d=uz(d=uF(d=uk(d),n),n),p=uz(p=uF(p=uk(p),n),n),d=uW(d),p=uW(p),!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",s=[y,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+s,o=["#define varying in",n.glslVersion===D?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===D?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);let M=S+s+d,T=S+o+p,w=uP(c,c.VERTEX_SHADER,M),E=uP(c,c.FRAGMENT_SHADER,T);function A(t){if(e.debug.checkShaderErrors){let n=c.getProgramInfoLog(b)||"",i=c.getShaderInfoLog(w)||"",r=c.getShaderInfoLog(E)||"",a=n.trim(),l=i.trim(),u=r.trim(),h=!0,d=!0;if(!1===c.getProgramParameter(b,c.LINK_STATUS))if(h=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(c,b,w,E);else{let e=uN(c,w,"vertex"),n=uN(c,E,"fragment");K("THREE.WebGLProgram: Shader Error "+c.getError()+" - VALIDATE_STATUS "+c.getProgramParameter(b,c.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+a+"\n"+e+"\n"+n)}else""!==a?J("WebGLProgram: Program Info Log:",a):(""===l||""===u)&&(d=!1);d&&(t.diagnostics={runnable:h,programLog:a,vertexShader:{log:l,prefix:s},fragmentShader:{log:u,prefix:o}})}c.deleteShader(w),c.deleteShader(E),l=new uR(c,b),u=function(e,t){let n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){let i=e.getActiveAttrib(t,r),a=i.name,s=1;i.type===e.FLOAT_MAT2&&(s=2),i.type===e.FLOAT_MAT3&&(s=3),i.type===e.FLOAT_MAT4&&(s=4),n[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:s}}return n}(c,b)}c.attachShader(b,w),c.attachShader(b,E),void 0!==n.index0AttributeName?c.bindAttribLocation(b,0,n.index0AttributeName):!0===n.morphTargets&&c.bindAttribLocation(b,0,"position"),c.linkProgram(b),this.getUniforms=function(){return void 0===l&&A(this),l},this.getAttributes=function(){return void 0===u&&A(this),u};let C=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===C&&(C=c.getProgramParameter(b,37297)),C},this.destroy=function(){i.releaseStatesOfProgram(this),c.deleteProgram(b),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=uI++,this.cacheKey=t,this.usedTimes=1,this.program=b,this.vertexShader=w,this.fragmentShader=E,this}let u$=0;class uQ{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(r)&&(a.add(r),r.usedTimes++),this}remove(e){for(let t of this.materialCache.get(e))t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return void 0===n&&(n=new u0(e),t.set(e,n)),n}}class u0{constructor(e){this.id=u$++,this.code=e,this.usedTimes=0}}function u1(e,t,n,i,r,a,s){let o=new td,l=new uQ,u=new Set,c=[],h=new Map,d=r.logarithmicDepthBuffer,p=r.precision,f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic"
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
gl_Position = vec4( position, 1.0 );
|
||
|
|
|
||
|
|
}`,cf=`
|
||
|
|
uniform sampler2DArray depthColor;
|
||
|
|
uniform float depthWidth;
|
||
|
|
uniform float depthHeight;
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
|
||
|
|
|
||
|
|
if ( coord.x >= 1.0 ) {
|
||
|
|
|
||
|
|
gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
|
||
|
|
|
||
|
|
} else {
|
||
|
|
|
||
|
|
gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}`;class cm{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(null===this.texture){let n=new rM(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new nI({vertexShader:cp,fragmentShader:cf,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new nT(new ay(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class cg extends ee{constructor(e,t){super();const n=this;let i=null,r=1,a=null,s="local-floor",o=1,l=null,u=null,c=null,h=null,d=null,p=null;const f="u">typeof XRWebGLBinding,m=new cm,g={},v=t.getContextAttributes();let _=null,y=null;const x=[],b=[],S=new ed;let M=null;const T=new nO;T.viewport=new eI;const w=new nO;w.viewport=new eI;const E=[T,w],A=new sG;let C=null,R=null;function P(e){let t=b.indexOf(e.inputSource);if(-1===t)return;let n=x[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function I(){i.removeEventListener("select",P),i.removeEventListener("selectstart",P),i.removeEventListener("selectend",P),i.removeEventListener("squeeze",P),i.removeEventListener("squeezestart",P),i.removeEventListener("squeezeend",P),i.removeEventListener("end",I),i.removeEventListener("inputsourceschange",L);for(let e=0;e<x.length;e++){let t=b[e];null!==t&&(b[e]=null,x[e].disconnect(t))}for(let e in C=null,R=null,m.reset(),g)delete g[e];e.setRenderTarget(_),d=null,h=null,c=null,i=null,y=null,F.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(S.width,S.height,!1),n.dispatchEvent({type:"sessionend"})}function L(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],i=b.indexOf(n);i>=0&&(b[i]=null,x[i].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],i=b.indexOf(n);if(-1===i){for(let e=0;e<x.length;e++)if(e>=b.length){b.push(n),i=e;break}else if(null===b[e]){b[e]=n,i=e;break}if(-1===i)break}let r=x[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return void 0===t&&(t=new nH,x[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===n.isPresenting&&J("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&J("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return null===c&&f&&(c=new XRWebGLBinding(i,t)),c},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(u){if(null!==(i=u)){if(_=e.getRenderTarget(),i.addEventListener("select",P),i.addEventListener("selectstart",P),i.addEventListener("selectend",P),i.addEventListener("squeeze",P),i.addEventListener("squeezestart",P),i.addEventListener("squeezeend",P),i.addEventListener("end",I),i.addEventListener("inputsourceschange",L),!0!==v.xrCompatible&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(S),f&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,a=null,s=null;v.depth&&(s=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?1027:1026,a=v.stencil?1020:1014);let o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:r};h=(c=this.getBinding()).createProjectionLayer(o),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),y=new eN(h.textureWidth,h.textureHeight,{format:1023,type:1009,depthTexture:new rb(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4
|
||
|
|
at`)?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
|
|
`+a7+e+se}function A(e,t){if(!e||sY)return"";sY=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var i=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){i=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){i=e}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(e){if(e&&i&&"string"==typeof e.stack)return[e.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split(`
|
||
|
|
`),u=o.split(`
|
||
|
|
`);for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===u.length)for(i=l.length-1,r=u.length-1;1<=i&&0<=r&&l[i]!==u[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==u[r]){if(1!==i||1!==r)do if(i--,r--,0>r||l[i]!==u[r]){var c=`
|
||
|
|
`+l[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=r)break}}}finally{sY=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?T(n):""}function C(e){try{var t="",n=null;do t+=function(e,t){switch(e.tag){case 26:case 27:case 5:return T(e.type);case 16:return T("Lazy");case 13:return e.child!==t&&null!==t?T("Suspense Fallback"):T("Suspense");case 19:return T("SuspenseList");case 0:case 15:return A(e.type,!1);case 11:return A(e.type.render,!1);case 1:return A(e.type,!0);case 31:return T("Activity");default:return""}}(e,n),n=e,e=e.return;while(e)return t}catch(e){return`
|
||
|
|
Error generating stack: `+e.message+`
|
||
|
|
`+e.stack}}function R(e,t){if("object"==typeof e&&null!==e){var n=sZ.get(e);return void 0!==n?n:(t={value:e,source:t,stack:C(t)},sZ.set(e,t),t)}return{value:e,source:t,stack:C(t)}}function P(e,t){sJ[sK++]=sQ,sJ[sK++]=s$,s$=e,sQ=t}function I(e,t,n){s0[s1++]=s3,s0[s1++]=s4,s0[s1++]=s2,s2=e;var i=s3;e=s4;var r=32-sE(i)-1;i&=~(1<<r),n+=1;var a=32-sE(t)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,s3=1<<32-sE(t)+r|n<<r|i,s4=a+e}else s3=1<<a|n<<r|i,s4=e}function L(e){null!==e.return&&(P(e,1),I(e,1,0))}function N(e){for(;e===s$;)s$=sJ[--sK],sJ[sK]=null,sQ=sJ[--sK],sJ[sK]=null;for(;e===s2;)s2=s0[--s1],s0[s1]=null,s4=s0[--s1],s0[s1]=null,s3=s0[--s1],s0[s1]=null}function U(e,t){s0[s1++]=s3,s0[s1++]=s4,s0[s1++]=s2,s3=t.id,s4=t.overflow,s2=e}function D(e,t){h(s8,t),h(s6,e),h(s5,null),e=rC(t),c(s5),h(s5,e)}function O(){c(s5),c(s6),c(s8)}function F(e){null!==e.memoizedState&&h(s9,e);var t=s5.current,n=rR(t,e.type);t!==n&&(h(s6,e),h(s5,n))}function z(e){s6.current===e&&(c(s5),c(s6)),s9.current===e&&(c(s9),rk?r5._currentValue=r4:r5._currentValue2=r4)}function B(e){var t=Error(i(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML",""));throw j(R(t,e)),or}function k(e,t){if(!rG)throw Error(i(175));aX(e.stateNode,e.type,e.memoizedProps,t,e)||B(e,!0)}function V(e){for(s7=e.return;s7;)switch(s7.tag){case 5:case 31:case 13:oi=!1;return;case 27:case 3:oi=!0;return;default:s7=s7.return}}function H(e){if(!rG||e!==s7)return!1;if(!ot)return V(e),ot=!0,!1;var t=e.tag;if(sv?3!==t&&27!==t&&(5!==t||a9(e.type)&&!rD(e.type,e.memoizedProps))&&oe&&B(e):3!==t&&(5!==t||a9(e.type)&&!rD(e.type,e.memoizedProps))&&oe&&B(e),V(e),13===t){if(!rG)throw Error(i(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));oe=aK(e)}else if(31===t){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));oe=aJ(e)}else oe=sv&&27===t?aO(e.type,oe):s7?aD(e.stateNode):null;return!0}function G(){rG&&(oe=s7=null,ot=!1)}function W(){var e=on;return null!==e&&(null===lL?lL=e:lL.push.apply(lL,e),on=null),e}function j(e){null===on?on=[e]:on.push(e)}function X(e,t,n){rk?(h(oa,t._currentValue),t._currentValue=n):(h(oa,t._currentValue2),t._currentValue2=n)}function q(e){var t=oa.current;rk?e._currentValue=t:e._currentValue2=t,c(oa)}function Y(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Z(e,t,n,r){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var s=a.dependencies;if(null!==s){var o=a.child;s=s.firstContext;o:for(;null!==s;){var l=s;s=a;for(var u=0;u<t.length;u++)if(l.context===t[u]){s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Y(s.return,n,e),r||(o=null);break o}s=l.next}}else if(18===a.tag){if(null===(o=a.return))throw Error(i(341));o.lanes|=n,null!==(s=o.alternate)&&(s.lanes|=n),Y(o,n,e),o=null}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===e){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}}function J(e,t,n,r){e=null;for(var a=t,s=!1;null!==a;){if(!s){if((524288&a.flags)!=0)s=!0;else if((262144&a.flags)!=0)break}if(10===a.tag){var o=a.alternate;if(null===o)throw Error(i(387));if(null!==(o=o.memoizedProps)){var l=a.type;sj(a.pendingProps.value,o.value)||(null!==e?e.push(l):e=[l])}}else if(a===s9.current){if(null===(o=a.alternate))throw Error(i(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(r5):e=[r5])}a=a.return}null!==e&&Z(t,e,n,r),t.flags|=262144}function K(e){for(e=e.firstContext;null!==e;){var t=e.context;if(!sj(rk?t._currentValue:t._currentValue2,e.memoizedValue))return!0;e=e.next}return!1}function $(e){os=e,oo=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Q(e){return et(os,e)}function ee(e,t){return null===os&&$(e),et(e,t)}function et(e,t){var n=rk?t._currentValue:t._currentValue2;if(t={context:t,memoizedValue:n,next:null},null===oo){if(null===e)throw Error(i(308));oo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else oo=oo.ne
|
||
|
|
`+r.join(" > ")+`
|
||
|
|
|
||
|
|
No matching component was found for:
|
||
|
|
`+e.join(" > ")}return null},rt.getPublicRootInstance=function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 27:case 5:return rA(e.child.stateNode);default:return e.child.stateNode}},rt.injectIntoDevTools=function(){var e={bundleType:0,version:rT,rendererPackageName:rw,currentDispatcherRef:rM,reconcilerVersion:"19.2.0"};if(null!==rE&&(e.rendererConfig=rE),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{sG=t.inject(e),sW=t}catch{}e=!!t.checkDCE}}return e},rt.isAlreadyRendering=function(){return(6&lm)!=0},rt.observeVisibleRects=function(e,t,n,r){if(!r7)throw Error(i(363));var a=as(e=im(e,t),n,r).disconnect;return{disconnect:function(){a()}}},rt.shouldError=function(){return null},rt.shouldSuspend=function(){return!1},rt.startHostTransition=function(e,t,r,a){if(5!==e.tag)throw Error(i(476));var s=tW(e).queue;tG(e,s,t,r4,null===r?n:function(){var t=tW(e);return null===t.next&&(t=e.alternate.memoizedState),tK(e,t.next.queue,{},ig()),r(a)})},rt.updateContainer=function(e,t,n,i){var r=t.current,a=ig();return i9(r,a,e,t,n,i),a},rt.updateContainerSync=function(e,t,n,i){return i9(t.current,2,e,t,n,i),2},rt},hc.exports.default=hc.exports,Object.defineProperty(hc.exports,"__esModule",{value:!0})),hu.exports=hc.exports),(b=hu.exports)&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default"))?b.default:b,hd={},hp=/^three(?=[A-Z])/,hf=e=>`${e[0].toUpperCase()}${e.slice(1)}`,hm=0;function hg(e){if("function"==typeof e){let t=`${hm++}`;return hd[t]=e,t}Object.assign(hd,e)}function hv(e,t){let n=hf(e),i=hd[n];if("primitive"!==e&&!i)throw Error(`R3F: ${n} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if("primitive"===e&&!t.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw Error("R3F: The args prop must be an array!")}function h_(e){if(e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?c0(e.parent,e):c9(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,c8(e)}}function hy(e,t,n){let i=t.root.getState();if(e.parent||e.object===i.scene){if(!t.object){var r,a;let e=hd[hf(t.type)];t.object=null!=(r=t.props.object)?r:new e(...null!=(a=t.props.args)?a:[]),t.object.__r3f=t}if(c6(t.object,t.props),t.props.attach)c0(e,t);else if(c9(t.object)&&c9(e.object)){let i=e.object.children.indexOf(null==n?void 0:n.object);if(n&&-1!==i){let n=e.object.children.indexOf(t.object);-1!==n?(e.object.children.splice(n,1),e.object.children.splice(n<i?i-1:i,0,t.object)):(t.object.parent=e.object,e.object.children.splice(i,0,t.object),t.object.dispatchEvent({type:"added"}),e.object.dispatchEvent({type:"childadded",child:t.object}))}else e.object.add(t.object)}for(let e of t.children)hy(t,e);c8(t)}}function hx(e,t){t&&(t.parent=e,e.children.push(t),hy(e,t))}function hb(e,t,n){if(!t||!n)return;t.parent=e;let i=e.children.indexOf(n);-1!==i?e.children.splice(i,0,t):e.children.push(t),hy(e,t,n)}function hS(e){if("function"==typeof e.dispose){let t=()=>{try{e.dispose()}catch{}};"u">typeof IS_REACT_ACT_ENVIRONMENT?t():(0,cC.unstable_scheduleCallback)(cC.unstable_IdlePriority,t)}}function hM(e,t,n){if(!t)return;t.parent=null;let i=e.children.indexOf(t);-1!==i&&e.children.splice(i,1),t.props.attach?c1(e,t):c9(t.object)&&c9(e.object)&&(e.object.remove(t.object),function(e,t){let{internal:n}=e.getState();n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,i)=>{(e.eventObject===t||e.object===t)&&n.hovered.delete(i)}),n.capturedMap.forEach((e,i)=>{he(n.capturedMap,t,e,i)})}(cB(t),t.object));let r=null!==t.props.dispose&&!1!==n;for(let e=t.children.length-1;e>=0;e--){let n=t.children[e];hM(t,n,r)}t.children.length=0,delete t.object.__r3f,r&&"primitive"!==t.type&&"Scene"!==t.object.type&&hS(t.object),void 0===n&&c8(t)}let hT=[],hw=()=>{},hE={},hA=0,hC=(S={isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsM
|