@realsee/five 6.8.0-alpha.14 → 6.8.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +7 -6
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +63 -63
- package/docs/classes/five.FivePass.html +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMCustomShader.html +1 -1
- package/docs/classes/five.PBMGSObject.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PBMPanoFilter.html +1 -1
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PBMUpdateable.html +1 -1
- package/docs/classes/five.Parameter.html +1 -1
- package/docs/classes/five.Tile3D.html +1 -1
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.WorkResolvedObserver.html +1 -1
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/five.ParameterValue.html +1 -1
- package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/five.RgbaData.html +4 -4
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkObserver.html +1 -1
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/types/five.ParseOptions.html +1 -1
- package/five/application/five.d.ts +5 -0
- package/five/index.js +31 -77
- package/five/index.mjs +144 -218
- package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +9 -7
- package/five/renderer/tools/render-full-screen.d.ts +1 -1
- package/five/texture/textureData.d.ts +1 -0
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +31 -77
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/five/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 3/
|
|
5
|
-
* Version: 6.8.0-alpha.
|
|
4
|
+
* Generated: 3/12/2026
|
|
5
|
+
* Version: 6.8.0-alpha.16
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -20270,15 +20270,17 @@ void main() {
|
|
|
20270
20270
|
`, textureFragmentShader = `
|
|
20271
20271
|
uniform sampler2D tDiffuse;
|
|
20272
20272
|
uniform float opacity;
|
|
20273
|
+
uniform float scaleY;
|
|
20273
20274
|
varying vec2 vUv;
|
|
20274
20275
|
void main() {
|
|
20275
|
-
vec4 diffuse = texture2D(tDiffuse, vUv);
|
|
20276
|
+
vec4 diffuse = texture2D(tDiffuse, vUv * vec2(1.0, scaleY));
|
|
20276
20277
|
gl_FragColor = vec4(diffuse.rgb, diffuse.a * opacity);
|
|
20277
20278
|
}
|
|
20278
20279
|
`, textureMaterial = new THREE.ShaderMaterial({
|
|
20279
20280
|
uniforms: {
|
|
20280
20281
|
tDiffuse: { value: null },
|
|
20281
|
-
opacity: { value: 1 }
|
|
20282
|
+
opacity: { value: 1 },
|
|
20283
|
+
scaleY: { value: 1 }
|
|
20282
20284
|
},
|
|
20283
20285
|
vertexShader: textureVertexShader,
|
|
20284
20286
|
fragmentShader: textureFragmentShader,
|
|
@@ -20306,8 +20308,93 @@ void main() {
|
|
|
20306
20308
|
depthTest: !1,
|
|
20307
20309
|
depthWrite: !1
|
|
20308
20310
|
}), colorFsQuad = new FullScreenQuad(colorMaterial);
|
|
20309
|
-
function renderFullScreen(n, t, e) {
|
|
20310
|
-
e === void 0 && (e = 1), t instanceof THREE.Texture ? (textureMaterial.uniforms.tDiffuse.value = t, textureMaterial.uniforms.opacity.value = e, textureFsQuad.render(n), textureMaterial.uniforms.tDiffuse.value = null) : (colorMaterial.uniforms.color.value.copy(t), colorMaterial.uniforms.opacity.value =
|
|
20311
|
+
function renderFullScreen(n, t, e, r) {
|
|
20312
|
+
e === void 0 && (e = !1), r === void 0 && (r = 1), t instanceof THREE.Texture ? (textureMaterial.uniforms.tDiffuse.value = t, textureMaterial.uniforms.opacity.value = r, textureMaterial.uniforms.scaleY.value = e ? -1 : 1, textureFsQuad.render(n), textureMaterial.uniforms.tDiffuse.value = null) : (colorMaterial.uniforms.color.value.copy(t), colorMaterial.uniforms.opacity.value = r, colorFsQuad.render(n));
|
|
20313
|
+
}
|
|
20314
|
+
var sharedHistogramRgbaWidth = 256, sharedHistogramRgbaHeight = 128, sharedHistogramRgbaData = {
|
|
20315
|
+
width: sharedHistogramRgbaWidth,
|
|
20316
|
+
height: sharedHistogramRgbaHeight,
|
|
20317
|
+
data: new Uint8ClampedArray(sharedHistogramRgbaWidth * sharedHistogramRgbaHeight * 4)
|
|
20318
|
+
}, histSize = 256, grayHistBuffer = new Uint32Array(histSize);
|
|
20319
|
+
function computeHistogram(n, t) {
|
|
20320
|
+
t === void 0 && (t = { peak: 0, mean: 0, min: 0, max: 0 });
|
|
20321
|
+
for (var e = 0, r = 0, u = 1; u < histSize; u++)
|
|
20322
|
+
grayHistBuffer[u] = 0;
|
|
20323
|
+
for (var u = 0; u < n.length; u++) {
|
|
20324
|
+
var o = n[u], s = o.type === "rgb" ? 3 : 4, l = o.data.length / s;
|
|
20325
|
+
e += l;
|
|
20326
|
+
for (var c = o.data, f = 0; f < l; f++) {
|
|
20327
|
+
var d = f * s, p = c[d], h = c[d + 1], v = c[d + 2], m = Math.round(0.299 * p + 0.587 * h + 0.114 * v);
|
|
20328
|
+
grayHistBuffer[m]++, r += m;
|
|
20329
|
+
}
|
|
20330
|
+
}
|
|
20331
|
+
for (var g = r / e, b = 0, A = 0, u = 1; u < histSize; u++)
|
|
20332
|
+
grayHistBuffer[u] > A && (A = grayHistBuffer[u], b = u);
|
|
20333
|
+
for (var y = 0, u = 0; u < histSize; u++)
|
|
20334
|
+
if (grayHistBuffer[u] !== 0) {
|
|
20335
|
+
y = u;
|
|
20336
|
+
break;
|
|
20337
|
+
}
|
|
20338
|
+
for (var E = histSize - 1, u = E; u >= 0; u--)
|
|
20339
|
+
if (grayHistBuffer[u] !== 0) {
|
|
20340
|
+
E = u;
|
|
20341
|
+
break;
|
|
20342
|
+
}
|
|
20343
|
+
return t.peak = b / (histSize - 1), t.mean = g / 255, t.min = y / (histSize - 1), t.max = E / (histSize - 1), t;
|
|
20344
|
+
}
|
|
20345
|
+
var Histogram = (
|
|
20346
|
+
/** @class */
|
|
20347
|
+
(function() {
|
|
20348
|
+
function n(t, e, r, u) {
|
|
20349
|
+
this.peak = t != null ? t : 0, this.mean = e != null ? e : 0, this.min = r != null ? r : 0, this.max = u != null ? u : 0;
|
|
20350
|
+
}
|
|
20351
|
+
return n.prototype.formPixels = function() {
|
|
20352
|
+
for (var t = [], e = 0; e < arguments.length; e++)
|
|
20353
|
+
t[e] = arguments[e];
|
|
20354
|
+
var r = t.map(function(u) {
|
|
20355
|
+
return {
|
|
20356
|
+
data: u,
|
|
20357
|
+
type: "rgba"
|
|
20358
|
+
};
|
|
20359
|
+
});
|
|
20360
|
+
return computeHistogram(r, this), this;
|
|
20361
|
+
}, n.prototype.toJSON = function() {
|
|
20362
|
+
return {
|
|
20363
|
+
peak: this.peak,
|
|
20364
|
+
mean: this.mean,
|
|
20365
|
+
min: this.min,
|
|
20366
|
+
max: this.max
|
|
20367
|
+
};
|
|
20368
|
+
}, n.prototype.toString = function() {
|
|
20369
|
+
return "".concat(this.peak, " ").concat(this.mean, " ").concat(this.min, " ").concat(this.max);
|
|
20370
|
+
}, n;
|
|
20371
|
+
})()
|
|
20372
|
+
), PI = Math.PI, TAU = PI * 2;
|
|
20373
|
+
function stepNumber(n, t, e) {
|
|
20374
|
+
if (n === t)
|
|
20375
|
+
return t;
|
|
20376
|
+
var r = t - n, u = Math.abs(r);
|
|
20377
|
+
if (u <= e)
|
|
20378
|
+
return t;
|
|
20379
|
+
var o = r > 0 ? 1 : -1;
|
|
20380
|
+
return n + o * e;
|
|
20381
|
+
}
|
|
20382
|
+
function stepVector(n, t, e) {
|
|
20383
|
+
if (n.equals(t))
|
|
20384
|
+
return new THREE.Vector3().copy(t);
|
|
20385
|
+
var r = new THREE.Vector3().subVectors(t, n);
|
|
20386
|
+
return r.lengthSq() < e * e ? r.copy(t) : r.setLength(e).add(n);
|
|
20387
|
+
}
|
|
20388
|
+
function stepCoordinates(n, t, e) {
|
|
20389
|
+
if (n.longitude === t.longitude && n.latitude === t.latitude)
|
|
20390
|
+
return { longitude: t.longitude, latitude: t.latitude };
|
|
20391
|
+
var r = formatRad$1(n.longitude), u = n.latitude, o = formatRad$1(t.longitude), s = t.latitude;
|
|
20392
|
+
o - r > PI ? r += TAU : r - o > PI && (r -= TAU);
|
|
20393
|
+
var l = Math.sqrt(Math.pow(o - r, 2) + Math.pow(s - u, 2)), c = e / l;
|
|
20394
|
+
return c >= 1 ? { longitude: t.longitude, latitude: t.latitude } : {
|
|
20395
|
+
longitude: r + (o - r) * c,
|
|
20396
|
+
latitude: u + (s - u) * c
|
|
20397
|
+
};
|
|
20311
20398
|
}
|
|
20312
20399
|
var luminanceVertexShader = `
|
|
20313
20400
|
varying vec2 vUv;
|
|
@@ -20317,124 +20404,52 @@ void main() {
|
|
|
20317
20404
|
}
|
|
20318
20405
|
`, luminanceFragmentShader = `
|
|
20319
20406
|
uniform sampler2D inputBuffer;
|
|
20320
|
-
uniform float
|
|
20407
|
+
uniform float screenScale;
|
|
20408
|
+
uniform float minValue;
|
|
20409
|
+
uniform float maxValue;
|
|
20321
20410
|
varying vec2 vUv;
|
|
20322
20411
|
|
|
20323
|
-
|
|
20412
|
+
vec3 rgb2yuv(vec3 rgb) {
|
|
20413
|
+
float y = 0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b;
|
|
20414
|
+
float u = (rgb.b - y) * 0.493;
|
|
20415
|
+
float v = (rgb.r - y) * 0.877;
|
|
20416
|
+
return vec3(y, u, v);
|
|
20417
|
+
}
|
|
20324
20418
|
|
|
20419
|
+
vec3 yuv2rgb(vec3 yuv) {
|
|
20420
|
+
float y = yuv.x;
|
|
20421
|
+
float u = yuv.y;
|
|
20422
|
+
float v = yuv.z;
|
|
20423
|
+
float r = y + 1.0 / 0.877 * v;
|
|
20424
|
+
float g = y - 0.39393 * u - 0.58081 * v;
|
|
20425
|
+
float b = y + 1.0 / 0.493 * u;
|
|
20426
|
+
return vec3(r, g, b);
|
|
20427
|
+
}
|
|
20325
20428
|
void main() {
|
|
20326
|
-
|
|
20327
|
-
|
|
20328
|
-
|
|
20329
|
-
|
|
20330
|
-
gl_FragColor = vec4(luminance);
|
|
20429
|
+
vec4 rgba = texture2D(inputBuffer, vUv);
|
|
20430
|
+
vec3 yuv = rgb2yuv(rgba.rgb);
|
|
20431
|
+
yuv.x = clamp((yuv.x - minValue) / (maxValue - minValue), 0.0, 1.0);
|
|
20432
|
+
gl_FragColor = vec4(yuv2rgb(yuv), rgba.a);
|
|
20331
20433
|
}
|
|
20332
20434
|
`, luminanceMaterial = new THREE.ShaderMaterial({
|
|
20333
20435
|
uniforms: {
|
|
20334
20436
|
inputBuffer: { value: null },
|
|
20335
|
-
|
|
20437
|
+
minValue: { value: 0 },
|
|
20438
|
+
maxValue: { value: 1 }
|
|
20336
20439
|
},
|
|
20337
20440
|
vertexShader: luminanceVertexShader,
|
|
20338
20441
|
fragmentShader: luminanceFragmentShader
|
|
20339
20442
|
}), luminanceFsQuid = new FullScreenQuad(luminanceMaterial);
|
|
20340
|
-
function renderLuminance(n, t, e) {
|
|
20341
|
-
luminanceMaterial.uniforms.inputBuffer.value = t, luminanceMaterial.uniforms.
|
|
20342
|
-
}
|
|
20343
|
-
var nextStepVertexShader = `
|
|
20344
|
-
varying vec2 vUv;
|
|
20345
|
-
void main() {
|
|
20346
|
-
vUv = uv;
|
|
20347
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
20348
|
-
}
|
|
20349
|
-
`, nextStepFragmentShader = `
|
|
20350
|
-
uniform sampler2D luminanceBuffer;
|
|
20351
|
-
uniform sampler2D inputBuffer;
|
|
20352
|
-
uniform float step;
|
|
20353
|
-
varying vec2 vUv;
|
|
20354
|
-
void main() {
|
|
20355
|
-
|
|
20356
|
-
#ifdef GL_EXT_shader_texture_lod
|
|
20357
|
-
#if __VERSION__ < 300
|
|
20358
|
-
float target = texture2DLodEXT(luminanceBuffer, vUv, 5.0).r;
|
|
20359
|
-
#else
|
|
20360
|
-
float target = textureLod(luminanceBuffer, vUv, 5.0).r;
|
|
20361
|
-
#endif
|
|
20362
|
-
#else
|
|
20363
|
-
float target = texture2D(luminanceBuffer, vUv).r;
|
|
20364
|
-
#endif
|
|
20365
|
-
float current = texture2D(inputBuffer, vUv).r;
|
|
20366
|
-
|
|
20367
|
-
float result;
|
|
20368
|
-
if (abs(target - current) < step) {
|
|
20369
|
-
result = target;
|
|
20370
|
-
} else if (target - current > 0.0) {
|
|
20371
|
-
result = current + step;
|
|
20372
|
-
} else {
|
|
20373
|
-
result = current - step;
|
|
20374
|
-
}
|
|
20375
|
-
gl_FragColor = vec4(result, result, result, 1.0);
|
|
20376
|
-
}
|
|
20377
|
-
`, nextStepMaterial = new THREE.ShaderMaterial({
|
|
20378
|
-
uniforms: {
|
|
20379
|
-
inputBuffer: { value: null },
|
|
20380
|
-
luminanceBuffer: { value: null },
|
|
20381
|
-
step: { value: 1 }
|
|
20382
|
-
},
|
|
20383
|
-
vertexShader: nextStepVertexShader,
|
|
20384
|
-
fragmentShader: nextStepFragmentShader
|
|
20385
|
-
});
|
|
20386
|
-
nextStepMaterial.extensions.shaderTextureLOD = !0;
|
|
20387
|
-
var nextStepFsQuid = new FullScreenQuad(nextStepMaterial);
|
|
20388
|
-
function renderNextStep(n, t, e, r) {
|
|
20389
|
-
nextStepMaterial.uniforms.inputBuffer.value = t, nextStepMaterial.uniforms.luminanceBuffer.value = e, nextStepMaterial.uniforms.step.value = r, nextStepFsQuid.render(n), nextStepMaterial.uniforms.inputBuffer.value = null, nextStepMaterial.uniforms.luminanceBuffer.value = null;
|
|
20443
|
+
function renderLuminance(n, t, e, r) {
|
|
20444
|
+
luminanceMaterial.uniforms.inputBuffer.value = t, luminanceMaterial.uniforms.minValue.value = e, luminanceMaterial.uniforms.maxValue.value = r, luminanceFsQuid.render(n), luminanceMaterial.uniforms.inputBuffer.value = null;
|
|
20390
20445
|
}
|
|
20391
|
-
var
|
|
20392
|
-
varying vec2 vUv;
|
|
20393
|
-
void main() {
|
|
20394
|
-
vUv = uv;
|
|
20395
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
20396
|
-
}
|
|
20397
|
-
`, adaptiveLuminanceFragmentShader = `
|
|
20398
|
-
#include <common>
|
|
20399
|
-
uniform sampler2D inputBuffer;
|
|
20400
|
-
uniform sampler2D luminanceAdaptiveBuffer;
|
|
20401
|
-
uniform float progress;
|
|
20402
|
-
varying vec2 vUv;
|
|
20403
|
-
|
|
20404
|
-
void main() {
|
|
20405
|
-
float middleGrey = 1.5;
|
|
20406
|
-
float whitePoint = 13.0;
|
|
20407
|
-
float exposure = 1.4;
|
|
20408
|
-
vec4 inputColor = texture2D(inputBuffer, vUv);
|
|
20409
|
-
vec3 rgb = inputColor.rgb * exposure;
|
|
20410
|
-
float alpha = inputColor.a;
|
|
20411
|
-
float luminance = linearToRelativeLuminance(rgb);
|
|
20412
|
-
float lumAvg = texture2D(luminanceAdaptiveBuffer, vec2(0.5)).r;
|
|
20413
|
-
float lumScaled = (luminance * middleGrey) / max(lumAvg, 1e-6);
|
|
20414
|
-
float lumCompressed = lumScaled * (1.0 + lumScaled / (whitePoint * whitePoint));
|
|
20415
|
-
lumCompressed /= (1.0 + lumScaled);
|
|
20416
|
-
rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
|
|
20417
|
-
gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
|
|
20418
|
-
}
|
|
20419
|
-
`, adaptiveLuminanceMaterial = new THREE.ShaderMaterial({
|
|
20420
|
-
uniforms: {
|
|
20421
|
-
inputBuffer: { value: null },
|
|
20422
|
-
luminanceAdaptiveBuffer: { value: null },
|
|
20423
|
-
progress: { value: 1 }
|
|
20424
|
-
},
|
|
20425
|
-
vertexShader: adaptiveLuminanceVertexShader,
|
|
20426
|
-
fragmentShader: adaptiveLuminanceFragmentShader
|
|
20427
|
-
}), adaptiveLuminanceFsQuid = new FullScreenQuad(adaptiveLuminanceMaterial);
|
|
20428
|
-
function renderAdaptiveLuminance(n, t, e, r) {
|
|
20429
|
-
adaptiveLuminanceMaterial.uniforms.inputBuffer.value = t, adaptiveLuminanceMaterial.uniforms.luminanceAdaptiveBuffer.value = e, adaptiveLuminanceMaterial.uniforms.progress.value = r, adaptiveLuminanceFsQuid.render(n), adaptiveLuminanceMaterial.uniforms.inputBuffer.value = null, adaptiveLuminanceMaterial.uniforms.luminanceAdaptiveBuffer.value = null;
|
|
20430
|
-
}
|
|
20431
|
-
var AdaptiveLuminancePass = (
|
|
20446
|
+
var sampleSize = 64, AdaptiveLuminancePass = (
|
|
20432
20447
|
/** @class */
|
|
20433
20448
|
(function(n) {
|
|
20434
20449
|
__extends(t, n);
|
|
20435
20450
|
function t() {
|
|
20436
20451
|
var e = n.call(this) || this;
|
|
20437
|
-
e.
|
|
20452
|
+
e.histogram = new Histogram(), e.minValue = 0, e.maxValue = 1, e.maxMinValue = 0.2, e.minMaxValue = 0.8, e.valueStep = 1 / 255, e.sampleTestScale = 0.8;
|
|
20438
20453
|
var r = e.enabled;
|
|
20439
20454
|
return Object.defineProperty(e, "enabled", {
|
|
20440
20455
|
get: function() {
|
|
@@ -20446,31 +20461,22 @@ var AdaptiveLuminancePass = (
|
|
|
20446
20461
|
}), e;
|
|
20447
20462
|
}
|
|
20448
20463
|
return t.prototype.render = function(e, r, u, o, s) {
|
|
20449
|
-
|
|
20450
|
-
|
|
20451
|
-
minFilter: THREE.LinearMipmapLinearFilter,
|
|
20452
|
-
magFilter: THREE.LinearFilter,
|
|
20453
|
-
stencilBuffer: !1,
|
|
20464
|
+
var l = 4;
|
|
20465
|
+
this.luminanceSampleBuffer || (this.luminanceSampleBuffer = new ArrayBuffer(sampleSize * sampleSize * l)), this.luminanceSampleTarget || (this.luminanceSampleTarget = new THREE.WebGLRenderTarget(sampleSize, sampleSize, {
|
|
20454
20466
|
depthBuffer: !1,
|
|
20455
|
-
format: THREE.RGBAFormat,
|
|
20456
|
-
generateMipmaps: !0
|
|
20457
|
-
})), this.luminanceTargetBuffer.texture.encoding = e.outputEncoding, e.setRenderTarget(this.luminanceTargetBuffer), renderLuminance(e, u.texture, this.luminanceScreenSampleScale), this.luminancePrevBuffer || (this.luminancePrevBuffer = new THREE.WebGLRenderTarget(1, 1, {
|
|
20458
|
-
encoding: e.outputEncoding,
|
|
20459
|
-
minFilter: THREE.NearestFilter,
|
|
20460
|
-
magFilter: THREE.NearestFilter,
|
|
20461
|
-
type: THREE.HalfFloatType,
|
|
20462
|
-
stencilBuffer: !1,
|
|
20463
|
-
depthBuffer: !1
|
|
20464
|
-
})), this.luminancePrevBuffer.texture.encoding = e.outputEncoding, this.luminanceNextBuffer || (this.luminanceNextBuffer = new THREE.WebGLRenderTarget(1, 1, {
|
|
20465
|
-
minFilter: THREE.NearestFilter,
|
|
20466
|
-
magFilter: THREE.NearestFilter,
|
|
20467
|
-
type: THREE.HalfFloatType,
|
|
20468
|
-
encoding: e.outputEncoding,
|
|
20469
20467
|
stencilBuffer: !1,
|
|
20470
|
-
|
|
20471
|
-
|
|
20468
|
+
generateMipmaps: !1,
|
|
20469
|
+
magFilter: THREE.LinearFilter,
|
|
20470
|
+
minFilter: THREE.LinearFilter
|
|
20471
|
+
}));
|
|
20472
|
+
var c = r.width, f = r.height, d = sampleSize / Math.max(c, f), p = Math.floor(c * d), h = Math.floor(f * d);
|
|
20473
|
+
this.luminanceSampleTarget.setSize(p, h), e.setRenderTarget(this.luminanceSampleTarget), renderFullScreen(e, u.texture);
|
|
20474
|
+
var v = Math.floor(p * ((1 - this.sampleTestScale) / 2)), m = Math.floor(h * ((1 - this.sampleTestScale) / 2)), g = Math.floor(p * this.sampleTestScale), b = Math.floor(h * this.sampleTestScale), A = new Uint8ClampedArray(this.luminanceSampleBuffer, 0, g * b * l);
|
|
20475
|
+
e.readRenderTargetPixels(this.luminanceSampleTarget, v, m, g, b, A), this.histogram.formPixels(A);
|
|
20476
|
+
var y = Math.min(this.histogram.min, this.maxMinValue), E = Math.max(this.histogram.max, this.minMaxValue);
|
|
20477
|
+
this.minValue = stepNumber(this.minValue, y, this.valueStep), this.maxValue = stepNumber(this.maxValue, E, this.valueStep), this.renderToScreen ? e.setRenderTarget(null) : (e.setRenderTarget(r), this.clear && e.clear()), renderLuminance(e, u.texture, this.minValue, this.maxValue);
|
|
20472
20478
|
}, t.prototype.clearBuffer = function() {
|
|
20473
|
-
this.
|
|
20479
|
+
this.luminanceSampleTarget && (this.luminanceSampleTarget.dispose(), this.luminanceSampleTarget = void 0), this.luminanceSampleBuffer && (this.luminanceSampleBuffer = void 0), this.minValue = 0, this.maxValue = 1;
|
|
20474
20480
|
}, t.prototype.dispose = function() {
|
|
20475
20481
|
this.clearBuffer();
|
|
20476
20482
|
}, t;
|
|
@@ -21689,64 +21695,6 @@ var Scene = (
|
|
|
21689
21695
|
}), this.needsRender = u, u;
|
|
21690
21696
|
}, t;
|
|
21691
21697
|
})(THREE.Scene)
|
|
21692
|
-
), sharedHistogramRgbaWidth = 256, sharedHistogramRgbaHeight = 128, sharedHistogramRgbaData = {
|
|
21693
|
-
width: sharedHistogramRgbaWidth,
|
|
21694
|
-
height: sharedHistogramRgbaHeight,
|
|
21695
|
-
data: new Uint8ClampedArray(sharedHistogramRgbaWidth * sharedHistogramRgbaHeight * 4)
|
|
21696
|
-
}, histSize = 256, grayHistBuffer = new Uint32Array(histSize);
|
|
21697
|
-
function computeHistogram(n, t) {
|
|
21698
|
-
t === void 0 && (t = { peak: 0, mean: 0, min: 0, max: 0 });
|
|
21699
|
-
for (var e = 0, r = 0, u = 1; u < histSize; u++)
|
|
21700
|
-
grayHistBuffer[u] = 0;
|
|
21701
|
-
for (var u = 0; u < n.length; u++) {
|
|
21702
|
-
var o = n[u], s = o.type === "rgb" ? 3 : 4, l = o.data.length / s;
|
|
21703
|
-
e += l;
|
|
21704
|
-
for (var c = o.data, f = 0; f < l; f++) {
|
|
21705
|
-
var d = f * s, p = c[d], h = c[d + 1], v = c[d + 2], m = Math.round(0.299 * p + 0.587 * h + 0.114 * v);
|
|
21706
|
-
grayHistBuffer[m]++, r += m;
|
|
21707
|
-
}
|
|
21708
|
-
}
|
|
21709
|
-
for (var g = r / e, b = 0, A = 0, u = 1; u < histSize; u++)
|
|
21710
|
-
grayHistBuffer[u] > A && (A = grayHistBuffer[u], b = u);
|
|
21711
|
-
for (var y = 0, u = 0; u < histSize; u++)
|
|
21712
|
-
if (grayHistBuffer[u] !== 0) {
|
|
21713
|
-
y = u;
|
|
21714
|
-
break;
|
|
21715
|
-
}
|
|
21716
|
-
for (var E = histSize - 1, u = E; u >= 0; u--)
|
|
21717
|
-
if (grayHistBuffer[u] !== 0) {
|
|
21718
|
-
E = u;
|
|
21719
|
-
break;
|
|
21720
|
-
}
|
|
21721
|
-
return t.peak = b / (histSize - 1), t.mean = g / 255, t.min = y / (histSize - 1), t.max = E / (histSize - 1), t;
|
|
21722
|
-
}
|
|
21723
|
-
var Histogram = (
|
|
21724
|
-
/** @class */
|
|
21725
|
-
(function() {
|
|
21726
|
-
function n(t, e, r, u) {
|
|
21727
|
-
this.peak = t != null ? t : 0, this.mean = e != null ? e : 0, this.min = r != null ? r : 0, this.max = u != null ? u : 0;
|
|
21728
|
-
}
|
|
21729
|
-
return n.prototype.formPixels = function() {
|
|
21730
|
-
for (var t = [], e = 0; e < arguments.length; e++)
|
|
21731
|
-
t[e] = arguments[e];
|
|
21732
|
-
var r = t.map(function(u) {
|
|
21733
|
-
return {
|
|
21734
|
-
data: u,
|
|
21735
|
-
type: "rgba"
|
|
21736
|
-
};
|
|
21737
|
-
});
|
|
21738
|
-
return computeHistogram(r, this), this;
|
|
21739
|
-
}, n.prototype.toJSON = function() {
|
|
21740
|
-
return {
|
|
21741
|
-
peak: this.peak,
|
|
21742
|
-
mean: this.mean,
|
|
21743
|
-
min: this.min,
|
|
21744
|
-
max: this.max
|
|
21745
|
-
};
|
|
21746
|
-
}, n.prototype.toString = function() {
|
|
21747
|
-
return "".concat(this.peak, " ").concat(this.mean, " ").concat(this.min, " ").concat(this.max);
|
|
21748
|
-
}, n;
|
|
21749
|
-
})()
|
|
21750
21698
|
), easeOut$2 = function(n) {
|
|
21751
21699
|
return n * (2 - n);
|
|
21752
21700
|
}, sharedGeometry2$2 = (function() {
|
|
@@ -22664,33 +22612,6 @@ function isSimilarVector3(n, t) {
|
|
|
22664
22612
|
function notSimilarVector3(n, t) {
|
|
22665
22613
|
return !isSimilarVector3(n, t);
|
|
22666
22614
|
}
|
|
22667
|
-
var PI = Math.PI, TAU = PI * 2;
|
|
22668
|
-
function stepNumber(n, t, e) {
|
|
22669
|
-
if (n === t)
|
|
22670
|
-
return t;
|
|
22671
|
-
var r = t - n, u = Math.abs(r);
|
|
22672
|
-
if (u <= e)
|
|
22673
|
-
return t;
|
|
22674
|
-
var o = r > 0 ? 1 : -1;
|
|
22675
|
-
return n + o * e;
|
|
22676
|
-
}
|
|
22677
|
-
function stepVector(n, t, e) {
|
|
22678
|
-
if (n.equals(t))
|
|
22679
|
-
return new THREE.Vector3().copy(t);
|
|
22680
|
-
var r = new THREE.Vector3().subVectors(t, n);
|
|
22681
|
-
return r.lengthSq() < e * e ? r.copy(t) : r.setLength(e).add(n);
|
|
22682
|
-
}
|
|
22683
|
-
function stepCoordinates(n, t, e) {
|
|
22684
|
-
if (n.longitude === t.longitude && n.latitude === t.latitude)
|
|
22685
|
-
return { longitude: t.longitude, latitude: t.latitude };
|
|
22686
|
-
var r = formatRad$1(n.longitude), u = n.latitude, o = formatRad$1(t.longitude), s = t.latitude;
|
|
22687
|
-
o - r > PI ? r += TAU : r - o > PI && (r -= TAU);
|
|
22688
|
-
var l = Math.sqrt(Math.pow(o - r, 2) + Math.pow(s - u, 2)), c = e / l;
|
|
22689
|
-
return c >= 1 ? { longitude: t.longitude, latitude: t.latitude } : {
|
|
22690
|
-
longitude: r + (o - r) * c,
|
|
22691
|
-
latitude: u + (s - u) * c
|
|
22692
|
-
};
|
|
22693
|
-
}
|
|
22694
22615
|
function isPromise(n) {
|
|
22695
22616
|
return !!n && (typeof n == "object" || typeof n == "function") && typeof n.then == "function";
|
|
22696
22617
|
}
|
|
@@ -29530,7 +29451,7 @@ var circleImageURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYA
|
|
|
29530
29451
|
}
|
|
29531
29452
|
return Object.defineProperty(t, "version", {
|
|
29532
29453
|
get: function() {
|
|
29533
|
-
return "6.8.0-alpha.
|
|
29454
|
+
return "6.8.0-alpha.16";
|
|
29534
29455
|
},
|
|
29535
29456
|
enumerable: !1,
|
|
29536
29457
|
configurable: !0
|
|
@@ -31671,7 +31592,7 @@ var PBMGSRenderMesh = (
|
|
|
31671
31592
|
m.getPixelsRenderTarget = new THREE.WebGLRenderTarget(1, 1, {
|
|
31672
31593
|
encoding: (h = (p = m.renderer) === null || p === void 0 ? void 0 : p.outputEncoding) !== null && h !== void 0 ? h : THREE.sRGBEncoding,
|
|
31673
31594
|
generateMipmaps: !1
|
|
31674
|
-
}), m.viewport = Object.assign({ left: 0, bottom: 0, width: 1, height: 1 }, e.viewport), m.camera = new Camera(DEFAULT_CAMERA_FOV), m.scene = new Scene(), m.xrCustomObjectsScene = new THREE.Scene(), m.scene.add(m.xrCustomObjectsScene), m.scene.matrixAutoUpdate = !1, m.
|
|
31595
|
+
}), m.viewport = Object.assign({ left: 0, bottom: 0, width: 1, height: 1 }, e.viewport), m.camera = new Camera(DEFAULT_CAMERA_FOV), m.scene = new Scene(), m.xrCustomObjectsScene = new THREE.Scene(), m.scene.add(m.xrCustomObjectsScene), m.scene.matrixAutoUpdate = !1, m.requestProxy = (v = e.requestProxy) !== null && v !== void 0 ? v : DEFAULT_REQUEST_PROXY, m.networkSubscribe = new NetworkSubscribe(), m.networkSubscribe.on("network", function(w, B, O, z) {
|
|
31675
31596
|
var k;
|
|
31676
31597
|
m.emit("network.resource", createEvent("network.resource", {
|
|
31677
31598
|
source: w,
|
|
@@ -31714,7 +31635,7 @@ var PBMGSRenderMesh = (
|
|
|
31714
31635
|
};
|
|
31715
31636
|
if (typeof document != "undefined" && document.addEventListener("fullscreenchange", E, !1), m.renderer && m.renderer.domElement.addEventListener("webglcontextrestored", T, !1), m.removeEventListeners = function() {
|
|
31716
31637
|
typeof document != "undefined" && document.removeEventListener("fullscreenchange", E, !1), m.renderer && m.renderer.domElement.removeEventListener("webglcontextrestored", T, !1);
|
|
31717
|
-
}, m.plugins = {}, e.plugins && e.plugins.length)
|
|
31638
|
+
}, m.loadWorkTask = m.prepare(), m.plugins = {}, e.plugins && e.plugins.length)
|
|
31718
31639
|
for (var S = 0, R = e.plugins; S < R.length; S++) {
|
|
31719
31640
|
var M = R[S];
|
|
31720
31641
|
if (typeof M == "function")
|
|
@@ -31731,7 +31652,7 @@ var PBMGSRenderMesh = (
|
|
|
31731
31652
|
}
|
|
31732
31653
|
return Object.defineProperty(t, "version", {
|
|
31733
31654
|
get: function() {
|
|
31734
|
-
return "6.8.0-alpha.
|
|
31655
|
+
return "6.8.0-alpha.16";
|
|
31735
31656
|
},
|
|
31736
31657
|
enumerable: !1,
|
|
31737
31658
|
configurable: !0
|
|
@@ -31774,7 +31695,12 @@ var PBMGSRenderMesh = (
|
|
|
31774
31695
|
},
|
|
31775
31696
|
enumerable: !1,
|
|
31776
31697
|
configurable: !0
|
|
31777
|
-
}), t.prototype.
|
|
31698
|
+
}), t.prototype.prepare = function() {
|
|
31699
|
+
return Promise.all([
|
|
31700
|
+
// 图片支持度检测
|
|
31701
|
+
imageSupport().catch(noop)
|
|
31702
|
+
]).then(noop);
|
|
31703
|
+
}, t.prototype.dispose = function() {
|
|
31778
31704
|
var e;
|
|
31779
31705
|
if (this.destroyed !== !0) {
|
|
31780
31706
|
delete Five_Instances[this.fiveId], this.emit("dispose"), this.destroyed = !0, this.pause(), this.stopAnimationLoop && (this.stopAnimationLoop(), this.stopAnimationLoop = void 0), this.off(), this.networkSubscribe.off(), this.controller && (this.controller.destroy(), this.controller = void 0);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { FivePass } from './pass';
|
|
3
3
|
export declare class AdaptiveLuminancePass extends FivePass {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private
|
|
4
|
+
maxMinValue: number;
|
|
5
|
+
minMaxValue: number;
|
|
6
|
+
valueStep: number;
|
|
7
|
+
sampleTestScale: number;
|
|
8
|
+
private histogram;
|
|
9
|
+
private minValue;
|
|
10
|
+
private maxValue;
|
|
11
|
+
private luminanceSampleTarget?;
|
|
12
|
+
private luminanceSampleBuffer?;
|
|
11
13
|
constructor();
|
|
12
14
|
render(renderer: THREE.WebGLRenderer, writeBuffer: THREE.WebGLRenderTarget, readBuffer: THREE.WebGLRenderTarget, deltaTime: number, maskActive?: boolean): void;
|
|
13
15
|
clearBuffer(): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
export declare function renderFullScreen(renderer: THREE.WebGLRenderer, source: THREE.Texture | THREE.Color, opacity?: number): void;
|
|
2
|
+
export declare function renderFullScreen(renderer: THREE.WebGLRenderer, source: THREE.Texture | THREE.Color, flipY?: boolean, opacity?: number): void;
|
|
@@ -8,3 +8,4 @@ export interface RgbaData {
|
|
|
8
8
|
data: Uint8ClampedArray<ArrayBuffer>;
|
|
9
9
|
}
|
|
10
10
|
export declare function getRgbaDataFromCubeTexture(renderer: THREE.WebGLRenderer, cubemap: THREE.CubeTexture, flipY: boolean, rgbaData: RgbaData): RgbaData;
|
|
11
|
+
export declare function getRgbaDataFromTexture(renderer: THREE.WebGLRenderer, map: THREE.Texture, flipY: boolean, rgbaData: RgbaData): RgbaData;
|
package/gltf-loader/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 3/
|
|
5
|
-
* Version: 6.8.0-alpha.
|
|
4
|
+
* Generated: 3/12/2026
|
|
5
|
+
* Version: 6.8.0-alpha.16
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -258,4 +258,4 @@
|
|
|
258
258
|
`),a=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
|
|
259
259
|
`),i=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join(`
|
|
260
260
|
`),s={specular:{value:new c.Color().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(o){for(var l in s)o.uniforms[l]=s[l];o.fragmentShader=o.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),o.fragmentShader=o.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),o.fragmentShader=o.fragmentShader.replace("#include <roughnessmap_pars_fragment>",r),o.fragmentShader=o.fragmentShader.replace("#include <metalnessmap_pars_fragment>",n),o.fragmentShader=o.fragmentShader.replace("#include <roughnessmap_fragment>",t),o.fragmentShader=o.fragmentShader.replace("#include <metalnessmap_fragment>",a),o.fragmentShader=o.fragmentShader.replace("#include <lights_physical_fragment>",i)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(o){s.specular.value=o}},specularMap:{get:function(){return s.specularMap.value},set:function(o){s.specularMap.value=o}},glossiness:{get:function(){return s.glossiness.value},set:function(o){s.glossiness.value=o}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(o){s.glossinessMap.value=o,o?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}b.prototype=Object.create(c.MeshStandardMaterial.prototype),b.prototype.constructor=b,b.prototype.copy=function(e){return c.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this};function j(){return{name:u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return b},extendParams:function(e,r,n){var t=r.extensions[this.name];e.color=new c.Color(1,1,1),e.opacity=1;var a=[];if(Array.isArray(t.diffuseFactor)){var i=t.diffuseFactor;e.color.fromArray(i),e.opacity=i[3]}if(t.diffuseTexture!==void 0&&a.push(n.assignTexture(e,"map",t.diffuseTexture)),e.emissive=new c.Color(0,0,0),e.glossiness=t.glossinessFactor!==void 0?t.glossinessFactor:1,e.specular=new c.Color(1,1,1),Array.isArray(t.specularFactor)&&e.specular.fromArray(t.specularFactor),t.specularGlossinessTexture!==void 0){var s=t.specularGlossinessTexture;a.push(n.assignTexture(e,"glossinessMap",s)),a.push(n.assignTexture(e,"specularMap",s))}return Promise.all(a)},createMaterial:function(e){var r=new b(e);return r.fog=!0,r.color=e.color,r.map=e.map===void 0?null:e.map,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=e.aoMap===void 0?null:e.aoMap,r.aoMapIntensity=1,r.emissive=e.emissive,r.emissiveIntensity=1,r.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,r.bumpMap=e.bumpMap===void 0?null:e.bumpMap,r.bumpScale=1,r.normalMap=e.normalMap===void 0?null:e.normalMap,r.normalMapType=c.TangentSpaceNormalMap,e.normalScale&&(r.normalScale=e.normalScale),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.specularMap=e.specularMap===void 0?null:e.specularMap,r.specular=e.specular,r.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,r.glossiness=e.glossiness,r.alphaMap=null,r.envMap=e.envMap===void 0?null:e.envMap,r.envMapIntensity=1,r.refractionRatio=.98,r}}}function te(){this.name=u.KHR_MESH_QUANTIZATION}function P(e,r,n,t){c.Interpolant.call(this,e,r,n,t)}P.prototype=Object.create(c.Interpolant.prototype),P.prototype.constructor=P,P.prototype.copySampleValue_=function(e){for(var r=this.resultBuffer,n=this.sampleValues,t=this.valueSize,a=e*t*3+t,i=0;i!==t;i++)r[i]=n[a+i];return r},P.prototype.beforeStart_=P.prototype.copySampleValue_,P.prototype.afterEnd_=P.prototype.copySampleValue_,P.prototype.interpolate_=function(e,r,n,t){for(var a=this.resultBuffer,i=this.sampleValues,s=this.valueSize,o=s*2,l=s*3,f=t-r,v=(n-r)/f,d=v*v,h=d*v,S=e*l,L=S-l,E=-2*h+3*d,y=h-d,R=1-E,F=y-d+v,H=0;H!==s;H++){var ne=i[L+H+s],ae=i[L+H+o]*f,ee=i[S+H+s],K=i[S+H]*f;a[H]=R*ne+F*ae+E*ee+y*K}return a};function Q(e){this.parser=e,this.name=u.REALSEE_MATERIALS_LIGHTMAP}Q.prototype.getMaterialType=function(e){return c.MeshPhongMaterial},Q.prototype.extendParams=function(e,r,n){if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var t=[],a=r.extensions[this.name];return a.lightMapTexture!==void 0&&t.push(n.assignTexture(e,"lightMap",a.lightMapTexture)),a.lightMapIntensity!==void 0&&(e.lightMapIntensity=a.lightMapIntensity),Promise.all(t)};var B={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Z={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},$={9728:c.NearestFilter,9729:c.LinearFilter,9984:c.NearestMipmapNearestFilter,9985:c.LinearMipmapNearestFilter,9986:c.NearestMipmapLinearFilter,9987:c.LinearMipmapLinearFilter},z={33071:c.ClampToEdgeWrapping,33648:c.MirroredRepeatWrapping,10497:c.RepeatWrapping},W={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},le={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},V={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Ae={CUBICSPLINE:void 0,LINEAR:c.InterpolateLinear,STEP:c.InterpolateDiscrete},ce={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},pe={"image/png":c.RGBAFormat,"image/jpeg":c.RGBFormat};function he(e,r){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(r)&&/^\//.test(e)&&(r=r.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:r+e)}function Se(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new c.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:c.FrontSide})),e.DefaultMaterial}function oe(e,r,n){for(var t in n.extensions)e[t]===void 0&&(r.userData.gltfExtensions=r.userData.gltfExtensions||{},r.userData.gltfExtensions[t]=n.extensions[t])}function Y(e,r){r.extras!==void 0&&(typeof r.extras=="object"?Object.assign(e.userData,r.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+r.extras))}function ye(e,r,n){for(var t=!1,a=!1,i=0,s=r.length;i<s;i++){var o=r[i];if(o.POSITION!==void 0&&(t=!0),o.NORMAL!==void 0&&(a=!0),t&&a)break}if(!t&&!a)return Promise.resolve(e);for(var l=[],f=[],i=0,s=r.length;i<s;i++){var o=r[i];if(t){var v=o.POSITION!==void 0?n.getDependency("accessor",o.POSITION):e.attributes.position;l.push(v)}if(a){var v=o.NORMAL!==void 0?n.getDependency("accessor",o.NORMAL):e.attributes.normal;f.push(v)}}return Promise.all([Promise.all(l),Promise.all(f)]).then(function(d){var h=d[0],S=d[1];return t&&(e.morphAttributes.position=h),a&&(e.morphAttributes.normal=S),e.morphTargetsRelative=!0,e})}function Ee(e,r){if(e.updateMorphTargets(),r.weights!==void 0)for(var n=0,t=r.weights.length;n<t;n++)e.morphTargetInfluences[n]=r.weights[n];if(r.extras&&Array.isArray(r.extras.targetNames)){var a=r.extras.targetNames;if(e.morphTargetInfluences.length===a.length){e.morphTargetDictionary={};for(var n=0,t=a.length;n<t;n++)e.morphTargetDictionary[a[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function G(e){var r=e.extensions&&e.extensions[u.KHR_DRACO_MESH_COMPRESSION],n;return r?n="draco:"+r.bufferView+":"+r.indices+":"+q(r.attributes):n=e.indices+":"+q(e.attributes)+":"+e.mode,n}function q(e){for(var r="",n=Object.keys(e).sort(),t=0,a=n.length;t<a;t++)r+=n[t]+":"+e[n[t]]+";";return r}function O(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new g,this.associations=new Map,this.primitiveCache={},this.textureLoader=new c.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new c.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}O.prototype.parse=function(e,r){var n=this,t=this.json,a=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(i){var s={scene:i[0][t.scene||0],scenes:i[0],animations:i[1],cameras:i[2],asset:t.asset,parser:n,userData:{}};oe(a,s,t),Y(s,t),e(s)}).catch(r)},O.prototype.markDefs=function(){for(var e=this.json.nodes||[],r=this.json.skins||[],n=this.json.meshes||[],t={},a={},i=0,s=r.length;i<s;i++)for(var o=r[i].joints,l=0,f=o.length;l<f;l++)e[o[l]].isBone=!0;for(var v=0,d=e.length;v<d;v++){var h=e[v];h.mesh!==void 0&&(t[h.mesh]===void 0&&(t[h.mesh]=a[h.mesh]=0),t[h.mesh]++,h.skin!==void 0&&(n[h.mesh].isSkinnedMesh=!0))}this.json.meshReferences=t,this.json.meshUses=a},O.prototype.getDependency=function(e,r){var n=e+":"+r,t=this.cache.get(n);if(!t){switch(e){case"scene":t=this.loadScene(r);break;case"node":t=this.loadNode(r);break;case"mesh":t=this.loadMesh(r);break;case"accessor":t=this.loadAccessor(r);break;case"bufferView":t=this.loadBufferView(r);break;case"buffer":t=this.loadBuffer(r);break;case"material":t=this.loadMaterial(r);break;case"texture":t=this.loadTexture(r);break;case"skin":t=this.loadSkin(r);break;case"animation":t=this.loadAnimation(r);break;case"camera":t=this.loadCamera(r);break;case"light":t=this.extensions[u.KHR_LIGHTS_PUNCTUAL].loadLight(r);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,t)}return t},O.prototype.getDependencies=function(e){var r=this.cache.get(e);if(!r){var n=this,t=this.json[e+(e==="mesh"?"es":"s")]||[];r=Promise.all(t.map(function(a,i){return n.getDependency(e,i)})),this.cache.add(e,r)}return r},O.prototype.loadBuffer=function(e){var r=this.json.buffers[e],n=this.fileLoader;if(r.type&&r.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+r.type+" buffer type is not supported.");if(r.uri===void 0&&e===0)return Promise.resolve(this.extensions[u.KHR_BINARY_GLTF].body);var t=this.options;return new Promise(function(a,i){n.load(he(r.uri,t.path),a,void 0,function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+r.uri+'".'))})})},O.prototype.loadBufferView=function(e){var r=this.json.bufferViews[e];return this.getDependency("buffer",r.buffer).then(function(n){var t=r.byteLength||0,a=r.byteOffset||0;return n.slice(a,a+t)})},O.prototype.loadAccessor=function(e){var r=this,n=this.json,t=this.json.accessors[e];if(t.bufferView===void 0&&t.sparse===void 0)return Promise.resolve(null);var a=[];return t.bufferView!==void 0?a.push(this.getDependency("bufferView",t.bufferView)):a.push(null),t.sparse!==void 0&&(a.push(this.getDependency("bufferView",t.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",t.sparse.values.bufferView))),Promise.all(a).then(function(i){var s=i[0],o=W[t.type],l=Z[t.componentType],f=l.BYTES_PER_ELEMENT,v=f*o,d=t.byteOffset||0,h=t.bufferView!==void 0?n.bufferViews[t.bufferView].byteStride:void 0,S=t.normalized===!0,L,E;if(h&&h!==v){var y=Math.floor(d/h),R="InterleavedBuffer:"+t.bufferView+":"+t.componentType+":"+y+":"+t.count,F=r.cache.get(R);F||(L=new l(s,y*h,t.count*h/f),F=new c.InterleavedBuffer(L,h/f),r.cache.add(R,F)),E=new c.InterleavedBufferAttribute(F,o,d%h/f,S)}else s===null?L=new l(t.count*o):L=new l(s,d,t.count*o),E=new c.BufferAttribute(L,o,S);if(t.sparse!==void 0){var H=W.SCALAR,ne=Z[t.sparse.indices.componentType],ae=t.sparse.indices.byteOffset||0,ee=t.sparse.values.byteOffset||0,K=new ne(i[1],ae,t.sparse.count*H),ue=new l(i[2],ee,t.sparse.count*o);s!==null&&(E=new c.BufferAttribute(E.array.slice(),E.itemSize,E.normalized));for(var N=0,Le=K.length;N<Le;N++){var se=K[N];if(E.setX(se,ue[N*o]),o>=2&&E.setY(se,ue[N*o+1]),o>=3&&E.setZ(se,ue[N*o+2]),o>=4&&E.setW(se,ue[N*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return E})},O.prototype.loadTexture=function(e){var r=this,n=this.json,t=this.options,a=this.textureLoader,i=self.URL||self.webkitURL,s=n.textures[e],o=s.extensions||{},l;o[u.MSFT_TEXTURE_DDS]?l=n.images[o[u.MSFT_TEXTURE_DDS].source]:l=n.images[s.source];var f=l.uri,v=!1;return l.bufferView!==void 0&&(f=r.getDependency("bufferView",l.bufferView).then(function(d){v=!0;var h=new Blob([d],{type:l.mimeType});return f=i.createObjectURL(h),f})),Promise.resolve(f).then(function(d){var h=t.manager.getHandler(d);return h||(h=o[u.MSFT_TEXTURE_DDS]?r.extensions[u.MSFT_TEXTURE_DDS].ddsLoader:a),new Promise(function(S,L){h.load(he(d,t.path),S,void 0,L)})}).then(function(d){v===!0&&i.revokeObjectURL(f),d.flipY=!1,s.name&&(d.name=s.name),l.mimeType in pe&&(d.format=pe[l.mimeType]);var h=n.samplers||{},S=h[s.sampler]||{};return d.magFilter=$[S.magFilter]||c.LinearFilter,d.minFilter=$[S.minFilter]||c.LinearMipmapLinearFilter,d.wrapS=z[S.wrapS]||c.RepeatWrapping,d.wrapT=z[S.wrapT]||c.RepeatWrapping,r.associations.set(d,{type:"textures",index:e}),d})},O.prototype.assignTexture=function(e,r,n){var t=this;return this.getDependency("texture",n.index).then(function(a){if(!a.isCompressedTexture)switch(r){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=c.RGBFormat;break}if(n.texCoord!==void 0&&n.texCoord!=0&&!(r==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+r+" not yet supported."),t.extensions[u.KHR_TEXTURE_TRANSFORM]){var i=n.extensions!==void 0?n.extensions[u.KHR_TEXTURE_TRANSFORM]:void 0;if(i){var s=t.associations.get(a);a=t.extensions[u.KHR_TEXTURE_TRANSFORM].extendTexture(a,i),t.associations.set(a,s)}}e[r]=a})},O.prototype.assignFinalMaterial=function(e){var r=e.geometry,n=e.material,t=r.attributes.tangent!==void 0,a=r.attributes.color!==void 0,i=r.attributes.normal===void 0,s=e.isSkinnedMesh===!0,o=Object.keys(r.morphAttributes).length>0,l=o&&r.morphAttributes.normal!==void 0;if(e.isPoints){var f="PointsMaterial:"+n.uuid,v=this.cache.get(f);v||(v=new c.PointsMaterial,c.Material.prototype.copy.call(v,n),v.color.copy(n.color),v.map=n.map,v.sizeAttenuation=!1,this.cache.add(f,v)),n=v}else if(e.isLine){var f="LineBasicMaterial:"+n.uuid,d=this.cache.get(f);d||(d=new c.LineBasicMaterial,c.Material.prototype.copy.call(d,n),d.color.copy(n.color),this.cache.add(f,d)),n=d}if(t||a||i||s||o){var f="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(f+="specular-glossiness:"),s&&(f+="skinning:"),t&&(f+="vertex-tangents:"),a&&(f+="vertex-colors:"),i&&(f+="flat-shading:"),o&&(f+="morph-targets:"),l&&(f+="morph-normals:");var h=this.cache.get(f);h||(h=n.clone(),s&&(h.skinning=!0),t&&(h.vertexTangents=!0),a&&(h.vertexColors=!0),i&&(h.flatShading=!0),o&&(h.morphTargets=!0),l&&(h.morphNormals=!0),this.cache.add(f,h),this.associations.set(h,this.associations.get(n))),n=h}n.aoMap&&r.attributes.uv2===void 0&&r.attributes.uv!==void 0&&r.setAttribute("uv2",r.attributes.uv),n.normalScale&&!t&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!t&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},O.prototype.loadMaterial=function(e){var r=this,n=this.json,t=this.extensions,a=n.materials[e],i,s={},o=a.extensions||{},l=[];if(o[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var f=t[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];i=f.getMaterialType(),l.push(f.extendParams(s,a,r))}else if(o[u.KHR_MATERIALS_UNLIT]){var v=t[u.KHR_MATERIALS_UNLIT];i=v.getMaterialType(),l.push(v.extendParams(s,a,r))}else{i=c.MeshStandardMaterial;var d=a.pbrMetallicRoughness||{};if(s.color=new c.Color(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){var h=d.baseColorFactor;s.color.fromArray(h),s.opacity=h[3]}d.baseColorTexture!==void 0&&l.push(r.assignTexture(s,"map",d.baseColorTexture)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(l.push(r.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),l.push(r.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture)))}a.doubleSided===!0&&(s.side=c.DoubleSide);var S=a.alphaMode||ce.OPAQUE;if(S===ce.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,S===ce.MASK&&(s.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&i!==c.MeshBasicMaterial&&(l.push(r.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new c.Vector2(1,1),a.normalTexture.scale!==void 0&&s.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),a.occlusionTexture!==void 0&&i!==c.MeshBasicMaterial&&(l.push(r.assignTexture(s,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&i!==c.MeshBasicMaterial&&(s.emissive=new c.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&i!==c.MeshBasicMaterial&&l.push(r.assignTexture(s,"emissiveMap",a.emissiveTexture)),o[u.KHR_MATERIALS_CLEARCOAT]){var L=t[u.KHR_MATERIALS_CLEARCOAT];i=L.getMaterialType(),l.push(L.extendParams(s,{extensions:o},r))}if(o[u.KHR_MATERIALS_TRANSMISSION]){var L=t[u.KHR_MATERIALS_TRANSMISSION];i=L.getMaterialType(),l.push(L.extendParams(s,{extensions:o},r))}if(o[u.REALSEE_MATERIALS_LIGHTMAP]){var E=t[u.REALSEE_MATERIALS_LIGHTMAP];i=E.getMaterialType(),l.push(E.extendParams(s,{extensions:o},r))}return Promise.all(l).then(function(){var y;return i===b?y=t[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):y=new i(s),a.name&&(y.name=a.name),y.map&&(y.map.encoding=c.sRGBEncoding),y.emissiveMap&&(y.emissiveMap.encoding=c.sRGBEncoding),Y(y,a),r.associations.set(y,{type:"materials",index:e}),a.extensions&&oe(t,y,a),y})};function ve(e,r,n){var t=r.attributes,a=new c.Box3;if(t.POSITION!==void 0){var i=n.json.accessors[t.POSITION],s=i.min,o=i.max;if(s!==void 0&&o!==void 0)a.set(new c.Vector3(s[0],s[1],s[2]),new c.Vector3(o[0],o[1],o[2]));else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;var l=r.targets;if(l!==void 0){for(var f=new c.Vector3,v=new c.Vector3,d=0,h=l.length;d<h;d++){var S=l[d];if(S.POSITION!==void 0){var i=n.json.accessors[S.POSITION],s=i.min,o=i.max;s!==void 0&&o!==void 0?(v.setX(Math.max(Math.abs(s[0]),Math.abs(o[0]))),v.setY(Math.max(Math.abs(s[1]),Math.abs(o[1]))),v.setZ(Math.max(Math.abs(s[2]),Math.abs(o[2]))),f.max(v)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(f)}e.boundingBox=a;var L=new c.Sphere;a.getCenter(L.center),L.radius=a.min.distanceTo(a.max)/2,e.boundingSphere=L}function X(e,r,n){var t=r.attributes,a=[];function i(f,v){return n.getDependency("accessor",f).then(function(d){e.setAttribute(v,d)})}for(var s in t){var o=le[s]||s.toLowerCase();o in e.attributes||a.push(i(t[s],o))}if(r.indices!==void 0&&!e.index){var l=n.getDependency("accessor",r.indices).then(function(f){e.setIndex(f)});a.push(l)}return Y(e,r),ve(e,r,n),Promise.all(a).then(function(){return r.targets!==void 0?ye(e,r.targets,n):e})}function ie(e,r){var n=e.getIndex();if(n===null){var t=[],a=e.getAttribute("position");if(a!==void 0){for(var i=0;i<a.count;i++)t.push(i);e.setIndex(t),n=e.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e}var s=n.count-2,o=[];if(r===c.TriangleFanDrawMode)for(var i=1;i<=s;i++)o.push(n.getX(0)),o.push(n.getX(i)),o.push(n.getX(i+1));else for(var i=0;i<s;i++)i%2===0?(o.push(n.getX(i)),o.push(n.getX(i+1)),o.push(n.getX(i+2))):(o.push(n.getX(i+2)),o.push(n.getX(i+1)),o.push(n.getX(i)));o.length/3!==s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var l=e.clone();return l.setIndex(o),l}return O.prototype.loadGeometries=function(e){var r=this,n=this.extensions,t=this.primitiveCache;function a(h){return n[u.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(h,r).then(function(S){return X(S,h,r)})}for(var i=[],s=0,o=e.length;s<o;s++){var l=e[s],f=G(l),v=t[f];if(v)i.push(v.promise);else{var d;l.extensions&&l.extensions[u.KHR_DRACO_MESH_COMPRESSION]?d=a(l):d=X(new c.BufferGeometry,l,r),t[f]={primitive:l,promise:d},i.push(d)}}return Promise.all(i)},O.prototype.loadMesh=function(e){for(var r=this,n=this.json,t=n.meshes[e],a=t.primitives,i=[],s=0,o=a.length;s<o;s++){var l=a[s].material===void 0?Se(this.cache):this.getDependency("material",a[s].material);i.push(l)}return i.push(r.loadGeometries(a)),Promise.all(i).then(function(f){for(var v=f.slice(0,f.length-1),d=f[f.length-1],h=[],S=0,L=d.length;S<L;S++){var E=d[S],y=a[S],R,F=v[S];if(y.mode===B.TRIANGLES||y.mode===B.TRIANGLE_STRIP||y.mode===B.TRIANGLE_FAN||y.mode===void 0)R=t.isSkinnedMesh===!0?new c.SkinnedMesh(E,F):new c.Mesh(E,F),R.isSkinnedMesh===!0&&!R.geometry.attributes.skinWeight.normalized&&R.normalizeSkinWeights(),y.mode===B.TRIANGLE_STRIP?R.geometry=ie(R.geometry,c.TriangleStripDrawMode):y.mode===B.TRIANGLE_FAN&&(R.geometry=ie(R.geometry,c.TriangleFanDrawMode));else if(y.mode===B.LINES)R=new c.LineSegments(E,F);else if(y.mode===B.LINE_STRIP)R=new c.Line(E,F);else if(y.mode===B.LINE_LOOP)R=new c.LineLoop(E,F);else if(y.mode===B.POINTS)R=new c.Points(E,F);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+y.mode);Object.keys(R.geometry.morphAttributes).length>0&&Ee(R,t),R.name=t.name||"mesh_"+e,d.length>1&&(R.name+="_"+S),Y(R,t),r.assignFinalMaterial(R),h.push(R)}if(h.length===1)return h[0];for(var H=new c.Group,S=0,L=h.length;S<L;S++)H.add(h[S]);return H})},O.prototype.loadCamera=function(e){var r,n=this.json.cameras[e],t=n[n.type];if(!t){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?r=new c.PerspectiveCamera(c.MathUtils.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):n.type==="orthographic"&&(r=new c.OrthographicCamera(-t.xmag,t.xmag,t.ymag,-t.ymag,t.znear,t.zfar)),n.name&&(r.name=n.name),Y(r,n),Promise.resolve(r)},O.prototype.loadSkin=function(e){var r=this.json.skins[e],n={joints:r.joints};return r.inverseBindMatrices===void 0?Promise.resolve(n):this.getDependency("accessor",r.inverseBindMatrices).then(function(t){return n.inverseBindMatrices=t,n})},O.prototype.loadAnimation=function(e){for(var r=this.json,n=r.animations[e],t=[],a=[],i=[],s=[],o=[],l=0,f=n.channels.length;l<f;l++){var v=n.channels[l],d=n.samplers[v.sampler],h=v.target,S=h.node!==void 0?h.node:h.id,L=n.parameters!==void 0?n.parameters[d.input]:d.input,E=n.parameters!==void 0?n.parameters[d.output]:d.output;t.push(this.getDependency("node",S)),a.push(this.getDependency("accessor",L)),i.push(this.getDependency("accessor",E)),s.push(d),o.push(h)}return Promise.all([Promise.all(t),Promise.all(a),Promise.all(i),Promise.all(s),Promise.all(o)]).then(function(y){for(var R=y[0],F=y[1],H=y[2],ne=y[3],ae=y[4],ee=[],K=0,ue=R.length;K<ue;K++){var N=R[K],Le=F[K],se=H[K],Me=ne[K],_e=ae[K];if(N!==void 0){N.updateMatrix(),N.matrixAutoUpdate=!0;var ge;switch(V[_e.path]){case V.weights:ge=c.NumberKeyframeTrack;break;case V.rotation:ge=c.QuaternionKeyframeTrack;break;case V.position:case V.scale:default:ge=c.VectorKeyframeTrack;break}var De=N.name?N.name:N.uuid,Pe=Me.interpolation!==void 0?Ae[Me.interpolation]:c.InterpolateLinear,Te=[];V[_e.path]===V.weights?N.traverse(function(de){de.isMesh===!0&&de.morphTargetInfluences&&Te.push(de.name?de.name:de.uuid)}):Te.push(De);var J=se.array;if(se.normalized){var fe;if(J.constructor===Int8Array)fe=1/127;else if(J.constructor===Uint8Array)fe=1/255;else if(J.constructor==Int16Array)fe=1/32767;else if(J.constructor===Uint16Array)fe=1/65535;else throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");for(var Ce=new Float32Array(J.length),re=0,Re=J.length;re<Re;re++)Ce[re]=J[re]*fe;J=Ce}for(var re=0,Re=Te.length;re<Re;re++){var we=new ge(Te[re]+"."+V[_e.path],Le.array,J,Pe);Me.interpolation==="CUBICSPLINE"&&(we.createInterpolant=function(Ge){return new P(this.times,this.values,this.getValueSize()/3,Ge)},we.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),ee.push(we)}}}var Ue=n.name?n.name:"animation_"+e;return new c.AnimationClip(Ue,void 0,ee)})},O.prototype.loadNode=function(e){var r=this.json,n=this.extensions,t=this,a=r.meshReferences,i=r.meshUses,s=r.nodes[e];return(function(){var o=[];return s.mesh!==void 0&&o.push(t.getDependency("mesh",s.mesh).then(function(l){var f;if(a[s.mesh]>1){var v=i[s.mesh]++;f=l.clone(),f.name+="_instance_"+v}else f=l;return s.weights!==void 0&&f.traverse(function(d){if(d.isMesh)for(var h=0,S=s.weights.length;h<S;h++)d.morphTargetInfluences[h]=s.weights[h]}),f})),s.camera!==void 0&&o.push(t.getDependency("camera",s.camera)),s.extensions&&s.extensions[u.KHR_LIGHTS_PUNCTUAL]&&s.extensions[u.KHR_LIGHTS_PUNCTUAL].light!==void 0&&o.push(t.getDependency("light",s.extensions[u.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(o)})().then(function(o){var l;if(s.isBone===!0?l=new c.Bone:o.length>1?l=new c.Group:o.length===1?l=o[0]:l=new c.Object3D,l!==o[0])for(var f=0,v=o.length;f<v;f++)l.add(o[f]);if(s.name&&(l.userData.name=s.name,l.name=c.PropertyBinding.sanitizeNodeName(s.name)),Y(l,s),s.extensions&&oe(n,l,s),s.matrix!==void 0){var d=new c.Matrix4;d.fromArray(s.matrix),l.applyMatrix4(d)}else s.translation!==void 0&&l.position.fromArray(s.translation),s.rotation!==void 0&&l.quaternion.fromArray(s.rotation),s.scale!==void 0&&l.scale.fromArray(s.scale);return t.associations.set(l,{type:"nodes",index:e}),l})},O.prototype.loadScene=(function(){function e(r,n,t,a){var i=t.nodes[r];return a.getDependency("node",r).then(function(s){if(i.skin===void 0)return s;var o;return a.getDependency("skin",i.skin).then(function(l){o=l;for(var f=[],v=0,d=o.joints.length;v<d;v++)f.push(a.getDependency("node",o.joints[v]));return Promise.all(f)}).then(function(l){return s.traverse(function(f){if(f.isMesh){for(var v=[],d=[],h=0,S=l.length;h<S;h++){var L=l[h];if(L){v.push(L);var E=new c.Matrix4;o.inverseBindMatrices!==void 0&&E.fromArray(o.inverseBindMatrices.array,h*16),d.push(E)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}f.bind(new c.Skeleton(v,d),f.matrixWorld)}}),s})}).then(function(s){n.add(s);var o=[];if(i.children)for(var l=i.children,f=0,v=l.length;f<v;f++){var d=l[f];o.push(e(d,s,t,a))}return Promise.all(o)})}return function(n){var t=this.json,a=this.extensions,i=this.json.scenes[n],s=this,o=new c.Group;i.name&&(o.name=i.name),Y(o,i),i.extensions&&oe(a,o,i);for(var l=i.nodes||[],f=[],v=0,d=l.length;v<d;v++)f.push(e(l[v],o,t,s));return Promise.all(f).then(function(){return o})}})(),p})(),k=function(p){c.Loader.call(this,p),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};k.prototype=Object.assign(Object.create(c.Loader.prototype),{constructor:k,setDecoderPath:function(p){return this.decoderPath=p,this},setDecoderConfig:function(p){return this.decoderConfig=p,this},setWorkerLimit:function(p){return this.workerLimit=p,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(p,g,u,m){var T=new c.FileLoader(this.manager);T.setPath(this.path),T.setResponseType("arraybuffer"),this.crossOrigin==="use-credentials"&&T.setWithCredentials(!0),T.load(p,A=>{var M={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(A,M).then(g).catch(m)},u,m)},decodeDracoFile:function(p,g,u,m){var T={attributeIDs:u||this.defaultAttributeIDs,attributeTypes:m||this.defaultAttributeTypes,useUniqueIDs:!!u};this.decodeGeometry(p,T).then(g)},decodeGeometry:function(p,g){for(var u in g.attributeTypes){var m=g.attributeTypes[u];m.BYTES_PER_ELEMENT!==void 0&&(g.attributeTypes[u]=m.name)}var T=JSON.stringify(g);if(k.taskCache.has(p)){var A=k.taskCache.get(p);if(A.key===T)return A.promise;if(p.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var M,C=this.workerNextTaskID++,D=p.byteLength,_=this._getWorker(C,D).then(I=>(M=I,new Promise((U,x)=>{M._callbacks[C]={resolve:U,reject:x},M.postMessage({type:"decode",id:C,taskConfig:g,buffer:p},[p])}))).then(I=>this._createGeometry(I.geometry));return _.catch(()=>!0).then(()=>{M&&C&&this._releaseTask(M,C)}),k.taskCache.set(p,{key:T,promise:_}),_},_createGeometry:function(p){var g=new c.BufferGeometry;p.index&&g.setIndex(new c.BufferAttribute(p.index.array,1));for(var u=0;u<p.attributes.length;u++){var m=p.attributes[u],T=m.name,A=m.array,M=m.itemSize;g.setAttribute(T,new c.BufferAttribute(A,M))}return g},_loadLibrary:function(p,g){var u=new c.FileLoader(this.manager);return u.setPath(this.decoderPath),u.setResponseType(g),new Promise((m,T)=>{u.load(p,m,void 0,T)})},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var p=typeof WebAssembly!="object"||this.decoderConfig.type==="js",g=[];return p?g.push(this._loadLibrary("draco_decoder.js","text")):(g.push(this._loadLibrary("draco_wasm_wrapper.js","text")),g.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(g).then(u=>{var m=u[0];p||(this.decoderConfig.wasmBinary=u[1]);var T=k.DRACOWorker.toString(),A=["/* draco decoder */",m,"","/* worker */",T.substring(T.indexOf("{")+1,T.lastIndexOf("}"))].join(`
|
|
261
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([A]))}),this.decoderPending},_getWorker:function(p,g){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){var u=new Worker(this.workerSourceURL);u._callbacks={},u._taskCosts={},u._taskLoad=0,u.postMessage({type:"init",decoderConfig:this.decoderConfig}),u.onmessage=function(T){var A=T.data;switch(A.type){case"decode":u._callbacks[A.id].resolve(A);break;case"error":u._callbacks[A.id].reject(A);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+A.type+'"')}},this.workerPool.push(u)}else this.workerPool.sort(function(m,T){return m._taskLoad>T._taskLoad?-1:1});var u=this.workerPool[this.workerPool.length-1];return u._taskCosts[p]=g,u._taskLoad+=g,u})},_releaseTask:function(p,g){p._taskLoad-=p._taskCosts[g],delete p._callbacks[g],delete p._taskCosts[g]},debug:function(){console.log("Task load: ",this.workerPool.map(p=>p._taskLoad))},dispose:function(){for(var p=0;p<this.workerPool.length;++p)this.workerPool[p].terminate();return this.workerPool.length=0,this}});k.DRACOWorker=function(){var p,g;onmessage=function(T){var A=T.data;switch(A.type){case"init":p=A.decoderConfig,g=new Promise(function(D){p.onModuleLoaded=function(_){D({draco:_})},DracoDecoderModule(p)});break;case"decode":var M=A.buffer,C=A.taskConfig;g.then(D=>{var _=D.draco,I=new _.Decoder,U=new _.DecoderBuffer;U.Init(new Int8Array(M),M.byteLength);try{var x=u(_,I,U,C),w=x.attributes.map(b=>b.array.buffer);x.index&&w.push(x.index.array.buffer),self.postMessage({type:"decode",id:A.id,geometry:x},w)}catch(b){console.error(b),self.postMessage({type:"error",id:A.id,error:b.message})}finally{_.destroy(U),_.destroy(I)}});break}};function u(T,A,M,C){var D=C.attributeIDs,_=C.attributeTypes,I,U,x=A.GetEncodedGeometryType(M);if(x===T.TRIANGULAR_MESH)I=new T.Mesh,U=A.DecodeBufferToMesh(M,I);else if(x===T.POINT_CLOUD)I=new T.PointCloud,U=A.DecodeBufferToPointCloud(M,I);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!U.ok()||I.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+U.error_msg());var w={index:null,attributes:[]};for(var b in D){var j=self[_[b]],te,P;if(C.useUniqueIDs)P=D[b],te=A.GetAttributeByUniqueId(I,P);else{if(P=A.GetAttributeId(I,T[D[b]]),P===-1)continue;te=A.GetAttribute(I,P)}w.attributes.push(m(T,A,I,b,j,te))}if(x===T.TRIANGULAR_MESH){for(var Q=I.num_faces(),B=Q*3,Z=new Uint32Array(B),$=new T.DracoInt32Array,z=0;z<Q;++z){A.GetFaceFromMesh(I,z,$);for(var W=0;W<3;++W)Z[z*3+W]=$.GetValue(W)}w.index={array:Z,itemSize:1},T.destroy($)}return T.destroy(I),w}function m(T,A,M,C,D,_){var I=_.num_components(),U=M.num_points(),x=U*I,w,b;switch(D){case Float32Array:w=new T.DracoFloat32Array,A.GetAttributeFloatForAllPoints(M,_,w),b=new Float32Array(x);break;case Int8Array:w=new T.DracoInt8Array,A.GetAttributeInt8ForAllPoints(M,_,w),b=new Int8Array(x);break;case Int16Array:w=new T.DracoInt16Array,A.GetAttributeInt16ForAllPoints(M,_,w),b=new Int16Array(x);break;case Int32Array:w=new T.DracoInt32Array,A.GetAttributeInt32ForAllPoints(M,_,w),b=new Int32Array(x);break;case Uint8Array:w=new T.DracoUInt8Array,A.GetAttributeUInt8ForAllPoints(M,_,w),b=new Uint8Array(x);break;case Uint16Array:w=new T.DracoUInt16Array,A.GetAttributeUInt16ForAllPoints(M,_,w),b=new Uint16Array(x);break;case Uint32Array:w=new T.DracoUInt32Array,A.GetAttributeUInt32ForAllPoints(M,_,w),b=new Uint32Array(x);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var j=0;j<x;j++)b[j]=w.GetValue(j);return T.destroy(w),{name:C,array:b,itemSize:I}}};k.taskCache=new WeakMap;k.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")};k.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")};k.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")};k.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var me=function(p){c.CompressedTextureLoader.call(this,p)};me.prototype=Object.assign(Object.create(c.CompressedTextureLoader.prototype),{constructor:me,parse:function(p,g){var u={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},m=542327876,T=131072,A=512,M=1024,C=2048,D=4096,_=8192,I=16384,U=32768,x=4;function w(l){return l.charCodeAt(0)+(l.charCodeAt(1)<<8)+(l.charCodeAt(2)<<16)+(l.charCodeAt(3)<<24)}function b(l){return String.fromCharCode(l&255,l>>8&255,l>>16&255,l>>24&255)}function j(l,f,v,d){for(var h=v*d*4,S=new Uint8Array(l,f,h),L=new Uint8Array(h),E=0,y=0,R=0;R<d;R++)for(var F=0;F<v;F++){var H=S[y];y++;var ne=S[y];y++;var ae=S[y];y++;var ee=S[y];y++,L[E]=ae,E++,L[E]=ne,E++,L[E]=H,E++,L[E]=ee,E++}return L}var te=w("DXT1"),P=w("DXT3"),Q=w("DXT5"),B=w("ETC1"),Z=31,$=0,z=1,W=2,le=3,V=4,Ae=7,ce=20,pe=21,he=22,Se=23,oe=24,Y=25,ye=26,Ee=28,G=new Int32Array(p,0,Z);if(G[$]!==m)return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),u;if(!G[ce]&x)return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),u;var q,O=G[pe],ve=!1;switch(O){case te:q=8,u.format=c.RGB_S3TC_DXT1_Format;break;case P:q=16,u.format=c.RGBA_S3TC_DXT3_Format;break;case Q:q=16,u.format=c.RGBA_S3TC_DXT5_Format;break;case B:q=8,u.format=c.RGB_ETC1_Format;break;default:if(G[he]===32&&G[Se]&16711680&&G[oe]&65280&&G[Y]&255&&G[ye]&4278190080)ve=!0,q=64,u.format=c.RGBAFormat;else return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",b(O)),u}u.mipmapCount=1,G[W]&T&&g!==!1&&(u.mipmapCount=Math.max(1,G[Ae]));var X=G[Ee];if(u.isCubemap=!!(X&A),u.isCubemap&&(!(X&M)||!(X&C)||!(X&D)||!(X&_)||!(X&I)||!(X&U)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),u;u.width=G[V],u.height=G[le];for(var ie=G[z]+4,e=u.isCubemap?6:1,r=0;r<e;r++)for(var n=u.width,t=u.height,a=0;a<u.mipmapCount;a++){if(ve)var i=j(p,ie,n,t),s=i.length;else var s=Math.max(4,n)/4*Math.max(4,t)/4*q,i=new Uint8Array(p,ie,s);var o={data:i,width:n,height:t};u.mipmaps.push(o),ie+=s,n=Math.max(n>>1,1),t=Math.max(t>>1,1)}return u}});var xe=(function(p){Oe(g,p);function g(u){var m=p.call(this)||this;return m.needsRender=!0,u&&u.children.length&&m.add.apply(m,u.children),m.mixer=new be.AnimationMixer(m),m}return g.prototype.clone=function(){var u=p.prototype.clone.call(this,!0),m=new be.AnimationMixer(u);return u.mixer=m,u.needsRender=!0,u},g})(be.Group),Ne="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",ke=(function(p){Oe(g,p);function g(u){var m=p.call(this,u)||this;return m.ddsLoader=new me(u),m.dracoLoader=new k(u),m.dracoLoader.setDecoderPath(Ne),m}return Object.defineProperty(g,"version",{get:function(){return"6.8.0-alpha.
|
|
261
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([A]))}),this.decoderPending},_getWorker:function(p,g){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){var u=new Worker(this.workerSourceURL);u._callbacks={},u._taskCosts={},u._taskLoad=0,u.postMessage({type:"init",decoderConfig:this.decoderConfig}),u.onmessage=function(T){var A=T.data;switch(A.type){case"decode":u._callbacks[A.id].resolve(A);break;case"error":u._callbacks[A.id].reject(A);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+A.type+'"')}},this.workerPool.push(u)}else this.workerPool.sort(function(m,T){return m._taskLoad>T._taskLoad?-1:1});var u=this.workerPool[this.workerPool.length-1];return u._taskCosts[p]=g,u._taskLoad+=g,u})},_releaseTask:function(p,g){p._taskLoad-=p._taskCosts[g],delete p._callbacks[g],delete p._taskCosts[g]},debug:function(){console.log("Task load: ",this.workerPool.map(p=>p._taskLoad))},dispose:function(){for(var p=0;p<this.workerPool.length;++p)this.workerPool[p].terminate();return this.workerPool.length=0,this}});k.DRACOWorker=function(){var p,g;onmessage=function(T){var A=T.data;switch(A.type){case"init":p=A.decoderConfig,g=new Promise(function(D){p.onModuleLoaded=function(_){D({draco:_})},DracoDecoderModule(p)});break;case"decode":var M=A.buffer,C=A.taskConfig;g.then(D=>{var _=D.draco,I=new _.Decoder,U=new _.DecoderBuffer;U.Init(new Int8Array(M),M.byteLength);try{var x=u(_,I,U,C),w=x.attributes.map(b=>b.array.buffer);x.index&&w.push(x.index.array.buffer),self.postMessage({type:"decode",id:A.id,geometry:x},w)}catch(b){console.error(b),self.postMessage({type:"error",id:A.id,error:b.message})}finally{_.destroy(U),_.destroy(I)}});break}};function u(T,A,M,C){var D=C.attributeIDs,_=C.attributeTypes,I,U,x=A.GetEncodedGeometryType(M);if(x===T.TRIANGULAR_MESH)I=new T.Mesh,U=A.DecodeBufferToMesh(M,I);else if(x===T.POINT_CLOUD)I=new T.PointCloud,U=A.DecodeBufferToPointCloud(M,I);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!U.ok()||I.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+U.error_msg());var w={index:null,attributes:[]};for(var b in D){var j=self[_[b]],te,P;if(C.useUniqueIDs)P=D[b],te=A.GetAttributeByUniqueId(I,P);else{if(P=A.GetAttributeId(I,T[D[b]]),P===-1)continue;te=A.GetAttribute(I,P)}w.attributes.push(m(T,A,I,b,j,te))}if(x===T.TRIANGULAR_MESH){for(var Q=I.num_faces(),B=Q*3,Z=new Uint32Array(B),$=new T.DracoInt32Array,z=0;z<Q;++z){A.GetFaceFromMesh(I,z,$);for(var W=0;W<3;++W)Z[z*3+W]=$.GetValue(W)}w.index={array:Z,itemSize:1},T.destroy($)}return T.destroy(I),w}function m(T,A,M,C,D,_){var I=_.num_components(),U=M.num_points(),x=U*I,w,b;switch(D){case Float32Array:w=new T.DracoFloat32Array,A.GetAttributeFloatForAllPoints(M,_,w),b=new Float32Array(x);break;case Int8Array:w=new T.DracoInt8Array,A.GetAttributeInt8ForAllPoints(M,_,w),b=new Int8Array(x);break;case Int16Array:w=new T.DracoInt16Array,A.GetAttributeInt16ForAllPoints(M,_,w),b=new Int16Array(x);break;case Int32Array:w=new T.DracoInt32Array,A.GetAttributeInt32ForAllPoints(M,_,w),b=new Int32Array(x);break;case Uint8Array:w=new T.DracoUInt8Array,A.GetAttributeUInt8ForAllPoints(M,_,w),b=new Uint8Array(x);break;case Uint16Array:w=new T.DracoUInt16Array,A.GetAttributeUInt16ForAllPoints(M,_,w),b=new Uint16Array(x);break;case Uint32Array:w=new T.DracoUInt32Array,A.GetAttributeUInt32ForAllPoints(M,_,w),b=new Uint32Array(x);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var j=0;j<x;j++)b[j]=w.GetValue(j);return T.destroy(w),{name:C,array:b,itemSize:I}}};k.taskCache=new WeakMap;k.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")};k.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")};k.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")};k.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var me=function(p){c.CompressedTextureLoader.call(this,p)};me.prototype=Object.assign(Object.create(c.CompressedTextureLoader.prototype),{constructor:me,parse:function(p,g){var u={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},m=542327876,T=131072,A=512,M=1024,C=2048,D=4096,_=8192,I=16384,U=32768,x=4;function w(l){return l.charCodeAt(0)+(l.charCodeAt(1)<<8)+(l.charCodeAt(2)<<16)+(l.charCodeAt(3)<<24)}function b(l){return String.fromCharCode(l&255,l>>8&255,l>>16&255,l>>24&255)}function j(l,f,v,d){for(var h=v*d*4,S=new Uint8Array(l,f,h),L=new Uint8Array(h),E=0,y=0,R=0;R<d;R++)for(var F=0;F<v;F++){var H=S[y];y++;var ne=S[y];y++;var ae=S[y];y++;var ee=S[y];y++,L[E]=ae,E++,L[E]=ne,E++,L[E]=H,E++,L[E]=ee,E++}return L}var te=w("DXT1"),P=w("DXT3"),Q=w("DXT5"),B=w("ETC1"),Z=31,$=0,z=1,W=2,le=3,V=4,Ae=7,ce=20,pe=21,he=22,Se=23,oe=24,Y=25,ye=26,Ee=28,G=new Int32Array(p,0,Z);if(G[$]!==m)return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),u;if(!G[ce]&x)return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),u;var q,O=G[pe],ve=!1;switch(O){case te:q=8,u.format=c.RGB_S3TC_DXT1_Format;break;case P:q=16,u.format=c.RGBA_S3TC_DXT3_Format;break;case Q:q=16,u.format=c.RGBA_S3TC_DXT5_Format;break;case B:q=8,u.format=c.RGB_ETC1_Format;break;default:if(G[he]===32&&G[Se]&16711680&&G[oe]&65280&&G[Y]&255&&G[ye]&4278190080)ve=!0,q=64,u.format=c.RGBAFormat;else return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",b(O)),u}u.mipmapCount=1,G[W]&T&&g!==!1&&(u.mipmapCount=Math.max(1,G[Ae]));var X=G[Ee];if(u.isCubemap=!!(X&A),u.isCubemap&&(!(X&M)||!(X&C)||!(X&D)||!(X&_)||!(X&I)||!(X&U)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),u;u.width=G[V],u.height=G[le];for(var ie=G[z]+4,e=u.isCubemap?6:1,r=0;r<e;r++)for(var n=u.width,t=u.height,a=0;a<u.mipmapCount;a++){if(ve)var i=j(p,ie,n,t),s=i.length;else var s=Math.max(4,n)/4*Math.max(4,t)/4*q,i=new Uint8Array(p,ie,s);var o={data:i,width:n,height:t};u.mipmaps.push(o),ie+=s,n=Math.max(n>>1,1),t=Math.max(t>>1,1)}return u}});var xe=(function(p){Oe(g,p);function g(u){var m=p.call(this)||this;return m.needsRender=!0,u&&u.children.length&&m.add.apply(m,u.children),m.mixer=new be.AnimationMixer(m),m}return g.prototype.clone=function(){var u=p.prototype.clone.call(this,!0),m=new be.AnimationMixer(u);return u.mixer=m,u.needsRender=!0,u},g})(be.Group),Ne="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",ke=(function(p){Oe(g,p);function g(u){var m=p.call(this,u)||this;return m.ddsLoader=new me(u),m.dracoLoader=new k(u),m.dracoLoader.setDecoderPath(Ne),m}return Object.defineProperty(g,"version",{get:function(){return"6.8.0-alpha.16"},enumerable:!1,configurable:!0}),g.prototype.load=function(u,m,T,A){return p.prototype.load.call(this,u,m,T,A)},g.prototype.parse=function(u,m,T,A){return p.prototype.parse.call(this,u,m,function(M){var C=new xe(M.scene),D=M.scenes.map(function(_){return _===M.scene?C:new xe(_)});T(Object.assign(M,{scene:C,scenes:D}))},A)},g})(Fe);exports.DDSLoader=me;exports.DRACOLoader=k;exports.GLTFLoader=ke;exports.GLTFObject=xe;exports.THREEGLTFLoader=Fe;
|
package/gltf-loader/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 3/
|
|
5
|
-
* Version: 6.8.0-alpha.
|
|
4
|
+
* Generated: 3/12/2026
|
|
5
|
+
* Version: 6.8.0-alpha.16
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -1683,7 +1683,7 @@ var Qe = (
|
|
|
1683
1683
|
}
|
|
1684
1684
|
return Object.defineProperty(T, "version", {
|
|
1685
1685
|
get: function() {
|
|
1686
|
-
return "6.8.0-alpha.
|
|
1686
|
+
return "6.8.0-alpha.16";
|
|
1687
1687
|
},
|
|
1688
1688
|
enumerable: !1,
|
|
1689
1689
|
configurable: !0
|