@perceptimagery/dita-configurator-staging 0.1.6200 → 0.1.6300
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/dist/index.js +599 -151
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,9 +30,9 @@ var __publicField = (obj, key, value) => {
|
|
|
30
30
|
const expires = this.config.EXPIRES;
|
|
31
31
|
if (!expires)
|
|
32
32
|
return true;
|
|
33
|
-
const
|
|
33
|
+
const now2 = (/* @__PURE__ */ new Date()).getTime();
|
|
34
34
|
const expiresDate = new Date(expires).getTime();
|
|
35
|
-
const diff = expiresDate -
|
|
35
|
+
const diff = expiresDate - now2;
|
|
36
36
|
return expires === "" || diff <= 0;
|
|
37
37
|
}
|
|
38
38
|
IsConfigExpired() {
|
|
@@ -111,7 +111,7 @@ var __publicField = (obj, key, value) => {
|
|
|
111
111
|
host: "https://api.sprie.io"
|
|
112
112
|
};
|
|
113
113
|
const config = Object.freeze(Config$1);
|
|
114
|
-
const version = "0.1.
|
|
114
|
+
const version = "0.1.6300";
|
|
115
115
|
function modifyLensArr(arr, element) {
|
|
116
116
|
const index = arr.findIndex((e) => e["sku"] === element["sku"]);
|
|
117
117
|
if (index !== -1) {
|
|
@@ -30233,6 +30233,13 @@ var __publicField = (obj, key, value) => {
|
|
|
30233
30233
|
this.image = images;
|
|
30234
30234
|
}
|
|
30235
30235
|
}
|
|
30236
|
+
class RawShaderMaterial extends ShaderMaterial {
|
|
30237
|
+
constructor(parameters) {
|
|
30238
|
+
super(parameters);
|
|
30239
|
+
this.isRawShaderMaterial = true;
|
|
30240
|
+
this.type = "RawShaderMaterial";
|
|
30241
|
+
}
|
|
30242
|
+
}
|
|
30236
30243
|
class MeshStandardMaterial extends Material {
|
|
30237
30244
|
constructor(parameters) {
|
|
30238
30245
|
super();
|
|
@@ -32056,6 +32063,47 @@ var __publicField = (obj, key, value) => {
|
|
|
32056
32063
|
scope.manager.itemStart(url);
|
|
32057
32064
|
}
|
|
32058
32065
|
}
|
|
32066
|
+
class Clock {
|
|
32067
|
+
constructor(autoStart = true) {
|
|
32068
|
+
this.autoStart = autoStart;
|
|
32069
|
+
this.startTime = 0;
|
|
32070
|
+
this.oldTime = 0;
|
|
32071
|
+
this.elapsedTime = 0;
|
|
32072
|
+
this.running = false;
|
|
32073
|
+
}
|
|
32074
|
+
start() {
|
|
32075
|
+
this.startTime = now();
|
|
32076
|
+
this.oldTime = this.startTime;
|
|
32077
|
+
this.elapsedTime = 0;
|
|
32078
|
+
this.running = true;
|
|
32079
|
+
}
|
|
32080
|
+
stop() {
|
|
32081
|
+
this.getElapsedTime();
|
|
32082
|
+
this.running = false;
|
|
32083
|
+
this.autoStart = false;
|
|
32084
|
+
}
|
|
32085
|
+
getElapsedTime() {
|
|
32086
|
+
this.getDelta();
|
|
32087
|
+
return this.elapsedTime;
|
|
32088
|
+
}
|
|
32089
|
+
getDelta() {
|
|
32090
|
+
let diff = 0;
|
|
32091
|
+
if (this.autoStart && !this.running) {
|
|
32092
|
+
this.start();
|
|
32093
|
+
return 0;
|
|
32094
|
+
}
|
|
32095
|
+
if (this.running) {
|
|
32096
|
+
const newTime = now();
|
|
32097
|
+
diff = (newTime - this.oldTime) / 1e3;
|
|
32098
|
+
this.oldTime = newTime;
|
|
32099
|
+
this.elapsedTime += diff;
|
|
32100
|
+
}
|
|
32101
|
+
return diff;
|
|
32102
|
+
}
|
|
32103
|
+
}
|
|
32104
|
+
function now() {
|
|
32105
|
+
return (typeof performance === "undefined" ? Date : performance).now();
|
|
32106
|
+
}
|
|
32059
32107
|
const _RESERVED_CHARS_RE = "\\[\\]\\.:\\/";
|
|
32060
32108
|
const _reservedRe = new RegExp("[" + _RESERVED_CHARS_RE + "]", "g");
|
|
32061
32109
|
const _wordChar = "[^" + _RESERVED_CHARS_RE + "]";
|
|
@@ -36671,6 +36719,475 @@ var __publicField = (obj, key, value) => {
|
|
|
36671
36719
|
return super.load(url, onLoadCallback, onProgress, onError);
|
|
36672
36720
|
}
|
|
36673
36721
|
}
|
|
36722
|
+
const CopyShader = {
|
|
36723
|
+
name: "CopyShader",
|
|
36724
|
+
uniforms: {
|
|
36725
|
+
"tDiffuse": { value: null },
|
|
36726
|
+
"opacity": { value: 1 }
|
|
36727
|
+
},
|
|
36728
|
+
vertexShader: (
|
|
36729
|
+
/* glsl */
|
|
36730
|
+
`
|
|
36731
|
+
|
|
36732
|
+
varying vec2 vUv;
|
|
36733
|
+
|
|
36734
|
+
void main() {
|
|
36735
|
+
|
|
36736
|
+
vUv = uv;
|
|
36737
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
36738
|
+
|
|
36739
|
+
}`
|
|
36740
|
+
),
|
|
36741
|
+
fragmentShader: (
|
|
36742
|
+
/* glsl */
|
|
36743
|
+
`
|
|
36744
|
+
|
|
36745
|
+
uniform float opacity;
|
|
36746
|
+
|
|
36747
|
+
uniform sampler2D tDiffuse;
|
|
36748
|
+
|
|
36749
|
+
varying vec2 vUv;
|
|
36750
|
+
|
|
36751
|
+
void main() {
|
|
36752
|
+
|
|
36753
|
+
vec4 texel = texture2D( tDiffuse, vUv );
|
|
36754
|
+
gl_FragColor = opacity * texel;
|
|
36755
|
+
|
|
36756
|
+
|
|
36757
|
+
}`
|
|
36758
|
+
)
|
|
36759
|
+
};
|
|
36760
|
+
class Pass {
|
|
36761
|
+
constructor() {
|
|
36762
|
+
this.isPass = true;
|
|
36763
|
+
this.enabled = true;
|
|
36764
|
+
this.needsSwap = true;
|
|
36765
|
+
this.clear = false;
|
|
36766
|
+
this.renderToScreen = false;
|
|
36767
|
+
}
|
|
36768
|
+
setSize() {
|
|
36769
|
+
}
|
|
36770
|
+
render() {
|
|
36771
|
+
console.error("THREE.Pass: .render() must be implemented in derived pass.");
|
|
36772
|
+
}
|
|
36773
|
+
dispose() {
|
|
36774
|
+
}
|
|
36775
|
+
}
|
|
36776
|
+
const _camera = new OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
|
36777
|
+
class FullscreenTriangleGeometry extends BufferGeometry {
|
|
36778
|
+
constructor() {
|
|
36779
|
+
super();
|
|
36780
|
+
this.setAttribute("position", new Float32BufferAttribute([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3));
|
|
36781
|
+
this.setAttribute("uv", new Float32BufferAttribute([0, 2, 0, 0, 2, 0], 2));
|
|
36782
|
+
}
|
|
36783
|
+
}
|
|
36784
|
+
const _geometry = new FullscreenTriangleGeometry();
|
|
36785
|
+
class FullScreenQuad {
|
|
36786
|
+
constructor(material) {
|
|
36787
|
+
this._mesh = new Mesh(_geometry, material);
|
|
36788
|
+
}
|
|
36789
|
+
dispose() {
|
|
36790
|
+
this._mesh.geometry.dispose();
|
|
36791
|
+
}
|
|
36792
|
+
render(renderer) {
|
|
36793
|
+
renderer.render(this._mesh, _camera);
|
|
36794
|
+
}
|
|
36795
|
+
get material() {
|
|
36796
|
+
return this._mesh.material;
|
|
36797
|
+
}
|
|
36798
|
+
set material(value) {
|
|
36799
|
+
this._mesh.material = value;
|
|
36800
|
+
}
|
|
36801
|
+
}
|
|
36802
|
+
class ShaderPass extends Pass {
|
|
36803
|
+
constructor(shader, textureID) {
|
|
36804
|
+
super();
|
|
36805
|
+
this.textureID = textureID !== void 0 ? textureID : "tDiffuse";
|
|
36806
|
+
if (shader instanceof ShaderMaterial) {
|
|
36807
|
+
this.uniforms = shader.uniforms;
|
|
36808
|
+
this.material = shader;
|
|
36809
|
+
} else if (shader) {
|
|
36810
|
+
this.uniforms = UniformsUtils.clone(shader.uniforms);
|
|
36811
|
+
this.material = new ShaderMaterial({
|
|
36812
|
+
name: shader.name !== void 0 ? shader.name : "unspecified",
|
|
36813
|
+
defines: Object.assign({}, shader.defines),
|
|
36814
|
+
uniforms: this.uniforms,
|
|
36815
|
+
vertexShader: shader.vertexShader,
|
|
36816
|
+
fragmentShader: shader.fragmentShader
|
|
36817
|
+
});
|
|
36818
|
+
}
|
|
36819
|
+
this.fsQuad = new FullScreenQuad(this.material);
|
|
36820
|
+
}
|
|
36821
|
+
render(renderer, writeBuffer, readBuffer) {
|
|
36822
|
+
if (this.uniforms[this.textureID]) {
|
|
36823
|
+
this.uniforms[this.textureID].value = readBuffer.texture;
|
|
36824
|
+
}
|
|
36825
|
+
this.fsQuad.material = this.material;
|
|
36826
|
+
if (this.renderToScreen) {
|
|
36827
|
+
renderer.setRenderTarget(null);
|
|
36828
|
+
this.fsQuad.render(renderer);
|
|
36829
|
+
} else {
|
|
36830
|
+
renderer.setRenderTarget(writeBuffer);
|
|
36831
|
+
if (this.clear)
|
|
36832
|
+
renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);
|
|
36833
|
+
this.fsQuad.render(renderer);
|
|
36834
|
+
}
|
|
36835
|
+
}
|
|
36836
|
+
dispose() {
|
|
36837
|
+
this.material.dispose();
|
|
36838
|
+
this.fsQuad.dispose();
|
|
36839
|
+
}
|
|
36840
|
+
}
|
|
36841
|
+
class MaskPass extends Pass {
|
|
36842
|
+
constructor(scene, camera) {
|
|
36843
|
+
super();
|
|
36844
|
+
this.scene = scene;
|
|
36845
|
+
this.camera = camera;
|
|
36846
|
+
this.clear = true;
|
|
36847
|
+
this.needsSwap = false;
|
|
36848
|
+
this.inverse = false;
|
|
36849
|
+
}
|
|
36850
|
+
render(renderer, writeBuffer, readBuffer) {
|
|
36851
|
+
const context = renderer.getContext();
|
|
36852
|
+
const state = renderer.state;
|
|
36853
|
+
state.buffers.color.setMask(false);
|
|
36854
|
+
state.buffers.depth.setMask(false);
|
|
36855
|
+
state.buffers.color.setLocked(true);
|
|
36856
|
+
state.buffers.depth.setLocked(true);
|
|
36857
|
+
let writeValue, clearValue;
|
|
36858
|
+
if (this.inverse) {
|
|
36859
|
+
writeValue = 0;
|
|
36860
|
+
clearValue = 1;
|
|
36861
|
+
} else {
|
|
36862
|
+
writeValue = 1;
|
|
36863
|
+
clearValue = 0;
|
|
36864
|
+
}
|
|
36865
|
+
state.buffers.stencil.setTest(true);
|
|
36866
|
+
state.buffers.stencil.setOp(context.REPLACE, context.REPLACE, context.REPLACE);
|
|
36867
|
+
state.buffers.stencil.setFunc(context.ALWAYS, writeValue, 4294967295);
|
|
36868
|
+
state.buffers.stencil.setClear(clearValue);
|
|
36869
|
+
state.buffers.stencil.setLocked(true);
|
|
36870
|
+
renderer.setRenderTarget(readBuffer);
|
|
36871
|
+
if (this.clear)
|
|
36872
|
+
renderer.clear();
|
|
36873
|
+
renderer.render(this.scene, this.camera);
|
|
36874
|
+
renderer.setRenderTarget(writeBuffer);
|
|
36875
|
+
if (this.clear)
|
|
36876
|
+
renderer.clear();
|
|
36877
|
+
renderer.render(this.scene, this.camera);
|
|
36878
|
+
state.buffers.color.setLocked(false);
|
|
36879
|
+
state.buffers.depth.setLocked(false);
|
|
36880
|
+
state.buffers.color.setMask(true);
|
|
36881
|
+
state.buffers.depth.setMask(true);
|
|
36882
|
+
state.buffers.stencil.setLocked(false);
|
|
36883
|
+
state.buffers.stencil.setFunc(context.EQUAL, 1, 4294967295);
|
|
36884
|
+
state.buffers.stencil.setOp(context.KEEP, context.KEEP, context.KEEP);
|
|
36885
|
+
state.buffers.stencil.setLocked(true);
|
|
36886
|
+
}
|
|
36887
|
+
}
|
|
36888
|
+
class ClearMaskPass extends Pass {
|
|
36889
|
+
constructor() {
|
|
36890
|
+
super();
|
|
36891
|
+
this.needsSwap = false;
|
|
36892
|
+
}
|
|
36893
|
+
render(renderer) {
|
|
36894
|
+
renderer.state.buffers.stencil.setLocked(false);
|
|
36895
|
+
renderer.state.buffers.stencil.setTest(false);
|
|
36896
|
+
}
|
|
36897
|
+
}
|
|
36898
|
+
class EffectComposer {
|
|
36899
|
+
constructor(renderer, renderTarget) {
|
|
36900
|
+
this.renderer = renderer;
|
|
36901
|
+
this._pixelRatio = renderer.getPixelRatio();
|
|
36902
|
+
if (renderTarget === void 0) {
|
|
36903
|
+
const size = renderer.getSize(new Vector2());
|
|
36904
|
+
this._width = size.width;
|
|
36905
|
+
this._height = size.height;
|
|
36906
|
+
renderTarget = new WebGLRenderTarget(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: HalfFloatType });
|
|
36907
|
+
renderTarget.texture.name = "EffectComposer.rt1";
|
|
36908
|
+
} else {
|
|
36909
|
+
this._width = renderTarget.width;
|
|
36910
|
+
this._height = renderTarget.height;
|
|
36911
|
+
}
|
|
36912
|
+
this.renderTarget1 = renderTarget;
|
|
36913
|
+
this.renderTarget2 = renderTarget.clone();
|
|
36914
|
+
this.renderTarget2.texture.name = "EffectComposer.rt2";
|
|
36915
|
+
this.writeBuffer = this.renderTarget1;
|
|
36916
|
+
this.readBuffer = this.renderTarget2;
|
|
36917
|
+
this.renderToScreen = true;
|
|
36918
|
+
this.passes = [];
|
|
36919
|
+
this.copyPass = new ShaderPass(CopyShader);
|
|
36920
|
+
this.copyPass.material.blending = NoBlending;
|
|
36921
|
+
this.clock = new Clock();
|
|
36922
|
+
}
|
|
36923
|
+
swapBuffers() {
|
|
36924
|
+
const tmp = this.readBuffer;
|
|
36925
|
+
this.readBuffer = this.writeBuffer;
|
|
36926
|
+
this.writeBuffer = tmp;
|
|
36927
|
+
}
|
|
36928
|
+
addPass(pass) {
|
|
36929
|
+
this.passes.push(pass);
|
|
36930
|
+
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
36931
|
+
}
|
|
36932
|
+
insertPass(pass, index) {
|
|
36933
|
+
this.passes.splice(index, 0, pass);
|
|
36934
|
+
pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
36935
|
+
}
|
|
36936
|
+
removePass(pass) {
|
|
36937
|
+
const index = this.passes.indexOf(pass);
|
|
36938
|
+
if (index !== -1) {
|
|
36939
|
+
this.passes.splice(index, 1);
|
|
36940
|
+
}
|
|
36941
|
+
}
|
|
36942
|
+
isLastEnabledPass(passIndex) {
|
|
36943
|
+
for (let i = passIndex + 1; i < this.passes.length; i++) {
|
|
36944
|
+
if (this.passes[i].enabled) {
|
|
36945
|
+
return false;
|
|
36946
|
+
}
|
|
36947
|
+
}
|
|
36948
|
+
return true;
|
|
36949
|
+
}
|
|
36950
|
+
render(deltaTime) {
|
|
36951
|
+
if (deltaTime === void 0) {
|
|
36952
|
+
deltaTime = this.clock.getDelta();
|
|
36953
|
+
}
|
|
36954
|
+
const currentRenderTarget = this.renderer.getRenderTarget();
|
|
36955
|
+
let maskActive = false;
|
|
36956
|
+
for (let i = 0, il = this.passes.length; i < il; i++) {
|
|
36957
|
+
const pass = this.passes[i];
|
|
36958
|
+
if (pass.enabled === false)
|
|
36959
|
+
continue;
|
|
36960
|
+
pass.renderToScreen = this.renderToScreen && this.isLastEnabledPass(i);
|
|
36961
|
+
pass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive);
|
|
36962
|
+
if (pass.needsSwap) {
|
|
36963
|
+
if (maskActive) {
|
|
36964
|
+
const context = this.renderer.getContext();
|
|
36965
|
+
const stencil = this.renderer.state.buffers.stencil;
|
|
36966
|
+
stencil.setFunc(context.NOTEQUAL, 1, 4294967295);
|
|
36967
|
+
this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime);
|
|
36968
|
+
stencil.setFunc(context.EQUAL, 1, 4294967295);
|
|
36969
|
+
}
|
|
36970
|
+
this.swapBuffers();
|
|
36971
|
+
}
|
|
36972
|
+
if (MaskPass !== void 0) {
|
|
36973
|
+
if (pass instanceof MaskPass) {
|
|
36974
|
+
maskActive = true;
|
|
36975
|
+
} else if (pass instanceof ClearMaskPass) {
|
|
36976
|
+
maskActive = false;
|
|
36977
|
+
}
|
|
36978
|
+
}
|
|
36979
|
+
}
|
|
36980
|
+
this.renderer.setRenderTarget(currentRenderTarget);
|
|
36981
|
+
}
|
|
36982
|
+
reset(renderTarget) {
|
|
36983
|
+
if (renderTarget === void 0) {
|
|
36984
|
+
const size = this.renderer.getSize(new Vector2());
|
|
36985
|
+
this._pixelRatio = this.renderer.getPixelRatio();
|
|
36986
|
+
this._width = size.width;
|
|
36987
|
+
this._height = size.height;
|
|
36988
|
+
renderTarget = this.renderTarget1.clone();
|
|
36989
|
+
renderTarget.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
36990
|
+
}
|
|
36991
|
+
this.renderTarget1.dispose();
|
|
36992
|
+
this.renderTarget2.dispose();
|
|
36993
|
+
this.renderTarget1 = renderTarget;
|
|
36994
|
+
this.renderTarget2 = renderTarget.clone();
|
|
36995
|
+
this.writeBuffer = this.renderTarget1;
|
|
36996
|
+
this.readBuffer = this.renderTarget2;
|
|
36997
|
+
}
|
|
36998
|
+
setSize(width, height) {
|
|
36999
|
+
this._width = width;
|
|
37000
|
+
this._height = height;
|
|
37001
|
+
const effectiveWidth = this._width * this._pixelRatio;
|
|
37002
|
+
const effectiveHeight = this._height * this._pixelRatio;
|
|
37003
|
+
this.renderTarget1.setSize(effectiveWidth, effectiveHeight);
|
|
37004
|
+
this.renderTarget2.setSize(effectiveWidth, effectiveHeight);
|
|
37005
|
+
for (let i = 0; i < this.passes.length; i++) {
|
|
37006
|
+
this.passes[i].setSize(effectiveWidth, effectiveHeight);
|
|
37007
|
+
}
|
|
37008
|
+
}
|
|
37009
|
+
setPixelRatio(pixelRatio) {
|
|
37010
|
+
this._pixelRatio = pixelRatio;
|
|
37011
|
+
this.setSize(this._width, this._height);
|
|
37012
|
+
}
|
|
37013
|
+
dispose() {
|
|
37014
|
+
this.renderTarget1.dispose();
|
|
37015
|
+
this.renderTarget2.dispose();
|
|
37016
|
+
this.copyPass.dispose();
|
|
37017
|
+
}
|
|
37018
|
+
}
|
|
37019
|
+
const OutputShader = {
|
|
37020
|
+
name: "OutputShader",
|
|
37021
|
+
uniforms: {
|
|
37022
|
+
"tDiffuse": { value: null },
|
|
37023
|
+
"toneMappingExposure": { value: 1 }
|
|
37024
|
+
},
|
|
37025
|
+
vertexShader: (
|
|
37026
|
+
/* glsl */
|
|
37027
|
+
`
|
|
37028
|
+
precision highp float;
|
|
37029
|
+
|
|
37030
|
+
uniform mat4 modelViewMatrix;
|
|
37031
|
+
uniform mat4 projectionMatrix;
|
|
37032
|
+
|
|
37033
|
+
attribute vec3 position;
|
|
37034
|
+
attribute vec2 uv;
|
|
37035
|
+
|
|
37036
|
+
varying vec2 vUv;
|
|
37037
|
+
|
|
37038
|
+
void main() {
|
|
37039
|
+
|
|
37040
|
+
vUv = uv;
|
|
37041
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
37042
|
+
|
|
37043
|
+
}`
|
|
37044
|
+
),
|
|
37045
|
+
fragmentShader: (
|
|
37046
|
+
/* glsl */
|
|
37047
|
+
`
|
|
37048
|
+
|
|
37049
|
+
precision highp float;
|
|
37050
|
+
|
|
37051
|
+
uniform sampler2D tDiffuse;
|
|
37052
|
+
|
|
37053
|
+
#include <tonemapping_pars_fragment>
|
|
37054
|
+
#include <colorspace_pars_fragment>
|
|
37055
|
+
|
|
37056
|
+
varying vec2 vUv;
|
|
37057
|
+
|
|
37058
|
+
void main() {
|
|
37059
|
+
|
|
37060
|
+
gl_FragColor = texture2D( tDiffuse, vUv );
|
|
37061
|
+
|
|
37062
|
+
// tone mapping
|
|
37063
|
+
|
|
37064
|
+
#ifdef LINEAR_TONE_MAPPING
|
|
37065
|
+
|
|
37066
|
+
gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
|
|
37067
|
+
|
|
37068
|
+
#elif defined( REINHARD_TONE_MAPPING )
|
|
37069
|
+
|
|
37070
|
+
gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
|
|
37071
|
+
|
|
37072
|
+
#elif defined( CINEON_TONE_MAPPING )
|
|
37073
|
+
|
|
37074
|
+
gl_FragColor.rgb = OptimizedCineonToneMapping( gl_FragColor.rgb );
|
|
37075
|
+
|
|
37076
|
+
#elif defined( ACES_FILMIC_TONE_MAPPING )
|
|
37077
|
+
|
|
37078
|
+
gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
|
|
37079
|
+
|
|
37080
|
+
#endif
|
|
37081
|
+
|
|
37082
|
+
// color space
|
|
37083
|
+
|
|
37084
|
+
#ifdef SRGB_TRANSFER
|
|
37085
|
+
|
|
37086
|
+
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
|
37087
|
+
|
|
37088
|
+
#endif
|
|
37089
|
+
|
|
37090
|
+
}`
|
|
37091
|
+
)
|
|
37092
|
+
};
|
|
37093
|
+
class OutputPass extends Pass {
|
|
37094
|
+
constructor() {
|
|
37095
|
+
super();
|
|
37096
|
+
const shader = OutputShader;
|
|
37097
|
+
this.uniforms = UniformsUtils.clone(shader.uniforms);
|
|
37098
|
+
this.material = new RawShaderMaterial({
|
|
37099
|
+
name: shader.name,
|
|
37100
|
+
uniforms: this.uniforms,
|
|
37101
|
+
vertexShader: shader.vertexShader,
|
|
37102
|
+
fragmentShader: shader.fragmentShader
|
|
37103
|
+
});
|
|
37104
|
+
this.fsQuad = new FullScreenQuad(this.material);
|
|
37105
|
+
this._outputColorSpace = null;
|
|
37106
|
+
this._toneMapping = null;
|
|
37107
|
+
}
|
|
37108
|
+
render(renderer, writeBuffer, readBuffer) {
|
|
37109
|
+
this.uniforms["tDiffuse"].value = readBuffer.texture;
|
|
37110
|
+
this.uniforms["toneMappingExposure"].value = renderer.toneMappingExposure;
|
|
37111
|
+
if (this._outputColorSpace !== renderer.outputColorSpace || this._toneMapping !== renderer.toneMapping) {
|
|
37112
|
+
this._outputColorSpace = renderer.outputColorSpace;
|
|
37113
|
+
this._toneMapping = renderer.toneMapping;
|
|
37114
|
+
this.material.defines = {};
|
|
37115
|
+
if (ColorManagement.getTransfer(this._outputColorSpace) === SRGBTransfer)
|
|
37116
|
+
this.material.defines.SRGB_TRANSFER = "";
|
|
37117
|
+
if (this._toneMapping === LinearToneMapping)
|
|
37118
|
+
this.material.defines.LINEAR_TONE_MAPPING = "";
|
|
37119
|
+
else if (this._toneMapping === ReinhardToneMapping)
|
|
37120
|
+
this.material.defines.REINHARD_TONE_MAPPING = "";
|
|
37121
|
+
else if (this._toneMapping === CineonToneMapping)
|
|
37122
|
+
this.material.defines.CINEON_TONE_MAPPING = "";
|
|
37123
|
+
else if (this._toneMapping === ACESFilmicToneMapping)
|
|
37124
|
+
this.material.defines.ACES_FILMIC_TONE_MAPPING = "";
|
|
37125
|
+
this.material.needsUpdate = true;
|
|
37126
|
+
}
|
|
37127
|
+
if (this.renderToScreen === true) {
|
|
37128
|
+
renderer.setRenderTarget(null);
|
|
37129
|
+
this.fsQuad.render(renderer);
|
|
37130
|
+
} else {
|
|
37131
|
+
renderer.setRenderTarget(writeBuffer);
|
|
37132
|
+
if (this.clear)
|
|
37133
|
+
renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);
|
|
37134
|
+
this.fsQuad.render(renderer);
|
|
37135
|
+
}
|
|
37136
|
+
}
|
|
37137
|
+
dispose() {
|
|
37138
|
+
this.material.dispose();
|
|
37139
|
+
this.fsQuad.dispose();
|
|
37140
|
+
}
|
|
37141
|
+
}
|
|
37142
|
+
class RenderPass extends Pass {
|
|
37143
|
+
constructor(scene, camera, overrideMaterial = null, clearColor = null, clearAlpha = null) {
|
|
37144
|
+
super();
|
|
37145
|
+
this.scene = scene;
|
|
37146
|
+
this.camera = camera;
|
|
37147
|
+
this.overrideMaterial = overrideMaterial;
|
|
37148
|
+
this.clearColor = clearColor;
|
|
37149
|
+
this.clearAlpha = clearAlpha;
|
|
37150
|
+
this.clear = true;
|
|
37151
|
+
this.clearDepth = false;
|
|
37152
|
+
this.needsSwap = false;
|
|
37153
|
+
this._oldClearColor = new Color();
|
|
37154
|
+
}
|
|
37155
|
+
render(renderer, writeBuffer, readBuffer) {
|
|
37156
|
+
const oldAutoClear = renderer.autoClear;
|
|
37157
|
+
renderer.autoClear = false;
|
|
37158
|
+
let oldClearAlpha, oldOverrideMaterial;
|
|
37159
|
+
if (this.overrideMaterial !== null) {
|
|
37160
|
+
oldOverrideMaterial = this.scene.overrideMaterial;
|
|
37161
|
+
this.scene.overrideMaterial = this.overrideMaterial;
|
|
37162
|
+
}
|
|
37163
|
+
if (this.clearColor !== null) {
|
|
37164
|
+
renderer.getClearColor(this._oldClearColor);
|
|
37165
|
+
renderer.setClearColor(this.clearColor);
|
|
37166
|
+
}
|
|
37167
|
+
if (this.clearAlpha !== null) {
|
|
37168
|
+
oldClearAlpha = renderer.getClearAlpha();
|
|
37169
|
+
renderer.setClearAlpha(this.clearAlpha);
|
|
37170
|
+
}
|
|
37171
|
+
if (this.clearDepth == true) {
|
|
37172
|
+
renderer.clearDepth();
|
|
37173
|
+
}
|
|
37174
|
+
renderer.setRenderTarget(this.renderToScreen ? null : readBuffer);
|
|
37175
|
+
if (this.clear === true) {
|
|
37176
|
+
renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);
|
|
37177
|
+
}
|
|
37178
|
+
renderer.render(this.scene, this.camera);
|
|
37179
|
+
if (this.clearColor !== null) {
|
|
37180
|
+
renderer.setClearColor(this._oldClearColor);
|
|
37181
|
+
}
|
|
37182
|
+
if (this.clearAlpha !== null) {
|
|
37183
|
+
renderer.setClearAlpha(oldClearAlpha);
|
|
37184
|
+
}
|
|
37185
|
+
if (this.overrideMaterial !== null) {
|
|
37186
|
+
this.scene.overrideMaterial = oldOverrideMaterial;
|
|
37187
|
+
}
|
|
37188
|
+
renderer.autoClear = oldAutoClear;
|
|
37189
|
+
}
|
|
37190
|
+
}
|
|
36674
37191
|
const HorizontalBlurShader = {
|
|
36675
37192
|
name: "HorizontalBlurShader",
|
|
36676
37193
|
uniforms: {
|
|
@@ -36818,6 +37335,7 @@ var __publicField = (obj, key, value) => {
|
|
|
36818
37335
|
antialias: true
|
|
36819
37336
|
});
|
|
36820
37337
|
this.renderer.setSize(newWidth, newHeight);
|
|
37338
|
+
this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
|
36821
37339
|
}
|
|
36822
37340
|
cleanUp() {
|
|
36823
37341
|
if (this.renderer) {
|
|
@@ -37000,13 +37518,17 @@ var __publicField = (obj, key, value) => {
|
|
|
37000
37518
|
if (isRawGlbFile) {
|
|
37001
37519
|
result = await loader.loadAsync(modelFileUrl);
|
|
37002
37520
|
} else {
|
|
37003
|
-
result = await this.LoadEncryptedGlb(
|
|
37521
|
+
result = await this.LoadEncryptedGlb(
|
|
37522
|
+
loader,
|
|
37523
|
+
modelFileUrl,
|
|
37524
|
+
password
|
|
37525
|
+
).then((finalRes) => {
|
|
37004
37526
|
if (renderAsIs) {
|
|
37005
37527
|
this.updateScene(finalRes.result);
|
|
37006
37528
|
} else {
|
|
37007
37529
|
this.updateMaterials(finalRes.result);
|
|
37008
37530
|
}
|
|
37009
|
-
this.
|
|
37531
|
+
this.loadModelInsideScene(finalRes.result.scene);
|
|
37010
37532
|
});
|
|
37011
37533
|
}
|
|
37012
37534
|
return result == null ? void 0 : result.scene;
|
|
@@ -37090,7 +37612,10 @@ var __publicField = (obj, key, value) => {
|
|
|
37090
37612
|
if (lens.direction == "u") {
|
|
37091
37613
|
optionContent.setAttribute("data-color", lens.color);
|
|
37092
37614
|
} else {
|
|
37093
|
-
optionContent.setAttribute(
|
|
37615
|
+
optionContent.setAttribute(
|
|
37616
|
+
"data-color",
|
|
37617
|
+
JSON.stringify(lens.gradientColors)
|
|
37618
|
+
);
|
|
37094
37619
|
}
|
|
37095
37620
|
optionContent.setAttribute("data-direction", lens.direction);
|
|
37096
37621
|
optionContent.setAttribute("data-opacity", `${lens.opacity}`);
|
|
@@ -37131,17 +37656,25 @@ var __publicField = (obj, key, value) => {
|
|
|
37131
37656
|
selectedOption.style.background = "#f2f2f2";
|
|
37132
37657
|
if (lensMaterial) {
|
|
37133
37658
|
if (selectedOption.getAttribute("data-direction") == "u") {
|
|
37134
|
-
lensMaterial.color = new Color(
|
|
37135
|
-
|
|
37659
|
+
lensMaterial.color = new Color(
|
|
37660
|
+
selectedOption.getAttribute("data-color")
|
|
37661
|
+
);
|
|
37662
|
+
lensMaterial.opacity = selectedOption.getAttribute(
|
|
37663
|
+
"data-opacity"
|
|
37664
|
+
);
|
|
37136
37665
|
gu.uAlpha.value = false;
|
|
37137
37666
|
const image = document.getElementById("LensdropdownImgD");
|
|
37138
37667
|
image.style.background = selectedOption.getAttribute("data-color");
|
|
37139
37668
|
} else if (selectedOption.getAttribute("data-direction") == "tb") {
|
|
37140
|
-
const gradientColors = JSON.parse(
|
|
37669
|
+
const gradientColors = JSON.parse(
|
|
37670
|
+
selectedOption.getAttribute("data-color")
|
|
37671
|
+
);
|
|
37141
37672
|
gu.uAlpha.value = true;
|
|
37142
37673
|
let index = 0;
|
|
37143
37674
|
gradientColors.forEach(() => {
|
|
37144
|
-
gu.colors.value[index] = new Color(
|
|
37675
|
+
gu.colors.value[index] = new Color(
|
|
37676
|
+
gradientColors[index].color
|
|
37677
|
+
);
|
|
37145
37678
|
gu.positions.value[index] = gradientColors[index].position;
|
|
37146
37679
|
gu.opacities.value[index] = gradientColors[index].alpha;
|
|
37147
37680
|
index++;
|
|
@@ -37157,8 +37690,12 @@ var __publicField = (obj, key, value) => {
|
|
|
37157
37690
|
lensMaterial.clearcoat = 1;
|
|
37158
37691
|
lensMaterial.clearcoatRoughness = 0;
|
|
37159
37692
|
}
|
|
37160
|
-
lensMaterial.roughness = selectedOption.getAttribute(
|
|
37161
|
-
|
|
37693
|
+
lensMaterial.roughness = selectedOption.getAttribute(
|
|
37694
|
+
"data-roughness"
|
|
37695
|
+
);
|
|
37696
|
+
lensMaterial.metalness = selectedOption.getAttribute(
|
|
37697
|
+
"data-metalness"
|
|
37698
|
+
);
|
|
37162
37699
|
const name = document.getElementById("LensdropdownNameD");
|
|
37163
37700
|
name.textContent = selectedOption.getAttribute("data-name");
|
|
37164
37701
|
const desc = document.getElementById("LensdropdownSkuD");
|
|
@@ -37180,7 +37717,6 @@ var __publicField = (obj, key, value) => {
|
|
|
37180
37717
|
}
|
|
37181
37718
|
async setupLensDefault(response) {
|
|
37182
37719
|
if (lensMaterial) {
|
|
37183
|
-
console.log("leen", response);
|
|
37184
37720
|
lensMaterial.color = new Color(response.customisation[0].color);
|
|
37185
37721
|
lensMaterial.opacity = response.customisation[0].opacity;
|
|
37186
37722
|
lensMaterial.metalness = response.customisation[0].metalness;
|
|
@@ -37199,6 +37735,7 @@ var __publicField = (obj, key, value) => {
|
|
|
37199
37735
|
}
|
|
37200
37736
|
setupLensMaterial(selectedLens) {
|
|
37201
37737
|
if (lensMaterial) {
|
|
37738
|
+
console.log(selectedLens);
|
|
37202
37739
|
if (selectedLens.direction == "u") {
|
|
37203
37740
|
lensMaterial.color = new Color(selectedLens.color);
|
|
37204
37741
|
lensMaterial.opacity = selectedLens.opacity;
|
|
@@ -37228,137 +37765,18 @@ var __publicField = (obj, key, value) => {
|
|
|
37228
37765
|
lensMaterial.metalness = selectedLens.metalness;
|
|
37229
37766
|
}
|
|
37230
37767
|
}
|
|
37231
|
-
|
|
37232
|
-
// guiContainer!.innerHTML = '';
|
|
37233
|
-
// gui.destroy();
|
|
37234
|
-
// gui = new GUI({ autoPlace: false });
|
|
37235
|
-
// const datGuiContainer = document.createElement('div');
|
|
37236
|
-
// guiContainer!.appendChild(datGuiContainer);
|
|
37237
|
-
// datGuiContainer.appendChild(gui.domElement);
|
|
37238
|
-
// const opacityControl = gui
|
|
37239
|
-
// .add(selectedLens, 'opacity', 0, 1)
|
|
37240
|
-
// .name('Opacity');
|
|
37241
|
-
// opacityControl.onChange((opacity) => {
|
|
37242
|
-
// if (lensMaterial) {
|
|
37243
|
-
// lensMaterial.opacity = opacity;
|
|
37244
|
-
// }
|
|
37245
|
-
// });
|
|
37246
|
-
// const colorControl = gui.addColor(selectedLens, 'color').name(name);
|
|
37247
|
-
// colorControl.onChange((color) => {
|
|
37248
|
-
// if (lensMaterial) {
|
|
37249
|
-
// lensMaterial.color.set(color);
|
|
37250
|
-
// }
|
|
37251
|
-
// });
|
|
37252
|
-
// }
|
|
37253
|
-
// createGuiControlsGrad(selectedLens: any, name: any) {
|
|
37254
|
-
// guiContainer!.innerHTML = '';
|
|
37255
|
-
// gui.destroy();
|
|
37256
|
-
// gui = new GUI({ autoPlace: false });
|
|
37257
|
-
// const datGuiContainer = document.createElement('div');
|
|
37258
|
-
// guiContainer!.appendChild(datGuiContainer);
|
|
37259
|
-
// datGuiContainer.appendChild(gui.domElement);
|
|
37260
|
-
// const positionControl1 = gui
|
|
37261
|
-
// .add(selectedLens[0], 'position', 0, 1)
|
|
37262
|
-
// .name('position');
|
|
37263
|
-
// const positionControl2 = gui
|
|
37264
|
-
// .add(selectedLens[1], 'position', 0, 1)
|
|
37265
|
-
// .name('position');
|
|
37266
|
-
// const positionControl3 = gui
|
|
37267
|
-
// .add(selectedLens[2], 'position', 0, 1)
|
|
37268
|
-
// .name('position');
|
|
37269
|
-
// const positionControl4 = gui
|
|
37270
|
-
// .add(selectedLens[3], 'position', 0, 1)
|
|
37271
|
-
// .name('position');
|
|
37272
|
-
// positionControl1.onChange((position) => {
|
|
37273
|
-
// if (lensMaterial) {
|
|
37274
|
-
// gu.positions.value[0] = position;
|
|
37275
|
-
// }
|
|
37276
|
-
// });
|
|
37277
|
-
// positionControl2.onChange((position) => {
|
|
37278
|
-
// if (lensMaterial) {
|
|
37279
|
-
// gu.positions.value[1] = position;
|
|
37280
|
-
// }
|
|
37281
|
-
// });
|
|
37282
|
-
// positionControl3.onChange((position) => {
|
|
37283
|
-
// if (lensMaterial) {
|
|
37284
|
-
// gu.positions.value[2] = position;
|
|
37285
|
-
// }
|
|
37286
|
-
// });
|
|
37287
|
-
// positionControl4.onChange((position) => {
|
|
37288
|
-
// if (lensMaterial) {
|
|
37289
|
-
// gu.positions.value[3] = position;
|
|
37290
|
-
// }
|
|
37291
|
-
// });
|
|
37292
|
-
// const opacityControl1 = gui
|
|
37293
|
-
// .add(selectedLens[0], 'opacity', 0, 1)
|
|
37294
|
-
// .name('Opacity');
|
|
37295
|
-
// const opacityControl2 = gui
|
|
37296
|
-
// .add(selectedLens[1], 'opacity', 0, 1)
|
|
37297
|
-
// .name('Opacity');
|
|
37298
|
-
// const opacityControl3 = gui
|
|
37299
|
-
// .add(selectedLens[2], 'opacity', 0, 1)
|
|
37300
|
-
// .name('Opacity');
|
|
37301
|
-
// const opacityControl4 = gui
|
|
37302
|
-
// .add(selectedLens[3], 'opacity', 0, 1)
|
|
37303
|
-
// .name('Opacity');
|
|
37304
|
-
// opacityControl1.onChange((opacity) => {
|
|
37305
|
-
// if (lensMaterial) {
|
|
37306
|
-
// gu.opacities.value[0] = opacity;
|
|
37307
|
-
// }
|
|
37308
|
-
// });
|
|
37309
|
-
// opacityControl2.onChange((opacity) => {
|
|
37310
|
-
// if (lensMaterial) {
|
|
37311
|
-
// gu.opacities.value[1] = opacity;
|
|
37312
|
-
// }
|
|
37313
|
-
// });
|
|
37314
|
-
// opacityControl3.onChange((opacity) => {
|
|
37315
|
-
// if (lensMaterial) {
|
|
37316
|
-
// gu.opacities.value[2] = opacity;
|
|
37317
|
-
// }
|
|
37318
|
-
// });
|
|
37319
|
-
// opacityControl4.onChange((opacity) => {
|
|
37320
|
-
// if (lensMaterial) {
|
|
37321
|
-
// gu.opacities.value[3] = opacity;
|
|
37322
|
-
// }
|
|
37323
|
-
// });
|
|
37324
|
-
// const colorControl1 = gui.addColor(selectedLens[0], 'color').name(name);
|
|
37325
|
-
// const colorControl2 = gui.addColor(selectedLens[1], 'color').name(name);
|
|
37326
|
-
// const colorControl3 = gui.addColor(selectedLens[2], 'color').name(name);
|
|
37327
|
-
// const colorControl4 = gui.addColor(selectedLens[3], 'color').name(name);
|
|
37328
|
-
// colorControl1.onChange((color) => {
|
|
37329
|
-
// if (lensMaterial) {
|
|
37330
|
-
// gu.colors.value[0] = new THREE.Color(color);
|
|
37331
|
-
// }
|
|
37332
|
-
// });
|
|
37333
|
-
// colorControl2.onChange((color) => {
|
|
37334
|
-
// if (lensMaterial) {
|
|
37335
|
-
// gu.colors.value[1] = new THREE.Color(color);
|
|
37336
|
-
// }
|
|
37337
|
-
// });
|
|
37338
|
-
// colorControl3.onChange((color) => {
|
|
37339
|
-
// if (lensMaterial) {
|
|
37340
|
-
// gu.colors.value[2] = new THREE.Color(color);
|
|
37341
|
-
// }
|
|
37342
|
-
// });
|
|
37343
|
-
// colorControl4.onChange((color) => {
|
|
37344
|
-
// if (lensMaterial) {
|
|
37345
|
-
// gu.colors.value[3] = new THREE.Color(color);
|
|
37346
|
-
// }
|
|
37347
|
-
// });
|
|
37348
|
-
// }
|
|
37349
|
-
setupAndRenderScene(model) {
|
|
37350
|
-
this.scene.remove(this.scene.children[0], this.scene.children[2]);
|
|
37351
|
-
const Modelscene = model;
|
|
37768
|
+
setupAndRenderScene() {
|
|
37352
37769
|
const rgbeLoader = new RGBELoader();
|
|
37353
37770
|
rgbeLoader.load(
|
|
37354
37771
|
"https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/royal_esplanade_1k_desaturated.hdr",
|
|
37355
37772
|
(environmentMap) => {
|
|
37356
|
-
const
|
|
37357
|
-
|
|
37358
|
-
|
|
37773
|
+
const pmremGenerator = new PMREMGenerator(this.renderer);
|
|
37774
|
+
pmremGenerator.compileCubemapShader();
|
|
37775
|
+
const hdrCubeRenderTarget = pmremGenerator.fromEquirectangular(environmentMap).texture;
|
|
37776
|
+
this.scene.environment = hdrCubeRenderTarget;
|
|
37777
|
+
pmremGenerator.dispose();
|
|
37359
37778
|
}
|
|
37360
37779
|
);
|
|
37361
|
-
this.scene.add(Modelscene);
|
|
37362
37780
|
if (!this.camera || !this.renderer)
|
|
37363
37781
|
return;
|
|
37364
37782
|
this.scene.add(this.camera);
|
|
@@ -37373,8 +37791,8 @@ var __publicField = (obj, key, value) => {
|
|
|
37373
37791
|
2.2,
|
|
37374
37792
|
4
|
|
37375
37793
|
);
|
|
37376
|
-
controls.minDistance =
|
|
37377
|
-
controls.maxDistance =
|
|
37794
|
+
controls.minDistance = 2;
|
|
37795
|
+
controls.maxDistance = 7;
|
|
37378
37796
|
controls.enableDamping = true;
|
|
37379
37797
|
controls.dampingFactor = 0.2;
|
|
37380
37798
|
controls.enablePan = true;
|
|
@@ -37474,6 +37892,14 @@ var __publicField = (obj, key, value) => {
|
|
|
37474
37892
|
function updateShadowCamera() {
|
|
37475
37893
|
shadowCamera.updateProjectionMatrix();
|
|
37476
37894
|
}
|
|
37895
|
+
const outputPass = new OutputPass();
|
|
37896
|
+
const size = this.renderer.getDrawingBufferSize(new Vector2());
|
|
37897
|
+
const renderTarget2 = new WebGLRenderTarget(size.width, size.height, { samples: 4, type: HalfFloatType });
|
|
37898
|
+
const renderPass = new RenderPass(this.scene, this.camera);
|
|
37899
|
+
renderPass.clearAlpha = 0;
|
|
37900
|
+
let composer = new EffectComposer(this.renderer, renderTarget2);
|
|
37901
|
+
composer.addPass(renderPass);
|
|
37902
|
+
composer.addPass(outputPass);
|
|
37477
37903
|
const animate = () => {
|
|
37478
37904
|
controls.update();
|
|
37479
37905
|
const initialBackground = this.scene.background;
|
|
@@ -37483,18 +37909,35 @@ var __publicField = (obj, key, value) => {
|
|
|
37483
37909
|
return;
|
|
37484
37910
|
const initialClearAlpha = this.renderer.getClearAlpha();
|
|
37485
37911
|
this.renderer.setClearAlpha(0);
|
|
37912
|
+
this.renderer.clear();
|
|
37486
37913
|
this.renderer.setRenderTarget(renderTarget);
|
|
37487
37914
|
this.renderer.render(this.scene, shadowCamera);
|
|
37488
37915
|
this.scene.overrideMaterial = null;
|
|
37489
37916
|
blurShadow(state.shadow.blur, this.renderer);
|
|
37917
|
+
blurShadow(state.shadow.blur * 0.4, this.renderer);
|
|
37490
37918
|
this.renderer.setRenderTarget(null);
|
|
37491
37919
|
this.renderer.setClearAlpha(initialClearAlpha);
|
|
37492
37920
|
this.scene.background = initialBackground;
|
|
37493
|
-
this.renderer.render(this.scene, this.camera);
|
|
37494
37921
|
requestAnimationFrame(animate);
|
|
37922
|
+
composer.render();
|
|
37495
37923
|
};
|
|
37496
37924
|
animate();
|
|
37497
37925
|
}
|
|
37926
|
+
loadModelInsideScene(model) {
|
|
37927
|
+
this.scene.traverse((node) => {
|
|
37928
|
+
if (node.name == "Scene") {
|
|
37929
|
+
this.scene.remove(node);
|
|
37930
|
+
node.traverse((child) => {
|
|
37931
|
+
if (child instanceof Mesh) {
|
|
37932
|
+
child.geometry.dispose();
|
|
37933
|
+
child.material.dispose();
|
|
37934
|
+
}
|
|
37935
|
+
});
|
|
37936
|
+
}
|
|
37937
|
+
});
|
|
37938
|
+
const Modelscene = model;
|
|
37939
|
+
this.scene.add(Modelscene);
|
|
37940
|
+
}
|
|
37498
37941
|
}
|
|
37499
37942
|
const { warn } = console;
|
|
37500
37943
|
class SDKServiceFactory {
|
|
@@ -38462,6 +38905,7 @@ var __publicField = (obj, key, value) => {
|
|
|
38462
38905
|
}) {
|
|
38463
38906
|
customRenderer = new CustomRenderer(apiService);
|
|
38464
38907
|
customRenderer.intialize();
|
|
38908
|
+
customRenderer.setupAndRenderScene();
|
|
38465
38909
|
setLoading(true);
|
|
38466
38910
|
const frame = frameList[0];
|
|
38467
38911
|
const apiRes = await apiService.DownloadMA({
|
|
@@ -38547,16 +38991,20 @@ var __publicField = (obj, key, value) => {
|
|
|
38547
38991
|
});
|
|
38548
38992
|
}
|
|
38549
38993
|
} else if (hasSpecialDefaultLens && lens.sku != "lens-default") {
|
|
38550
|
-
|
|
38551
|
-
|
|
38552
|
-
|
|
38553
|
-
|
|
38554
|
-
|
|
38555
|
-
|
|
38556
|
-
|
|
38557
|
-
|
|
38558
|
-
|
|
38559
|
-
|
|
38994
|
+
if ((selectedLens == null ? void 0 : selectedLens.sku) == "lens-default") {
|
|
38995
|
+
setModelLoading(true);
|
|
38996
|
+
if (currentFrame) {
|
|
38997
|
+
const apiRes = await apiService.DownloadMA({
|
|
38998
|
+
orgId,
|
|
38999
|
+
assetsId: currentFrame._id
|
|
39000
|
+
});
|
|
39001
|
+
customRenderer.renderModel(apiRes.asset.cloudfrontUrl, renderAsIs, apiRes.decryptionKey).then(() => {
|
|
39002
|
+
setModelLoading(false);
|
|
39003
|
+
customRenderer.setupLensMaterial(lens);
|
|
39004
|
+
});
|
|
39005
|
+
}
|
|
39006
|
+
} else {
|
|
39007
|
+
customRenderer.setupLensMaterial(lens);
|
|
38560
39008
|
}
|
|
38561
39009
|
} else if (!hasSpecialDefaultLens && lens.sku == "lens-default") {
|
|
38562
39010
|
customRenderer.setupLensMaterial(includedLens);
|