@xeokit/xeokit-sdk 2.6.112 → 2.6.113

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/README.md CHANGED
@@ -4,8 +4,7 @@
4
4
  [![](https://data.jsdelivr.com/v1/package/npm/@xeokit/xeokit-sdk/badge)](https://www.jsdelivr.com/package/npm/@xeokit/xeokit-sdk)
5
5
  [![CodeSee](https://github.com/xeokit/xeokit-sdk/actions/workflows/codesee-arch-diagram.yml/badge.svg)](https://github.com/xeokit/xeokit-sdk/actions/workflows/codesee-arch-diagram.yml)
6
6
 
7
- [xeokit](http://xeokit.io) is a JavaScript software development kit created by [xeolabs](http://xeolabs.com) and supported by [Creoox AG](https://creoox.com) for viewing
8
- high-detail, full-precision 3D engineering and BIM models in the browser.
7
+ [xeokit](http://xeokit.io) is a JavaScript software development kit by [Creoox AG](https://creoox.com) for viewing high-detail, full-precision 3D engineering and BIM models in the browser.
9
8
 
10
9
  ## Resources
11
10
 
@@ -1,11 +1,11 @@
1
1
  /**
2
- * xeokit-sdk v2.6.112
3
- * Commit: 2ce58020bcf3e4af1f68e47009f413c448a8a2a4
4
- * Built: 2026-06-25T15:09:42.607Z
2
+ * xeokit-sdk v2.6.113
3
+ * Commit: 35015312cd61fbe9a764d8874667ca89dadefeb0
4
+ * Built: 2026-08-20T08:03:36.951Z
5
5
  */
6
6
 
7
7
  if (typeof window !== 'undefined') {
8
- window.__XEOKIT__ = { version: '2.6.112', commit: '2ce58020bcf3e4af1f68e47009f413c448a8a2a4', built: '2026-06-25T15:09:42.607Z' };
8
+ window.__XEOKIT__ = { version: '2.6.113', commit: '35015312cd61fbe9a764d8874667ca89dadefeb0', built: '2026-08-20T08:03:36.951Z' };
9
9
  }
10
10
 
11
11
  'use strict';
@@ -31621,14 +31621,10 @@ const FlatColorProgram = function(programVariables, geometry, logarithmicDepthBu
31621
31621
  };
31622
31622
  };
31623
31623
 
31624
- const OcclusionProgram = function(programVariables, logarithmicDepthBufferEnabled) {
31624
+ const OcclusionProgram = function(programVariables) {
31625
31625
  const outColor = programVariables.createOutput("vec4", "outColor");
31626
31626
  return {
31627
31627
  programName: "Occlusion",
31628
- // Logarithmic depth buffer involves an accuracy tradeoff, sacrificing
31629
- // accuracy at close range to improve accuracy at long range. This can
31630
- // mess up accuracy for occlusion tests, so we'll disable for now.
31631
- getLogDepth: false ,
31632
31628
  renderPassFlag: 0, // COLOR_OPAQUE // Only opaque objects can be occluders
31633
31629
  appendFragmentOutputs: (src) => src.push(`${outColor} = vec4(0.0, 0.0, 1.0, 1.0);`) // Occluders are blue
31634
31630
  };
@@ -32262,7 +32258,7 @@ const getRenderers = (function() {
32262
32258
  if (primitive === "points") {
32263
32259
  cache[sceneId] = {
32264
32260
  colorRenderers: { "sao-": { "vertex": lazy((vars, geo, c) => c(makeColorProgram(vars, geo, null, null))) } },
32265
- occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars, scene.logarithmicDepthBufferEnabled))),
32261
+ occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars))),
32266
32262
  pickDepthRenderer: lazy(makePickDepthProgram),
32267
32263
  pickMeshRenderer: lazy(makePickMeshProgram),
32268
32264
  // VBOBatchingPointsShadowRenderer has been implemented by 14e973df6268369b00baef60e468939e062ac320,
@@ -32324,7 +32320,7 @@ const getRenderers = (function() {
32324
32320
  uniform: lazy((vars, geo, c) => c(EdgesProgram(vars, geo, scene.logarithmicDepthBufferEnabled, true)), { vertices: false }),
32325
32321
  vertex: lazy((vars, geo, c) => c(EdgesProgram(vars, geo, scene.logarithmicDepthBufferEnabled, false)), { vertices: false })
32326
32322
  },
32327
- occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars, scene.logarithmicDepthBufferEnabled))),
32323
+ occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars))),
32328
32324
  pickDepthRenderer: eager(makePickDepthProgram),
32329
32325
  pickMeshRenderer: eager(makePickMeshProgram),
32330
32326
  pickNormalsFlatRenderer: eager((vars, geo, c) => makePickNormalsProgram(vars, geo, c, true)),
@@ -46987,13 +46983,12 @@ class OcclusionTester {
46987
46983
  "OcclusionTester",
46988
46984
  {
46989
46985
  sectionPlanesState: sectionPlanesState,
46990
- getLogDepth: scene.logarithmicDepthBufferEnabled && (vFragDepth => vFragDepth),
46991
46986
  clippableTest: () => "true",
46992
46987
  getVertexData: () => {
46993
46988
  const src = [ ];
46994
46989
  src.push(`vec4 worldPosition = vec4(${position}, 1.0);`);
46995
46990
  src.push(`vec4 ${clipPos} = ${projMatrix} * ${viewMatrix} * worldPosition;`);
46996
- if ((! scene.logarithmicDepthBufferEnabled) && (scene.markerZOffset < 0.000)) {
46991
+ if (scene.markerZOffset < 0.000) {
46997
46992
  src.push(`${clipPos}.z += ${scene.markerZOffset};`);
46998
46993
  }
46999
46994
  return src;
@@ -54991,6 +54986,8 @@ class Scene extends Component {
54991
54986
  alphaDepthMask: alphaDepthMask
54992
54987
  });
54993
54988
 
54989
+ this.canvas._renderer = this._renderer;
54990
+
54994
54991
  this._sectionPlanesState = new (function () {
54995
54992
 
54996
54993
  this.sectionPlanes = [];
@@ -1,11 +1,11 @@
1
1
  /**
2
- * xeokit-sdk v2.6.112
3
- * Commit: 2ce58020bcf3e4af1f68e47009f413c448a8a2a4
4
- * Built: 2026-06-25T15:09:42.607Z
2
+ * xeokit-sdk v2.6.113
3
+ * Commit: 35015312cd61fbe9a764d8874667ca89dadefeb0
4
+ * Built: 2026-08-20T08:03:36.951Z
5
5
  */
6
6
 
7
7
  if (typeof window !== 'undefined') {
8
- window.__XEOKIT__ = { version: '2.6.112', commit: '2ce58020bcf3e4af1f68e47009f413c448a8a2a4', built: '2026-06-25T15:09:42.607Z' };
8
+ window.__XEOKIT__ = { version: '2.6.113', commit: '35015312cd61fbe9a764d8874667ca89dadefeb0', built: '2026-08-20T08:03:36.951Z' };
9
9
  }
10
10
 
11
11
  /** @private */
@@ -31617,14 +31617,10 @@ const FlatColorProgram = function(programVariables, geometry, logarithmicDepthBu
31617
31617
  };
31618
31618
  };
31619
31619
 
31620
- const OcclusionProgram = function(programVariables, logarithmicDepthBufferEnabled) {
31620
+ const OcclusionProgram = function(programVariables) {
31621
31621
  const outColor = programVariables.createOutput("vec4", "outColor");
31622
31622
  return {
31623
31623
  programName: "Occlusion",
31624
- // Logarithmic depth buffer involves an accuracy tradeoff, sacrificing
31625
- // accuracy at close range to improve accuracy at long range. This can
31626
- // mess up accuracy for occlusion tests, so we'll disable for now.
31627
- getLogDepth: false ,
31628
31624
  renderPassFlag: 0, // COLOR_OPAQUE // Only opaque objects can be occluders
31629
31625
  appendFragmentOutputs: (src) => src.push(`${outColor} = vec4(0.0, 0.0, 1.0, 1.0);`) // Occluders are blue
31630
31626
  };
@@ -32258,7 +32254,7 @@ const getRenderers = (function() {
32258
32254
  if (primitive === "points") {
32259
32255
  cache[sceneId] = {
32260
32256
  colorRenderers: { "sao-": { "vertex": lazy((vars, geo, c) => c(makeColorProgram(vars, geo, null, null))) } },
32261
- occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars, scene.logarithmicDepthBufferEnabled))),
32257
+ occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars))),
32262
32258
  pickDepthRenderer: lazy(makePickDepthProgram),
32263
32259
  pickMeshRenderer: lazy(makePickMeshProgram),
32264
32260
  // VBOBatchingPointsShadowRenderer has been implemented by 14e973df6268369b00baef60e468939e062ac320,
@@ -32320,7 +32316,7 @@ const getRenderers = (function() {
32320
32316
  uniform: lazy((vars, geo, c) => c(EdgesProgram(vars, geo, scene.logarithmicDepthBufferEnabled, true)), { vertices: false }),
32321
32317
  vertex: lazy((vars, geo, c) => c(EdgesProgram(vars, geo, scene.logarithmicDepthBufferEnabled, false)), { vertices: false })
32322
32318
  },
32323
- occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars, scene.logarithmicDepthBufferEnabled))),
32319
+ occlusionRenderer: lazy((vars, geo, c) => c(OcclusionProgram(vars))),
32324
32320
  pickDepthRenderer: eager(makePickDepthProgram),
32325
32321
  pickMeshRenderer: eager(makePickMeshProgram),
32326
32322
  pickNormalsFlatRenderer: eager((vars, geo, c) => makePickNormalsProgram(vars, geo, c, true)),
@@ -46983,13 +46979,12 @@ class OcclusionTester {
46983
46979
  "OcclusionTester",
46984
46980
  {
46985
46981
  sectionPlanesState: sectionPlanesState,
46986
- getLogDepth: scene.logarithmicDepthBufferEnabled && (vFragDepth => vFragDepth),
46987
46982
  clippableTest: () => "true",
46988
46983
  getVertexData: () => {
46989
46984
  const src = [ ];
46990
46985
  src.push(`vec4 worldPosition = vec4(${position}, 1.0);`);
46991
46986
  src.push(`vec4 ${clipPos} = ${projMatrix} * ${viewMatrix} * worldPosition;`);
46992
- if ((! scene.logarithmicDepthBufferEnabled) && (scene.markerZOffset < 0.000)) {
46987
+ if (scene.markerZOffset < 0.000) {
46993
46988
  src.push(`${clipPos}.z += ${scene.markerZOffset};`);
46994
46989
  }
46995
46990
  return src;
@@ -54987,6 +54982,8 @@ class Scene extends Component {
54987
54982
  alphaDepthMask: alphaDepthMask
54988
54983
  });
54989
54984
 
54985
+ this.canvas._renderer = this._renderer;
54986
+
54990
54987
  this._sectionPlanesState = new (function () {
54991
54988
 
54992
54989
  this.sectionPlanes = [];
@@ -1,10 +1,10 @@
1
1
  /**
2
- * xeokit-sdk v2.6.112
3
- * Commit: 2ce58020bcf3e4af1f68e47009f413c448a8a2a4
4
- * Built: 2026-06-25T15:09:42.607Z
2
+ * xeokit-sdk v2.6.113
3
+ * Commit: 35015312cd61fbe9a764d8874667ca89dadefeb0
4
+ * Built: 2026-08-20T08:03:36.951Z
5
5
  */
6
6
 
7
- var _globalThis$loaders3;var _marked=/*#__PURE__*/_regenerator().m(makeStringIterator),_marked2=/*#__PURE__*/_regenerator().m(makeMeshPrimitiveIterator);function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(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(r,a):void 0;}}function _arrayLikeToArray(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;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _awaitAsyncGenerator(e){return new _OverloadYield(e,0);}function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments));};}function AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,u=o instanceof _OverloadYield;Promise.resolve(u?o.v:o).then(function(n){if(u){var i="return"===t&&o.k?t:"next";if(!o.k||n.done)return resume(i,n);n=e[i](n).value;}settle(!!r.done,n);},function(e){resume("throw",e);});}catch(e){settle(2,e);}}function settle(e,r){2===e?t.reject(r):t.resolve({value:r,done:e}),(t=t.next)?resume(t.key,t.arg):n=null;}this._invoke=function(e,r){return new Promise(function(o,u){var i={key:e,arg:r,resolve:o,reject:u,next:null};n?n=n.next=i:(t=n=i,resume(e,r));});},"function"!=typeof e["return"]&&(this["return"]=void 0);}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this;},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e);},AsyncGenerator.prototype["throw"]=function(e){return this._invoke("throw",e);},AsyncGenerator.prototype["return"]=function(e){return this._invoke("return",e);};function _OverloadYield(e,d){this.v=e,this.k=d;}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}if(typeof window!=='undefined'){window.__XEOKIT__={version:'2.6.112',commit:'2ce58020bcf3e4af1f68e47009f413c448a8a2a4',built:'2026-06-25T15:09:42.607Z'};}/** @private */var Map$1=/*#__PURE__*/function(){function Map$1(items,baseId){_classCallCheck(this,Map$1);this.items=items||[];this._lastUniqueId=(baseId||0)+1;}/**
7
+ var _globalThis$loaders3;var _marked=/*#__PURE__*/_regenerator().m(makeStringIterator),_marked2=/*#__PURE__*/_regenerator().m(makeMeshPrimitiveIterator);function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(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(r,a):void 0;}}function _arrayLikeToArray(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;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _awaitAsyncGenerator(e){return new _OverloadYield(e,0);}function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments));};}function AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,u=o instanceof _OverloadYield;Promise.resolve(u?o.v:o).then(function(n){if(u){var i="return"===t&&o.k?t:"next";if(!o.k||n.done)return resume(i,n);n=e[i](n).value;}settle(!!r.done,n);},function(e){resume("throw",e);});}catch(e){settle(2,e);}}function settle(e,r){2===e?t.reject(r):t.resolve({value:r,done:e}),(t=t.next)?resume(t.key,t.arg):n=null;}this._invoke=function(e,r){return new Promise(function(o,u){var i={key:e,arg:r,resolve:o,reject:u,next:null};n?n=n.next=i:(t=n=i,resume(e,r));});},"function"!=typeof e["return"]&&(this["return"]=void 0);}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this;},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e);},AsyncGenerator.prototype["throw"]=function(e){return this._invoke("throw",e);},AsyncGenerator.prototype["return"]=function(e){return this._invoke("return",e);};function _OverloadYield(e,d){this.v=e,this.k=d;}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}if(typeof window!=='undefined'){window.__XEOKIT__={version:'2.6.113',commit:'35015312cd61fbe9a764d8874667ca89dadefeb0',built:'2026-08-20T08:03:36.951Z'};}/** @private */var Map$1=/*#__PURE__*/function(){function Map$1(items,baseId){_classCallCheck(this,Map$1);this.items=items||[];this._lastUniqueId=(baseId||0)+1;}/**
8
8
  * Usage:
9
9
  *
10
10
  * id = myMap.addItem("foo") // ID internally generated
@@ -9115,10 +9115,7 @@ appendFragmentOutputs:function appendFragmentOutputs(src,getGammaOutputExpressio
9115
9115
  // isn't it the same as vec4(vec3(1.0 - gl_FragCoord.z), 1.0) ?
9116
9116
  appendFragmentOutputs:function appendFragmentOutputs(src){return src.push("".concat(outColor," = vec4(vec3((1.0 - ").concat(vHighPrecisionZW,"[0] / ").concat(vHighPrecisionZW,"[1]) / 2.0), 1.0);"));}};};var EdgesProgram=function EdgesProgram(programVariables,geometry,logarithmicDepthBufferEnabled,colorUniform){var edgeColorUniform=colorUniform&&programVariables.createUniform("vec4","edgeColor",function(set,state){return set(state.legacyFrameCtx.programColor);});var color=geometry.attributes.color;var vColor=!colorUniform&&programVariables.createVarying("vec4","vColor",function(){return"vec4(".concat(color,".rgb * 0.5, ").concat(color,".a)");});var outColor=programVariables.createOutput("vec4","outColor");return{programName:colorUniform?"Edges":"EdgesColor",getLogDepth:logarithmicDepthBufferEnabled&&function(vFragDepth){return vFragDepth;},renderPassFlag:2,// EDGES_COLOR_OPAQUE | EDGES_COLOR_TRANSPARENT | EDGES_HIGHLIGHTED | EDGES_XRAYED | EDGES_SELECTED
9117
9117
  appendFragmentOutputs:function appendFragmentOutputs(src){return src.push("".concat(outColor," = ").concat(edgeColorUniform||vColor,";"));}};};var FlatColorProgram=function FlatColorProgram(programVariables,geometry,logarithmicDepthBufferEnabled,lightSetup,sao){var attributes=geometry.attributes;var vViewPosition=programVariables.createVarying("vec3","vViewPosition",function(){return"".concat(attributes.position.view,".xyz");});var vColor=programVariables.createVarying("vec4","vColor",function(){return attributes.color;});var outColor=programVariables.createOutput("vec4","outColor");return{programName:"FlatColor",getHash:function getHash(){return[lightSetup.getHash(),sao?"sao":"nosao"];},cleanerEdges:true,getLogDepth:logarithmicDepthBufferEnabled&&function(vFragDepth){return vFragDepth;},renderPassFlag:0,// COLOR_OPAQUE | COLOR_TRANSPARENT
9118
- appendFragmentOutputs:function appendFragmentOutputs(src,getGammaOutputExpression,gl_FragCoord,sliceColorOr){src.push("vec3 viewNormal = normalize(cross(dFdx(".concat(vViewPosition,"), dFdy(").concat(vViewPosition,")));"));var lightComponents=[lightSetup.getAmbientColor()].concat(lightSetup.directionalLights.map(function(light){return"max(dot(viewNormal, ".concat(light.getDirection(geometry.viewMatrix,vViewPosition),"), 0.0) * ").concat(light.getColor());}));src.push("vec4 fragColor = vec4(".concat(lightComponents.join(" + "),", 1) * ").concat(sliceColorOr(vColor),";"));src.push("".concat(outColor," = ").concat(sao?"vec4(fragColor.rgb * ".concat(sao.getAmbient(gl_FragCoord),", fragColor.a)"):"fragColor",";"));}};};var OcclusionProgram=function OcclusionProgram(programVariables,logarithmicDepthBufferEnabled){var outColor=programVariables.createOutput("vec4","outColor");return{programName:"Occlusion",// Logarithmic depth buffer involves an accuracy tradeoff, sacrificing
9119
- // accuracy at close range to improve accuracy at long range. This can
9120
- // mess up accuracy for occlusion tests, so we'll disable for now.
9121
- getLogDepth:false,renderPassFlag:0,// COLOR_OPAQUE // Only opaque objects can be occluders
9118
+ appendFragmentOutputs:function appendFragmentOutputs(src,getGammaOutputExpression,gl_FragCoord,sliceColorOr){src.push("vec3 viewNormal = normalize(cross(dFdx(".concat(vViewPosition,"), dFdy(").concat(vViewPosition,")));"));var lightComponents=[lightSetup.getAmbientColor()].concat(lightSetup.directionalLights.map(function(light){return"max(dot(viewNormal, ".concat(light.getDirection(geometry.viewMatrix,vViewPosition),"), 0.0) * ").concat(light.getColor());}));src.push("vec4 fragColor = vec4(".concat(lightComponents.join(" + "),", 1) * ").concat(sliceColorOr(vColor),";"));src.push("".concat(outColor," = ").concat(sao?"vec4(fragColor.rgb * ".concat(sao.getAmbient(gl_FragCoord),", fragColor.a)"):"fragColor",";"));}};};var OcclusionProgram=function OcclusionProgram(programVariables){var outColor=programVariables.createOutput("vec4","outColor");return{programName:"Occlusion",renderPassFlag:0,// COLOR_OPAQUE // Only opaque objects can be occluders
9122
9119
  appendFragmentOutputs:function appendFragmentOutputs(src){return src.push("".concat(outColor," = vec4(0.0, 0.0, 1.0, 1.0);"));}// Occluders are blue
9123
9120
  };};var PBRProgram=function PBRProgram(programVariables,geometry,scene,lightSetup,sao){var setup2dTexture=function setup2dTexture(name,isSrgb,getTexture){return setupTexture(programVariables,"sampler2D",name,isSrgb?sRGBEncoding:LinearEncoding,function(set,state){var texture=getTexture(state.layerTextureSet);texture&&set(texture.texture);});};var attributes=geometry.attributes;var getIrradiance=lightSetup.getIrradiance;var colorMap=setup2dTexture("uColorMap",true,function(textureSet){return textureSet.colorTexture;});var metallicRoughMap=setup2dTexture("uMetallicRoughMap",false,function(textureSet){return textureSet.metallicRoughnessTexture;});var emissiveMap=setup2dTexture("uEmissiveMap",true,function(textureSet){return textureSet.emissiveTexture;});var normalMap=setup2dTexture("uNormalMap",false,function(textureSet){return textureSet.normalsTexture;});var aOMap=setup2dTexture("uAOMap",false,function(textureSet){return textureSet.occlusionTexture;});var vViewPosition=programVariables.createVarying("vec3","vViewPosition",function(){return"".concat(attributes.position.view,".xyz");});var vViewNormal=programVariables.createVarying("vec3","vViewNormal",function(){return attributes.normal.view;});var vColor=programVariables.createVarying("vec4","vColor",function(){return attributes.color;});var vUV=programVariables.createVarying("vec2","vUV",function(){return attributes.uv;});var vMetallicRoughness=programVariables.createVarying("vec2","vMetallicRoughness",function(){return attributes.metallicRoughness;});var vWorldNormal=programVariables.createVarying("vec3","vWorldNormal",function(){return"".concat(attributes.normal.world,".xyz");});var outColor=programVariables.createOutput("vec4","outColor");var saturate=programVariables.createFragmentDefinition("saturate",function(name,src){return src.push("float ".concat(name,"(const in float a) { return clamp(a, 0.0, 1.0); }"));});var BRDF_Specular_GGX=programVariables.createFragmentDefinition("BRDF_Specular_GGX",function(name,src){src.push("vec3 F_Schlick(const in vec3 specularColor, const in float dotLH) {");src.push(" float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );");src.push(" return ( 1.0 - specularColor ) * fresnel + specularColor;");src.push("}");src.push("float G_GGX_Smith(const in float alpha, const in float dotNL, const in float dotNV) {");src.push(" float a2 = ( alpha * alpha );");src.push(" float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );");src.push(" float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );");src.push(" return 1.0 / ( gl * gv );");src.push("}");src.push("float G_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) {");src.push(" float a2 = ( alpha * alpha );");src.push(" float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );");src.push(" float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );");src.push(" return 0.5 / max( gv + gl, 1e-6 );");src.push("}");src.push("float D_GGX(const in float alpha, const in float dotNH) {");src.push(" float a2 = ( alpha * alpha );");src.push(" float denom = ( dotNH * dotNH) * ( a2 - 1.0 ) + 1.0;");src.push(" return 0.31830988618 * a2 / ( denom * denom);");// 1/PI
9124
9121
  src.push("}");src.push("vec3 ".concat(name,"(const in vec3 incidentLightDirection, const in vec3 viewNormal, const in vec3 viewEyeDir, const in vec3 specularColor, const in float roughness) {"));src.push(" float alpha = ( roughness * roughness );");src.push(" vec3 halfDir = normalize( incidentLightDirection + viewEyeDir );");src.push(" float dotNL = ".concat(saturate,"( dot( viewNormal, incidentLightDirection ) );"));src.push(" float dotNV = ".concat(saturate,"( dot( viewNormal, viewEyeDir ) );"));src.push(" float dotNH = ".concat(saturate,"( dot( viewNormal, halfDir ) );"));src.push(" float dotLH = ".concat(saturate,"( dot( incidentLightDirection, halfDir ) );"));src.push(" vec3 F = F_Schlick( specularColor, dotLH );");src.push(" float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );");src.push(" float D = D_GGX( alpha, dotNH );");src.push(" return F * (G * D);");src.push("}");});var BRDF_Specular_GGX_Environment=programVariables.createFragmentDefinition("BRDF_Specular_GGX_Environment",function(name,src){src.push("vec3 ".concat(name,"(const in vec3 viewNormal, const in vec3 viewEyeDir, const in vec3 specularColor, const in float roughness) {"));src.push(" float dotNV = ".concat(saturate,"(dot(viewNormal, viewEyeDir));"));src.push(" const vec4 c0 = vec4( -1, -0.0275, -0.572, 0.022);");src.push(" const vec4 c1 = vec4( 1, 0.0425, 1.04, -0.04);");src.push(" vec4 r = roughness * c0 + c1;");src.push(" float a004 = min(r.x * r.x, exp2(-9.28 * dotNV)) * r.x + r.y;");src.push(" vec2 AB = vec2(-1.04, 1.04) * a004 + r.zw;");src.push(" return specularColor * AB.x + AB.y;");src.push("}");});var perturbNormal2Arb=programVariables.createFragmentDefinition("perturbNormal2Arb",function(name,src){src.push("vec3 ".concat(name,"( vec3 eye_pos, vec3 surf_norm, vec2 uv, vec4 texel ) {"));src.push(" if (texel.r == 0.0 && texel.g == 0.0 && texel.b == 0.0) {");src.push(" return surf_norm;");src.push(" }");src.push(" vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );");src.push(" vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );");src.push(" vec2 st0 = dFdx( uv.st );");src.push(" vec2 st1 = dFdy( uv.st );");src.push(" vec3 S = normalize( q0 * st1.t - q1 * st0.t );");src.push(" vec3 T = normalize( -q0 * st1.s + q1 * st0.s );");src.push(" vec3 N = normalize( surf_norm );");src.push(" vec3 mapN = texel.xyz * 2.0 - 1.0;");src.push(" mat3 tsn = mat3( S, T, N );");// src.push(" mapN *= 3.0;");
@@ -9150,7 +9147,7 @@ PICK:11};var safeInvVec3=function safeInvVec3(v){return[math.safeInv(v[0]),math.
9150
9147
  " return;","}"]:[]).concat(programSetup.filterIntensityRange&&primitive==="points"&&pointsMaterial.filterIntensity?function(){var intensityRange=programVariables.createUniform("vec2","intensityRange",function(set){tempVec2[0]=pointsMaterial.minIntensity;tempVec2[1]=pointsMaterial.maxIntensity;set(tempVec2);});return["if ((".concat(colorA,".a < ").concat(intensityRange,"[0]) || (").concat(colorA,".a > ").concat(intensityRange,"[1])) {")," gl_Position = vec4(0.0, 0.0, 0.0, 0.0);",// Cull vertex
9151
9148
  " return;","}"];}():[]);var vertexData=[];renderingAttributes.ensureColorAndFlagAvailable&&renderingAttributes.ensureColorAndFlagAvailable(vertexData);afterFlagsColorLines.forEach(function(line){return vertexData.push(line);});renderingAttributes.appendVertexData(vertexData);var viewPosition=geometryParameters.attributes.position.view;vertexData.push("vec4 ".concat(viewPosition," = ").concat(geometryParameters.viewMatrix," * ").concat(worldPositionAttribute,";"));vertexData.push("vec4 ".concat(clipPos," = ").concat(geometryParameters.projMatrix," * ").concat(viewPosition,";"));return vertexData;},projMatrix:geometryParameters.projMatrix,sectionPlanesState:scene._sectionPlanesState,testPerspectiveForGl_FragDepth:primitive!=="points"&&primitive!=="lines"||subGeometry,usePickClipPos:usePickClipPos,worldPositionAttribute:worldPositionAttribute}),_programVariablesStat4=_slicedToArray(_programVariablesStat3,2),program=_programVariablesStat4[0],errors=_programVariablesStat4[1];if(errors){console.error(errors);return{getValid:getValid,destroy:function destroy(){},drawLayer:function drawLayer(frameCtx,layer,renderPass){}};}else{return{getValid:getValid,destroy:function destroy(){return program.destroy();},drawLayer:function drawLayer(frameCtx,layer,renderPass){if(frameCtx.lastProgramId!==program.id){frameCtx.lastProgramId=program.id;program.bind();}var origin=layer.origin;var model=layer.model;var viewParams=frameCtx.viewParams;var rtcOrigin=tempVec3$6;math.transformPoint3(model.matrix,origin,rtcOrigin);var viewMatrix=viewParams.viewMatrix;var projMatrix=viewParams.projMatrix;if(frameCtx.snapPickOrigin){frameCtx.snapPickOrigin[0]=rtcOrigin[0];frameCtx.snapPickOrigin[1]=rtcOrigin[1];frameCtx.snapPickOrigin[2]=rtcOrigin[2];}var state={legacyFrameCtx:frameCtx,layerTextureSet:layer.layerTextureSet,mesh:{layerIndex:layer.layerIndex,origin:rtcOrigin,renderFlags:{sectionPlanesActivePerLayer:model.renderFlags.sectionPlanesActivePerLayer}},renderPass:renderPass,view:{eye:viewParams.eye,far:viewParams.far,projMatrix:projMatrix,viewMatrix:math.compareVec3(rtcOrigin,vec3zero)?viewMatrix:createRTCViewMat(viewMatrix,rtcOrigin,tempMat4$2),viewNormalMatrix:viewParams.viewNormalMatrix}};program.inputSetters.setUniforms(frameCtx,state);layer.drawCalls[subGeometry?subGeometry.vertices?"drawVertices":"drawEdges":"drawSurface"](program.inputSetters.attributesHash,renderingAttributes.layerTypeInputs,{projMatrix:projMatrix,viewMatrix:math.compareVec3(rtcOrigin,vec3zero)?viewMatrix:createRTCViewMat(viewMatrix,rtcOrigin,tempMat4$2),viewNormalMatrix:viewParams.viewNormalMatrix,eye:viewParams.eye});if(incrementDrawState){frameCtx.drawElements++;}}};}});};var renderer=isEager&&instantiate();return{drawLayer:function drawLayer(frameCtx,layer,renderPass){if(!renderer){renderer=instantiate();}renderer.drawLayer(frameCtx,layer,renderPass);},revalidate:function revalidate(force){if(renderer&&(force||!renderer.getValid())){renderer.destroy();renderer=isEager&&instantiate();}}};};// Pre-initialize certain renderers that would otherwise be lazy-initialised on user interaction,
9152
9149
  // such as picking or emphasis, so that there is no delay when user first begins interacting with the viewer.
9153
- var eager=function eager(createProgramSetup,subGeometry){return wrapRenderer(createProgramSetup,subGeometry,true);};var lazy=function lazy(createProgramSetup,subGeometry){return wrapRenderer(createProgramSetup,subGeometry,false);};var makeColorProgram=function makeColorProgram(vars,geo,lights,sao){return ColorProgram(vars,geo,scene.logarithmicDepthBufferEnabled,lights,sao,primitive);};var makePickDepthProgram=function makePickDepthProgram(vars,geo,c){return c(PickDepthProgram(vars,geo,scene.logarithmicDepthBufferEnabled),true);};var makePickMeshProgram=function makePickMeshProgram(vars,geo,c){return c(PickMeshProgram(vars,geo,scene.logarithmicDepthBufferEnabled),true);};var makePickNormalsProgram=function makePickNormalsProgram(vars,geo,c,isFlat){return c(PickNormalsProgram(vars,geo,scene.logarithmicDepthBufferEnabled,isFlat),true);};var makeSnapProgram=function makeSnapProgram(vars,geo,c,isSnapInit,isPoints){return c(SnapProgram(vars,geo,isSnapInit,isPoints),true);};if(primitive==="points"){cache[sceneId]={colorRenderers:{"sao-":{"vertex":lazy(function(vars,geo,c){return c(makeColorProgram(vars,geo,null,null));})}},occlusionRenderer:lazy(function(vars,geo,c){return c(OcclusionProgram(vars,scene.logarithmicDepthBufferEnabled));}),pickDepthRenderer:lazy(makePickDepthProgram),pickMeshRenderer:lazy(makePickMeshProgram),// VBOBatchingPointsShadowRenderer has been implemented by 14e973df6268369b00baef60e468939e062ac320,
9150
+ var eager=function eager(createProgramSetup,subGeometry){return wrapRenderer(createProgramSetup,subGeometry,true);};var lazy=function lazy(createProgramSetup,subGeometry){return wrapRenderer(createProgramSetup,subGeometry,false);};var makeColorProgram=function makeColorProgram(vars,geo,lights,sao){return ColorProgram(vars,geo,scene.logarithmicDepthBufferEnabled,lights,sao,primitive);};var makePickDepthProgram=function makePickDepthProgram(vars,geo,c){return c(PickDepthProgram(vars,geo,scene.logarithmicDepthBufferEnabled),true);};var makePickMeshProgram=function makePickMeshProgram(vars,geo,c){return c(PickMeshProgram(vars,geo,scene.logarithmicDepthBufferEnabled),true);};var makePickNormalsProgram=function makePickNormalsProgram(vars,geo,c,isFlat){return c(PickNormalsProgram(vars,geo,scene.logarithmicDepthBufferEnabled,isFlat),true);};var makeSnapProgram=function makeSnapProgram(vars,geo,c,isSnapInit,isPoints){return c(SnapProgram(vars,geo,isSnapInit,isPoints),true);};if(primitive==="points"){cache[sceneId]={colorRenderers:{"sao-":{"vertex":lazy(function(vars,geo,c){return c(makeColorProgram(vars,geo,null,null));})}},occlusionRenderer:lazy(function(vars,geo,c){return c(OcclusionProgram(vars));}),pickDepthRenderer:lazy(makePickDepthProgram),pickMeshRenderer:lazy(makePickMeshProgram),// VBOBatchingPointsShadowRenderer has been implemented by 14e973df6268369b00baef60e468939e062ac320,
9154
9151
  // but never used (and probably not maintained), as opposed to VBOInstancingPointsShadowRenderer in the same commit
9155
9152
  // drawShadow has been nop in VBO point layers
9156
9153
  // shadowRenderer: instancing && lazy((vars, geo, c) => c(ShadowProgram(scene.logarithmicDepthBufferEnabled))),
@@ -9159,7 +9156,7 @@ var createLights=function createLights(vars){return createLightSetup(vars,scene.
9159
9156
  // Would be more efficient to defer this, then render lines later, using same depth buffer for Z-reject
9160
9157
  var uv="".concat(gl_FragCoord,".xy / ").concat(uSAOParams,".xy");// / viewportWH
9161
9158
  var blendCutoff="".concat(uSAOParams,".z");var blendFactor="".concat(uSAOParams,".w");var unPackFactors="(255. / 256.) / vec4(256. * 256. * 256., 256. * 256., 256., 1.)";return"(smoothstep(".concat(blendCutoff,", 1.0, dot(").concat(uOcclusionTexture(uv),", ").concat(unPackFactors,")) * ").concat(blendFactor,")");}};};var saoRenderers=function saoRenderers(useSao){var makeColorTextureProgram=function makeColorTextureProgram(vars,geo,useAlphaCutoff){return ColorTextureProgram(vars,geo,scene,createLights(vars),useSao&&createSAO(vars),useAlphaCutoff,scene.gammaOutput);};// If gammaOutput set, then it expects that all textures and colors need to be outputted in premultiplied gamma. Default is false.
9162
- return{"PBR":pbrSupported&&lazy(function(vars,geo,c){return c(PBRProgram(vars,geo,scene,createLights(vars),useSao&&createSAO(vars)));}),"texture":colorTextureSupported&&{"alphaCutoff-":lazy(function(vars,geo,c){return c(makeColorTextureProgram(vars,geo,false));}),"alphaCutoff+":lazy(function(vars,geo,c){return c(makeColorTextureProgram(vars,geo,true));})},"vertex":surfaceHasNormals?lazy(function(vars,geo,c){return c(makeColorProgram(vars,geo,createLights(vars),useSao&&createSAO(vars)));}):lazy(function(vars,geo,c){return c(FlatColorProgram(vars,geo,scene.logarithmicDepthBufferEnabled,createLights(vars),useSao&&createSAO(vars)));})};};return{"sao-":saoRenderers(false),"sao+":saoEnabled&&saoRenderers(true)};}(),depthRenderer:lazy(function(vars,geo,c){return c(DepthProgram(vars,geo,scene.logarithmicDepthBufferEnabled));}),edgesRenderers:{uniform:lazy(function(vars,geo,c){return c(EdgesProgram(vars,geo,scene.logarithmicDepthBufferEnabled,true));},{vertices:false}),vertex:lazy(function(vars,geo,c){return c(EdgesProgram(vars,geo,scene.logarithmicDepthBufferEnabled,false));},{vertices:false})},occlusionRenderer:lazy(function(vars,geo,c){return c(OcclusionProgram(vars,scene.logarithmicDepthBufferEnabled));}),pickDepthRenderer:eager(makePickDepthProgram),pickMeshRenderer:eager(makePickMeshProgram),pickNormalsFlatRenderer:eager(function(vars,geo,c){return makePickNormalsProgram(vars,geo,c,true);}),pickNormalsRenderer:eager(function(vars,geo,c){return makePickNormalsProgram(vars,geo,c,false);}),shadowRenderer:lazy(function(vars,geo,c){return c(ShadowProgram(vars,scene));}),silhouetteRenderer:eager(function(vars,geo,c){return c(SilhouetteProgram(vars,geo,scene.logarithmicDepthBufferEnabled,false));}),snapInitRenderer:eager(function(vars,geo,c){return makeSnapProgram(vars,geo,c,true,false);}),snapEdgeRenderer:eager(function(vars,geo,c){return makeSnapProgram(vars,geo,c,false,false);},{vertices:false}),snapVertexRenderer:eager(function(vars,geo,c){return makeSnapProgram(vars,geo,c,false,false);},{vertices:true})};}var revalidateAll=function revalidateAll(force){(function rec(obj){if(obj.revalidate){obj.revalidate(force);}else{Object.values(obj).forEach(function(v){return v&&rec(v);});}})(cache[sceneId]);};var compile=function compile(){return revalidateAll(false);};compile();scene.on("compile",compile);scene.on("destroyed",function(){delete cache[sceneId];});}return cache[sceneId];};}();var Layer=/*#__PURE__*/function(){function Layer(model,primitive,origin){_classCallCheck(this,Layer);this.model=model;this.primitive=primitive;this.origin=origin;this._meshes=[];// The axis-aligned World-space boundary of this Layer's positions.
9159
+ return{"PBR":pbrSupported&&lazy(function(vars,geo,c){return c(PBRProgram(vars,geo,scene,createLights(vars),useSao&&createSAO(vars)));}),"texture":colorTextureSupported&&{"alphaCutoff-":lazy(function(vars,geo,c){return c(makeColorTextureProgram(vars,geo,false));}),"alphaCutoff+":lazy(function(vars,geo,c){return c(makeColorTextureProgram(vars,geo,true));})},"vertex":surfaceHasNormals?lazy(function(vars,geo,c){return c(makeColorProgram(vars,geo,createLights(vars),useSao&&createSAO(vars)));}):lazy(function(vars,geo,c){return c(FlatColorProgram(vars,geo,scene.logarithmicDepthBufferEnabled,createLights(vars),useSao&&createSAO(vars)));})};};return{"sao-":saoRenderers(false),"sao+":saoEnabled&&saoRenderers(true)};}(),depthRenderer:lazy(function(vars,geo,c){return c(DepthProgram(vars,geo,scene.logarithmicDepthBufferEnabled));}),edgesRenderers:{uniform:lazy(function(vars,geo,c){return c(EdgesProgram(vars,geo,scene.logarithmicDepthBufferEnabled,true));},{vertices:false}),vertex:lazy(function(vars,geo,c){return c(EdgesProgram(vars,geo,scene.logarithmicDepthBufferEnabled,false));},{vertices:false})},occlusionRenderer:lazy(function(vars,geo,c){return c(OcclusionProgram(vars));}),pickDepthRenderer:eager(makePickDepthProgram),pickMeshRenderer:eager(makePickMeshProgram),pickNormalsFlatRenderer:eager(function(vars,geo,c){return makePickNormalsProgram(vars,geo,c,true);}),pickNormalsRenderer:eager(function(vars,geo,c){return makePickNormalsProgram(vars,geo,c,false);}),shadowRenderer:lazy(function(vars,geo,c){return c(ShadowProgram(vars,scene));}),silhouetteRenderer:eager(function(vars,geo,c){return c(SilhouetteProgram(vars,geo,scene.logarithmicDepthBufferEnabled,false));}),snapInitRenderer:eager(function(vars,geo,c){return makeSnapProgram(vars,geo,c,true,false);}),snapEdgeRenderer:eager(function(vars,geo,c){return makeSnapProgram(vars,geo,c,false,false);},{vertices:false}),snapVertexRenderer:eager(function(vars,geo,c){return makeSnapProgram(vars,geo,c,false,false);},{vertices:true})};}var revalidateAll=function revalidateAll(force){(function rec(obj){if(obj.revalidate){obj.revalidate(force);}else{Object.values(obj).forEach(function(v){return v&&rec(v);});}})(cache[sceneId]);};var compile=function compile(){return revalidateAll(false);};compile();scene.on("compile",compile);scene.on("destroyed",function(){delete cache[sceneId];});}return cache[sceneId];};}();var Layer=/*#__PURE__*/function(){function Layer(model,primitive,origin){_classCallCheck(this,Layer);this.model=model;this.primitive=primitive;this.origin=origin;this._meshes=[];// The axis-aligned World-space boundary of this Layer's positions.
9163
9160
  this._aabb=math.collapseAABB3();this._aabbDirty=true;}return _createClass(Layer,[{key:"finalize",value:function finalize(){var _this36=this;if(!this._compiledPortions){this._compiledPortions=this.compilePortions();this.solid=this._compiledPortions.solid;this.sortId=this._compiledPortions.sortId;this.layerTextureSet=this._compiledPortions.layerTextureSet;this.drawCalls=this._compiledPortions.drawCalls;this._renderers=this._compiledPortions.renderers;this._setFlags=this._compiledPortions.setFlags;this.setColor=this._compiledPortions.setColor;this.setMatrix=this._compiledPortions.setMatrix;this.setOffset=this._compiledPortions.setOffset;this.getEachIndex=this._compiledPortions.getEachIndex;this.getEachVertex=this._compiledPortions.getEachVertex;this.readGeometryData=this._compiledPortions.readGeometryData;this.precisionRayPickSurface=this._compiledPortions.precisionRayPickSurface;// These counts are used to avoid unnecessary render passes
9164
9161
  this._countsByFlag={};var setupFlagCount=function setupFlagCount(entityFlag,modelCountProperty){var cnt={count:0,fromFlags:function fromFlags(flags,onlyIncrement){if(flags&entityFlag){cnt.count++;_this36.model[modelCountProperty]++;}else if(!onlyIncrement){cnt.count--;_this36.model[modelCountProperty]--;}}};_this36._countsByFlag[entityFlag]=cnt;};setupFlagCount(ENTITY_FLAGS.VISIBLE,"numVisibleLayerPortions");setupFlagCount(ENTITY_FLAGS.CULLED,"numCulledLayerPortions");setupFlagCount(ENTITY_FLAGS.PICKABLE,"numPickableLayerPortions");setupFlagCount(ENTITY_FLAGS.CLIPPABLE,"numClippableLayerPortions");setupFlagCount(ENTITY_FLAGS.XRAYED,"numXRayedLayerPortions");setupFlagCount(ENTITY_FLAGS.HIGHLIGHTED,"numHighlightedLayerPortions");setupFlagCount(ENTITY_FLAGS.SELECTED,"numSelectedLayerPortions");if(this._renderers.edgesRenderers){setupFlagCount(ENTITY_FLAGS.EDGES,"numEdgesLayerPortions");}// Optimize initFlags to not require Object.values call each time (adds up a lot)
9165
9162
  this._countsByFlagArr=Object.values(this._countsByFlag);this._numTransparentLayerPortions=0;}}},{key:"aabbChanged",value:function aabbChanged(){this._aabbDirty=true;}},{key:"getAABB",value:function getAABB(){var _this37=this;if(this._aabbDirty){// Per-layer AABB for best RTC accuracy
@@ -14409,7 +14406,7 @@ var j=0;for(var _i193=0;_i193<this.numMarkers;_i193++){if(this.markerList[_i193]
14409
14406
  * @returns {Boolean}
14410
14407
  */},{key:"needOcclusionTest",get:function get(){return this._occlusionTestListDirty;}/**
14411
14408
  * Draws {@link Marker}s to the render buffer.
14412
- */},{key:"drawMarkers",value:function drawMarkers(){var _this86=this;var scene=this._scene;var canvas=scene.canvas;var gl=canvas.gl;var sectionPlanesState=scene._sectionPlanesState;var shaderSourceHash=[canvas.canvas.id,sectionPlanesState.getHash()].join(";");if(!this._drawable||shaderSourceHash!==this._drawable.shaderSourceHash){if(this._drawable){this._drawable.destroy();}var programVariablesState=createProgramVariablesState();var programVariables=programVariablesState.programVariables;var viewMatrix=programVariables.createUniform("mat4","viewMatrix");var projMatrix=programVariables.createUniform("mat4","projMatrix");var _position3=programVariables.createAttribute("vec3","position");var outColor=programVariables.createOutput("vec4","outColor");var clipPos="clipPos";var _programVariablesStat5=programVariablesState.buildProgram(gl,"OcclusionTester",{sectionPlanesState:sectionPlanesState,getLogDepth:scene.logarithmicDepthBufferEnabled&&function(vFragDepth){return vFragDepth;},clippableTest:function clippableTest(){return"true";},getVertexData:function getVertexData(){var src=[];src.push("vec4 worldPosition = vec4(".concat(_position3,", 1.0);"));src.push("vec4 ".concat(clipPos," = ").concat(projMatrix," * ").concat(viewMatrix," * worldPosition;"));if(!scene.logarithmicDepthBufferEnabled&&scene.markerZOffset<0.000){src.push("".concat(clipPos,".z += ").concat(scene.markerZOffset,";"));}return src;},worldPositionAttribute:"worldPosition",getPointSize:function getPointSize(){return"20.0";},clipPos:clipPos,appendFragmentOutputs:function appendFragmentOutputs(src){return src.push("".concat(outColor," = vec4(1.0, 0.0, 0.0, 1.0);"));}}),_programVariablesStat6=_slicedToArray(_programVariablesStat5,2),program=_programVariablesStat6[0],errors=_programVariablesStat6[1];if(errors){console.error(errors.join("\n"));throw errors.join("\n");}else{this._occlusionTestListDirty=true;this._drawable={shaderSourceHash:shaderSourceHash,destroy:function destroy(){return program.destroy();},drawCall:function drawCall(){var camera=scene.camera;var project=camera.project;program.bind();projMatrix.setInputValue(project.matrix);var boundary=canvas.boundary;var canvasWidth=boundary[2];var canvasHeight=boundary[3];var near=camera.perspective.near;// Assume near enough to ortho near
14409
+ */},{key:"drawMarkers",value:function drawMarkers(){var _this86=this;var scene=this._scene;var canvas=scene.canvas;var gl=canvas.gl;var sectionPlanesState=scene._sectionPlanesState;var shaderSourceHash=[canvas.canvas.id,sectionPlanesState.getHash()].join(";");if(!this._drawable||shaderSourceHash!==this._drawable.shaderSourceHash){if(this._drawable){this._drawable.destroy();}var programVariablesState=createProgramVariablesState();var programVariables=programVariablesState.programVariables;var viewMatrix=programVariables.createUniform("mat4","viewMatrix");var projMatrix=programVariables.createUniform("mat4","projMatrix");var _position3=programVariables.createAttribute("vec3","position");var outColor=programVariables.createOutput("vec4","outColor");var clipPos="clipPos";var _programVariablesStat5=programVariablesState.buildProgram(gl,"OcclusionTester",{sectionPlanesState:sectionPlanesState,clippableTest:function clippableTest(){return"true";},getVertexData:function getVertexData(){var src=[];src.push("vec4 worldPosition = vec4(".concat(_position3,", 1.0);"));src.push("vec4 ".concat(clipPos," = ").concat(projMatrix," * ").concat(viewMatrix," * worldPosition;"));if(scene.markerZOffset<0.000){src.push("".concat(clipPos,".z += ").concat(scene.markerZOffset,";"));}return src;},worldPositionAttribute:"worldPosition",getPointSize:function getPointSize(){return"20.0";},clipPos:clipPos,appendFragmentOutputs:function appendFragmentOutputs(src){return src.push("".concat(outColor," = vec4(1.0, 0.0, 0.0, 1.0);"));}}),_programVariablesStat6=_slicedToArray(_programVariablesStat5,2),program=_programVariablesStat6[0],errors=_programVariablesStat6[1];if(errors){console.error(errors.join("\n"));throw errors.join("\n");}else{this._occlusionTestListDirty=true;this._drawable={shaderSourceHash:shaderSourceHash,destroy:function destroy(){return program.destroy();},drawCall:function drawCall(){var camera=scene.camera;var project=camera.project;program.bind();projMatrix.setInputValue(project.matrix);var boundary=canvas.boundary;var canvasWidth=boundary[2];var canvasHeight=boundary[3];var near=camera.perspective.near;// Assume near enough to ortho near
14413
14410
  var markerInView=function markerInView(marker){var viewPos=marker.viewPos;var canvasPos=marker.canvasPos;var canvasX=canvasPos[0];var canvasY=canvasPos[1];return viewPos[2]<=-near&&canvasX>=-10&&canvasY>=-10&&canvasX<=canvasWidth+10&&canvasY<=canvasHeight+10;};_this86._occlusionLayersList.forEach(function(occlusionLayer){occlusionLayer.update(gl,markerInView);var culled=sectionPlanesState.sectionPlanes.some(function(sectionPlane,i){var intersect=sectionPlane.active?math.planeAABB3Intersect(sectionPlane.dir,sectionPlane.dist,occlusionLayer.aabb):1;var outside=intersect===-1;occlusionLayer.sectionPlanesActive[i]=intersect===0;// if outside, then sectionPlanesActive won't be even tested
14414
14411
  return outside;});if(!culled){var origin=occlusionLayer.origin;viewMatrix.setInputValue(createRTCViewMat(camera.viewMatrix,origin));program.inputSetters.setUniforms(null,{view:{far:project.far},mesh:{origin:origin,renderFlags:{sectionPlanesActivePerLayer:occlusionLayer.sectionPlanesActive}}});_position3.setInputValue(occlusionLayer.positionsBuf);var indicesBuf=occlusionLayer.indicesBuf;indicesBuf.bind();gl.drawElements(gl.POINTS,indicesBuf.numItems,indicesBuf.itemType,0);}});}};}}if(this._occlusionLayersListDirty){var numOcclusionLayers=0;for(var originHash in this._occlusionLayers){if(this._occlusionLayers.hasOwnProperty(originHash)){this._occlusionLayersList[numOcclusionLayers++]=this._occlusionLayers[originHash];}}this._occlusionLayersList.length=numOcclusionLayers;this._occlusionLayersListDirty=false;}if(this._occlusionTestListDirty){for(var _i195=0,len=this._occlusionLayersList.length;_i195<len;_i195++){var occlusionLayer=this._occlusionLayersList[_i195];occlusionLayer.occlusionTestListDirty=true;}this._occlusionTestListDirty=false;}this._drawable.drawCall();}/**
14415
14412
  * Sets visibilities of {@link Marker}s according to whether or not they are obscured by anything in the render buffer.
@@ -17620,7 +17617,7 @@ _this101._needRecompile=false;/**
17620
17617
  *
17621
17618
  * @type {Canvas}
17622
17619
  */_this101.canvas=new Canvas(_this101,{dontClear:true,// Never destroy this component with Scene#clear();
17623
- canvas:canvas,spinnerElementId:cfg.spinnerElementId,transparent:transparent,webgl2:cfg.webgl2!==false,contextAttr:cfg.contextAttr||{},backgroundColor:cfg.backgroundColor,backgroundColorFromAmbientLight:cfg.backgroundColorFromAmbientLight,premultipliedAlpha:cfg.premultipliedAlpha});var onContextLost=function onContextLost(event){return _this101.viewer.destroy();};canvas.addEventListener("webglcontextlost",onContextLost,false);_this101._removeWebglcontextlostListener=function(){return canvas.removeEventListener("webglcontextlost",onContextLost,false);};_this101.canvas.on("boundary",function(){_this101.glRedraw();});_this101.canvas.on("webglContextFailed",function(){alert("xeokit failed to find WebGL!");});_this101._renderer=new Renderer$1(_this101,{transparent:transparent,alphaDepthMask:alphaDepthMask});_this101._sectionPlanesState=new function(){this.sectionPlanes=[];this.clippingCaps=false;this._numCachedSectionPlanes=0;var hash=null;this.getHash=function(){if(hash){return hash;}var numAllocatedSectionPlanes=this.getNumAllocatedSectionPlanes();this.sectionPlanes;if(numAllocatedSectionPlanes===0){return this.hash=";";}var hashParts=[];for(var _i205=0,len=numAllocatedSectionPlanes;_i205<len;_i205++){hashParts.push("cp");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addSectionPlane=function(sectionPlane){this.sectionPlanes.push(sectionPlane);hash=null;};this.removeSectionPlane=function(sectionPlane){for(var _i206=0,len=this.sectionPlanes.length;_i206<len;_i206++){if(this.sectionPlanes[_i206].id===sectionPlane.id){this.sectionPlanes.splice(_i206,1);hash=null;return;}}};this.setNumCachedSectionPlanes=function(numCachedSectionPlanes){this._numCachedSectionPlanes=numCachedSectionPlanes;hash=null;};this.getNumCachedSectionPlanes=function(){return this._numCachedSectionPlanes;};this.getNumAllocatedSectionPlanes=function(){var num=this.sectionPlanes.length;return num>this._numCachedSectionPlanes?num:this._numCachedSectionPlanes;};}();_this101._sectionPlanesState.setNumCachedSectionPlanes(cfg.numCachedSectionPlanes||0);_this101._lightsState=new function(){var DEFAULT_AMBIENT=math.vec4([0,0,0,0]);var ambientColorIntensity=math.vec4();this.lights=[];this.reflectionMaps=[];this.lightMaps=[];var hash=null;var ambientLight=null;this.getHash=function(){if(hash){return hash;}var hashParts=[];var lights=this.lights;var light;for(var _i207=0,len=lights.length;_i207<len;_i207++){light=lights[_i207];hashParts.push("/");hashParts.push(light.type);hashParts.push(light.space==="world"?"w":"v");if(light.castsShadow){hashParts.push("sh");}}if(this.lightMaps.length>0){hashParts.push("/lm");}if(this.reflectionMaps.length>0){hashParts.push("/rm");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addLight=function(state){this.lights.push(state);ambientLight=null;hash=null;};this.removeLight=function(state){for(var _i208=0,len=this.lights.length;_i208<len;_i208++){var light=this.lights[_i208];if(light.id===state.id){this.lights.splice(_i208,1);if(ambientLight&&ambientLight.id===state.id){ambientLight=null;}hash=null;return;}}};this.addReflectionMap=function(state){this.reflectionMaps.push(state);hash=null;};this.removeReflectionMap=function(state){for(var _i209=0,len=this.reflectionMaps.length;_i209<len;_i209++){if(this.reflectionMaps[_i209].id===state.id){this.reflectionMaps.splice(_i209,1);hash=null;return;}}};this.addLightMap=function(state){this.lightMaps.push(state);hash=null;};this.removeLightMap=function(state){for(var _i210=0,len=this.lightMaps.length;_i210<len;_i210++){if(this.lightMaps[_i210].id===state.id){this.lightMaps.splice(_i210,1);hash=null;return;}}};this.getAmbientColorAndIntensity=function(){if(!ambientLight){for(var _i211=0,len=this.lights.length;_i211<len;_i211++){var light=this.lights[_i211];if(light.type==="ambient"){ambientLight=light;break;}}}if(ambientLight){var _color5=ambientLight.color;var intensity=ambientLight.intensity;ambientColorIntensity[0]=_color5[0];ambientColorIntensity[1]=_color5[1];ambientColorIntensity[2]=_color5[2];ambientColorIntensity[3]=intensity;return ambientColorIntensity;}else{return DEFAULT_AMBIENT;}};}();/**
17620
+ canvas:canvas,spinnerElementId:cfg.spinnerElementId,transparent:transparent,webgl2:cfg.webgl2!==false,contextAttr:cfg.contextAttr||{},backgroundColor:cfg.backgroundColor,backgroundColorFromAmbientLight:cfg.backgroundColorFromAmbientLight,premultipliedAlpha:cfg.premultipliedAlpha});var onContextLost=function onContextLost(event){return _this101.viewer.destroy();};canvas.addEventListener("webglcontextlost",onContextLost,false);_this101._removeWebglcontextlostListener=function(){return canvas.removeEventListener("webglcontextlost",onContextLost,false);};_this101.canvas.on("boundary",function(){_this101.glRedraw();});_this101.canvas.on("webglContextFailed",function(){alert("xeokit failed to find WebGL!");});_this101._renderer=new Renderer$1(_this101,{transparent:transparent,alphaDepthMask:alphaDepthMask});_this101.canvas._renderer=_this101._renderer;_this101._sectionPlanesState=new function(){this.sectionPlanes=[];this.clippingCaps=false;this._numCachedSectionPlanes=0;var hash=null;this.getHash=function(){if(hash){return hash;}var numAllocatedSectionPlanes=this.getNumAllocatedSectionPlanes();this.sectionPlanes;if(numAllocatedSectionPlanes===0){return this.hash=";";}var hashParts=[];for(var _i205=0,len=numAllocatedSectionPlanes;_i205<len;_i205++){hashParts.push("cp");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addSectionPlane=function(sectionPlane){this.sectionPlanes.push(sectionPlane);hash=null;};this.removeSectionPlane=function(sectionPlane){for(var _i206=0,len=this.sectionPlanes.length;_i206<len;_i206++){if(this.sectionPlanes[_i206].id===sectionPlane.id){this.sectionPlanes.splice(_i206,1);hash=null;return;}}};this.setNumCachedSectionPlanes=function(numCachedSectionPlanes){this._numCachedSectionPlanes=numCachedSectionPlanes;hash=null;};this.getNumCachedSectionPlanes=function(){return this._numCachedSectionPlanes;};this.getNumAllocatedSectionPlanes=function(){var num=this.sectionPlanes.length;return num>this._numCachedSectionPlanes?num:this._numCachedSectionPlanes;};}();_this101._sectionPlanesState.setNumCachedSectionPlanes(cfg.numCachedSectionPlanes||0);_this101._lightsState=new function(){var DEFAULT_AMBIENT=math.vec4([0,0,0,0]);var ambientColorIntensity=math.vec4();this.lights=[];this.reflectionMaps=[];this.lightMaps=[];var hash=null;var ambientLight=null;this.getHash=function(){if(hash){return hash;}var hashParts=[];var lights=this.lights;var light;for(var _i207=0,len=lights.length;_i207<len;_i207++){light=lights[_i207];hashParts.push("/");hashParts.push(light.type);hashParts.push(light.space==="world"?"w":"v");if(light.castsShadow){hashParts.push("sh");}}if(this.lightMaps.length>0){hashParts.push("/lm");}if(this.reflectionMaps.length>0){hashParts.push("/rm");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addLight=function(state){this.lights.push(state);ambientLight=null;hash=null;};this.removeLight=function(state){for(var _i208=0,len=this.lights.length;_i208<len;_i208++){var light=this.lights[_i208];if(light.id===state.id){this.lights.splice(_i208,1);if(ambientLight&&ambientLight.id===state.id){ambientLight=null;}hash=null;return;}}};this.addReflectionMap=function(state){this.reflectionMaps.push(state);hash=null;};this.removeReflectionMap=function(state){for(var _i209=0,len=this.reflectionMaps.length;_i209<len;_i209++){if(this.reflectionMaps[_i209].id===state.id){this.reflectionMaps.splice(_i209,1);hash=null;return;}}};this.addLightMap=function(state){this.lightMaps.push(state);hash=null;};this.removeLightMap=function(state){for(var _i210=0,len=this.lightMaps.length;_i210<len;_i210++){if(this.lightMaps[_i210].id===state.id){this.lightMaps.splice(_i210,1);hash=null;return;}}};this.getAmbientColorAndIntensity=function(){if(!ambientLight){for(var _i211=0,len=this.lights.length;_i211<len;_i211++){var light=this.lights[_i211];if(light.type==="ambient"){ambientLight=light;break;}}}if(ambientLight){var _color5=ambientLight.color;var intensity=ambientLight.intensity;ambientColorIntensity[0]=_color5[0];ambientColorIntensity[1]=_color5[1];ambientColorIntensity[2]=_color5[2];ambientColorIntensity[3]=intensity;return ambientColorIntensity;}else{return DEFAULT_AMBIENT;}};}();/**
17624
17621
  * Publishes input events that occur on this Scene's canvas.
17625
17622
  *
17626
17623
  * @property input