@crystaldesign/real-time-viewer 25.7.0-beta.3 → 25.7.0-beta.30

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.
@@ -7,7 +7,7 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
7
7
  import _createClass from '@babel/runtime/helpers/createClass';
8
8
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
9
9
  import { Tags } from '@babylonjs/core/Misc/tags';
10
- import { Vector3, Matrix } from '@babylonjs/core/Maths/math.vector';
10
+ import { Vector3, Matrix, Vector2 } from '@babylonjs/core/Maths/math.vector';
11
11
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
12
12
  import { MeshBuilder } from '@babylonjs/core/Meshes/meshBuilder';
13
13
  import { ActionManager } from '@babylonjs/core/Actions/actionManager';
@@ -30,6 +30,8 @@ import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
30
30
  import { AdvancedDynamicTexture } from '@babylonjs/gui/2D/advancedDynamicTexture';
31
31
  import { Button } from '@babylonjs/gui/2D/controls/button';
32
32
  import { Ellipse } from '@babylonjs/gui/2D/controls/ellipse';
33
+ import { Effect } from '@babylonjs/core/Materials/effect';
34
+ import { ShaderMaterial } from '@babylonjs/core/Materials/shaderMaterial';
33
35
  import '@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicTexture';
34
36
  import '@babylonjs/core/Engines/WebGPU/Extensions/engine.multiRender';
35
37
  import '@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTarget';
@@ -38,7 +40,6 @@ import { Rectangle } from '@babylonjs/gui/2D/controls/rectangle';
38
40
  import { TextBlock } from '@babylonjs/gui/2D/controls/textBlock';
39
41
  import { Mesh } from '@babylonjs/core/Meshes/mesh';
40
42
  import { Axis } from '@babylonjs/core/Maths/math.axis';
41
- import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
42
43
  import { Texture } from '@babylonjs/core/Materials/Textures/texture';
43
44
  import { Constants } from '@babylonjs/core/Engines/constants';
44
45
  import { HighlightLayer } from '@babylonjs/core/Layers';
@@ -175,7 +176,7 @@ function GetCameraControls(camera) {
175
176
  beta = _calculateAngles.beta,
176
177
  distance = _calculateAngles.distance;
177
178
  alpha = alpha + deltaX * -0.003;
178
- beta = clamp(beta + deltaY * -0.003, 0.1, Math.PI - 0.1);
179
+ beta = clamp(beta + deltaY * -0.003, 0.1, Math.PI / 2);
179
180
  var x = sceneStore.cameraTargetPosition.x + distance * Math.sin(beta) * Math.cos(alpha);
180
181
  var y = sceneStore.cameraTargetPosition.y + distance * Math.cos(beta);
181
182
  var z = sceneStore.cameraTargetPosition.z + distance * Math.sin(beta) * Math.sin(alpha);
@@ -893,7 +894,6 @@ function createCams(scene, viewpoint) {
893
894
  var _useUtilStoreContext = useUtilStoreContext(),
894
895
  vector3ToBVector3 = _useUtilStoreContext.vector3ToBVector3,
895
896
  degreesToRadians = _useUtilStoreContext.degreesToRadians;
896
- useUIStoreContext();
897
897
  function createCam(_ref) {
898
898
  var name = _ref.name,
899
899
  pos = _ref.pos,
@@ -997,7 +997,7 @@ function shadow() {
997
997
  scene = _useSceneStoreContext.scene;
998
998
  var _useUtilStoreContext = useUtilStoreContext(),
999
999
  degreesToRadians = _useUtilStoreContext.degreesToRadians;
1000
- if (!hasRendered) {
1000
+ if (!hasRendered && !scene.getMeshByName('ground')) {
1001
1001
  var light = new DirectionalLight('dirl', new Vector3(-1, 0, 0), scene);
1002
1002
  var lightf = new DirectionalLight('dirf', new Vector3(0, -0.436, -0.9), scene);
1003
1003
  var lightr = new DirectionalLight('dirr', new Vector3(0, -1, 0.3), scene);
@@ -1846,6 +1846,7 @@ var UIStore = /*#__PURE__*/function () {
1846
1846
  _defineProperty(this, "_elementsInfo", void 0);
1847
1847
  _defineProperty(this, "_diffuseTexture", void 0);
1848
1848
  _defineProperty(this, "_plane", void 0);
1849
+ _defineProperty(this, "_shaderMat", void 0);
1849
1850
  _defineProperty(this, "_selectedMeshes", []);
1850
1851
  _defineProperty(this, "_isUnityComb", false);
1851
1852
  _defineProperty(this, "_selectedHl", void 0);
@@ -1854,41 +1855,57 @@ var UIStore = /*#__PURE__*/function () {
1854
1855
  _defineProperty(this, "_isMobile", void 0);
1855
1856
  _defineProperty(this, "_guiIsPicked", void 0);
1856
1857
  _defineProperty(this, "updateOverlayImage", function (overlayImage) {
1857
- var _this$_diffuseTexture, _this$_runRenderLoopF;
1858
- if (!overlayImage || !_this._scene || !_this._scene.activeCamera || ((_this$_diffuseTexture = _this._diffuseTexture) === null || _this$_diffuseTexture === void 0 ? void 0 : _this$_diffuseTexture.url) == overlayImage.base64) return;
1858
+ var _this$_diffuseTexture;
1859
+ if (!overlayImage || !_this._scene || ((_this$_diffuseTexture = _this._diffuseTexture) === null || _this$_diffuseTexture === void 0 ? void 0 : _this$_diffuseTexture.url) == overlayImage.base64) return;
1860
+ if (!_this._scene.activeCamera) createCams(_this._scene, undefined);
1859
1861
  var utilStore = useUtilStoreContext();
1860
1862
  if (!utilStore || !utilStore.updateCam) return;
1861
1863
  _this._isStaticBg = overlayImage.isStaticBg;
1862
- if (_this._isStaticBg)
1864
+ if (_this._isStaticBg) {
1863
1865
  // no highlightlayer on static room bg
1864
1866
  _this.deactivateHighlightLayer();
1865
- _this._plane.setEnabled(false);
1867
+ _this._plane.setEnabled(true);
1868
+ } else
1869
+ // never switch to rtv when in room
1870
+ _this._plane.setEnabled(false);
1866
1871
  _this.resize();
1867
1872
  _this._diffuseTexture.updateURL(overlayImage.base64, undefined, function () {
1868
- return _this.fadeInOverlayImage(_this._plane.visibility == 1);
1873
+ return _this.fadeInOverlayImage(_this._plane.visibility == 1 || !!_this._isStaticBg);
1869
1874
  });
1870
- (_this$_runRenderLoopF = _this._runRenderLoopForTime) === null || _this$_runRenderLoopF === void 0 || _this$_runRenderLoopF.call(_this, 2000);
1871
1875
  });
1872
1876
  this._scene = scene;
1873
1877
  this._tabgroupTypeActive = tabgroupTypeActive;
1874
1878
  this._isMobile = !!isMobile;
1875
1879
  this._guiIsPicked = false;
1876
- var mat = new StandardMaterial('planeMat', scene);
1880
+
1881
+ // Define shader
1882
+ Effect.ShadersStore["customVertexShader"] = "\n precision highp float;\n\n attribute vec3 position;\n attribute vec2 uv;\n\n uniform mat4 worldViewProjection;\n\n varying vec2 vUV;\n\n void main(void) {\n gl_Position = worldViewProjection * vec4(position, 1.0);\n vUV = uv;\n }\n ";
1883
+ Effect.ShadersStore["customFragmentShader"] = "\n precision highp float;\n\n varying vec2 vUV;\n\n uniform sampler2D textureSampler;\n uniform vec2 scale;\n uniform float visibility;\n\n void main(void) {\n vec2 center = vec2(0.5, 0.5);\n vec2 halfScale = scale * 0.5;\n vec2 minUV = center - halfScale;\n vec2 maxUV = center + halfScale;\n\n // Always sample the texture\n vec2 localUV = (vUV - minUV) / scale;\n vec4 texColor = texture2D(textureSampler, localUV);\n\n // Calculate mask: 1.0 inside, 0.0 outside\n float inside = step(minUV.x, vUV.x) * step(vUV.x, maxUV.x)\n * step(minUV.y, vUV.y) * step(vUV.y, maxUV.y);\n\n // Mix texture and white\n vec4 finalColor = mix(vec4(1.0), texColor, inside);\n gl_FragColor = finalColor;\n gl_FragColor.a *= visibility;\n }\n ";
1884
+
1885
+ // Create material
1886
+ var shaderMat = new ShaderMaterial("shader", scene, {
1887
+ vertex: "custom",
1888
+ fragment: "custom"
1889
+ }, {
1890
+ attributes: ["position", "uv"],
1891
+ uniforms: ["worldViewProjection", "scale", "visibility"],
1892
+ samplers: ["textureSampler"]
1893
+ });
1877
1894
  this._diffuseTexture = new Texture((_overlayImage$base = _overlayImage === null || _overlayImage === void 0 ? void 0 : _overlayImage.base64) !== null && _overlayImage$base !== void 0 ? _overlayImage$base : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAwAB/ep3wWkAAAAASUVORK5CYII=', scene, false, true);
1895
+ shaderMat.setTexture("textureSampler", this._diffuseTexture);
1896
+ shaderMat.setVector2("scale", new Vector2(1, 1)); // adjust scale here
1897
+ shaderMat.alpha = 1;
1898
+ shaderMat.backFaceCulling = true;
1878
1899
  this._diffuseTexture.anisotropicFilteringLevel = 16;
1879
1900
  this._diffuseTexture.updateSamplingMode(Texture.TRILINEAR_SAMPLINGMODE);
1880
- mat.bumpTexture = null;
1881
- mat.diffuseTexture = this._diffuseTexture;
1882
- mat.emissiveTexture = this._diffuseTexture;
1883
- mat.specularColor = Color3.Black();
1884
1901
 
1885
1902
  // Get aspect ratio of the current screen
1886
1903
  this._plane = MeshBuilder.CreatePlane('overlayplane', {
1887
1904
  size: 1
1888
1905
  }, scene);
1889
1906
  this._plane.setEnabled(false);
1890
- this._plane.material = mat;
1891
- this._plane.visibility = 0;
1907
+ this._plane.material = shaderMat;
1908
+ this._shaderMat = shaderMat;
1892
1909
 
1893
1910
  // Position it in front of the camera
1894
1911
  this._plane.position.z = 0.11;
@@ -1921,6 +1938,7 @@ var UIStore = /*#__PURE__*/function () {
1921
1938
  if (_overlayImage) {
1922
1939
  this._isUnityComb = true;
1923
1940
  this._enableSSAO(false);
1941
+ if (_overlayImage.isStaticBg) this.fadeInOverlayImage(true);
1924
1942
  }
1925
1943
  this._runRenderLoopForTime = runRenderLoopForTime;
1926
1944
  }
@@ -1959,6 +1977,7 @@ var UIStore = /*#__PURE__*/function () {
1959
1977
  key: "fadeOutOverlayImage",
1960
1978
  value: function fadeOutOverlayImage() {
1961
1979
  this._plane.visibility = 0;
1980
+ this._shaderMat.setFloat("visiblity", 0);
1962
1981
  var root = this._scene.getTransformNodeByName('Root');
1963
1982
  if (root) root.getChildMeshes().forEach(function (m) {
1964
1983
  m.visibility = 1;
@@ -1969,17 +1988,18 @@ var UIStore = /*#__PURE__*/function () {
1969
1988
  }
1970
1989
  }, {
1971
1990
  key: "fadeInOverlayImage",
1972
- value: function fadeInOverlayImage(shorter) {
1991
+ value: function fadeInOverlayImage(skip) {
1973
1992
  var _this3 = this;
1974
1993
  var startTime = performance.now();
1975
1994
  this._plane.setEnabled(true);
1976
1995
  this._selectedHl.addExcludedMesh(this._plane);
1977
1996
  var _animate = function animate() {
1978
1997
  var elapsedTime = performance.now() - startTime;
1979
- var progress = Math.min(elapsedTime / (shorter ? 50 : 500), 1); // Normalize progress (0 to 1)
1998
+ var progress = Math.min(elapsedTime / 500, 1); // Normalize progress (0 to 1)
1980
1999
 
1981
- _this3._plane.visibility = progress;
1982
- if (progress < 1) {
2000
+ _this3._plane.visibility = skip ? 1 : progress;
2001
+ _this3._shaderMat.setFloat("visibility", skip ? 1 : progress);
2002
+ if (!skip && progress < 1) {
1983
2003
  requestAnimationFrame(_animate);
1984
2004
  } else {
1985
2005
  //animation finished
@@ -2055,7 +2075,13 @@ var UIStore = /*#__PURE__*/function () {
2055
2075
  var size = this._diffuseTexture.getSize();
2056
2076
  var engine = this._scene.getEngine();
2057
2077
  if (Math.round(size.width / size.height * 100) / 100 != Math.round(engine.getRenderWidth() / engine.getRenderHeight() * 100) / 100) {
2058
- this.fadeOutOverlayImage();
2078
+ if (!this._isStaticBg) {
2079
+ this.fadeOutOverlayImage();
2080
+ } else {
2081
+ var ratio = size.width / size.height;
2082
+ var engineRatio = engine.getRenderWidth() / engine.getRenderHeight();
2083
+ this._shaderMat.setVector2("scale", new Vector2(1 / (engineRatio / ratio), 1)); // adjust scale here */
2084
+ }
2059
2085
  }
2060
2086
  this._gui.dispose();
2061
2087
  this._gui = AdvancedDynamicTexture.CreateFullscreenUI('UI', true, this._scene);
@@ -2077,9 +2103,9 @@ var UIStore = /*#__PURE__*/function () {
2077
2103
  }, {
2078
2104
  key: "pointerOverElement",
2079
2105
  value: function pointerOverElement(element) {
2080
- var _this$_runRenderLoopF2,
2106
+ var _this$_runRenderLoopF,
2081
2107
  _this5 = this;
2082
- this.unityCombActive && ((_this$_runRenderLoopF2 = this._runRenderLoopForTime) === null || _this$_runRenderLoopF2 === void 0 ? void 0 : _this$_runRenderLoopF2.call(this, 1000));
2108
+ this.unityCombActive && ((_this$_runRenderLoopF = this._runRenderLoopForTime) === null || _this$_runRenderLoopF === void 0 ? void 0 : _this$_runRenderLoopF.call(this, 1000));
2083
2109
  this._selectedHl.removeAllMeshes();
2084
2110
  this._selectedHl.addExcludedMesh(this._plane);
2085
2111
  if (this._plane.visibility == 1) this._selectedMeshes.forEach(function (_m) {
@@ -2093,9 +2119,9 @@ var UIStore = /*#__PURE__*/function () {
2093
2119
  }, {
2094
2120
  key: "pointerOutElement",
2095
2121
  value: function pointerOutElement(element) {
2096
- var _this$_runRenderLoopF3,
2122
+ var _this$_runRenderLoopF2,
2097
2123
  _this6 = this;
2098
- this.unityCombActive && ((_this$_runRenderLoopF3 = this._runRenderLoopForTime) === null || _this$_runRenderLoopF3 === void 0 ? void 0 : _this$_runRenderLoopF3.call(this, 1000));
2124
+ this.unityCombActive && ((_this$_runRenderLoopF2 = this._runRenderLoopForTime) === null || _this$_runRenderLoopF2 === void 0 ? void 0 : _this$_runRenderLoopF2.call(this, 1000));
2099
2125
  this._selectedHl.removeAllMeshes();
2100
2126
  this._selectedHl.addExcludedMesh(this._plane);
2101
2127
  if (this._plane.visibility == 1) element.getChildMeshes().forEach(function (_m) {
@@ -2405,7 +2431,7 @@ var UIStore = /*#__PURE__*/function () {
2405
2431
  }, {
2406
2432
  key: "onMove",
2407
2433
  value: function onMove() {
2408
- if (!this._isUnityComb) return;
2434
+ if (!this._isUnityComb || this._isStaticBg) return;
2409
2435
  if (this._plane.visibility != 0) {
2410
2436
  this._enableSSAO(true);
2411
2437
  this.fadeOutOverlayImage();
@@ -2417,7 +2443,7 @@ var UIStore = /*#__PURE__*/function () {
2417
2443
  value: function requestNewOverlayImage(viewpoint, focusedElement, targetCameraPosition, updateCameraInformation) {
2418
2444
  var _this11 = this;
2419
2445
  //this._overlayImage exists only when unity combi is enabled
2420
- if (!this._isUnityComb) return;
2446
+ if (!this._isUnityComb || this._isStaticBg) return;
2421
2447
  var elementId = undefined;
2422
2448
  var setId = undefined;
2423
2449
  var ob = this._scene.getTransformNodeByName(focusedElement.name);
@@ -2841,12 +2867,10 @@ var customMat = /*#__PURE__*/function () {
2841
2867
  var setDataRow,
2842
2868
  sceneStore,
2843
2869
  url,
2870
+ doReCtrTex,
2844
2871
  _mat,
2845
2872
  res,
2846
2873
  parsedMat,
2847
- baseTexture,
2848
- mRTexture,
2849
- nTexture,
2850
2874
  found,
2851
2875
  mat,
2852
2876
  _args = arguments;
@@ -2863,27 +2887,34 @@ var customMat = /*#__PURE__*/function () {
2863
2887
  url.searchParams.append('debug', JSON.stringify(!!sceneStore.apiConfig.useDebugUrl));
2864
2888
  if (_customMat.tiling) url.searchParams.append('tiling', JSON.stringify(_customMat.tiling));
2865
2889
  _context.prev = 9;
2866
- _context.next = 12;
2890
+ // need to re construct the textures, due to data loss(tiling, mimetype, etc.) on glbasync export after parse/serialize of a mat
2891
+ // just triggers the right things for that to work, texture itself is cached so no real perf impact
2892
+ doReCtrTex = function doReCtrTex(texture) {
2893
+ if (!texture) return texture;
2894
+ var reCtrTex = new Texture(texture.url, _customMat.scene);
2895
+ reCtrTex.uScale = texture.uScale;
2896
+ reCtrTex.vScale = texture.vScale;
2897
+ reCtrTex._mimeType = texture.url.endsWith('.jpg') ? 'image/jpeg' : 'image/png';
2898
+ return reCtrTex;
2899
+ };
2900
+ _context.next = 13;
2867
2901
  return fetch(url.toString(), {
2868
2902
  method: 'GET',
2869
2903
  headers: {
2870
2904
  Authorization: "Bearer ".concat(sceneStore.jwt)
2871
2905
  }
2872
2906
  });
2873
- case 12:
2907
+ case 13:
2874
2908
  _mat = _context.sent;
2875
- _context.next = 15;
2909
+ _context.next = 16;
2876
2910
  return _mat.json();
2877
- case 15:
2911
+ case 16:
2878
2912
  res = _context.sent;
2879
2913
  parsedMat = PBRMetallicRoughnessMaterial.Parse(res, _customMat.scene, '');
2880
2914
  parsedMat.name = _customMat.name;
2881
- baseTexture = parsedMat.baseTexture;
2882
- mRTexture = parsedMat.metallicRoughnessTexture;
2883
- nTexture = parsedMat.normalTexture;
2884
- if (baseTexture) baseTexture._mimeType = baseTexture.url.endsWith('.jpg') ? 'image/jpeg' : 'image/png';
2885
- if (mRTexture) mRTexture._mimeType = mRTexture.url.endsWith('.jpg') ? 'image/jpeg' : 'image/png';
2886
- if (nTexture) nTexture._mimeType = nTexture.url.endsWith('.jpg') ? 'image/jpeg' : 'image/png';
2915
+ parsedMat.baseTexture = doReCtrTex(parsedMat.baseTexture);
2916
+ parsedMat.metallicRoughnessTexture = doReCtrTex(parsedMat.metallicRoughnessTexture);
2917
+ parsedMat.normalTexture = doReCtrTex(parsedMat.normalTexture);
2887
2918
  found = !!parsedMat.baseTexture;
2888
2919
  if (!found) LOG$1.warn('MISSING_MATERIAL: could not get material ' + _customMat.name + ' for iln ' + _customMat.blob);
2889
2920
  if (setDataRow) useUtilStoreContext().setAnalyzeDataRow({
@@ -2898,8 +2929,8 @@ var customMat = /*#__PURE__*/function () {
2898
2929
  mat: parsedMat,
2899
2930
  found: true
2900
2931
  });
2901
- case 30:
2902
- _context.prev = 30;
2932
+ case 28:
2933
+ _context.prev = 28;
2903
2934
  _context.t0 = _context["catch"](9);
2904
2935
  if (setDataRow) useUtilStoreContext().setAnalyzeDataRow({
2905
2936
  type: 'MAT',
@@ -2909,17 +2940,17 @@ var customMat = /*#__PURE__*/function () {
2909
2940
  path: _customMat.blob,
2910
2941
  sizeMb: 0
2911
2942
  });
2912
- case 33:
2943
+ case 31:
2913
2944
  mat = new PBRMetallicRoughnessMaterial(_customMat.name, _customMat.scene);
2914
2945
  return _context.abrupt("return", {
2915
2946
  mat: mat,
2916
2947
  found: true
2917
2948
  });
2918
- case 35:
2949
+ case 33:
2919
2950
  case "end":
2920
2951
  return _context.stop();
2921
2952
  }
2922
- }, _callee, null, [[9, 30]]);
2953
+ }, _callee, null, [[9, 28]]);
2923
2954
  }));
2924
2955
  return function customMat(_x) {
2925
2956
  return _ref.apply(this, arguments);
@@ -3300,26 +3331,27 @@ function createOrGetMaterial(_x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10) {
3300
3331
  }
3301
3332
  function _createOrGetMaterial() {
3302
3333
  _createOrGetMaterial = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(name, blob, fileName, checkExisting, isStdMat, isIDM3D, tiling, setDataRow) {
3303
- var sceneStore, _iterator5, _step5, cachedMaterial, mat, material;
3334
+ var sceneStore, uiStore, _iterator5, _step5, cachedMaterial, mat, material;
3304
3335
  return _regeneratorRuntime.wrap(function _callee4$(_context6) {
3305
3336
  while (1) switch (_context6.prev = _context6.next) {
3306
3337
  case 0:
3307
3338
  sceneStore = useSceneStoreContext();
3339
+ uiStore = useUIStoreContext();
3308
3340
  if (!checkExisting) {
3309
- _context6.next = 20;
3341
+ _context6.next = 21;
3310
3342
  break;
3311
3343
  }
3312
3344
  _iterator5 = _createForOfIteratorHelper$3(sceneStore.materialCache);
3313
- _context6.prev = 3;
3345
+ _context6.prev = 4;
3314
3346
  _iterator5.s();
3315
- case 5:
3347
+ case 6:
3316
3348
  if ((_step5 = _iterator5.n()).done) {
3317
- _context6.next = 12;
3349
+ _context6.next = 13;
3318
3350
  break;
3319
3351
  }
3320
3352
  cachedMaterial = _step5.value;
3321
3353
  if (!(name === cachedMaterial.mat.name)) {
3322
- _context6.next = 10;
3354
+ _context6.next = 11;
3323
3355
  break;
3324
3356
  }
3325
3357
  cachedMaterial.lastUsage = sceneStore.modelIteration;
@@ -3327,21 +3359,21 @@ function _createOrGetMaterial() {
3327
3359
  mat: cachedMaterial.mat,
3328
3360
  found: true
3329
3361
  });
3330
- case 10:
3331
- _context6.next = 5;
3362
+ case 11:
3363
+ _context6.next = 6;
3332
3364
  break;
3333
- case 12:
3334
- _context6.next = 17;
3365
+ case 13:
3366
+ _context6.next = 18;
3335
3367
  break;
3336
- case 14:
3337
- _context6.prev = 14;
3338
- _context6.t0 = _context6["catch"](3);
3368
+ case 15:
3369
+ _context6.prev = 15;
3370
+ _context6.t0 = _context6["catch"](4);
3339
3371
  _iterator5.e(_context6.t0);
3340
- case 17:
3341
- _context6.prev = 17;
3372
+ case 18:
3373
+ _context6.prev = 18;
3342
3374
  _iterator5.f();
3343
- return _context6.finish(17);
3344
- case 20:
3375
+ return _context6.finish(18);
3376
+ case 21:
3345
3377
  mat = {
3346
3378
  isStdMat: !!isStdMat,
3347
3379
  isIDM3D: isIDM3D,
@@ -3351,10 +3383,11 @@ function _createOrGetMaterial() {
3351
3383
  scene: sceneStore.scene,
3352
3384
  tiling: tiling
3353
3385
  };
3354
- _context6.next = 23;
3386
+ _context6.next = 24;
3355
3387
  return customMat(mat, setDataRow);
3356
- case 23:
3388
+ case 24:
3357
3389
  material = _context6.sent;
3390
+ if (uiStore.unityCombActive) material.mat.disableColorWrite = true;
3358
3391
  sceneStore.addMaterialToCache({
3359
3392
  mat: material.mat,
3360
3393
  isStdMat: isStdMat,
@@ -3364,11 +3397,11 @@ function _createOrGetMaterial() {
3364
3397
  mat: material.mat,
3365
3398
  found: material.found
3366
3399
  });
3367
- case 26:
3400
+ case 28:
3368
3401
  case "end":
3369
3402
  return _context6.stop();
3370
3403
  }
3371
- }, _callee4, null, [[3, 14, 17, 20]]);
3404
+ }, _callee4, null, [[4, 15, 18, 21]]);
3372
3405
  }));
3373
3406
  return _createOrGetMaterial.apply(this, arguments);
3374
3407
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CustomMaterial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAI1G,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAGD,QAAA,MAAM,SAAS,cAAqB,cAAc,eAAc,OAAO,KAAU,OAAO,CAAC;IAAE,GAAG,EAAE,4BAA4B,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAyC7I,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CustomMaterial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAK1G,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAGD,QAAA,MAAM,SAAS,cAAqB,cAAc,eAAc,OAAO,KAAU,OAAO,CAAC;IAAE,GAAG,EAAE,4BAA4B,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAiD7I,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/createCams/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAoEhG;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,QA+B/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/createCams/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAmEhG;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,QA+B/D"}
@@ -28,6 +28,7 @@ export declare class UIStore {
28
28
  private _elementsInfo?;
29
29
  private _diffuseTexture;
30
30
  private _plane;
31
+ private _shaderMat;
31
32
  private _selectedMeshes;
32
33
  private _isUnityComb;
33
34
  private _selectedHl;
@@ -1 +1 @@
1
- {"version":3,"file":"UIStore.d.ts","sourceRoot":"","sources":["../../../../../src/store/UIStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAKrE,OAAO,iEAAiE,CAAC;AACzE,OAAO,8DAA8D,CAAC;AACtE,OAAO,+DAA+D,CAAC;AACvE,OAAO,sEAAsE,CAAC;AAM9E,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAA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