@crystaldesign/real-time-viewer 26.4.0-beta.2 → 26.4.0-beta.21

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.
Files changed (35) hide show
  1. package/build/esm/index.js +88 -57
  2. package/build/types/real-time-viewer/src/parser/buildScene/index.d.ts.map +1 -1
  3. package/build/types/real-time-viewer/src/parser/findAssets/index.d.ts.map +1 -1
  4. package/build/types/real-time-viewer/src/parser/findMaterials/index.d.ts.map +1 -1
  5. package/build/umd/105.real-time-viewer.umd.min.js +2 -0
  6. package/build/umd/105.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  7. package/build/umd/214.real-time-viewer.umd.min.js +2 -0
  8. package/build/umd/214.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  9. package/build/umd/245.real-time-viewer.umd.min.js +2 -0
  10. package/build/umd/245.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  11. package/build/umd/271.real-time-viewer.umd.min.js +2 -0
  12. package/build/umd/271.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  13. package/build/umd/281.real-time-viewer.umd.min.js +2 -0
  14. package/build/umd/281.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  15. package/build/umd/305.real-time-viewer.umd.min.js +2 -0
  16. package/build/umd/305.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  17. package/build/umd/346.real-time-viewer.umd.min.js +2 -0
  18. package/build/umd/346.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  19. package/build/umd/350.real-time-viewer.umd.min.js +2 -0
  20. package/build/umd/350.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  21. package/build/umd/375.real-time-viewer.umd.min.js +2 -0
  22. package/build/umd/375.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  23. package/build/umd/583.real-time-viewer.umd.min.js +2 -0
  24. package/build/umd/583.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  25. package/build/umd/702.real-time-viewer.umd.min.js +2 -0
  26. package/build/umd/702.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  27. package/build/umd/794.real-time-viewer.umd.min.js +2 -0
  28. package/build/umd/794.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  29. package/build/umd/799.real-time-viewer.umd.min.js +2 -0
  30. package/build/umd/799.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  31. package/build/umd/979.real-time-viewer.umd.min.js +2 -0
  32. package/build/umd/979.real-time-viewer.umd.min.js.LICENSE.txt +1 -0
  33. package/build/umd/real-time-viewer.umd.min.js +1 -1
  34. package/build/umd/report.html +1 -1
  35. package/package.json +16 -13
@@ -50,10 +50,9 @@ import { EngineFactory } from '@babylonjs/core/Engines/engineFactory';
50
50
  import { Scene } from '@babylonjs/core/scene';
51
51
  import { DracoCompression } from '@babylonjs/core/Meshes/Compression/dracoCompression';
52
52
  import { loadAssetContainerAsync } from '@babylonjs/core/Loading/index';
53
- import { useSceneStoreContext as useSceneStoreContext$1 } from '@crystaldesign/real-time-viewer/context';
54
- import { PBRMetallicRoughnessMaterial as PBRMetallicRoughnessMaterial$1, Texture as Texture$1, WebGPUEngine } from '@babylonjs/core';
55
53
  import '@babylonjs/loaders/glTF/2.0/';
56
54
  import { UniversalCamera } from '@babylonjs/core/Cameras/universalCamera';
55
+ import { WebGPUEngine } from '@babylonjs/core';
57
56
  import { jsxs, jsx } from 'react/jsx-runtime';
58
57
 
59
58
  (function() {
@@ -520,11 +519,12 @@ function Grids () {
520
519
  var _neighbourSize = (_neighbourBottom$plan3 = (_neighbourBottom$plan4 = neighbourBottom.plannedElement) === null || _neighbourBottom$plan4 === void 0 ? void 0 : _neighbourBottom$plan4.size) !== null && _neighbourBottom$plan3 !== void 0 ? _neighbourBottom$plan3 : gp.selectedElement.size;
521
520
  pos = new Vector3(neighbourElementBottom.bbn.position.x + size.width / 200, neighbourElementBottom.bbn.position.y + (_neighbourSize.height + size.height / 2) / 100, 0);
522
521
  } else if (cell.index.x == -1 && neighbourRight) {
522
+ var _neighbourElementRigh;
523
523
  var neighbourElementRight = sceneStore.elements.find(function (el) {
524
524
  var _elementId$toString;
525
525
  return el.hqs.name.endsWith((_elementId$toString = neighbourRight.plannedElement.elementId.toString()) !== null && _elementId$toString !== void 0 ? _elementId$toString : "-1");
526
526
  });
527
- pos = new Vector3(neighbourElementRight.bbn.position.x - size.width / 200, size.height / 200, 0);
527
+ pos = new Vector3(((_neighbourElementRigh = neighbourElementRight === null || neighbourElementRight === void 0 ? void 0 : neighbourElementRight.bbn.position.x) !== null && _neighbourElementRigh !== void 0 ? _neighbourElementRigh : 0) - size.width / 200, size.height / 200, 0);
528
528
  }
529
529
  var box = createPreviewBox('box', name, {
530
530
  width: (size.width + 1) / 100,
@@ -3278,7 +3278,7 @@ function _findAssets() {
3278
3278
  case 0:
3279
3279
  _importGeo = function _importGeo3() {
3280
3280
  _importGeo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(geo, path) {
3281
- var geoCached, cachedGeos, unusedGeos, geoCountToDelete, nextToDelete, size, result, mesh, _sceneStore$onMissing;
3281
+ var geoCached, size, result, mesh, _sceneStore$onMissing;
3282
3282
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
3283
3283
  while (1) switch (_context2.prev = _context2.next) {
3284
3284
  case 0:
@@ -3295,31 +3295,11 @@ function _findAssets() {
3295
3295
  };
3296
3296
  return _context2.abrupt("return", geoCached);
3297
3297
  case 4:
3298
- // cache max size otherwise some devices crash (ram to high)
3299
- cachedGeos = cacheGroup.getChildren(undefined, true);
3300
- if (cachedGeos.length > 10) {
3301
- // find unused geos
3302
- unusedGeos = cachedGeos.filter(function (g) {
3303
- return !cache.find(function (c) {
3304
- var _c$geo;
3305
- return ((_c$geo = c.geo) === null || _c$geo === void 0 ? void 0 : _c$geo.geometry.uniqueId) == g.uniqueId;
3306
- });
3307
- });
3308
- geoCountToDelete = cachedGeos.length - 10;
3309
- while (geoCountToDelete > 0 && unusedGeos.length > 0) {
3310
- nextToDelete = unusedGeos.reduce(function (oIdx, cur, curIdx, ar) {
3311
- return cur.metadata.lastUsed < ar[oIdx].metadata.lastUsed ? curIdx : oIdx;
3312
- }, 0);
3313
- unusedGeos[nextToDelete].dispose();
3314
- unusedGeos.splice(nextToDelete, 1);
3315
- geoCountToDelete--;
3316
- }
3317
- }
3318
3298
  size = 0;
3319
- _context2.prev = 7;
3320
- _context2.next = 10;
3299
+ _context2.prev = 5;
3300
+ _context2.next = 8;
3321
3301
  return loadAssetContainerAsync(path + geo.name + '.glb', sceneStore.scene);
3322
- case 10:
3302
+ case 8:
3323
3303
  result = _context2.sent;
3324
3304
  utilStore.setAnalyzeDataRow({
3325
3305
  name: geo.name,
@@ -3341,9 +3321,9 @@ function _findAssets() {
3341
3321
  lastUsed: Date.now()
3342
3322
  };
3343
3323
  return _context2.abrupt("return", mesh);
3344
- case 24:
3345
- _context2.prev = 24;
3346
- _context2.t0 = _context2["catch"](7);
3324
+ case 22:
3325
+ _context2.prev = 22;
3326
+ _context2.t0 = _context2["catch"](5);
3347
3327
  (_sceneStore$onMissing = sceneStore.onMissingGeo) === null || _sceneStore$onMissing === void 0 || _sceneStore$onMissing.call(sceneStore);
3348
3328
  utilStore.setAnalyzeDataRow({
3349
3329
  name: geo.name,
@@ -3354,11 +3334,11 @@ function _findAssets() {
3354
3334
  found: false
3355
3335
  });
3356
3336
  return _context2.abrupt("return", undefined);
3357
- case 29:
3337
+ case 27:
3358
3338
  case "end":
3359
3339
  return _context2.stop();
3360
3340
  }
3361
- }, _callee2, null, [[7, 24]]);
3341
+ }, _callee2, null, [[5, 22]]);
3362
3342
  }));
3363
3343
  return _importGeo.apply(this, arguments);
3364
3344
  };
@@ -3818,8 +3798,6 @@ var buildScene = function buildScene(_ref) {
3818
3798
  }
3819
3799
  }
3820
3800
  }
3821
-
3822
- // fill onElement for caching and other for applying in findmaterials
3823
3801
  function findMats(curMat, parentNode) {
3824
3802
  var cachedElement = cachedAssets.find(function (assets) {
3825
3803
  return assets.id == curMat.id;
@@ -3906,6 +3884,26 @@ var buildScene = function buildScene(_ref) {
3906
3884
  }
3907
3885
  }
3908
3886
  recursiveIteration(startNode, parentNode);
3887
+ // cache max size otherwise some devices crash (ram to high)
3888
+ var cachedGeos = cache.getChildren(undefined, true);
3889
+ if (cachedGeos.length > 10) {
3890
+ // find unused geos
3891
+ var unusedGeos = cachedGeos.filter(function (g) {
3892
+ return !cachedAssets.find(function (c) {
3893
+ var _c$geo;
3894
+ return ((_c$geo = c.geo) === null || _c$geo === void 0 ? void 0 : _c$geo.geometry.uniqueId) == g.uniqueId;
3895
+ });
3896
+ });
3897
+ var geoCountToDelete = cachedGeos.length - 10;
3898
+ while (geoCountToDelete > 0 && unusedGeos.length > 0) {
3899
+ var nextToDelete = unusedGeos.reduce(function (oIdx, cur, curIdx, ar) {
3900
+ return cur.metadata.lastUsed < ar[oIdx].metadata.lastUsed ? curIdx : oIdx;
3901
+ }, 0);
3902
+ unusedGeos[nextToDelete].dispose();
3903
+ unusedGeos.splice(nextToDelete, 1);
3904
+ geoCountToDelete--;
3905
+ }
3906
+ }
3909
3907
  sceneStore.cache = cachedAssets;
3910
3908
  };
3911
3909
 
@@ -3913,36 +3911,57 @@ function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symb
3913
3911
  function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
3914
3912
  function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3915
3913
  function findMaterials(cache) {
3916
- var sceneStore = useSceneStoreContext$1();
3914
+ var sceneStore = useSceneStoreContext();
3917
3915
  var matsOnMeshes = {};
3916
+ var getDepth = function getDepth(child, ancestor) {
3917
+ var depth = 0;
3918
+ var current = child;
3919
+ while (current && current.uniqueId !== ancestor.uniqueId) {
3920
+ depth++;
3921
+ current = current.parent;
3922
+ }
3923
+ return depth;
3924
+ };
3925
+
3918
3926
  //! parent = the parent from which on every child should receive the Material
3919
3927
  //! id = the id which points to the material that should be assigned
3920
- var setMaterials = function setMaterials(onNode, mat) {
3921
- var matStillExists = sceneStore.scene.materials.find(function (_mat) {
3922
- return mat.uniqueId == _mat.uniqueId;
3923
- });
3924
- if (!matStillExists) {
3925
- var sharedName = mat.name + "_recreated";
3926
- var sharedMat = sceneStore.scene.getMaterialByName(sharedName);
3927
- if (!sharedMat) {
3928
- sharedMat = new PBRMetallicRoughnessMaterial$1(sharedName, sceneStore.scene);
3929
- sharedMat.baseTexture = new Texture$1(mat.baseTexture.name, sceneStore.scene);
3930
- sharedMat.metallicRoughnessTexture = new Texture$1(mat.metallicRoughnessTexture.name, sceneStore.scene);
3931
- sharedMat.normalTexture = new Texture$1(mat.normalTexture.name, sceneStore.scene);
3932
- }
3933
- mat = sharedMat;
3934
- }
3928
+ // the level defines how many parents above the material was set the lower the higher the prio
3929
+ var setMaterials = function setMaterials(onNode, mat, parent) {
3935
3930
  if (onNode !== null && onNode !== void 0 && onNode._isMesh) {
3936
- matsOnMeshes[onNode.uniqueId] = {
3937
- mat: mat,
3938
- onNode: onNode
3939
- };
3940
- onNode.material = mat;
3931
+ var matStillExists = sceneStore.scene.materials.find(function (_mat) {
3932
+ return mat.uniqueId == _mat.uniqueId;
3933
+ });
3934
+ if (!matStillExists) {
3935
+ var sharedName = mat.name + '_recreated';
3936
+ var sharedMat = sceneStore.scene.getMaterialByName(sharedName);
3937
+ if (!sharedMat) {
3938
+ sharedMat = new PBRMetallicRoughnessMaterial(sharedName, sceneStore.scene);
3939
+ sharedMat.baseTexture = new Texture(mat.baseTexture.name, sceneStore.scene);
3940
+ sharedMat.metallicRoughnessTexture = new Texture(mat.metallicRoughnessTexture.name, sceneStore.scene);
3941
+ sharedMat.normalTexture = new Texture(mat.normalTexture.name, sceneStore.scene);
3942
+ }
3943
+ mat = sharedMat;
3944
+ }
3945
+ var mesh = onNode;
3946
+ if (mesh) {
3947
+ var _mesh$metadata;
3948
+ var depth = getDepth(mesh, parent);
3949
+ if (mesh.material && ((_mesh$metadata = mesh.metadata) === null || _mesh$metadata === void 0 ? void 0 : _mesh$metadata['matLevel']) < depth) return;
3950
+ matsOnMeshes[onNode.uniqueId] = {
3951
+ mat: mat,
3952
+ onNode: onNode
3953
+ };
3954
+ mesh.material = mat;
3955
+ if (!mesh.metadata) mesh.metadata = {
3956
+ matLevel: depth
3957
+ };else mesh.metadata['matLevel'] = depth;
3958
+ }
3941
3959
  }
3942
3960
  var _iterator = _createForOfIteratorHelper$1(onNode.getChildMeshes()),
3943
3961
  _step;
3944
3962
  try {
3945
3963
  var _loop = function _loop() {
3964
+ var _mesh$metadata2;
3946
3965
  var mesh = _step.value;
3947
3966
  var existing = Object.keys(matsOnMeshes).find(function (key) {
3948
3967
  return key == mesh.uniqueId.toString();
@@ -3953,16 +3972,24 @@ function findMaterials(cache) {
3953
3972
  return node.uniqueId.toString() == existing;
3954
3973
  })) return 0; // continue
3955
3974
  }
3975
+ var depth = getDepth(mesh, parent);
3976
+ if (mesh.material && ((_mesh$metadata2 = mesh.metadata) === null || _mesh$metadata2 === void 0 ? void 0 : _mesh$metadata2['matLevel']) < depth) return {
3977
+ v: void 0
3978
+ };
3956
3979
  matsOnMeshes[mesh.uniqueId] = {
3957
3980
  mat: mat,
3958
3981
  onNode: onNode
3959
3982
  };
3960
3983
  mesh.material = mat;
3984
+ if (!mesh.metadata) mesh.metadata = {
3985
+ matLevel: depth
3986
+ };else mesh.metadata['matLevel'] = depth;
3961
3987
  },
3962
3988
  _ret;
3963
3989
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
3964
3990
  _ret = _loop();
3965
3991
  if (_ret === 0) continue;
3992
+ if (_ret) return _ret.v;
3966
3993
  }
3967
3994
  } catch (err) {
3968
3995
  _iterator.e(err);
@@ -3975,14 +4002,18 @@ function findMaterials(cache) {
3975
4002
  var findOnNode = function findOnNode(mat, parent, onNode) {
3976
4003
  if (!mat.onNodes) return;
3977
4004
  var children = parent.getChildTransformNodes(false);
4005
+ var childMeshes = parent.getChildMeshes(true);
4006
+ if (onNode == '' || onNode == 'ALL') childMeshes.forEach(function (cm) {
4007
+ return setMaterials(cm, mat.mat, parent);
4008
+ });
3978
4009
  var _iterator2 = _createForOfIteratorHelper$1(children),
3979
4010
  _step2;
3980
4011
  try {
3981
4012
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
3982
4013
  var child = _step2.value;
3983
- if (onNode == "" || onNode == "ALL") setMaterials(child, mat.mat);
4014
+ if (onNode == '' || onNode == 'ALL') setMaterials(child, mat.mat, parent);
3984
4015
  if (child.name.startsWith(onNode) || child.name.startsWith('geo_') && child.name.includes(onNode)) {
3985
- setMaterials(child, mat.mat);
4016
+ setMaterials(child, mat.mat, parent);
3986
4017
  }
3987
4018
  }
3988
4019
  } catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/buildScene/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAkB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpD,QAAA,MAAM,UAAU,oDAKb;IACD,SAAS,EAAE,QAAQ,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,KAAK,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,SAgHA,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/buildScene/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAkB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpD,QAAA,MAAM,UAAU,oDAKb;IACD,SAAS,EAAE,QAAQ,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,KAAK,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,SA+HA,CAAC;AAGF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/findAssets/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAW,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,wBAA8B,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE;;;GAmK1E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/findAssets/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAW,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,wBAA8B,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE;;;GAoJ1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/findMaterials/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAY,MAAM,aAAa,CAAC;AAK9C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,wBA2DnD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/findMaterials/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAY,MAAM,aAAa,CAAC;AAM9C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,wBAsFnD"}
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 105.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[105],{56105:(e,t,n)=>{n.r(t),n.d(t,{volumetricLightingBlendVolumePixelShaderWGSL:()=>a});var r=n(17416);const i="volumetricLightingBlendVolumePixelShader",u="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;var depthSampler: texture_2d<f32>;uniform invProjection: mat4x4<f32>;uniform outputTextureSize: vec2f;\n#ifdef USE_EXTINCTION\nuniform extinction: vec3f;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#ifdef USE_EXTINCTION\nlet depth=textureLoad(depthSampler,vec2u(fragmentInputs.position.xy),0).r;let ndc=vec4f((fragmentInputs.position.xy/uniforms.outputTextureSize)*2.-1.,depth,1.0);var viewPos=uniforms.invProjection*ndc;viewPos=viewPos/viewPos.w;let eyeDist=length(viewPos);fragmentOutputs.color2=vec4f(exp(-uniforms.extinction*eyeDist),1.0);\n#endif\n}\n";r.v.ShadersStoreWGSL[i]||(r.v.ShadersStoreWGSL[i]=u);const a={name:i,shader:u}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:105 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 214.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[214],{37214:(e,i,t)=>{t.r(i),t.d(i,{volumetricLightingRenderVolumePixelShader:()=>l});var r=t(17416);t(33560),t(2889);const n="volumetricLightingRenderVolumePixelShader",o="#include<__decl__sceneFragment>\nuniform mat4 invViewProjection;uniform vec3 lightDir; \nuniform vec2 outputTextureSize;uniform vec4 extinctionPhaseG;uniform vec3 lightPower;uniform vec2 textureRatio;uniform sampler2D depthTexture;varying vec4 vWorldPos;float henyeyGreenstein(float g,float cosTheta) {float denom=1.0+g*g-2.0*g*cosTheta;return 1.0/(4.0*3.14159265)*(1.0-g*g)/(denom*sqrt(max(denom,0.0)));}\nvec3 integrateDirectional(float eyeDist,vec3 viewDir,vec3 lightDir) {float phaseG=extinctionPhaseG.w;\n#ifdef USE_EXTINCTION\nvec3 extinction=extinctionPhaseG.xyz;return henyeyGreenstein(phaseG,dot(viewDir,lightDir))*(vec3(1.0)-exp(-extinction*eyeDist))/extinction;\n#else\nreturn vec3(henyeyGreenstein(phaseG,dot(viewDir,lightDir)))*vec3(eyeDist);\n#endif\n}\nvoid main(void) {float depth=texelFetch(depthTexture,ivec2(gl_FragCoord.xy*textureRatio),0).r;vec4 worldPos=vWorldPos;if (gl_FragCoord.z>depth) {vec4 ndc=vec4((gl_FragCoord.xy/outputTextureSize)*2.0-1.0,depth*2.0-1.0,1.0);worldPos=invViewProjection*ndc;worldPos=worldPos/worldPos.w;}\nvec3 viewDir=worldPos.xyz-vEyePosition.xyz;float eyeDist=length(viewDir);viewDir=viewDir/eyeDist;float fSign=gl_FrontFacing ? 1.0 : -1.0;vec3 integral=integrateDirectional(eyeDist,-viewDir,lightDir);gl_FragColor=vec4(lightPower*integral*fSign,1.0);}\n";r.v.ShadersStore[n]||(r.v.ShadersStore[n]=o);const l={name:n,shader:o}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:214 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 245.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[245],{44245:(e,i,r)=>{r.r(i),r.d(i,{volumetricLightingBlendVolumePixelShader:()=>l});var n=r(17416);const t="volumetricLightingBlendVolumePixelShader",o="varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform mat4 invProjection;uniform vec2 outputTextureSize;\n#ifdef USE_EXTINCTION\nuniform vec3 extinction;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {gl_FragColor=texture2D(textureSampler,vUV);\n#ifdef USE_EXTINCTION\nfloat depth=texelFetch(depthSampler,ivec2(gl_FragCoord.xy),0).r;vec4 ndc=vec4((gl_FragCoord.xy/outputTextureSize)*2.-1.,depth*2.-1.,1.0);vec4 viewPos=invProjection*ndc;viewPos=viewPos/viewPos.w;float eyeDist=length(viewPos);gl_FragColor2=vec4(exp(-extinction*eyeDist),1.0);\n#endif\n}\n";n.v.ShadersStore[t]||(n.v.ShadersStore[t]=o);const l={name:t,shader:o}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:245 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 271.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[271],{28271:(e,n,t)=>{t.r(n),t.d(n,{selectionVertexShaderWGSL:()=>d});var i=t(17416);t(97762),t(31990),t(19120),t(46212),t(80870),t(42724),t(56403),t(39966),t(49413),t(58333),t(28439),t(56601);const r="selectionVertexShader",f="attribute position: vec3f;\n#ifdef INSTANCES\nattribute instanceSelectionId: f32;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\n#include<instancesDeclaration>\nuniform viewProjection: mat4x4f;\n#ifdef STORE_CAMERASPACE_Z\nuniform view: mat4x4f;\n#else\nuniform depthValues: vec2f;\n#endif\n#ifdef INSTANCES\nflat varying vSelectionId: f32;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying vViewPosZ: f32;\n#else\nvarying vDepthMetric: f32;\n#endif\n#ifdef ALPHATEST\nvarying vUV: vec2f;uniform diffuseMatrix: mat4x4f; \n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input: VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvar positionUpdated: vec3f=vertexInputs.position;\n#ifdef UV1\nvar uvUpdated: vec2f=vertexInputs.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vertexInputs.uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;\n#ifdef ALPHATEST\n#ifdef UV1\nvertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef UV2\nvertexOutputs.vUV=(uniforms.diffuseMatrix*vec4f(uv2Updated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvertexOutputs.vViewPosZ=(uniforms.view*worldPos).z;\n#else\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#else\nvertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));\n#endif\n#endif\n#ifdef INSTANCES\nvertexOutputs.vSelectionId=vertexInputs.instanceSelectionId;\n#endif\n#include<clipPlaneVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";i.v.ShadersStoreWGSL[r]||(i.v.ShadersStoreWGSL[r]=f);const d={name:r,shader:f}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:271 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 281.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[281],{62281:(e,n,i)=>{i.r(n),i.d(n,{selectionVertexShader:()=>r});var t=i(17416);i(33827),i(72335),i(58059),i(12230),i(60110),i(34122),i(58107),i(93592),i(39449),i(86096),i(73749),i(43888);const d="selectionVertexShader",a="attribute vec3 position;\n#ifdef INSTANCES\nattribute float instanceSelectionId;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<clipPlaneVertexDeclaration>\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef STORE_CAMERASPACE_Z\nuniform mat4 view;\n#else\nuniform vec2 depthValues;\n#endif\n#ifdef INSTANCES\nflat varying float vSelectionId;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying float vViewPosZ;\n#else\nvarying float vDepthMetric;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUV;uniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);gl_Position=viewProjection*worldPos;\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvViewPosZ=(view*worldPos).z;\n#else\n#ifdef USE_REVERSE_DEPTHBUFFER\nvDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y));\n#else\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#endif\n#endif\n#ifdef INSTANCES\nvSelectionId=instanceSelectionId;\n#endif\n#include<clipPlaneVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";t.v.ShadersStore[d]||(t.v.ShadersStore[d]=a);const r={name:d,shader:a}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:281 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 305.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[305],{55305:(e,r,o)=>{o.r(r),o.d(r,{oitFinalSimpleBlendPixelShader:()=>n});var l=o(17416);const i="oitFinalSimpleBlendPixelShader",a="precision highp float;uniform sampler2D uFrontColor;void main() {ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);glFragColor=frontColor;}\n";l.v.ShadersStore[i]||(l.v.ShadersStore[i]=a);const n={name:i,shader:a}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:305 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 346.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[346],{61346:(e,t,l)=>{l.r(t),l.d(t,{selectionOutlinePixelShaderWGSL:()=>s});var n=l(17416);const o="selectionOutlinePixelShader",r="var maskSamplerSampler: sampler;var maskSampler: texture_2d<f32>;var depthSamplerSampler: sampler;var depthSampler: texture_2d<f32>;varying vUV: vec2f;uniform screenSize: vec2f;uniform outlineColor: vec3f;uniform outlineThickness: f32;uniform occlusionStrength: f32;uniform occlusionThreshold: f32;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nlet texelSize: vec2f=1.0/uniforms.screenSize;let sampleOffset: vec2f=texelSize*uniforms.outlineThickness;\n#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nlet maskTopCenter: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).rg;let maskTopRight: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).rg;let maskMiddleCenter: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV,0.0).rg;let maskMiddleRight: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).rg;\n#endif\n#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nlet maskTopLeft: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,sampleOffset.y),0.0).rg;let maskMiddleLeft: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,0.0),0.0).rg;let maskBottomRight: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,-sampleOffset.y),0.0).rg;let maskBottomCenter: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(0.0,-sampleOffset.y),0.0).rg;let maskBottomLeft: vec2f=textureSampleLevel(maskSampler,maskSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,-sampleOffset.y),0.0).rg;\n#endif\n#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL\nlet gradient: vec3f=vec3f(\nmaskMiddleCenter.r-maskMiddleRight.r,\nmaskMiddleCenter.r-maskTopCenter.r,\nmaskMiddleCenter.r-maskTopRight.r\n);let edgeStrength: f32=length(gradient);\n#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nlet gradientX: f32 =\n(maskTopLeft.r+2.0*maskMiddleLeft.r+maskBottomLeft.r) -\n(maskTopRight.r+2.0*maskMiddleRight.r+maskBottomRight.r);let gradientY: f32 =\n(maskBottomLeft.r+2.0*maskBottomCenter.r+maskBottomRight.r) -\n(maskTopLeft.r+2.0*maskTopCenter.r+maskTopRight.r);let edgeStrength: f32=length(vec2f(gradientX,gradientY));\n#endif\nlet outlineMask: f32=step(0.5,edgeStrength); \n#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nlet depthTopCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(0.0,sampleOffset.y),0.0).r;let depthTopRight: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+sampleOffset,0.0).r;let depthMiddleCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV,0.0).r;let depthMiddleRight: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,0.0),0.0).r;\n#endif\n#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nlet depthTopLeft: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,sampleOffset.y),0.0).r;let depthMiddleLeft: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,0.0),0.0).r;let depthBottomRight: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(sampleOffset.x,-sampleOffset.y),0.0).r;let depthBottomCenter: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(0.0,-sampleOffset.y),0.0).r;let depthBottomLeft: f32=textureSampleLevel(depthSampler,depthSamplerSampler,fragmentInputs.vUV+vec2f(-sampleOffset.x,-sampleOffset.y),0.0).r;\n#endif\n#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nlet occlusionTopCenter: f32=step(uniforms.occlusionThreshold,abs(maskTopCenter.g-depthTopCenter));let occlusionTopRight: f32=step(uniforms.occlusionThreshold,abs(maskTopRight.g-depthTopRight));let occlusionMiddleCenter: f32=step(uniforms.occlusionThreshold,abs(maskMiddleCenter.g-depthMiddleCenter));let occlusionMiddleRight: f32=step(uniforms.occlusionThreshold,abs(maskMiddleRight.g-depthMiddleRight));\n#endif\n#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nlet occlusionTopLeft: f32=step(uniforms.occlusionThreshold,abs(maskTopLeft.g-depthTopLeft));let occlusionMiddleLeft: f32=step(uniforms.occlusionThreshold,abs(maskMiddleLeft.g-depthMiddleLeft));let occlusionBottomRight: f32=step(uniforms.occlusionThreshold,abs(maskBottomRight.g-depthBottomRight));let occlusionBottomCenter: f32=step(uniforms.occlusionThreshold,abs(maskBottomCenter.g-depthBottomCenter));let occlusionBottomLeft: f32=step(uniforms.occlusionThreshold,abs(maskBottomLeft.g-depthBottomLeft));\n#endif\nvar occlusionFactor: f32=occlusionMiddleCenter;\n#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL\nocclusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);\n#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nocclusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionTopLeft);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);occlusionFactor=min(occlusionFactor,occlusionMiddleLeft);occlusionFactor=min(occlusionFactor,occlusionBottomRight);occlusionFactor=min(occlusionFactor,occlusionBottomCenter);occlusionFactor=min(occlusionFactor,occlusionBottomLeft);\n#endif\nlet finalOutlineMask: f32=outlineMask*(1.0-uniforms.occlusionStrength*occlusionFactor);fragmentOutputs.color=vec4f(uniforms.outlineColor,finalOutlineMask);\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.v.ShadersStoreWGSL[o]||(n.v.ShadersStoreWGSL[o]=r);const s={name:o,shader:r}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:346 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 350.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[350],{26350:(e,r,t)=>{t.r(r),t.d(r,{oitFinalSimpleBlendPixelShaderWGSL:()=>i});var n=t(17416);const a="oitFinalSimpleBlendPixelShader",o="var uFrontColor: texture_2d<f32>;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var frontColor: vec4f=textureLoad(uFrontColor,fragCoord,0);fragmentOutputs.color=frontColor;}\n";n.v.ShadersStoreWGSL[a]||(n.v.ShadersStoreWGSL[a]=o);const i={name:a,shader:o}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:350 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 375.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[375],{71375:(e,t,o)=>{o.r(t),o.d(t,{selectionOutlinePixelShader:()=>l});var n=o(17416);const s="selectionOutlinePixelShader",i="uniform sampler2D maskSampler;uniform sampler2D depthSampler;varying vec2 vUV;uniform vec2 screenSize;uniform vec3 outlineColor;uniform float outlineThickness;uniform float occlusionStrength;uniform float occlusionThreshold;\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec2 texelSize=1.0/screenSize;vec2 sampleOffset=texelSize*outlineThickness;\n#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nvec2 maskTopCenter=texture2D(maskSampler,vUV+vec2(0.0,sampleOffset.y)).rg;vec2 maskTopRight=texture2D(maskSampler,vUV+sampleOffset).rg;vec2 maskMiddleCenter=texture2D(maskSampler,vUV).rg;vec2 maskMiddleRight=texture2D(maskSampler,vUV+vec2(sampleOffset.x,0.0)).rg;\n#endif\n#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nvec2 maskTopLeft=texture2D(maskSampler,vUV+vec2(-sampleOffset.x,sampleOffset.y)).rg;vec2 maskMiddleLeft=texture2D(maskSampler,vUV+vec2(-sampleOffset.x,0.0)).rg;vec2 maskBottomRight=texture2D(maskSampler,vUV+vec2(sampleOffset.x,-sampleOffset.y)).rg;vec2 maskBottomCenter=texture2D(maskSampler,vUV+vec2(0.0,-sampleOffset.y)).rg;vec2 maskBottomLeft=texture2D(maskSampler,vUV+vec2(-sampleOffset.x,-sampleOffset.y)).rg;\n#endif\n#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL\nvec3 gradient=vec3(\nmaskMiddleCenter.r-maskMiddleRight.r,\nmaskMiddleCenter.r-maskTopCenter.r,\nmaskMiddleCenter.r-maskTopRight.r\n);float edgeStrength=length(gradient);\n#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nfloat gradientX=\n(maskTopLeft.r+2.0*maskMiddleLeft.r+maskBottomLeft.r) -\n(maskTopRight.r+2.0*maskMiddleRight.r+maskBottomRight.r);float gradientY=\n(maskBottomLeft.r+2.0*maskBottomCenter.r+maskBottomRight.r) -\n(maskTopLeft.r+2.0*maskTopCenter.r+maskTopRight.r);float edgeStrength=length(vec2(gradientX,gradientY));\n#endif\nfloat outlineMask=step(0.5,edgeStrength); \n#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nfloat depthTopCenter=texture2D(depthSampler,vUV+vec2(0.0,sampleOffset.y)).r;float depthTopRight=texture2D(depthSampler,vUV+sampleOffset).r;float depthMiddleCenter=texture2D(depthSampler,vUV).r;float depthMiddleRight=texture2D(depthSampler,vUV+vec2(sampleOffset.x,0.0)).r;\n#endif\n#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nfloat depthTopLeft=texture2D(depthSampler,vUV+vec2(-sampleOffset.x,sampleOffset.y)).r;float depthMiddleLeft=texture2D(depthSampler,vUV+vec2(-sampleOffset.x,0.0)).r;float depthBottomRight=texture2D(depthSampler,vUV+vec2(sampleOffset.x,-sampleOffset.y)).r;float depthBottomCenter=texture2D(depthSampler,vUV+vec2(0.0,-sampleOffset.y)).r;float depthBottomLeft=texture2D(depthSampler,vUV+vec2(-sampleOffset.x,-sampleOffset.y)).r;\n#endif\n#if defined(OUTLINELAYER_SAMPLING_TRIDIRECTIONAL) || defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nfloat occlusionTopCenter=step(occlusionThreshold,abs(maskTopCenter.g-depthTopCenter));float occlusionTopRight=step(occlusionThreshold,abs(maskTopRight.g-depthTopRight));float occlusionMiddleCenter=step(occlusionThreshold,abs(maskMiddleCenter.g-depthMiddleCenter));float occlusionMiddleRight=step(occlusionThreshold,abs(maskMiddleRight.g-depthMiddleRight));\n#endif\n#if defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nfloat occlusionTopLeft=step(occlusionThreshold,abs(maskTopLeft.g-depthTopLeft));float occlusionMiddleLeft=step(occlusionThreshold,abs(maskMiddleLeft.g-depthMiddleLeft));float occlusionBottomRight=step(occlusionThreshold,abs(maskBottomRight.g-depthBottomRight));float occlusionBottomCenter=step(occlusionThreshold,abs(maskBottomCenter.g-depthBottomCenter));float occlusionBottomLeft=step(occlusionThreshold,abs(maskBottomLeft.g-depthBottomLeft));\n#endif\nfloat occlusionFactor=occlusionMiddleCenter;\n#ifdef OUTLINELAYER_SAMPLING_TRIDIRECTIONAL\nocclusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);\n#elif defined(OUTLINELAYER_SAMPLING_OCTADIRECTIONAL)\nocclusionFactor=min(occlusionFactor,occlusionTopCenter);occlusionFactor=min(occlusionFactor,occlusionTopRight);occlusionFactor=min(occlusionFactor,occlusionTopLeft);occlusionFactor=min(occlusionFactor,occlusionMiddleRight);occlusionFactor=min(occlusionFactor,occlusionMiddleLeft);occlusionFactor=min(occlusionFactor,occlusionBottomRight);occlusionFactor=min(occlusionFactor,occlusionBottomCenter);occlusionFactor=min(occlusionFactor,occlusionBottomLeft);\n#endif\nfloat finalOutlineMask=outlineMask*(1.0-occlusionStrength*occlusionFactor);gl_FragColor=vec4(outlineColor,finalOutlineMask);\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.v.ShadersStore[s]||(n.v.ShadersStore[s]=i);const l={name:s,shader:i}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:375 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 583.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[583],{2583:(e,r,o)=>{o.r(r),o.d(r,{volumetricLightingRenderVolumeVertexShader:()=>t});var i=o(17416);o(71508),o(2889),o(78109),o(66703);const s="volumetricLightingRenderVolumeVertexShader",n="#include<__decl__sceneVertex>\n#include<__decl__meshVertex>\nattribute vec3 position;varying vec4 vWorldPos;void main(void) {vec4 worldPos=world*vec4(position,1.0);vWorldPos=worldPos;gl_Position=viewProjection*worldPos;}\n";i.v.ShadersStore[s]||(i.v.ShadersStore[s]=n);const t={name:s,shader:n}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:583 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 702.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[702],{83702:(e,n,i)=>{i.r(n),i.d(n,{selectionPixelShaderWGSL:()=>t});var f=i(17416);i(47652),i(63665);const r="selectionPixelShader",a="#ifdef INSTANCES\nflat varying vSelectionId: f32;\n#else\nuniform selectionId: f32;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying vViewPosZ: f32;\n#else\nvarying vDepthMetric: f32;\n#endif\n#ifdef ALPHATEST\nvarying vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUV).a<0.4) {discard;}\n#endif\n#ifdef INSTANCES\nvar id: f32=fragmentInputs.vSelectionId;\n#else\nvar id: f32=uniforms.selectionId;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nfragmentOutputs.color=vec4(id,fragmentInputs.vViewPosZ,0.0,1.0);\n#else\nfragmentOutputs.color=vec4(id,fragmentInputs.vDepthMetric,0.0,1.0);\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";f.v.ShadersStoreWGSL[r]||(f.v.ShadersStoreWGSL[r]=a);const t={name:r,shader:a}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:702 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 794.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[794],{22794:(e,n,i)=>{i.r(n),i.d(n,{selectionPixelShader:()=>f});var d=i(17416);i(52397),i(15764);const l="selectionPixelShader",a="#ifdef INSTANCES\nflat varying float vSelectionId;\n#else\nuniform float selectionId;\n#endif\n#ifdef STORE_CAMERASPACE_Z\nvarying float vViewPosZ;\n#else\nvarying float vDepthMetric;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUV;uniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#ifdef INSTANCES\nfloat id=vSelectionId;\n#else\nfloat id=selectionId;\n#endif\n#ifdef STORE_CAMERASPACE_Z\ngl_FragColor=vec4(id,vViewPosZ,0.0,1.0);\n#else\ngl_FragColor=vec4(id,vDepthMetric,0.0,1.0);\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";d.v.ShadersStore[l]||(d.v.ShadersStore[l]=a);const f={name:l,shader:a}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:794 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 799.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[799],{5799:(e,t,i)=>{i.r(t),i.d(t,{volumetricLightingRenderVolumePixelShaderWGSL:()=>s});var n=i(17416);i(77761),i(90002);const r="volumetricLightingRenderVolumePixelShader",o="#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nuniform invViewProjection: mat4x4<f32>;uniform lightDir: vec3f; \nuniform outputTextureSize: vec2f;uniform extinctionPhaseG: vec4f;uniform lightPower: vec3f;uniform textureRatio: vec2f;var depthTexture: texture_2d<f32>;varying vWorldPos: vec4f;fn henyeyGreenstein(g: f32,cosTheta: f32)->f32 {let denom=1+g*g-2*g*cosTheta;return 1.0/(4.0*3.14159265)*(1.0-g*g)/(denom*sqrt(max(denom,0.0)));}\nfn integrateDirectional(eyeDist: f32,viewDir: vec3f,lightDir: vec3f)->vec3f {let phaseG=uniforms.extinctionPhaseG.w;\n#ifdef USE_EXTINCTION\nlet extinction=uniforms.extinctionPhaseG.xyz;return henyeyGreenstein(phaseG,dot(viewDir,lightDir))*(vec3f(1.0)-exp(-extinction*eyeDist))/extinction;\n#else\nreturn vec3f(henyeyGreenstein(phaseG,dot(viewDir,lightDir)))*vec3f(eyeDist);\n#endif\n}\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let depth=textureLoad(depthTexture,vec2u(fragmentInputs.position.xy*uniforms.textureRatio),0).r;var worldPos=fragmentInputs.vWorldPos;if (fragmentInputs.position.z>depth) {let ndc=vec4f((fragmentInputs.position.xy/uniforms.outputTextureSize)*2.-1.,depth,1.0);worldPos=uniforms.invViewProjection*ndc;worldPos=worldPos/worldPos.w;}\nvar viewDir=worldPos.xyz-scene.vEyePosition.xyz;let eyeDist=length(viewDir);viewDir=viewDir/eyeDist;let fSign=select(-1.0,1.0,fragmentInputs.frontFacing);let integral=integrateDirectional(eyeDist,-viewDir,uniforms.lightDir);fragmentOutputs.color=vec4f(uniforms.lightPower*integral*fSign,1.0);}\n";n.v.ShadersStoreWGSL[r]||(n.v.ShadersStoreWGSL[r]=o);const s={name:r,shader:o}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:799 */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 979.real-time-viewer.umd.min.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkCrystaldesignRealTimeViewer=self.webpackChunkCrystaldesignRealTimeViewer||[]).push([[979],{30979:(e,t,r)=>{r.r(t),r.d(t,{volumetricLightingRenderVolumeVertexShaderWGSL:()=>i});var n=r(17416);r(77761),r(90002);const o="volumetricLightingRenderVolumeVertexShader",s="#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute position : vec3f;varying vWorldPos: vec4f;@vertex\nfn main(input : VertexInputs)->FragmentInputs {let worldPos=mesh.world*vec4f(vertexInputs.position,1.0);vertexOutputs.vWorldPos=worldPos;vertexOutputs.position=scene.viewProjection*worldPos;}\n";n.v.ShadersStoreWGSL[o]||(n.v.ShadersStoreWGSL[o]=s);const i={name:o,shader:s}}}]);
@@ -0,0 +1 @@
1
+ /*! filename:979 */