x_ite 10.1.0 → 10.2.0

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 (71) hide show
  1. package/README.md +18 -18
  2. package/dist/X3DUOM.xml +69 -11
  3. package/dist/assets/components/Annotation.js +13 -13
  4. package/dist/assets/components/Annotation.min.js +1 -1
  5. package/dist/assets/components/CADGeometry.js +16 -16
  6. package/dist/assets/components/CADGeometry.min.js +1 -1
  7. package/dist/assets/components/CubeMapTexturing.js +39 -27
  8. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  9. package/dist/assets/components/DIS.js +13 -13
  10. package/dist/assets/components/DIS.min.js +1 -1
  11. package/dist/assets/components/EventUtilities.js +9 -9
  12. package/dist/assets/components/EventUtilities.min.js +1 -1
  13. package/dist/assets/components/Geometry2D.js +51 -35
  14. package/dist/assets/components/Geometry2D.min.js +1 -1
  15. package/dist/assets/components/Geospatial.js +34 -34
  16. package/dist/assets/components/Geospatial.min.js +1 -1
  17. package/dist/assets/components/HAnim.js +23 -23
  18. package/dist/assets/components/HAnim.min.js +1 -1
  19. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  20. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  21. package/dist/assets/components/Layout.js +27 -27
  22. package/dist/assets/components/Layout.min.js +1 -1
  23. package/dist/assets/components/NURBS.js +25 -25
  24. package/dist/assets/components/NURBS.min.js +1 -1
  25. package/dist/assets/components/ParticleSystems.js +26 -26
  26. package/dist/assets/components/ParticleSystems.min.js +1 -1
  27. package/dist/assets/components/Picking.js +18 -18
  28. package/dist/assets/components/Picking.min.js +1 -1
  29. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  30. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  31. package/dist/assets/components/Scripting.js +38 -38
  32. package/dist/assets/components/Scripting.min.js +1 -1
  33. package/dist/assets/components/Text.js +40 -42
  34. package/dist/assets/components/Text.min.js +1 -1
  35. package/dist/assets/components/TextureProjection.js +15 -15
  36. package/dist/assets/components/TextureProjection.min.js +1 -1
  37. package/dist/assets/components/Texturing3D.js +28 -28
  38. package/dist/assets/components/Texturing3D.min.js +1 -1
  39. package/dist/assets/components/VolumeRendering.js +19 -19
  40. package/dist/assets/components/VolumeRendering.min.js +1 -1
  41. package/dist/assets/components/X_ITE.js +1254 -1053
  42. package/dist/assets/components/X_ITE.min.js +1 -1
  43. package/dist/assets/fonts/PT_Sans/OFL.txt +94 -0
  44. package/dist/assets/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
  45. package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
  46. package/dist/assets/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
  47. package/dist/assets/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
  48. package/dist/assets/lib/mikktspace_bg.wasm +0 -0
  49. package/dist/example.html +1 -1
  50. package/dist/x_ite.css +1 -1
  51. package/dist/x_ite.d.ts +60 -11
  52. package/dist/x_ite.js +851 -600
  53. package/dist/x_ite.min.js +1 -1
  54. package/dist/x_ite.min.mjs +1 -1
  55. package/dist/x_ite.mjs +851 -600
  56. package/dist/x_ite.zip +0 -0
  57. package/package.json +1 -1
  58. /package/dist/assets/fonts/{DroidSerif Apache License.txt → Droid/DroidSerif Apache License.txt} +0 -0
  59. /package/dist/assets/fonts/{DroidSerif-Bold.ttf → Droid/DroidSerif-Bold.ttf} +0 -0
  60. /package/dist/assets/fonts/{DroidSerif-BoldItalic.ttf → Droid/DroidSerif-BoldItalic.ttf} +0 -0
  61. /package/dist/assets/fonts/{DroidSerif-Italic.ttf → Droid/DroidSerif-Italic.ttf} +0 -0
  62. /package/dist/assets/fonts/{DroidSerif-Regular.ttf → Droid/DroidSerif-Regular.ttf} +0 -0
  63. /package/dist/assets/fonts/{Ubuntu LICENCE.txt → Ubuntu/Ubuntu LICENCE.txt} +0 -0
  64. /package/dist/assets/fonts/{Ubuntu-B.ttf → Ubuntu/Ubuntu-B.ttf} +0 -0
  65. /package/dist/assets/fonts/{Ubuntu-BI.ttf → Ubuntu/Ubuntu-BI.ttf} +0 -0
  66. /package/dist/assets/fonts/{Ubuntu-R.ttf → Ubuntu/Ubuntu-R.ttf} +0 -0
  67. /package/dist/assets/fonts/{Ubuntu-RI.ttf → Ubuntu/Ubuntu-RI.ttf} +0 -0
  68. /package/dist/assets/fonts/{UbuntuMono-B.ttf → Ubuntu/UbuntuMono-B.ttf} +0 -0
  69. /package/dist/assets/fonts/{UbuntuMono-BI.ttf → Ubuntu/UbuntuMono-BI.ttf} +0 -0
  70. /package/dist/assets/fonts/{UbuntuMono-R.ttf → Ubuntu/UbuntuMono-R.ttf} +0 -0
  71. /package/dist/assets/fonts/{UbuntuMono-RI.ttf → Ubuntu/UbuntuMono-RI.ttf} +0 -0
package/dist/x_ite.js CHANGED
@@ -1,4 +1,4 @@
1
- /* X_ITE v10.1.0 */(function webpackUniversalModuleDefinition(root, factory) {
1
+ /* X_ITE v10.2.0 */(function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
3
  module.exports = factory();
4
4
  else if(typeof define === 'function' && define.amd)
@@ -11,10 +11,10 @@
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
14
- /***/ 531:
14
+ /***/ 48:
15
15
  /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
16
16
 
17
- /* provided dependency */ var jQuery = __webpack_require__(439);
17
+ /* provided dependency */ var jQuery = __webpack_require__(812);
18
18
  /**
19
19
  * @preserve jquery.fullscreen 1.1.5
20
20
  * https://github.com/code-lts/jquery-fullscreen-plugin
@@ -210,7 +210,7 @@ installFullScreenHandlers();
210
210
 
211
211
  /***/ }),
212
212
 
213
- /***/ 583:
213
+ /***/ 354:
214
214
  /***/ ((module, exports, __webpack_require__) => {
215
215
 
216
216
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -224,7 +224,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
224
224
  (function (factory) {
225
225
  if ( true ) {
226
226
  // AMD. Register as an anonymous module.
227
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(439)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
227
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(812)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
228
228
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
229
229
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
230
230
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -435,7 +435,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
435
435
 
436
436
  /***/ }),
437
437
 
438
- /***/ 439:
438
+ /***/ 812:
439
439
  /***/ (function(module, exports) {
440
440
 
441
441
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -11159,7 +11159,7 @@ return jQuery;
11159
11159
 
11160
11160
  /***/ }),
11161
11161
 
11162
- /***/ 12:
11162
+ /***/ 193:
11163
11163
  /***/ ((module) => {
11164
11164
 
11165
11165
  /**
@@ -15938,7 +15938,7 @@ if (true) {
15938
15938
 
15939
15939
  /***/ }),
15940
15940
 
15941
- /***/ 964:
15941
+ /***/ 552:
15942
15942
  /***/ (function(__unused_webpack_module, exports) {
15943
15943
 
15944
15944
 
@@ -19183,7 +19183,7 @@ if (true) {
19183
19183
 
19184
19184
  /***/ }),
19185
19185
 
19186
- /***/ 448:
19186
+ /***/ 807:
19187
19187
  /***/ (function(module, exports) {
19188
19188
 
19189
19189
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -20311,7 +20311,7 @@ Object .defineProperty (Namespace, "add",
20311
20311
  }
20312
20312
  else
20313
20313
  {
20314
- const X3D = window [Symbol .for ("X_ITE.X3D-10.1.0")];
20314
+ const X3D = window [Symbol .for ("X_ITE.X3D-10.2.0")];
20315
20315
 
20316
20316
  if (X3D)
20317
20317
  X3D [name] = module;
@@ -20654,23 +20654,6 @@ const Algorithm =
20654
20654
  {
20655
20655
  return lhs > rhs ? 1 : lhs < rhs ? -1 : 0;
20656
20656
  },
20657
- // lexicographicallyCompare (lhs, rhs)
20658
- // {
20659
- // const
20660
- // length1 = lhs .length,
20661
- // length2 = rhs .length;
20662
-
20663
- // for (let i = 0; i < length1 && i < length2; ++ i)
20664
- // {
20665
- // if (lhs [i] < rhs [i])
20666
- // return -1;
20667
-
20668
- // if (rhs [i] < lhs [i])
20669
- // return 1;
20670
- // }
20671
-
20672
- // return Algorithm .cmp (length1, length2);
20673
- // },
20674
20657
  less (lhs, rhs)
20675
20658
  {
20676
20659
  return lhs < rhs;
@@ -34297,7 +34280,7 @@ const X3DBaseNode_default_ = X3DBaseNode;
34297
34280
  x_ite_Namespace .add ("X3DBaseNode", "x_ite/Base/X3DBaseNode", X3DBaseNode_default_);
34298
34281
  /* harmony default export */ const Base_X3DBaseNode = (X3DBaseNode_default_);
34299
34282
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Legacy.js
34300
- /* provided dependency */ var $ = __webpack_require__(439);
34283
+ /* provided dependency */ var $ = __webpack_require__(812);
34301
34284
  /*******************************************************************************
34302
34285
  *
34303
34286
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34434,7 +34417,7 @@ x_ite_Namespace .add ("Legacy", "x_ite/Browser/Legacy", Legacy_default_);
34434
34417
  *
34435
34418
  ******************************************************************************/
34436
34419
 
34437
- const BROWSER_VERSION_default_ = "10.1.0";
34420
+ const BROWSER_VERSION_default_ = "10.2.0";
34438
34421
  ;
34439
34422
 
34440
34423
  x_ite_Namespace .add ("BROWSER_VERSION", "x_ite/BROWSER_VERSION", BROWSER_VERSION_default_);
@@ -37620,7 +37603,7 @@ const X3DBindableNode_default_ = X3DBindableNode;
37620
37603
  x_ite_Namespace .add ("X3DBindableNode", "x_ite/Components/Core/X3DBindableNode", X3DBindableNode_default_);
37621
37604
  /* harmony default export */ const Core_X3DBindableNode = (X3DBindableNode_default_);
37622
37605
  ;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle3.js
37623
- /* provided dependency */ var libtess = __webpack_require__(12);
37606
+ /* provided dependency */ var libtess = __webpack_require__(193);
37624
37607
  /*******************************************************************************
37625
37608
  *
37626
37609
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40190,7 +40173,7 @@ const X3DProtoDeclaration_default_ = X3DProtoDeclaration;
40190
40173
  x_ite_Namespace .add ("X3DProtoDeclaration", "x_ite/Prototype/X3DProtoDeclaration", X3DProtoDeclaration_default_);
40191
40174
  /* harmony default export */ const Prototype_X3DProtoDeclaration = (X3DProtoDeclaration_default_);
40192
40175
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/X3DParser.js
40193
- /* provided dependency */ var X3DParser_$ = __webpack_require__(439);
40176
+ /* provided dependency */ var X3DParser_$ = __webpack_require__(812);
40194
40177
  /*******************************************************************************
40195
40178
  *
40196
40179
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40448,7 +40431,7 @@ const Expressions_default_ = Expressions;
40448
40431
  x_ite_Namespace .add ("Expressions", "x_ite/Parser/Expressions", Expressions_default_);
40449
40432
  /* harmony default export */ const Parser_Expressions = (Expressions_default_);
40450
40433
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/VRMLParser.js
40451
- /* provided dependency */ var VRMLParser_$ = __webpack_require__(439);
40434
+ /* provided dependency */ var VRMLParser_$ = __webpack_require__(812);
40452
40435
  /*******************************************************************************
40453
40436
  *
40454
40437
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43148,7 +43131,7 @@ const VRMLParser_default_ = VRMLParser;
43148
43131
  x_ite_Namespace .add ("VRMLParser", "x_ite/Parser/VRMLParser", VRMLParser_default_);
43149
43132
  /* harmony default export */ const Parser_VRMLParser = (VRMLParser_default_);
43150
43133
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/XMLParser.js
43151
- /* provided dependency */ var XMLParser_$ = __webpack_require__(439);
43134
+ /* provided dependency */ var XMLParser_$ = __webpack_require__(812);
43152
43135
  /*******************************************************************************
43153
43136
  *
43154
43137
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45324,7 +45307,7 @@ const URLs_default_ = URLs;
45324
45307
  x_ite_Namespace .add ("URLs", "x_ite/Browser/Networking/URLs", URLs_default_);
45325
45308
  /* harmony default export */ const Networking_URLs = (URLs_default_);
45326
45309
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLTF2Parser.js
45327
- /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(439);
45310
+ /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(812);
45328
45311
  /*******************************************************************************
45329
45312
  *
45330
45313
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45385,9 +45368,8 @@ x_ite_Namespace .add ("URLs", "x_ite/Browser/Networking/URLs", URLs_default_);
45385
45368
 
45386
45369
 
45387
45370
 
45388
-
45389
45371
  // https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html
45390
- // https://github.com/KhronosGroup/glTF-Sample-Models
45372
+ // https://github.com/KhronosGroup/glTF-Sample-Assets
45391
45373
 
45392
45374
  const SAMPLES_PER_SECOND = 30; // in 1/s
45393
45375
 
@@ -45407,7 +45389,6 @@ function GLTF2Parser (scene)
45407
45389
  this .extensions = new Set ();
45408
45390
  this .envLights = [ ];
45409
45391
  this .lights = [ ];
45410
- this .usedLights = 0;
45411
45392
  this .materialVariants = [ ];
45412
45393
  this .materialVariantNodes = [ ];
45413
45394
  this .buffers = [ ];
@@ -45418,11 +45399,9 @@ function GLTF2Parser (scene)
45418
45399
  this .textureTransformNodes = [ ];
45419
45400
  this .meshes = [ ];
45420
45401
  this .cameras = [ ];
45421
- this .viewpointNodes = [ ];
45422
45402
  this .nodes = [ ];
45423
45403
  this .skins = [ ];
45424
45404
  this .joints = new Set ();
45425
- this .animations = 0;
45426
45405
  }
45427
45406
 
45428
45407
  Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser .prototype),
@@ -45543,7 +45522,12 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45543
45522
 
45544
45523
  this .viewpointsCenterOfRotation (this .getScene ());
45545
45524
  this .optimizeSceneGraph (this .getScene () .getRootNodes ());
45546
- this .viewpointsGroup ();
45525
+
45526
+ this .exportGroup ("Viewpoints", this .cameras);
45527
+ this .exportGroup ("EnvironmentLights", this .envLights);
45528
+ this .exportGroup ("Lights", this .lights);
45529
+ this .exportGroup ("Animations", glTF .animations);
45530
+
45547
45531
  this .materialVariantsSwitch ();
45548
45532
 
45549
45533
  return this .getScene ();
@@ -45622,6 +45606,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45622
45606
  case "KHR_materials_pbrSpecularGlossiness":
45623
45607
  case "KHR_materials_anisotropy":
45624
45608
  case "KHR_materials_clearcoat":
45609
+ case "KHR_materials_diffuse_transmission":
45625
45610
  case "KHR_materials_dispersion":
45626
45611
  case "KHR_materials_emissive_strength":
45627
45612
  case "KHR_materials_ior":
@@ -45700,7 +45685,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45700
45685
  const
45701
45686
  scene = this .getScene (),
45702
45687
  lightNode = scene .createNode ("EnvironmentLight", false),
45703
- name = `EnvironmentLight${id}`,
45688
+ name = `EnvironmentLight${id + 1}`,
45704
45689
  quaternion = new Numbers_Quaternion ();
45705
45690
 
45706
45691
  scene .addNamedNode (scene .getUniqueName (name), lightNode);
@@ -45790,7 +45775,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45790
45775
 
45791
45776
  const
45792
45777
  scene = this .getScene (),
45793
- name = this .sanitizeName (light .name) || `Light${id}`;
45778
+ name = this .sanitizeName (light .name) || `Light${id + 1}`;
45794
45779
 
45795
45780
  const color = new Numbers_Color3 (1, 1, 1);
45796
45781
 
@@ -45964,66 +45949,13 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45964
45949
  length = Math .min (stride * count, (bufferView .byteLength - byteOffset) / TypedArray .BYTES_PER_ELEMENT),
45965
45950
  array = new TypedArray (bufferView .buffer, byteOffset, length);
45966
45951
 
45967
- if (stride === components)
45968
- {
45969
- const value = this .sparseObject (accessor .sparse, array, components);
45952
+ let value;
45970
45953
 
45971
- Object .defineProperty (accessor, "array", { value: value });
45954
+ value = this .denseArray (TypedArray, components, count, stride, array);
45955
+ value = this .sparseObject (accessor, components, value);
45956
+ value = this .normalizedArray (accessor, value);
45972
45957
 
45973
- return value;
45974
- }
45975
- else
45976
- {
45977
- const
45978
- length = count * components,
45979
- dense = new TypedArray (length);
45980
-
45981
- for (let i = 0, j = 0; i < length; j += stride)
45982
- {
45983
- for (let c = 0; c < components; ++ c, ++ i)
45984
- dense [i] = array [j + c];
45985
- }
45986
-
45987
- const value = this .sparseObject (accessor .sparse, dense, components);
45988
-
45989
- Object .defineProperty (accessor, "array", { value: value });
45990
-
45991
- return value;
45992
- }
45993
- },
45994
- configurable: true,
45995
- });
45996
-
45997
- Object .defineProperty (accessor, "normalizedArray",
45998
- {
45999
- get: () =>
46000
- {
46001
- switch (accessor .componentType)
46002
- {
46003
- case 5120: // Int8Array
46004
- var value = Float32Array .from (accessor .array, v => Math .max (v / 127, -1));
46005
- break;
46006
- case 5121: // Uint8Array
46007
- var value = Float32Array .from (accessor .array, v => v / 255);
46008
- break;
46009
- case 5122: // Int16Array
46010
- var value = Float32Array .from (accessor .array, v => Math .max (v / 32767, -1));
46011
- break;
46012
- case 5123: // Uint16Array
46013
- var value = Float32Array .from (accessor .array, v => v / 65535);
46014
- break;
46015
- case 5124: // Int32Array
46016
- var value = Float32Array .from (accessor .array, v => Math .max (v / 2147483647, -1));
46017
- break;
46018
- case 5125: // Uint32Array
46019
- var value = Float32Array .from (accessor .array, v => v / 4294967295);
46020
- break;
46021
- case 5126: // Float32Array
46022
- var value = accessor .array;
46023
- break;
46024
- }
46025
-
46026
- Object .defineProperty (accessor, "normalizedArray", { value: value });
45958
+ Object .defineProperty (accessor, "array", { value });
46027
45959
 
46028
45960
  return value;
46029
45961
  },
@@ -46031,6 +45963,23 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46031
45963
  });
46032
45964
  };
46033
45965
  })(),
45966
+ denseArray (TypedArray, components, count, stride, array)
45967
+ {
45968
+ if (stride === components)
45969
+ return array;
45970
+
45971
+ const
45972
+ length = count * components,
45973
+ dense = new TypedArray (length);
45974
+
45975
+ for (let i = 0, j = 0; i < length; j += stride)
45976
+ {
45977
+ for (let c = 0; c < components; ++ c, ++ i)
45978
+ dense [i] = array [j + c];
45979
+ }
45980
+
45981
+ return dense;
45982
+ },
46034
45983
  sparseObject: (() =>
46035
45984
  {
46036
45985
  const TypedArrays = new Map ([
@@ -46039,7 +45988,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46039
45988
  [5125, Uint32Array],
46040
45989
  ]);
46041
45990
 
46042
- return function (sparse, array, components)
45991
+ return function ({ sparse }, components, array)
46043
45992
  {
46044
45993
  if (!(sparse instanceof Object))
46045
45994
  return array;
@@ -46075,6 +46024,29 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46075
46024
  return array;
46076
46025
  };
46077
46026
  })(),
46027
+ normalizedArray ({ normalized, componentType }, array)
46028
+ {
46029
+ if (!normalized)
46030
+ return array;
46031
+
46032
+ switch (componentType)
46033
+ {
46034
+ case 5120: // Int8Array
46035
+ return Float32Array .from (array, v => Math .max (v / 127, -1));
46036
+ case 5121: // Uint8Array
46037
+ return Float32Array .from (array, v => v / 255);
46038
+ case 5122: // Int16Array
46039
+ return Float32Array .from (array, v => Math .max (v / 32767, -1));
46040
+ case 5123: // Uint16Array
46041
+ return Float32Array .from (array, v => v / 65535);
46042
+ case 5124: // Int32Array
46043
+ return Float32Array .from (array, v => Math .max (v / 2147483647, -1));
46044
+ case 5125: // Uint32Array
46045
+ return Float32Array .from (array, v => v / 4294967295);
46046
+ case 5126: // Float32Array
46047
+ return array;
46048
+ }
46049
+ },
46078
46050
  samplersArray (samplers)
46079
46051
  {
46080
46052
  if (!(samplers instanceof Array))
@@ -46265,9 +46237,9 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46265
46237
  if (material .appearanceNode)
46266
46238
  return material .appearanceNode;
46267
46239
 
46268
- const texCoordIndices = this .texCoordIndices ("", material);
46240
+ const texCoordIndices = this .getTexCoordIndices ("", material);
46269
46241
 
46270
- this .texCoordIndex = Array .from (texCoordIndices) .reduce (Math .max, -1);
46242
+ this .texCoordIndex = Array .from (texCoordIndices) .reduce ((p, c) => Math .max (p, c), -1);
46271
46243
  this .textureTransformNodes = [ ];
46272
46244
  this .texCoordMappings = new Map ();
46273
46245
  this .texCoordOfNode = new Map ();
@@ -46324,13 +46296,13 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46324
46296
  appearanceNode ._alphaMode = this .stringValue (material .alphaMode, "OPAQUE");
46325
46297
  appearanceNode ._alphaCutoff = this .numberValue (material .alphaCutoff, 0.5);
46326
46298
  appearanceNode ._material = this .khrMaterialsUnlitObject (material .extensions ?.KHR_materials_unlit, materialNode);
46327
- appearanceNode ._textureTransform = this .createMultiTextureTransform (materialNode);
46299
+ appearanceNode ._textureTransform = this .createMultiTextureTransform (appearanceNode ._material .getValue ());
46328
46300
 
46329
46301
  appearanceNode .setup ();
46330
46302
 
46331
46303
  return material .appearanceNode = appearanceNode;
46332
46304
  },
46333
- texCoordIndices (key, object, indices = new Set ())
46305
+ getTexCoordIndices (key, object, indices = new Set ())
46334
46306
  {
46335
46307
  if (!(object instanceof Object))
46336
46308
  return indices;
@@ -46339,7 +46311,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46339
46311
  indices .add (object .texCoord || 0);
46340
46312
 
46341
46313
  for (const [key, value] of Object .entries (object))
46342
- this .texCoordIndices (key, value, indices);
46314
+ this .getTexCoordIndices (key, value, indices);
46343
46315
 
46344
46316
  return indices;
46345
46317
  },
@@ -46475,6 +46447,9 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46475
46447
  case "KHR_materials_clearcoat":
46476
46448
  this .khrMaterialsClearcoatObject (value, materialNode);
46477
46449
  break;
46450
+ case "KHR_materials_diffuse_transmission":
46451
+ this .khrMaterialsDiffuseTransmissionObject (value, materialNode);
46452
+ break;
46478
46453
  case "KHR_materials_dispersion":
46479
46454
  this .khrMaterialsDispersionObject (value, materialNode);
46480
46455
  break;
@@ -46540,6 +46515,29 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46540
46515
 
46541
46516
  materialNode ._extensions .push (extension);
46542
46517
  },
46518
+ khrMaterialsDiffuseTransmissionObject (KHR_materials_diffuse_transmission, materialNode)
46519
+ {
46520
+ if (!(KHR_materials_diffuse_transmission instanceof Object))
46521
+ return;
46522
+
46523
+ const extension = this .getScene () .createNode ("DiffuseTransmissionMaterialExtension", false);
46524
+
46525
+ extension ._diffuseTransmission = this .numberValue (KHR_materials_diffuse_transmission .diffuseTransmissionFactor, 0);
46526
+ extension ._diffuseTransmissionTexture = this .textureInfo (KHR_materials_diffuse_transmission .diffuseTransmissionTexture);
46527
+ extension ._diffuseTransmissionTextureMapping = this .textureMapping (KHR_materials_diffuse_transmission .diffuseTransmissionTexture);
46528
+
46529
+ const diffuseTransmissionColorFactor = new Numbers_Color3 ();
46530
+
46531
+ if (this .vectorValue (KHR_materials_diffuse_transmission .diffuseTransmissionColorFactor, diffuseTransmissionColorFactor))
46532
+ extension ._diffuseTransmissionColor = diffuseTransmissionColorFactor;
46533
+
46534
+ extension ._diffuseTransmissionColorTexture = this .textureInfo (KHR_materials_diffuse_transmission .diffuseTransmissionColorTexture);
46535
+ extension ._diffuseTransmissionColorTextureMapping = this .textureMapping (KHR_materials_diffuse_transmission .diffuseTransmissionColorTexture);
46536
+
46537
+ extension .setup ();
46538
+
46539
+ materialNode ._extensions .push (extension);
46540
+ },
46543
46541
  khrMaterialsDispersionObject (KHR_materials_dispersion, materialNode)
46544
46542
  {
46545
46543
  if (!(KHR_materials_dispersion instanceof Object))
@@ -46735,8 +46733,8 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46735
46733
  textureTransformNode = scene .createNode ("TextureTransformMatrix3D", false),
46736
46734
  mapping = `TEXCOORD_${this .texCoordIndex + this .textureTransformNodes .length + 1}`;
46737
46735
 
46738
- textureTransformNode ._mapping = mapping;
46739
- textureTransformNode ._matrix = matrix;
46736
+ textureTransformNode ._mapping = mapping;
46737
+ textureTransformNode ._matrix = matrix;
46740
46738
 
46741
46739
  textureTransformNode .setup ();
46742
46740
 
@@ -46816,9 +46814,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46816
46814
  shapeNode = this .createShape (primitive, weights, skin, EXT_mesh_gpu_instancing),
46817
46815
  variantsNode = this .khrMaterialsVariantsExtension (primitive .extensions, shapeNode);
46818
46816
 
46819
- if (variantsNode)
46820
- variantsNode ._children [this .materialVariants .length] = shapeNode;
46821
-
46822
46817
  shapeNodes .push (primitive .shapeNode = variantsNode ?? shapeNode);
46823
46818
  },
46824
46819
  attributesObject (attributes)
@@ -46874,15 +46869,15 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46874
46869
  if (!this .draco)
46875
46870
  return;
46876
46871
 
46877
- function indicesCallback (array)
46872
+ function indicesCallback (value)
46878
46873
  {
46879
- Object .defineProperty (primitive .indices, "array", { value: array });
46874
+ Object .defineProperty (primitive .indices, "array", { value });
46880
46875
  }
46881
46876
 
46882
- function attributeCallback (key, array)
46877
+ function attributeCallback (key, value)
46883
46878
  {
46884
46879
  if (attributes [key])
46885
- Object .defineProperty (attributes [key], "array", { value: array });
46880
+ Object .defineProperty (attributes [key], "array", { value });
46886
46881
  }
46887
46882
 
46888
46883
  const
@@ -47021,16 +47016,26 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47021
47016
  scene = this .getScene (),
47022
47017
  variantsNode = scene .createNode ("Switch", false);
47023
47018
 
47024
- variantsNode ._whichChoice = 0;
47025
-
47026
47019
  for (const mapping of mappings)
47027
47020
  this .khrMaterialsVariantsObjectMapping (mapping, shapeNode, variantsNode);
47028
47021
 
47029
- variantsNode .setup ();
47022
+ variantsNode ._whichChoice = this .materialVariants .length;
47030
47023
 
47031
47024
  if (!variantsNode ._children .length)
47032
47025
  return;
47033
47026
 
47027
+ // Last child ist default material.
47028
+ variantsNode ._children [this .materialVariants .length] = shapeNode;
47029
+
47030
+ // Fall back to default material if no active variant.
47031
+ for (const i of variantsNode ._children .keys ())
47032
+ {
47033
+ if (!variantsNode ._children [i])
47034
+ variantsNode ._children [i] = shapeNode;
47035
+ }
47036
+
47037
+ variantsNode .setup ();
47038
+
47034
47039
  this .materialVariantNodes .push (variantsNode);
47035
47040
 
47036
47041
  return variantsNode;
@@ -47069,18 +47074,18 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47069
47074
 
47070
47075
  this .cameras = cameras;
47071
47076
  },
47072
- cameraObject (camera)
47077
+ cameraObject (id, camera)
47073
47078
  {
47074
47079
  if (!(camera instanceof Object))
47075
47080
  return null;
47076
47081
 
47077
- if (camera .viewpointNode !== undefined)
47078
- return camera .viewpointNode;
47082
+ if (camera .node !== undefined)
47083
+ return camera .node;
47079
47084
 
47080
47085
  const viewpointNode = this .cameraType (camera);
47081
47086
 
47082
47087
  if (!viewpointNode)
47083
- return camera .viewpointNode = null;
47088
+ return camera .node = null;
47084
47089
 
47085
47090
  const
47086
47091
  scene = this .getScene (),
@@ -47094,12 +47099,10 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47094
47099
  scene .addExportedNode (scene .getUniqueExportName (name), viewpointNode);
47095
47100
  }
47096
47101
 
47097
- this .viewpointNodes .push (viewpointNode);
47098
-
47099
- viewpointNode ._description = this .description (camera .name || `Viewpoint ${this .viewpointNodes .length}`);
47102
+ viewpointNode ._description = this .description (camera .name || `Viewpoint ${id + 1}`);
47100
47103
  viewpointNode ._position = Numbers_Vector3 .Zero;
47101
47104
 
47102
- return camera .viewpointNode = viewpointNode;
47105
+ return camera .node = viewpointNode;
47103
47106
  },
47104
47107
  cameraType (camera)
47105
47108
  {
@@ -47288,7 +47291,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47288
47291
 
47289
47292
  // Add camera.
47290
47293
 
47291
- const viewpointNode = this .cameraObject (this .cameras [node .camera]);
47294
+ const viewpointNode = this .cameraObject (node .camera, this .cameras [node .camera]);
47292
47295
 
47293
47296
  if (viewpointNode)
47294
47297
  transformNode ._children .push (viewpointNode);
@@ -47369,8 +47372,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47369
47372
  if (!lightNode)
47370
47373
  return;
47371
47374
 
47372
- ++ this .usedLights;
47373
-
47374
47375
  transformNode ._children .push (lightNode);
47375
47376
  },
47376
47377
  nodeChildrenArray (children)
@@ -47472,9 +47473,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47472
47473
  {
47473
47474
  if (sceneNumber === 0)
47474
47475
  {
47475
- if (this .usedLights)
47476
- scene .getRootNodes () .push (this .createNavigationInfo ());
47477
-
47478
47476
  scene .getRootNodes () .push (children [0]);
47479
47477
  return;
47480
47478
  }
@@ -47485,9 +47483,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47485
47483
  {
47486
47484
  // Root
47487
47485
 
47488
- if (this .usedLights)
47489
- scene .getRootNodes () .push (this .createNavigationInfo ());
47490
-
47491
47486
  const switchNode = scene .createNode ("Switch", false);
47492
47487
 
47493
47488
  scene .addNamedNode (scene .getUniqueName ("Scenes"), switchNode);
@@ -47549,20 +47544,25 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47549
47544
  {
47550
47545
  return this .nodeChildrenArray (nodes);
47551
47546
  },
47552
- viewpointsGroup ()
47547
+ exportGroup (name, array)
47553
47548
  {
47554
- if (!this .viewpointNodes .length)
47549
+ if (!(array instanceof Array))
47550
+ return;
47551
+
47552
+ const nodes = array .map (object => object .node) .filter (node => node);
47553
+
47554
+ if (!nodes .length)
47555
47555
  return;
47556
47556
 
47557
47557
  const
47558
47558
  scene = this .getScene (),
47559
47559
  groupNode = scene .createNode ("Group", false);
47560
47560
 
47561
- scene .addNamedNode (scene .getUniqueName ("Viewpoints"), groupNode);
47562
- scene .addExportedNode (scene .getUniqueExportName ("Viewpoints"), groupNode);
47561
+ scene .addNamedNode (scene .getUniqueName (name), groupNode);
47562
+ scene .addExportedNode (scene .getUniqueExportName (name), groupNode);
47563
47563
 
47564
47564
  groupNode ._visible = false;
47565
- groupNode ._children = this .viewpointNodes;
47565
+ groupNode ._children = nodes;
47566
47566
 
47567
47567
  groupNode .setup ();
47568
47568
 
@@ -47598,28 +47598,10 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47598
47598
  if (!(animations instanceof Array))
47599
47599
  return;
47600
47600
 
47601
- const animationNodes = animations
47602
- .map (animation => this .animationObject (animation))
47603
- .filter (node => node);
47604
-
47605
- if (!animationNodes .length)
47606
- return;
47607
-
47608
- const
47609
- scene = this .getScene (),
47610
- groupNode = scene .createNode ("Group", false);
47611
-
47612
- scene .addNamedNode (scene .getUniqueName ("Animations"), groupNode);
47613
- scene .addExportedNode (scene .getUniqueExportName ("Animations"), groupNode);
47614
-
47615
- groupNode ._visible = false;
47616
- groupNode ._children = animationNodes;
47617
-
47618
- groupNode .setup ();
47619
-
47620
- scene .getRootNodes () .push (groupNode);
47601
+ for (const [i, animation] of animations .entries ())
47602
+ this .animationObject (i, animation);
47621
47603
  },
47622
- animationObject (animation)
47604
+ animationObject (id, animation)
47623
47605
  {
47624
47606
  if (!(animation instanceof Object))
47625
47607
  return null;
@@ -47630,27 +47612,25 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47630
47612
  channelNodes = this .animationChannelsArray (animation .channels, animation .samplers, timeSensorNode);
47631
47613
 
47632
47614
  if (!channelNodes .length)
47633
- return null;
47615
+ return;
47634
47616
 
47635
47617
  const
47636
47618
  groupNode = scene .createNode ("Group", false),
47637
47619
  name = this .sanitizeName (animation .name);
47638
47620
 
47639
- ++ this .animations;
47621
+ scene .addNamedNode (scene .getUniqueName (name || `Animation${id + 1}`), groupNode);
47622
+ scene .addNamedNode (scene .getUniqueName (`Timer${id + 1}`), timeSensorNode);
47623
+ scene .addExportedNode (scene .getUniqueExportName (name || `Animation${id + 1}`), groupNode);
47624
+ scene .addExportedNode (scene .getUniqueExportName (`Timer${id + 1}`), timeSensorNode);
47640
47625
 
47641
- scene .addNamedNode (scene .getUniqueName (name || `Animation${this .animations}`), groupNode);
47642
- scene .addNamedNode (scene .getUniqueName (`Timer${this .animations}`), timeSensorNode);
47643
- scene .addExportedNode (scene .getUniqueExportName (name || `Animation${this .animations}`), groupNode);
47644
- scene .addExportedNode (scene .getUniqueExportName (`Timer${this .animations}`), timeSensorNode);
47645
-
47646
- timeSensorNode ._description = this .description (animation .name) || `Animation ${this .animations}`;
47626
+ timeSensorNode ._description = this .description (animation .name) || `Animation ${id + 1}`;
47647
47627
  groupNode ._visible = false;
47648
47628
  groupNode ._children .push (timeSensorNode, ... channelNodes);
47649
47629
 
47650
47630
  timeSensorNode .setup ();
47651
47631
  groupNode .setup ();
47652
47632
 
47653
- return groupNode;
47633
+ animation .node = groupNode;
47654
47634
  },
47655
47635
  animationChannelsArray (channels, samplers, timeSensorNode)
47656
47636
  {
@@ -47708,18 +47688,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47708
47688
 
47709
47689
  return this .createInterpolator (timeSensorNode, node, target, sampler .interpolation, input .array, output, timeSensorNode ._cycleInterval .getValue ());
47710
47690
  },
47711
- createNavigationInfo ()
47712
- {
47713
- const
47714
- scene = this .getScene (),
47715
- navigationInfoNode = scene .createNode ("NavigationInfo", false);
47716
-
47717
- navigationInfoNode ._headlight = false;
47718
-
47719
- navigationInfoNode .setup ();
47720
-
47721
- return navigationInfoNode;
47722
- },
47723
47691
  createShape (primitive, weights, skin, EXT_mesh_gpu_instancing)
47724
47692
  {
47725
47693
  const
@@ -47763,7 +47731,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47763
47731
  scene = this .getScene (),
47764
47732
  instancedShapeNode = scene .createNode ("InstancedShape", false),
47765
47733
  translationArray = translation ?.array,
47766
- rotationArray = rotation ?.normalizedArray,
47734
+ rotationArray = rotation ?.array,
47767
47735
  scaleArray = scale ?.array;
47768
47736
 
47769
47737
  if (translationArray)
@@ -48207,8 +48175,8 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48207
48175
  colorNode = scene .createNode (opaque ? "Color" : typeName, false);
48208
48176
 
48209
48177
  colorNode ._color = opaque && typeName !== "Color"
48210
- ? color .normalizedArray .filter ((_, i) => (i + 1) % 4)
48211
- : color .normalizedArray;
48178
+ ? color .array .filter ((_, i) => (i + 1) % 4)
48179
+ : color .array;
48212
48180
 
48213
48181
  colorNode .setup ();
48214
48182
 
@@ -48239,9 +48207,10 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48239
48207
  }
48240
48208
  default:
48241
48209
  {
48242
- const textureCoordinateNodes = Array .from (material .texCoordMappings .entries (), ([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping))
48243
- .filter (node => node)
48244
- .sort ((a, b) => Math_Algorithm .cmp (a ._mapping .getValue (), b ._mapping .getValue ()));
48210
+ const textureCoordinateNodes = Array .from (material .texCoordMappings .entries ())
48211
+ .sort ((a, b) => Math_Algorithm .cmp (a [0], b [0]))
48212
+ .sort ((a, b) => a [1] - b [1])
48213
+ .map (([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping));
48245
48214
 
48246
48215
  if (!textureCoordinateNodes .length)
48247
48216
  return null;
@@ -48271,7 +48240,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48271
48240
  textureCoordinateNode = scene .createNode ("TextureCoordinate", false);
48272
48241
 
48273
48242
  textureCoordinateNode ._mapping = mapping;
48274
- textureCoordinateNode ._point = texCoord .normalizedArray;
48243
+ textureCoordinateNode ._point = texCoord .array;
48275
48244
 
48276
48245
  textureCoordinateNode .setup ();
48277
48246
 
@@ -48289,7 +48258,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48289
48258
  scene = this .getScene (),
48290
48259
  normalNode = scene .createNode ("Normal", false);
48291
48260
 
48292
- normalNode ._vector = normal .normalizedArray;
48261
+ normalNode ._vector = normal .array;
48293
48262
 
48294
48263
  if ((targets instanceof Array) && (weights instanceof Array))
48295
48264
  {
@@ -48388,7 +48357,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48388
48357
  const
48389
48358
  start = skin .coordinateNode ._point .length,
48390
48359
  jointsArray = joints .array,
48391
- weightsArray = weights .normalizedArray,
48360
+ weightsArray = weights .array,
48392
48361
  numVertices = jointsArray .length / 4;
48393
48362
 
48394
48363
  for (let v = 0; v < numVertices; ++ v)
@@ -48517,7 +48486,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48517
48486
  }
48518
48487
  case "rotation":
48519
48488
  {
48520
- const interpolatorNode = this .createOrientationInterpolator (interpolation, times, keyValues .normalizedArray, cycleInterval);
48489
+ const interpolatorNode = this .createOrientationInterpolator (interpolation, times, keyValues .array, cycleInterval);
48521
48490
 
48522
48491
  scene .addNamedNode (scene .getUniqueName ("RotationInterpolator"), interpolatorNode);
48523
48492
 
@@ -48555,7 +48524,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48555
48524
  if (!geometryNode)
48556
48525
  continue;
48557
48526
 
48558
- const coordinateInterpolatorNode = this .createArrayInterpolator ("CoordinateInterpolator", interpolation, times, keyValues .normalizedArray, cycleInterval, targets, attributes, "POSITION", false);
48527
+ const coordinateInterpolatorNode = this .createArrayInterpolator ("CoordinateInterpolator", interpolation, times, keyValues .array, cycleInterval, targets, attributes, "POSITION");
48559
48528
 
48560
48529
  if (coordinateInterpolatorNode)
48561
48530
  {
@@ -48565,7 +48534,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48565
48534
  scene .addRoute (coordinateInterpolatorNode, "value_changed", geometryNode ._coord, "set_point");
48566
48535
  }
48567
48536
 
48568
- const normalInterpolatorNode = this .createArrayInterpolator ("NormalInterpolator", interpolation, times, keyValues .normalizedArray, cycleInterval, targets, attributes, "NORMAL", true);
48537
+ const normalInterpolatorNode = this .createArrayInterpolator ("NormalInterpolator", interpolation, times, keyValues .array, cycleInterval, targets, attributes, "NORMAL");
48569
48538
 
48570
48539
  if (normalInterpolatorNode)
48571
48540
  {
@@ -48767,7 +48736,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48767
48736
  }
48768
48737
  }
48769
48738
  },
48770
- createArrayInterpolator (typeName, interpolation, times, weights, cycleInterval, targets, accessors, key, normalized)
48739
+ createArrayInterpolator (typeName, interpolation, times, weights, cycleInterval, targets, accessors, key)
48771
48740
  {
48772
48741
  const
48773
48742
  scene = this .getScene (),
@@ -48793,14 +48762,14 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48793
48762
 
48794
48763
  const w = Array .from (targets .keys (), i => weights [i]);
48795
48764
 
48796
- for (const value of this .applyMorphTargets (accessor .field, targets, key, w, normalized))
48765
+ for (const value of this .applyMorphTargets (accessor .field, targets, key, w))
48797
48766
  interpolatorNode ._keyValue .push (value);
48798
48767
 
48799
48768
  for (let t = 1, length = times .length; t < length; ++ t)
48800
48769
  {
48801
48770
  const
48802
48771
  w = Array .from (targets .keys (), i => weights [t * targets .length + i]),
48803
- values = this .applyMorphTargets (accessor .field, targets, key, w, normalized);
48772
+ values = this .applyMorphTargets (accessor .field, targets, key, w);
48804
48773
 
48805
48774
  for (const value of values)
48806
48775
  interpolatorNode ._keyValue .push (value);
@@ -48830,7 +48799,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48830
48799
  {
48831
48800
  const w = Array .from (targets .keys (), i => weights [t * targets .length + i]);
48832
48801
 
48833
- for (const value of this .applyMorphTargets (accessor .field, targets, key, w, normalized))
48802
+ for (const value of this .applyMorphTargets (accessor .field, targets, key, w))
48834
48803
  interpolatorNode ._keyValue .push (value);
48835
48804
  }
48836
48805
 
@@ -48858,7 +48827,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48858
48827
 
48859
48828
  const w = Array .from (targets .keys (), i => this .cubicSplineScalarArray (t, times, weights, targets .length, i));
48860
48829
 
48861
- for (const value of this .applyMorphTargets (accessor .field, targets, key, w, normalized))
48830
+ for (const value of this .applyMorphTargets (accessor .field, targets, key, w))
48862
48831
  interpolatorNode ._keyValue .push (value);
48863
48832
  }
48864
48833
 
@@ -48874,7 +48843,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48874
48843
  {
48875
48844
  const value = new Numbers_Vector3 ();
48876
48845
 
48877
- return function (array, targets, key, weights, normalized)
48846
+ return function (array, targets, key, weights)
48878
48847
  {
48879
48848
  const vectors = Array .from (array, v => v .getValue () .copy ());
48880
48849
 
@@ -48891,7 +48860,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
48891
48860
  continue;
48892
48861
 
48893
48862
  const
48894
- array = accessor [normalized ? "normalizedArray" : "array"],
48863
+ array = accessor .array,
48895
48864
  length = array .length;
48896
48865
 
48897
48866
  for (let a = 0, p = 0; a < length; a += 3, ++ p)
@@ -48983,7 +48952,7 @@ const GLTF2Parser_default_ = GLTF2Parser;
48983
48952
  x_ite_Namespace .add ("GLTF2Parser", "x_ite/Parser/GLTF2Parser", GLTF2Parser_default_);
48984
48953
  /* harmony default export */ const Parser_GLTF2Parser = (GLTF2Parser_default_);
48985
48954
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLB2Parser.js
48986
- /* provided dependency */ var GLB2Parser_$ = __webpack_require__(439);
48955
+ /* provided dependency */ var GLB2Parser_$ = __webpack_require__(812);
48987
48956
  /*******************************************************************************
48988
48957
  *
48989
48958
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49135,7 +49104,7 @@ const GLB2Parser_default_ = GLB2Parser;
49135
49104
  x_ite_Namespace .add ("GLB2Parser", "x_ite/Parser/GLB2Parser", GLB2Parser_default_);
49136
49105
  /* harmony default export */ const Parser_GLB2Parser = (GLB2Parser_default_);
49137
49106
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/OBJParser.js
49138
- /* provided dependency */ var OBJParser_$ = __webpack_require__(439);
49107
+ /* provided dependency */ var OBJParser_$ = __webpack_require__(812);
49139
49108
  /*******************************************************************************
49140
49109
  *
49141
49110
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52480,8 +52449,8 @@ const MatrixStack_default_ = MatrixStack;
52480
52449
  x_ite_Namespace .add ("MatrixStack", "standard/Math/Utility/MatrixStack", MatrixStack_default_);
52481
52450
  /* harmony default export */ const Utility_MatrixStack = (MatrixStack_default_);
52482
52451
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/SVGParser.js
52483
- /* provided dependency */ var SVGParser_$ = __webpack_require__(439);
52484
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(12);
52452
+ /* provided dependency */ var SVGParser_$ = __webpack_require__(812);
52453
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(193);
52485
52454
  /*******************************************************************************
52486
52455
  *
52487
52456
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55252,7 +55221,7 @@ const SVGParser_default_ = SVGParser;
55252
55221
  x_ite_Namespace .add ("SVGParser", "x_ite/Parser/SVGParser", SVGParser_default_);
55253
55222
  /* harmony default export */ const Parser_SVGParser = (SVGParser_default_);
55254
55223
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GoldenGate.js
55255
- /* provided dependency */ var GoldenGate_$ = __webpack_require__(439);
55224
+ /* provided dependency */ var GoldenGate_$ = __webpack_require__(812);
55256
55225
  /*******************************************************************************
55257
55226
  *
55258
55227
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58068,9 +58037,6 @@ Object .assign (X3DRenderObject .prototype,
58068
58037
  for (const light of lights)
58069
58038
  light .setGlobalVariables (this);
58070
58039
 
58071
- for (const light of globalLights)
58072
- globalLightsKeys .push (light .lightNode .getLightKey ());
58073
-
58074
58040
  this .renderAndGlobalLightsKey = `.${this .renderKey}.${globalLightsKeys .sort () .join ("")}.`;
58075
58041
  this .globalShadow = globalShadows .at (-1);
58076
58042
 
@@ -59742,8 +59708,13 @@ Object .assign (Object .setPrototypeOf (NavigationInfo .prototype, Core_X3DBinda
59742
59708
  if (type !== Rendering_TraverseType .DISPLAY)
59743
59709
  return;
59744
59710
 
59745
- if (this ._headlight .getValue ())
59746
- renderObject .getGlobalLights () .push (this .getBrowser () .getHeadlight ());
59711
+ if (!this ._headlight .getValue ())
59712
+ return;
59713
+
59714
+ const headlight = this .getBrowser () .getHeadlight ();
59715
+
59716
+ renderObject .getGlobalLights () .push (headlight);
59717
+ renderObject .getGlobalLightsKeys () .push (headlight .lightNode .getLightKey ());
59747
59718
  },
59748
59719
  traverse (type, renderObject)
59749
59720
  {
@@ -60302,6 +60273,213 @@ const VertexArray_default_ = VertexArray;
60302
60273
 
60303
60274
  x_ite_Namespace .add ("VertexArray", "x_ite/Rendering/VertexArray", VertexArray_default_);
60304
60275
  /* harmony default export */ const Rendering_VertexArray = (VertexArray_default_);
60276
+ ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/MikkTSpace.js
60277
+
60278
+
60279
+ // See: https://github.com/donmccurdy/mikktspace-wasm
60280
+
60281
+ const MikkTSpace_default_ = new class MikkTSpace
60282
+ {
60283
+ #promise;
60284
+
60285
+ async initialize ()
60286
+ {
60287
+ return this .#promise = this .#promise ?? new Promise (async resolve =>
60288
+ {
60289
+ const imports =
60290
+ {
60291
+ wbg:
60292
+ {
60293
+ __wbindgen_string_new: (arg0, arg1) =>
60294
+ {
60295
+ const ret = this .#getStringFromWasm0 (arg0, arg1);
60296
+
60297
+ return this .#addHeapObject (ret);
60298
+ },
60299
+ __wbindgen_rethrow: (arg0) =>
60300
+ {
60301
+ throw this .#takeObject (arg0);
60302
+ },
60303
+ },
60304
+ };
60305
+
60306
+ const input = await fetch (Networking_URLs .getLibraryURL ("mikktspace_bg.wasm"));
60307
+
60308
+ const { instance } = await this .#load (input, imports);
60309
+
60310
+ this .#wasm = instance .exports;
60311
+
60312
+ resolve ();
60313
+ });
60314
+ }
60315
+
60316
+ isInitialized ()
60317
+ {
60318
+ return !! this .#wasm;
60319
+ }
60320
+
60321
+ async #load (response, imports)
60322
+ {
60323
+ if (typeof WebAssembly .instantiateStreaming === "function")
60324
+ {
60325
+ try
60326
+ {
60327
+ return await WebAssembly .instantiateStreaming (response, imports);
60328
+ }
60329
+ catch (error)
60330
+ {
60331
+ if (response .headers .get ("Content-Type") !== "application/wasm")
60332
+ {
60333
+ console .warn ("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", error);
60334
+ }
60335
+ else
60336
+ {
60337
+ throw error;
60338
+ }
60339
+ }
60340
+ }
60341
+
60342
+ const bytes = await response .arrayBuffer ();
60343
+
60344
+ return await WebAssembly .instantiate (bytes, imports);
60345
+ }
60346
+
60347
+ /**
60348
+ * Generates vertex tangents for the given position/normal/texcoord attributes.
60349
+ * @param {Float32Array} position vec3
60350
+ * @param {Float32Array} normal vec3
60351
+ * @param {Float32Array} texcoord vec2
60352
+ * @returns {Float32Array} vec4
60353
+ */
60354
+ generateTangents (position, normal, texcoord)
60355
+ {
60356
+ try
60357
+ {
60358
+ const
60359
+ retptr = this .#wasm .__wbindgen_add_to_stack_pointer (-16),
60360
+ ptr0 = this .#passArrayF32ToWasm0 (position, this .#wasm .__wbindgen_malloc),
60361
+ len0 = this .#WASM_VECTOR_LEN,
60362
+ ptr1 = this .#passArrayF32ToWasm0 (normal, this .#wasm .__wbindgen_malloc),
60363
+ len1 = this .#WASM_VECTOR_LEN,
60364
+ ptr2 = this .#passArrayF32ToWasm0 (texcoord, this .#wasm .__wbindgen_malloc),
60365
+ len2 = this .#WASM_VECTOR_LEN;
60366
+
60367
+ this .#wasm .generateTangents (retptr, ptr0, len0, ptr1, len1, ptr2, len2);
60368
+
60369
+ const
60370
+ r0 = this .#getInt32Memory0 () [retptr / 4 + 0],
60371
+ r1 = this .#getInt32Memory0 () [retptr / 4 + 1],
60372
+ v3 = this .#getArrayF32FromWasm0 (r0, r1) .slice ();
60373
+
60374
+ this .#wasm .__wbindgen_free (r0, r1 * 4);
60375
+
60376
+ return v3;
60377
+ }
60378
+ finally
60379
+ {
60380
+ this .#wasm .__wbindgen_add_to_stack_pointer (16);
60381
+ }
60382
+ }
60383
+
60384
+ #wasm;
60385
+ #textDecoder = new TextDecoder ("utf-8", { ignoreBOM: true, fatal: true });
60386
+ #uint8Memory0;
60387
+
60388
+ #getUint8Memory0 ()
60389
+ {
60390
+ if (this .#uint8Memory0 ?.buffer !== this .#wasm .memory .buffer)
60391
+ this .#uint8Memory0 = new Uint8Array (this .#wasm .memory .buffer);
60392
+
60393
+ return this .#uint8Memory0;
60394
+ }
60395
+
60396
+ #getStringFromWasm0 (ptr, len)
60397
+ {
60398
+ return this .#textDecoder .decode (this .#getUint8Memory0 () .subarray (ptr, ptr + len));
60399
+ }
60400
+
60401
+ #heap = new Array (32) .fill (undefined) .toSpliced (32, 0, undefined, null, true, false);
60402
+ #heap_next = this .#heap .length;
60403
+
60404
+ #addHeapObject (obj)
60405
+ {
60406
+ if (this .#heap_next === this .#heap .length)
60407
+ this .#heap .push (this .#heap .length + 1);
60408
+
60409
+ const i = this .#heap_next;
60410
+
60411
+ this .#heap_next = this .#heap [i];
60412
+ this .#heap [i] = obj;
60413
+
60414
+ return i;
60415
+ }
60416
+
60417
+ #getObject (i)
60418
+ {
60419
+ return this .#heap [i];
60420
+ }
60421
+
60422
+ #dropObject (i)
60423
+ {
60424
+ if (i < 36)
60425
+ return;
60426
+
60427
+ this .#heap [i] = this .#heap_next;
60428
+
60429
+ this .#heap_next = i;
60430
+ }
60431
+
60432
+ #takeObject (i)
60433
+ {
60434
+ const ret = this .#getObject (i);
60435
+
60436
+ this .#dropObject (i);
60437
+
60438
+ return ret;
60439
+ }
60440
+
60441
+ #float32Memory0;
60442
+
60443
+ #getFloat32Memory0 ()
60444
+ {
60445
+ if (this .#float32Memory0 ?.buffer !== this .#wasm .memory .buffer)
60446
+ this .#float32Memory0 = new Float32Array (this .#wasm .memory .buffer);
60447
+
60448
+ return this .#float32Memory0;
60449
+ }
60450
+
60451
+ #WASM_VECTOR_LEN = 0;
60452
+
60453
+ #passArrayF32ToWasm0 (arg, malloc)
60454
+ {
60455
+ const ptr = malloc (arg .length * 4);
60456
+
60457
+ this .#getFloat32Memory0 () .set (arg, ptr / 4);
60458
+
60459
+ this .#WASM_VECTOR_LEN = arg .length;
60460
+
60461
+ return ptr;
60462
+ }
60463
+
60464
+ #int32Memory0;
60465
+
60466
+ #getInt32Memory0 ()
60467
+ {
60468
+ if (this .#int32Memory0 ?.buffer !== this .#wasm .memory .buffer)
60469
+ this .#int32Memory0 = new Int32Array (this .#wasm .memory .buffer);
60470
+
60471
+ return this .#int32Memory0;
60472
+ }
60473
+
60474
+ #getArrayF32FromWasm0 (ptr, len)
60475
+ {
60476
+ return this .#getFloat32Memory0 () .subarray (ptr / 4, ptr / 4 + len);
60477
+ }
60478
+ };
60479
+ ;
60480
+
60481
+ x_ite_Namespace .add ("MikkTSpace", "x_ite/Browser/Rendering/MikkTSpace", MikkTSpace_default_);
60482
+ /* harmony default export */ const MikkTSpace = (MikkTSpace_default_);
60305
60483
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/Shading.js
60306
60484
  /*******************************************************************************
60307
60485
  *
@@ -60427,6 +60605,7 @@ x_ite_Namespace .add ("Shading", "x_ite/Browser/Core/Shading", Shading_default_)
60427
60605
 
60428
60606
 
60429
60607
 
60608
+
60430
60609
  // Box normals for bbox / line intersection.
60431
60610
  const boxNormals = [
60432
60611
  new Numbers_Vector3 (0, 0, 1), // front
@@ -60467,9 +60646,9 @@ function X3DGeometryNode (executionContext)
60467
60646
  this .texCoords = X3DGeometryNode .createArray ();
60468
60647
  this .fogDepths = X3DGeometryNode .createArray ();
60469
60648
  this .colors = X3DGeometryNode .createArray ();
60649
+ this .tangents = X3DGeometryNode .createArray ();
60470
60650
  this .normals = X3DGeometryNode .createArray ();
60471
60651
  this .flatNormals = X3DGeometryNode .createArray ();
60472
- this .tangents = X3DGeometryNode .createArray ();
60473
60652
  this .vertices = X3DGeometryNode .createArray ();
60474
60653
  this .hasFogCoords = false;
60475
60654
  this .hasNormals = false;
@@ -60549,8 +60728,8 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
60549
60728
  this .texCoordBuffers = Array .from ({length: browser .getMaxTexCoords ()}, () => gl .createBuffer ());
60550
60729
  this .fogDepthBuffer = gl .createBuffer ();
60551
60730
  this .colorBuffer = gl .createBuffer ();
60552
- this .normalBuffer = gl .createBuffer ();
60553
60731
  this .tangentBuffer = gl .createBuffer ();
60732
+ this .normalBuffer = gl .createBuffer ();
60554
60733
  this .vertexBuffer = gl .createBuffer ();
60555
60734
  this .vertexArrayObject = new Rendering_VertexArray (gl);
60556
60735
 
@@ -60699,14 +60878,6 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
60699
60878
 
60700
60879
  this .textureCoordinateNode .getTextureCoordinateMapping (this .textureCoordinateMapping);
60701
60880
  },
60702
- setNormals (value)
60703
- {
60704
- this .normals .assign (value);
60705
- },
60706
- getNormals ()
60707
- {
60708
- return this .normals;
60709
- },
60710
60881
  setTangents (value)
60711
60882
  {
60712
60883
  this .tangents .assign (value);
@@ -60715,6 +60886,14 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
60715
60886
  {
60716
60887
  return this .tangents;
60717
60888
  },
60889
+ setNormals (value)
60890
+ {
60891
+ this .normals .assign (value);
60892
+ },
60893
+ getNormals ()
60894
+ {
60895
+ return this .normals;
60896
+ },
60718
60897
  setVertices (value)
60719
60898
  {
60720
60899
  this .vertices .assign (value);
@@ -60729,7 +60908,7 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
60729
60908
 
60730
60909
  this .updateInstances = true;
60731
60910
  },
60732
- buildTexCoords ()
60911
+ generateTexCoords ()
60733
60912
  {
60734
60913
  const texCoords = this .texCoords;
60735
60914
 
@@ -60810,6 +60989,31 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
60810
60989
  return texCoordParams;
60811
60990
  };
60812
60991
  })(),
60992
+ generateTangents ()
60993
+ {
60994
+ if (this .geometryType < 2)
60995
+ return;
60996
+
60997
+ if (!this .vertices .length)
60998
+ return;
60999
+
61000
+ if (!MikkTSpace .isInitialized ())
61001
+ return void (MikkTSpace .initialize () .then (() => this .requestRebuild ()));
61002
+
61003
+ const
61004
+ vertices = this .vertices .getValue () .filter ((v, i) => i % 4 < 3),
61005
+ normals = this .normals .getValue (),
61006
+ texCoords = this .multiTexCoords [0] .getValue () .filter ((v, i) => i % 4 < 2),
61007
+ tangents = MikkTSpace .generateTangents (vertices, normals, texCoords),
61008
+ length = tangents .length;
61009
+
61010
+ // Convert coordinate system handedness to respect output format of MikkTSpace.
61011
+ for (let i = 3; i < length; i += 4)
61012
+ tangents [i] = -tangents [i]; // Flip w-channel.
61013
+
61014
+ this .tangents .assign (tangents);
61015
+ this .tangents .shrinkToFit ();
61016
+ },
60813
61017
  refineNormals (normalIndex, normals, creaseAngle)
60814
61018
  {
60815
61019
  if (creaseAngle === 0)
@@ -61150,7 +61354,7 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
61150
61354
  {
61151
61355
  const point = new Numbers_Vector3 ();
61152
61356
 
61153
- return function ()
61357
+ return async function ()
61154
61358
  {
61155
61359
  this .clear ();
61156
61360
  this .build ();
@@ -61166,8 +61370,8 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
61166
61370
  this .coordIndices .shrinkToFit ();
61167
61371
  this .fogDepths .shrinkToFit ();
61168
61372
  this .colors .shrinkToFit ();
61169
- this .normals .shrinkToFit ();
61170
61373
  this .tangents .shrinkToFit ();
61374
+ this .normals .shrinkToFit ();
61171
61375
  this .vertices .shrinkToFit ();
61172
61376
 
61173
61377
  // Determine bbox.
@@ -61204,8 +61408,12 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
61204
61408
 
61205
61409
  // Generate texCoord if needed.
61206
61410
 
61207
- if (this .multiTexCoords .length === 0)
61208
- this .buildTexCoords ();
61411
+ if (!this .multiTexCoords .length)
61412
+ this .generateTexCoords ();
61413
+
61414
+ // Generate tangents if needed.
61415
+ if (!this .tangents .length)
61416
+ this .generateTangents ();
61209
61417
 
61210
61418
  // Transfer arrays and update.
61211
61419
 
@@ -61245,8 +61453,8 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
61245
61453
  this .colors .length = 0;
61246
61454
  this .multiTexCoords .length = 0;
61247
61455
  this .texCoords .length = 0;
61248
- this .normals .length = 0;
61249
61456
  this .tangents .length = 0;
61457
+ this .normals .length = 0;
61250
61458
  this .flatNormals .length = 0;
61251
61459
  this .vertices .length = 0;
61252
61460
  },
@@ -61302,17 +61510,6 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
61302
61510
  gl .bufferData (gl .ARRAY_BUFFER, this .multiTexCoords [i] .getValue (), gl .DYNAMIC_DRAW);
61303
61511
  }
61304
61512
 
61305
- // Transfer normals or flat normals.
61306
-
61307
- const lastHasNormals = this .hasNormals;
61308
-
61309
- this .set_shading__ (this .getBrowser () .getBrowserOptions () ._Shading);
61310
-
61311
- this .hasNormals = !! this .normals .length;
61312
-
61313
- if (this .hasNormals !== lastHasNormals)
61314
- this .updateVertexArrays ();
61315
-
61316
61513
  // Transfer tangents.
61317
61514
 
61318
61515
  const lastHasTangents = this .hasTangents;
@@ -61325,6 +61522,17 @@ Object .assign (Object .setPrototypeOf (X3DGeometryNode .prototype, Core_X3DNode
61325
61522
  if (this .hasTangents !== lastHasTangents)
61326
61523
  this .updateVertexArrays ();
61327
61524
 
61525
+ // Transfer normals or flat normals.
61526
+
61527
+ const lastHasNormals = this .hasNormals;
61528
+
61529
+ this .set_shading__ (this .getBrowser () .getBrowserOptions () ._Shading);
61530
+
61531
+ this .hasNormals = !! this .normals .length;
61532
+
61533
+ if (this .hasNormals !== lastHasNormals)
61534
+ this .updateVertexArrays ();
61535
+
61328
61536
  // Transfer vertices.
61329
61537
 
61330
61538
  gl .bindBuffer (gl .ARRAY_BUFFER, this .vertexBuffer);
@@ -62473,6 +62681,7 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62473
62681
  gl .uniform3f (shaderNode .x3d_EmissiveColor, 1, 1, 1)
62474
62682
  gl .uniform1f (shaderNode .x3d_Transparency, transparency)
62475
62683
  gl .uniform1i (shaderNode .x3d_TextureCoordinateGeneratorMode [0], 0);
62684
+ gl .uniform1f (shaderNode .x3d_Exposure, 1);
62476
62685
 
62477
62686
  // Enable vertex attribute arrays.
62478
62687
 
@@ -62490,6 +62699,8 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62490
62699
  gl .disable (gl .BLEND);
62491
62700
 
62492
62701
  gl .drawArrays (gl .TRIANGLES, 0, this .sphereCount);
62702
+
62703
+ gl .uniform1f (shaderNode .x3d_Exposure, browser .getBrowserOption ("Exposure"));
62493
62704
  },
62494
62705
  drawCube: (() =>
62495
62706
  {
@@ -62526,8 +62737,11 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62526
62737
  gl .uniform3f (shaderNode .x3d_EmissiveColor, 1, 1, 1);
62527
62738
  gl .uniform1f (shaderNode .x3d_Transparency, 0);
62528
62739
  gl .uniform1i (shaderNode .x3d_TextureCoordinateGeneratorMode [0], 0);
62740
+ gl .uniform1f (shaderNode .x3d_Exposure, 1);
62529
62741
 
62530
62742
  this .drawRectangle (gl, browser, shaderNode, renderObject, textureNode, this .textureBuffers [i], this .textureArrayObjects [i]);
62743
+
62744
+ gl .uniform1f (shaderNode .x3d_Exposure, browser .getBrowserOption ("Exposure"));
62531
62745
  }
62532
62746
  };
62533
62747
  })(),
@@ -62870,7 +63084,7 @@ Object .assign (Object .setPrototypeOf (X3DSingleTextureNode .prototype, Texturi
62870
63084
  if (value !== this ._linear .getValue ())
62871
63085
  this ._linear = value;
62872
63086
  },
62873
- getMipMaps ()
63087
+ canMipMaps ()
62874
63088
  {
62875
63089
  return this .mipMaps;
62876
63090
  },
@@ -62922,7 +63136,7 @@ Object .assign (Object .setPrototypeOf (X3DSingleTextureNode .prototype, Texturi
62922
63136
  gl .texParameteri (target, gl .TEXTURE_MIN_FILTER, gl .NEAREST);
62923
63137
  gl .texParameteri (target, gl .TEXTURE_MAG_FILTER, gl .NEAREST);
62924
63138
  }
62925
- else if (this .getMipMaps () && textureProperties ._generateMipMaps .getValue ())
63139
+ else if (this .canMipMaps () && textureProperties ._generateMipMaps .getValue ())
62926
63140
  {
62927
63141
  // Can MipMaps and wants MipMaps.
62928
63142
  gl .generateMipmap (target);
@@ -63220,7 +63434,7 @@ const X3DTexture2DNode_default_ = X3DTexture2DNode;
63220
63434
  x_ite_Namespace .add ("X3DTexture2DNode", "x_ite/Components/Texturing/X3DTexture2DNode", X3DTexture2DNode_default_);
63221
63435
  /* harmony default export */ const Texturing_X3DTexture2DNode = (X3DTexture2DNode_default_);
63222
63436
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/ImageTexture.js
63223
- /* provided dependency */ var ImageTexture_$ = __webpack_require__(439);
63437
+ /* provided dependency */ var ImageTexture_$ = __webpack_require__(812);
63224
63438
  /*******************************************************************************
63225
63439
  *
63226
63440
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66810,7 +67024,7 @@ const X3DWorld_default_ = X3DWorld;
66810
67024
  x_ite_Namespace .add ("X3DWorld", "x_ite/Execution/X3DWorld", X3DWorld_default_);
66811
67025
  /* harmony default export */ const Execution_X3DWorld = (X3DWorld_default_);
66812
67026
  ;// CONCATENATED MODULE: ./src/x_ite/InputOutput/FileLoader.js
66813
- /* provided dependency */ var FileLoader_$ = __webpack_require__(439);
67027
+ /* provided dependency */ var FileLoader_$ = __webpack_require__(812);
66814
67028
  /*******************************************************************************
66815
67029
  *
66816
67030
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67744,7 +67958,7 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
67744
67958
  x_ite_Namespace .add ("ProtoDeclarationArray", "x_ite/Prototype/ProtoDeclarationArray", ProtoDeclarationArray_default_);
67745
67959
  /* harmony default export */ const Prototype_ProtoDeclarationArray = (ProtoDeclarationArray_default_);
67746
67960
  ;// CONCATENATED MODULE: ./src/x_ite/Routing/X3DRoute.js
67747
- /* provided dependency */ var X3DRoute_$ = __webpack_require__(439);
67961
+ /* provided dependency */ var X3DRoute_$ = __webpack_require__(812);
67748
67962
  /*******************************************************************************
67749
67963
  *
67750
67964
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74853,6 +75067,7 @@ Object .assign (Object .setPrototypeOf (Box .prototype, Rendering_X3DGeometryNod
74853
75067
  size = this ._size .getValue ();
74854
75068
 
74855
75069
  this .setMultiTexCoords (geometry .getMultiTexCoords ());
75070
+ this .setTangents (geometry .getTangents ());
74856
75071
  this .setNormals (geometry .getNormals ());
74857
75072
 
74858
75073
  if (size .equals (defaultSize))
@@ -75222,6 +75437,7 @@ Object .assign (Object .setPrototypeOf (Cylinder .prototype, Rendering_X3DGeomet
75222
75437
  height1_2 = Math .abs (this ._height .getValue ()) / 2,
75223
75438
  radius = Math .abs (this ._radius .getValue ()),
75224
75439
  texCoordArray = this .getTexCoords (),
75440
+ tangentArray = this .getTangents (),
75225
75441
  normalArray = this .getNormals (),
75226
75442
  vertexArray = this .getVertices ();
75227
75443
 
@@ -75236,6 +75452,9 @@ Object .assign (Object .setPrototypeOf (Cylinder .prototype, Rendering_X3DGeomet
75236
75452
  for (const t of geometry .getMultiTexCoords () [0])
75237
75453
  texCoordArray .push (t);
75238
75454
 
75455
+ for (const t of geometry .getTangents ())
75456
+ tangentArray .push (t);
75457
+
75239
75458
  for (const n of geometry .getNormals ())
75240
75459
  normalArray .push (n);
75241
75460
 
@@ -75257,6 +75476,9 @@ Object .assign (Object .setPrototypeOf (Cylinder .prototype, Rendering_X3DGeomet
75257
75476
  for (const t of geometry .getMultiTexCoords () [0])
75258
75477
  texCoordArray .push (t);
75259
75478
 
75479
+ for (const t of geometry .getTangents ())
75480
+ tangentArray .push (t);
75481
+
75260
75482
  for (const n of geometry .getNormals ())
75261
75483
  normalArray .push (n);
75262
75484
 
@@ -75278,6 +75500,9 @@ Object .assign (Object .setPrototypeOf (Cylinder .prototype, Rendering_X3DGeomet
75278
75500
  for (const t of geometry .getMultiTexCoords () [0])
75279
75501
  texCoordArray .push (t);
75280
75502
 
75503
+ for (const t of geometry .getTangents ())
75504
+ tangentArray .push (t);
75505
+
75281
75506
  for (const n of geometry .getNormals ())
75282
75507
  normalArray .push (n);
75283
75508
 
@@ -75793,8 +76018,8 @@ Object .defineProperties (ElevationGrid,
75793
76018
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
75794
76019
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
75795
76020
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
75796
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
75797
76021
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
76022
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
75798
76023
  new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "height", new x_ite_Fields .MFFloat ()),
75799
76024
  ]),
75800
76025
  enumerable: true,
@@ -76801,12 +77026,12 @@ Object .assign (Object .setPrototypeOf (X3DComposedGeometryNode .prototype, Rend
76801
77026
  // Autogenerate normal if not specified.
76802
77027
 
76803
77028
  if (!this .getNormal ())
76804
- this .buildNormals (verticesPerPolygon, polygonsSize, trianglesSize);
77029
+ this .generateNormals (verticesPerPolygon, polygonsSize, trianglesSize);
76805
77030
 
76806
77031
  this .setSolid (this ._solid .getValue ());
76807
77032
  this .setCCW (this ._ccw .getValue ());
76808
77033
  },
76809
- buildNormals (verticesPerPolygon, polygonsSize, trianglesSize)
77034
+ generateNormals (verticesPerPolygon, polygonsSize, trianglesSize)
76810
77035
  {
76811
77036
  const
76812
77037
  normals = this .createNormals (verticesPerPolygon, polygonsSize),
@@ -77088,7 +77313,7 @@ Object .assign (Object .setPrototypeOf (IndexedFaceSet .prototype, Rendering_X3D
77088
77313
  // Autogenerate normals if not specified.
77089
77314
 
77090
77315
  if (!this .getNormal ())
77091
- this .buildNormals (polygons);
77316
+ this .generateNormals (polygons);
77092
77317
 
77093
77318
  this .setSolid (this ._solid .getValue ());
77094
77319
  this .setCCW (this ._ccw .getValue ());
@@ -77208,7 +77433,7 @@ Object .assign (Object .setPrototypeOf (IndexedFaceSet .prototype, Rendering_X3D
77208
77433
  Geometry_Triangle3 .triangulatePolygon (polygon, triangles);
77209
77434
  };
77210
77435
  })(),
77211
- buildNormals (polygons)
77436
+ generateNormals (polygons)
77212
77437
  {
77213
77438
  const
77214
77439
  normals = this .createNormals (polygons),
@@ -77361,8 +77586,8 @@ Object .defineProperties (IndexedFaceSet,
77361
77586
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
77362
77587
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
77363
77588
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
77364
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
77365
77589
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
77590
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
77366
77591
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
77367
77592
  ]),
77368
77593
  enumerable: true,
@@ -77458,6 +77683,7 @@ Object .assign (Object .setPrototypeOf (Sphere .prototype, Rendering_X3DGeometry
77458
77683
  radius = Math .abs (this ._radius .getValue ());
77459
77684
 
77460
77685
  this .setMultiTexCoords (geometry .getMultiTexCoords ());
77686
+ this .setTangents (geometry .getTangents ());
77461
77687
  this .setNormals (geometry .getNormals ());
77462
77688
 
77463
77689
  if (radius === 1)
@@ -81070,6 +81296,7 @@ Object .assign (Object .setPrototypeOf (X3DLightNode .prototype, Core_X3DChildNo
81070
81296
  renderObject .getLights () .push (lightContainer);
81071
81297
 
81072
81298
  renderObject .pushGlobalShadows (!! this .getShadowIntensity ());
81299
+ renderObject .getGlobalLightsKeys () .push (this .getLightKey ());
81073
81300
  }
81074
81301
  else
81075
81302
  {
@@ -81096,6 +81323,7 @@ Object .assign (Object .setPrototypeOf (X3DLightNode .prototype, Core_X3DChildNo
81096
81323
  renderObject .getLights () .push (lightContainer);
81097
81324
 
81098
81325
  renderObject .pushGlobalShadows (!! this .getShadowIntensity ());
81326
+ renderObject .getGlobalLightsKeys () .push (this .getLightKey ());
81099
81327
  }
81100
81328
  else
81101
81329
  {
@@ -81551,17 +81779,13 @@ Object .assign (EnvironmentLightContainer .prototype,
81551
81779
  ? this .GGXLUTTextureUnit = this .GGXLUTTextureUnit ?? browser .popTexture2DUnit ()
81552
81780
  : browser .getTexture2DUnit ();
81553
81781
 
81554
- // https://stackoverflow.com/a/25640078/1818915
81555
- // The system will automatically clamp the specified parameter appropriately.
81556
- // In GLSL 4 there is a textureQueryLevels function.
81557
- const specularTextureLevels = 1 + Math .floor (Math .log2 (specularTexture ?.getSize () ?? 1));
81558
-
81559
81782
  gl .uniform3f (shaderObject .x3d_EnvironmentLightColor, color .r, color .g, color .b);
81560
81783
  gl .uniform1f (shaderObject .x3d_EnvironmentLightIntensity, lightNode .getIntensity ());
81561
81784
  gl .uniformMatrix3fv (shaderObject .x3d_EnvironmentLightRotation, false, this .rotationMatrix);
81562
81785
  gl .uniform1i (shaderObject .x3d_EnvironmentLightDiffuseTextureLinear, diffuseTexture ?.isLinear ());
81786
+ gl .uniform1i (shaderObject .x3d_EnvironmentLightDiffuseTextureLevels, diffuseTexture ?.getLevels () ?? 0);
81563
81787
  gl .uniform1i (shaderObject .x3d_EnvironmentLightSpecularTextureLinear, specularTexture ?.isLinear ());
81564
- gl .uniform1i (shaderObject .x3d_EnvironmentLightSpecularTextureLevels, specularTextureLevels);
81788
+ gl .uniform1i (shaderObject .x3d_EnvironmentLightSpecularTextureLevels, specularTexture ?.getLevels () ?? 0);
81565
81789
 
81566
81790
  gl .activeTexture (gl .TEXTURE0 + diffuseTextureUnit);
81567
81791
  gl .bindTexture (gl .TEXTURE_CUBE_MAP, diffuseTexture ?.getTexture () ?? browser .getDefaultTextureCube ());
@@ -87955,7 +88179,7 @@ Object .assign (Object .setPrototypeOf (X3DLineGeometryNode .prototype, Renderin
87955
88179
 
87956
88180
  this .thickLinesVertexArrayObject .update ();
87957
88181
  },
87958
- buildTexCoords ()
88182
+ generateTexCoords ()
87959
88183
  {
87960
88184
  // Line stipple support.
87961
88185
 
@@ -88889,8 +89113,8 @@ Object .defineProperties (IndexedLineSet,
88889
89113
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "attrib", new x_ite_Fields .MFNode ()),
88890
89114
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
88891
89115
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
88892
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
88893
89116
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
89117
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
88894
89118
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
88895
89119
  ]),
88896
89120
  enumerable: true,
@@ -89068,8 +89292,8 @@ Object .defineProperties (IndexedTriangleFanSet,
89068
89292
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
89069
89293
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
89070
89294
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
89071
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89072
89295
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
89296
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89073
89297
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
89074
89298
  ]),
89075
89299
  enumerable: true,
@@ -89204,8 +89428,8 @@ Object .defineProperties (IndexedTriangleSet,
89204
89428
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
89205
89429
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
89206
89430
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
89207
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89208
89431
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
89432
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89209
89433
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
89210
89434
  ]),
89211
89435
  enumerable: true,
@@ -89391,8 +89615,8 @@ Object .defineProperties (IndexedTriangleStripSet,
89391
89615
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
89392
89616
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
89393
89617
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
89394
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89395
89618
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
89619
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89396
89620
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
89397
89621
  ]),
89398
89622
  enumerable: true,
@@ -89650,8 +89874,8 @@ Object .defineProperties (LineSet,
89650
89874
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "attrib", new x_ite_Fields .MFNode ()),
89651
89875
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
89652
89876
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
89653
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89654
89877
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
89878
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
89655
89879
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
89656
89880
  ]),
89657
89881
  enumerable: true,
@@ -89967,7 +90191,7 @@ Object .assign (Object .setPrototypeOf (X3DPointGeometryNode .prototype, Renderi
89967
90191
  {
89968
90192
  return false;
89969
90193
  },
89970
- buildTexCoords ()
90194
+ generateTexCoords ()
89971
90195
  { },
89972
90196
  display (gl, renderContext)
89973
90197
  {
@@ -90331,8 +90555,8 @@ Object .defineProperties (PointSet,
90331
90555
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "attrib", new x_ite_Fields .MFNode ()),
90332
90556
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
90333
90557
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
90334
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90335
90558
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
90559
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90336
90560
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
90337
90561
  ]),
90338
90562
  enumerable: true,
@@ -90649,8 +90873,8 @@ Object .defineProperties (TriangleFanSet,
90649
90873
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
90650
90874
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
90651
90875
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
90652
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90653
90876
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
90877
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90654
90878
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
90655
90879
  ]),
90656
90880
  enumerable: true,
@@ -90780,8 +91004,8 @@ Object .defineProperties (TriangleSet,
90780
91004
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
90781
91005
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
90782
91006
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
90783
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90784
91007
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
91008
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90785
91009
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
90786
91010
  ]),
90787
91011
  enumerable: true,
@@ -90945,8 +91169,8 @@ Object .defineProperties (TriangleStripSet,
90945
91169
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "fogCoord", new x_ite_Fields .SFNode ()),
90946
91170
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "color", new x_ite_Fields .SFNode ()),
90947
91171
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "texCoord", new x_ite_Fields .SFNode ()),
90948
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90949
91172
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "tangent", new x_ite_Fields .SFNode ()), // experimental
91173
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "normal", new x_ite_Fields .SFNode ()),
90950
91174
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "coord", new x_ite_Fields .SFNode ()),
90951
91175
  ]),
90952
91176
  enumerable: true,
@@ -91186,18 +91410,21 @@ const MaterialTextures_default_ = {
91186
91410
  "x3d_SpecularGlossinessTexture",
91187
91411
  "x3d_OcclusionTexture",
91188
91412
  "x3d_NormalTexture",
91413
+
91189
91414
  "x3d_AnisotropyTextureEXT",
91190
- "x3d_ClearcoatTextureEXT",
91191
- "x3d_ClearcoatRoughnessTextureEXT",
91192
91415
  "x3d_ClearcoatNormalTextureEXT",
91416
+ "x3d_ClearcoatRoughnessTextureEXT",
91417
+ "x3d_ClearcoatTextureEXT",
91418
+ "x3d_DiffuseTransmissionColorTextureEXT",
91419
+ "x3d_DiffuseTransmissionTextureEXT",
91193
91420
  "x3d_IridescenceTextureEXT",
91194
91421
  "x3d_IridescenceThicknessTextureEXT",
91195
91422
  "x3d_SheenColorTextureEXT",
91196
91423
  "x3d_SheenRoughnessTextureEXT",
91197
- "x3d_SpecularTextureEXT",
91198
91424
  "x3d_SpecularColorTextureEXT",
91199
- "x3d_TransmissionTextureEXT",
91425
+ "x3d_SpecularTextureEXT",
91200
91426
  "x3d_ThicknessTextureEXT",
91427
+ "x3d_TransmissionTextureEXT",
91201
91428
  ],
91202
91429
  texture (name, components = "rgba", colorSpace = "")
91203
91430
  {
@@ -91294,7 +91521,7 @@ mediump samplerCube textureCube;
91294
91521
  x_ite_Namespace .add ("MaterialTextures", "assets/shaders/MaterialTextures", MaterialTextures_default_);
91295
91522
  /* harmony default export */ const MaterialTextures = (MaterialTextures_default_);
91296
91523
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js
91297
- /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(439);
91524
+ /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(812);
91298
91525
  /*******************************************************************************
91299
91526
  *
91300
91527
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91490,6 +91717,7 @@ Object .assign (X3DProgrammableShaderObject .prototype,
91490
91717
  this .x3d_EnvironmentLightRotation = gl .getUniformLocation (program, "x3d_EnvironmentLightSource.rotation");
91491
91718
  this .x3d_EnvironmentLightDiffuseTexture = gl .getUniformLocation (program, "x3d_EnvironmentLightSource.diffuseTexture");
91492
91719
  this .x3d_EnvironmentLightDiffuseTextureLinear = gl .getUniformLocation (program, "x3d_EnvironmentLightSource.diffuseTextureLinear");
91720
+ this .x3d_EnvironmentLightDiffuseTextureLevels = gl .getUniformLocation (program, "x3d_EnvironmentLightSource.diffuseTextureLevels");
91493
91721
  this .x3d_EnvironmentLightSpecularTexture = gl .getUniformLocation (program, "x3d_EnvironmentLightSource.specularTexture");
91494
91722
  this .x3d_EnvironmentLightSpecularTextureLinear = gl .getUniformLocation (program, "x3d_EnvironmentLightSource.specularTextureLinear");
91495
91723
  this .x3d_EnvironmentLightSpecularTextureLevels = gl .getUniformLocation (program, "x3d_EnvironmentLightSource.specularTextureLevels");
@@ -91530,26 +91758,28 @@ Object .assign (X3DProgrammableShaderObject .prototype,
91530
91758
  "x3d_MultiTextureColor",
91531
91759
  // Extensions
91532
91760
  "x3d_AnisotropyEXT",
91761
+ "x3d_AttenuationColorEXT",
91762
+ "x3d_AttenuationDistanceEXT",
91533
91763
  "x3d_ClearcoatEXT",
91534
91764
  "x3d_ClearcoatRoughnessEXT",
91765
+ "x3d_DiffuseTransmissionColorEXT",
91766
+ "x3d_DiffuseTransmissionEXT",
91535
91767
  "x3d_DispersionEXT",
91536
91768
  "x3d_EmissiveStrengthEXT",
91537
91769
  "x3d_IorEXT",
91538
91770
  "x3d_IridescenceEXT",
91539
91771
  "x3d_IridescenceIndexOfRefractionEXT",
91540
- "x3d_IridescenceThicknessMinimumEXT",
91541
91772
  "x3d_IridescenceThicknessMaximumEXT",
91773
+ "x3d_IridescenceThicknessMinimumEXT",
91542
91774
  "x3d_SheenColorEXT",
91543
- "x3d_SheenRoughnessEXT",
91544
91775
  "x3d_SheenELUTTextureEXT",
91545
- "x3d_SpecularEXT",
91776
+ "x3d_SheenRoughnessEXT",
91546
91777
  "x3d_SpecularColorEXT",
91778
+ "x3d_SpecularEXT",
91779
+ "x3d_ThicknessEXT",
91547
91780
  "x3d_TransmissionEXT",
91548
91781
  "x3d_TransmissionFramebufferSamplerEXT",
91549
91782
  "x3d_TransmissionFramebufferSizeEXT",
91550
- "x3d_ThicknessEXT",
91551
- "x3d_AttenuationDistanceEXT",
91552
- "x3d_AttenuationColorEXT",
91553
91783
  ];
91554
91784
 
91555
91785
  for (const name of commonUniforms)
@@ -93771,71 +94001,6 @@ const ProgramShader_default_ = ProgramShader;
93771
94001
 
93772
94002
  x_ite_Namespace .add ("ProgramShader", "x_ite/Components/Shaders/ProgramShader", ProgramShader_default_);
93773
94003
  /* harmony default export */ const Shaders_ProgramShader = (ProgramShader_default_);
93774
- ;// CONCATENATED MODULE: ./src/assets/shaders/Types.glsl.js
93775
-
93776
-
93777
- const Types_glsl_default_ = /* glsl */ `
93778
- #if defined(X3D_FOG)
93779
- struct x3d_FogParameters{mediump int type;mediump vec3 color;mediump float visibilityRange;mediump mat3 matrix;};
93780
- #endif
93781
- #if defined(X3D_LIGHTING)
93782
- struct x3d_LightSourceParameters{mediump int type;mediump vec3 color;mediump float intensity;mediump float ambientIntensity;mediump vec3 attenuation;mediump vec3 location;mediump vec3 direction;mediump float radius;mediump float beamWidth;mediump float cutOffAngle;mediump mat3 matrix;
93783
- #if defined(X3D_SHADOWS)
93784
- mediump vec3 shadowColor;mediump float shadowIntensity;mediump float shadowBias;mediump mat4 shadowMatrix;mediump int shadowMapSize;
93785
- #endif
93786
- };
93787
- #endif
93788
- #if defined(X3D_USE_IBL)
93789
- struct x3d_EnvironmentLightSourceParameters{mediump vec3 color;mediump float intensity;mediump float ambientIntensity;mediump mat3 rotation;mediump samplerCube diffuseTexture;bool diffuseTextureLinear;mediump samplerCube specularTexture;bool specularTextureLinear;mediump int specularTextureLevels;mediump sampler2D GGXLUTTexture;
93790
- #if defined(X3D_SHEEN_MATERIAL_EXT)
93791
- mediump sampler2D CharlieLUTTexture;
93792
- #endif
93793
- };
93794
- #endif
93795
- #if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)
93796
- struct x3d_PointPropertiesParameters{mediump float pointSizeScaleFactor;mediump float pointSizeMinValue;mediump float pointSizeMaxValue;mediump vec3 attenuation;};
93797
- #endif
93798
- #if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)
93799
- struct x3d_LinePropertiesParameters{mediump int linetype;mediump float lineStippleScale;
93800
- #if defined(X3D_STYLE_PROPERTIES_TEXTURE)
93801
- sampler2D texture;
93802
- #endif
93803
- };
93804
- #endif
93805
- #if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)
93806
- struct x3d_FillPropertiesParameters{bool filled;bool hatched;mediump vec3 hatchColor;
93807
- #if defined(X3D_STYLE_PROPERTIES_TEXTURE)
93808
- sampler2D texture;
93809
- #endif
93810
- mediump float scale;};
93811
- #endif
93812
- #if defined(X3D_UNLIT_MATERIAL)
93813
- struct x3d_UnlitMaterialParameters{mediump vec3 emissiveColor;mediump float normalScale;mediump float transparency;};
93814
- #endif
93815
- #if defined(X3D_MATERIAL)
93816
- struct x3d_MaterialParameters{mediump float ambientIntensity;mediump vec3 diffuseColor;mediump vec3 specularColor;mediump vec3 emissiveColor;mediump float shininess;mediump float occlusionStrength;mediump float normalScale;mediump float transparency;};
93817
- #endif
93818
- #if defined(X3D_PHYSICAL_MATERIAL)
93819
- struct x3d_PhysicalMaterialParameters{
93820
- #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
93821
- mediump vec3 diffuseColor;mediump vec3 specularColor;mediump float glossiness;
93822
- #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
93823
- mediump vec3 baseColor;mediump float metallic;mediump float roughness;
93824
- #endif
93825
- mediump vec3 emissiveColor;mediump float occlusionStrength;mediump float normalScale;mediump float transparency;};
93826
- #endif
93827
- ${MaterialTextures .structs ()}
93828
- #if defined(X3D_MULTI_TEXTURING)
93829
- struct x3d_MultiTextureParameters{mediump int mode;mediump int alphaMode;mediump int source;mediump int function;};
93830
- #endif
93831
- #if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)
93832
- struct x3d_TextureCoordinateGeneratorParameters{mediump int mode;mediump float parameter[6];};
93833
- #endif
93834
- `
93835
- ;
93836
-
93837
- x_ite_Namespace .add ("Types.glsl", "assets/shaders/Types.glsl", Types_glsl_default_);
93838
- /* harmony default export */ const Types_glsl = (Types_glsl_default_);
93839
94004
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/ModeType.js
93840
94005
  /*******************************************************************************
93841
94006
  *
@@ -94111,6 +94276,150 @@ const TextureCoordinateGeneratorModeType_default_ = TextureCoordinateGeneratorMo
94111
94276
 
94112
94277
  x_ite_Namespace .add ("TextureCoordinateGeneratorModeType", "x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType", TextureCoordinateGeneratorModeType_default_);
94113
94278
  /* harmony default export */ const TextureCoordinateGeneratorModeType = (TextureCoordinateGeneratorModeType_default_);
94279
+ ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/RenderingConfiguration.js
94280
+ // The numbers must remain in single digits, otherwise the number base must
94281
+ // be increased in the number output for the material shader key.
94282
+
94283
+ const maxClipPlanes = 6;
94284
+
94285
+ ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/TexturingConfiguration.js
94286
+ // The numbers must remain in single digits, otherwise the number base must
94287
+ // be increased in the number output for the material shader key.
94288
+
94289
+ const maxTextureTransforms = 4;
94290
+ const maxTexCoords = 4;
94291
+ const maxTextures = 4;
94292
+
94293
+ ;// CONCATENATED MODULE: ./src/assets/shaders/Types.glsl.js
94294
+
94295
+
94296
+
94297
+
94298
+
94299
+
94300
+
94301
+
94302
+ const Types_glsl_default_ = /* glsl */ `
94303
+ #define X_ITE
94304
+ #define x3d_None 0
94305
+ #define x3d_Points 0
94306
+ #define x3d_Lines 1
94307
+ #define x3d_Geometry2D 2
94308
+ #define x3d_Geometry3D 3
94309
+ #define x3d_MaxClipPlanes ${maxClipPlanes}
94310
+ #define x3d_LinearFog 1
94311
+ #define x3d_ExponentialFog 2
94312
+ #define x3d_Exponential2Fog 3
94313
+ #define x3d_DirectionalLight 1
94314
+ #define x3d_PointLight 2
94315
+ #define x3d_SpotLight 3
94316
+ #define x3d_MaxTextures ${maxTextures}
94317
+ #define x3d_TextureType2D 2
94318
+ #define x3d_TextureType3D 3
94319
+ #define x3d_TextureTypeCube 4
94320
+ #define x3d_Replace ${Texturing_ModeType .REPLACE}
94321
+ #define x3d_Modulate ${Texturing_ModeType .MODULATE}
94322
+ #define x3d_Modulate2X ${Texturing_ModeType .MODULATE2X}
94323
+ #define x3d_Modulate4X ${Texturing_ModeType .MODULATE4X}
94324
+ #define x3d_Add ${Texturing_ModeType .ADD}
94325
+ #define x3d_AddSigned ${Texturing_ModeType .ADDSIGNED}
94326
+ #define x3d_AddSigned2X ${Texturing_ModeType .ADDSIGNED2X}
94327
+ #define x3d_AddSmooth ${Texturing_ModeType .ADDSMOOTH}
94328
+ #define x3d_Subtract ${Texturing_ModeType .SUBTRACT}
94329
+ #define x3d_BlendDiffuseAlpha ${Texturing_ModeType .BLENDDIFFUSEALPHA}
94330
+ #define x3d_BlendTextureAlpha ${Texturing_ModeType .BLENDTEXTUREALPHA}
94331
+ #define x3d_BlendFactorAlpha ${Texturing_ModeType .BLENDFACTORALPHA}
94332
+ #define x3d_BlendCurrentAlpha ${Texturing_ModeType .BLENDCURRENTALPHA}
94333
+ #define x3d_ModulateAlphaAddColor ${Texturing_ModeType .MODULATEALPHA_ADDCOLOR}
94334
+ #define x3d_ModulateInvAlphaAddColor ${Texturing_ModeType .MODULATEINVALPHA_ADDCOLOR}
94335
+ #define x3d_ModulateInvColorAddAlpha ${Texturing_ModeType .MODULATEINVCOLOR_ADDALPHA}
94336
+ #define x3d_DotProduct3 ${Texturing_ModeType .DOTPRODUCT3}
94337
+ #define x3d_SelectArg1 ${Texturing_ModeType .SELECTARG1}
94338
+ #define x3d_SelectArg2 ${Texturing_ModeType .SELECTARG2}
94339
+ #define x3d_Off ${Texturing_ModeType .OFF}
94340
+ #define x3d_Diffuse ${Texturing_SourceType .DIFFUSE}
94341
+ #define x3d_Specular ${Texturing_SourceType .SPECULAR}
94342
+ #define x3d_Factor ${Texturing_SourceType .FACTOR}
94343
+ #define x3d_Complement ${Texturing_FunctionType .COMPLEMENT}
94344
+ #define x3d_AlphaReplicate ${Texturing_FunctionType .ALPHAREPLICATE}
94345
+ #define x3d_Sphere ${TextureCoordinateGeneratorModeType .SPHERE}
94346
+ #define x3d_CameraSpaceNormal ${TextureCoordinateGeneratorModeType .CAMERASPACENORMAL}
94347
+ #define x3d_CameraSpacePosition ${TextureCoordinateGeneratorModeType .CAMERASPACEPOSITION}
94348
+ #define x3d_CameraSpaceReflectionVector ${TextureCoordinateGeneratorModeType .CAMERASPACEREFLECTIONVECTOR}
94349
+ #define x3d_SphereLocal ${TextureCoordinateGeneratorModeType .SPHERE_LOCAL}
94350
+ #define x3d_Coord ${TextureCoordinateGeneratorModeType .COORD}
94351
+ #define x3d_CoordEye ${TextureCoordinateGeneratorModeType .COORD_EYE}
94352
+ #define x3d_Noise ${TextureCoordinateGeneratorModeType .NOISE}
94353
+ #define x3d_NoiseEye ${TextureCoordinateGeneratorModeType .NOISE_EYE}
94354
+ #define x3d_SphereReflect ${TextureCoordinateGeneratorModeType .SPHERE_REFLECT}
94355
+ #define x3d_SphereReflectLocal ${TextureCoordinateGeneratorModeType .SPHERE_REFLECT_LOCAL}
94356
+ #define x3d_GeometryPoints 0
94357
+ #define x3d_GeometryLines 1
94358
+ #define x3d_NoneClipPlane vec4(88.0,51.0,68.0,33.0)
94359
+ #define x3d_NoneFog 0
94360
+ #define x3d_NoneLight 0
94361
+ #define x3d_NoneTexture 0
94362
+ #if defined(X3D_FOG)
94363
+ struct x3d_FogParameters{mediump int type;mediump vec3 color;mediump float visibilityRange;mediump mat3 matrix;};
94364
+ #endif
94365
+ #if defined(X3D_LIGHTING)
94366
+ struct x3d_LightSourceParameters{mediump int type;mediump vec3 color;mediump float intensity;mediump float ambientIntensity;mediump vec3 attenuation;mediump vec3 location;mediump vec3 direction;mediump float radius;mediump float beamWidth;mediump float cutOffAngle;mediump mat3 matrix;
94367
+ #if defined(X3D_SHADOWS)
94368
+ mediump vec3 shadowColor;mediump float shadowIntensity;mediump float shadowBias;mediump mat4 shadowMatrix;mediump int shadowMapSize;
94369
+ #endif
94370
+ };
94371
+ #endif
94372
+ #if defined(X3D_USE_IBL)
94373
+ struct x3d_EnvironmentLightSourceParameters{mediump vec3 color;mediump float intensity;mediump float ambientIntensity;mediump mat3 rotation;mediump samplerCube diffuseTexture;bool diffuseTextureLinear;mediump int diffuseTextureLevels;mediump samplerCube specularTexture;bool specularTextureLinear;mediump int specularTextureLevels;mediump sampler2D GGXLUTTexture;
94374
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
94375
+ mediump sampler2D CharlieLUTTexture;
94376
+ #endif
94377
+ };
94378
+ #endif
94379
+ #if defined(X3D_GEOMETRY_0D)&&defined(X3D_STYLE_PROPERTIES)
94380
+ struct x3d_PointPropertiesParameters{mediump float pointSizeScaleFactor;mediump float pointSizeMinValue;mediump float pointSizeMaxValue;mediump vec3 attenuation;};
94381
+ #endif
94382
+ #if defined(X3D_GEOMETRY_1D)&&defined(X3D_STYLE_PROPERTIES)
94383
+ struct x3d_LinePropertiesParameters{mediump int linetype;mediump float lineStippleScale;
94384
+ #if defined(X3D_STYLE_PROPERTIES_TEXTURE)
94385
+ sampler2D texture;
94386
+ #endif
94387
+ };
94388
+ #endif
94389
+ #if(defined(X3D_GEOMETRY_2D)||defined(X3D_GEOMETRY_3D))&&defined(X3D_STYLE_PROPERTIES)
94390
+ struct x3d_FillPropertiesParameters{bool filled;bool hatched;mediump vec3 hatchColor;
94391
+ #if defined(X3D_STYLE_PROPERTIES_TEXTURE)
94392
+ sampler2D texture;
94393
+ #endif
94394
+ mediump float scale;};
94395
+ #endif
94396
+ #if defined(X3D_UNLIT_MATERIAL)
94397
+ struct x3d_UnlitMaterialParameters{mediump vec3 emissiveColor;mediump float normalScale;mediump float transparency;};
94398
+ #endif
94399
+ #if defined(X3D_MATERIAL)
94400
+ struct x3d_MaterialParameters{mediump float ambientIntensity;mediump vec3 diffuseColor;mediump vec3 specularColor;mediump vec3 emissiveColor;mediump float shininess;mediump float occlusionStrength;mediump float normalScale;mediump float transparency;};
94401
+ #endif
94402
+ #if defined(X3D_PHYSICAL_MATERIAL)
94403
+ struct x3d_PhysicalMaterialParameters{
94404
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
94405
+ mediump vec3 diffuseColor;mediump vec3 specularColor;mediump float glossiness;
94406
+ #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
94407
+ mediump vec3 baseColor;mediump float metallic;mediump float roughness;
94408
+ #endif
94409
+ mediump vec3 emissiveColor;mediump float occlusionStrength;mediump float normalScale;mediump float transparency;};
94410
+ #endif
94411
+ ${MaterialTextures .structs ()}
94412
+ #if defined(X3D_MULTI_TEXTURING)
94413
+ struct x3d_MultiTextureParameters{mediump int mode;mediump int alphaMode;mediump int source;mediump int function;};
94414
+ #endif
94415
+ #if defined(X3D_TEXTURE)||defined(X3D_MATERIAL_TEXTURES)
94416
+ struct x3d_TextureCoordinateGeneratorParameters{mediump int mode;mediump float parameter[6];};
94417
+ #endif
94418
+ `
94419
+ ;
94420
+
94421
+ x_ite_Namespace .add ("Types.glsl", "assets/shaders/Types.glsl", Types_glsl_default_);
94422
+ /* harmony default export */ const Types_glsl = (Types_glsl_default_);
94114
94423
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Shaders/ShaderSource.js
94115
94424
  /*******************************************************************************
94116
94425
  *
@@ -94161,33 +94470,29 @@ x_ite_Namespace .add ("TextureCoordinateGeneratorModeType", "x_ite/Browser/Textu
94161
94470
 
94162
94471
 
94163
94472
 
94164
-
94165
-
94166
-
94167
-
94168
94473
  const ShaderSource =
94169
94474
  {
94170
94475
  getSource (gl, browser, source, options)
94171
94476
  {
94172
- const
94173
- COMMENTS = "\\s+|/\\*[\\s\\S]*?\\*/|//.*?\\n",
94174
- LINE = "#line\\s+.*?\\n",
94175
- IF = "#if\\s+.*?\\n",
94176
- ELIF = "#elif\\s+.*?\\n",
94177
- IFDEF = "#ifdef\\s+.*?\\n",
94178
- IFNDEF = "#ifndef\\s+.*?\\n",
94179
- ELSE = "#else.*?\\n",
94180
- ENDIF = "#endif.*?\\n",
94181
- DEFINE = "#define\\s+(?:[^\\n\\\\]|\\\\[^\\r\\n]|\\\\\\r?\\n)*\\n",
94182
- UNDEF = "#undef\\s+.*?\\n",
94183
- PRAGMA = "#pragma\\s+.*?\\n",
94184
- PREPROCESSOR = LINE + "|" + IF + "|" + ELIF + "|" + IFDEF + "|" + IFNDEF + "|" + ELSE + "|" + ENDIF + "|" + DEFINE + "|" + UNDEF + "|" + PRAGMA,
94185
- VERSION = "#version\\s+.*?\\n",
94186
- EXTENSION = "#extension\\s+.*?\\n";
94477
+ const
94478
+ COMMENTS = "\\s+|/\\*[\\s\\S]*?\\*/|//.*?\\n",
94479
+ LINE = "#line\\s+.*?\\n",
94480
+ IF = "#if\\s+.*?\\n",
94481
+ ELIF = "#elif\\s+.*?\\n",
94482
+ IFDEF = "#ifdef\\s+.*?\\n",
94483
+ IFNDEF = "#ifndef\\s+.*?\\n",
94484
+ ELSE = "#else.*?\\n",
94485
+ ENDIF = "#endif.*?\\n",
94486
+ DEFINE = "#define\\s+(?:[^\\n\\\\]|\\\\[^\\r\\n]|\\\\\\r?\\n)*\\n",
94487
+ UNDEF = "#undef\\s+.*?\\n",
94488
+ PRAGMA = "#pragma\\s+.*?\\n",
94489
+ PREPROCESSOR = `${LINE}|${IF}|${ELIF}|${IFDEF}|${IFNDEF}|${ELSE}|${ENDIF}|${DEFINE}|${UNDEF}|${PRAGMA}`,
94490
+ VERSION = "#version\\s+.*?\\n",
94491
+ EXTENSION = "#extension\\s+.*?\\n";
94187
94492
 
94188
- const
94189
- GLSL = new RegExp ("^((?:" + COMMENTS + "|" + PREPROCESSOR + ")*(?:" + VERSION + ")?(?:" + COMMENTS + "|" + PREPROCESSOR + "|" + EXTENSION + ")*)", "s"),
94190
- match = source .match (GLSL);
94493
+ const
94494
+ GLSL = new RegExp (`^((?:${COMMENTS}|${PREPROCESSOR})*(?:${VERSION})?(?:${COMMENTS}|${PREPROCESSOR}|${EXTENSION})*)`, "s"),
94495
+ match = source .match (GLSL);
94191
94496
 
94192
94497
  // const
94193
94498
  // COMMENTS = "\\s+|/\\*.*?\\*/|//.*?\\n",
@@ -94203,90 +94508,10 @@ const ShaderSource =
94203
94508
 
94204
94509
  // Constants
94205
94510
 
94206
- let constants = "";
94207
-
94208
- constants += "#define X_ITE\n";
94209
-
94210
- if (gl .HAS_FEATURE_DEPTH_TEXTURE)
94211
- constants += "#define X3D_DEPTH_TEXTURE\n";
94212
-
94213
- for (const option of options)
94214
- constants += "#define " + option + "\n";
94215
-
94216
- // Definitions
94217
-
94218
- let definitions = "";
94219
-
94220
- definitions += "#define x3d_None 0\n";
94221
-
94222
- definitions += "#define x3d_Points 0\n";
94223
- definitions += "#define x3d_Lines 1\n";
94224
- definitions += "#define x3d_Geometry2D 2\n";
94225
- definitions += "#define x3d_Geometry3D 3\n";
94226
-
94227
- definitions += "#define x3d_MaxClipPlanes " + browser .getMaxClipPlanes () + "\n";
94228
-
94229
- definitions += "#define x3d_LinearFog 1\n";
94230
- definitions += "#define x3d_ExponentialFog 2\n";
94231
- definitions += "#define x3d_Exponential2Fog 3\n";
94232
-
94233
- definitions += "#define x3d_MaxLights " + browser .getMaxLights () + "\n";
94234
- definitions += "#define x3d_DirectionalLight 1\n";
94235
- definitions += "#define x3d_PointLight 2\n";
94236
- definitions += "#define x3d_SpotLight 3\n";
94237
-
94238
- definitions += "#define x3d_MaxTextures " + browser .getMaxTextures () + "\n";
94239
- definitions += "#define x3d_TextureType2D 2\n";
94240
- definitions += "#define x3d_TextureType3D 3\n";
94241
- definitions += "#define x3d_TextureTypeCube 4\n";
94242
-
94243
- definitions += "#define x3d_Replace " + Texturing_ModeType .REPLACE + "\n";
94244
- definitions += "#define x3d_Modulate " + Texturing_ModeType .MODULATE + "\n";
94245
- definitions += "#define x3d_Modulate2X " + Texturing_ModeType .MODULATE2X + "\n";
94246
- definitions += "#define x3d_Modulate4X " + Texturing_ModeType .MODULATE4X + "\n";
94247
- definitions += "#define x3d_Add " + Texturing_ModeType .ADD + "\n";
94248
- definitions += "#define x3d_AddSigned " + Texturing_ModeType .ADDSIGNED + "\n";
94249
- definitions += "#define x3d_AddSigned2X " + Texturing_ModeType .ADDSIGNED2X + "\n";
94250
- definitions += "#define x3d_AddSmooth " + Texturing_ModeType .ADDSMOOTH + "\n";
94251
- definitions += "#define x3d_Subtract " + Texturing_ModeType .SUBTRACT + "\n";
94252
- definitions += "#define x3d_BlendDiffuseAlpha " + Texturing_ModeType .BLENDDIFFUSEALPHA + "\n";
94253
- definitions += "#define x3d_BlendTextureAlpha " + Texturing_ModeType .BLENDTEXTUREALPHA + "\n";
94254
- definitions += "#define x3d_BlendFactorAlpha " + Texturing_ModeType .BLENDFACTORALPHA + "\n";
94255
- definitions += "#define x3d_BlendCurrentAlpha " + Texturing_ModeType .BLENDCURRENTALPHA + "\n";
94256
- definitions += "#define x3d_ModulateAlphaAddColor " + Texturing_ModeType .MODULATEALPHA_ADDCOLOR + "\n";
94257
- definitions += "#define x3d_ModulateInvAlphaAddColor " + Texturing_ModeType .MODULATEINVALPHA_ADDCOLOR + "\n";
94258
- definitions += "#define x3d_ModulateInvColorAddAlpha " + Texturing_ModeType .MODULATEINVCOLOR_ADDALPHA + "\n";
94259
- definitions += "#define x3d_DotProduct3 " + Texturing_ModeType .DOTPRODUCT3 + "\n";
94260
- definitions += "#define x3d_SelectArg1 " + Texturing_ModeType .SELECTARG1 + "\n";
94261
- definitions += "#define x3d_SelectArg2 " + Texturing_ModeType .SELECTARG2 + "\n";
94262
- definitions += "#define x3d_Off " + Texturing_ModeType .OFF + "\n";
94263
-
94264
- definitions += "#define x3d_Diffuse " + Texturing_SourceType .DIFFUSE + "\n";
94265
- definitions += "#define x3d_Specular " + Texturing_SourceType .SPECULAR + "\n";
94266
- definitions += "#define x3d_Factor " + Texturing_SourceType .FACTOR + "\n";
94267
-
94268
- definitions += "#define x3d_Complement " + Texturing_FunctionType .COMPLEMENT + "\n";
94269
- definitions += "#define x3d_AlphaReplicate " + Texturing_FunctionType .ALPHAREPLICATE + "\n";
94270
-
94271
- definitions += "#define x3d_Sphere " + TextureCoordinateGeneratorModeType .SPHERE + "\n";
94272
- definitions += "#define x3d_CameraSpaceNormal " + TextureCoordinateGeneratorModeType .CAMERASPACENORMAL + "\n";
94273
- definitions += "#define x3d_CameraSpacePosition " + TextureCoordinateGeneratorModeType .CAMERASPACEPOSITION + "\n";
94274
- definitions += "#define x3d_CameraSpaceReflectionVector " + TextureCoordinateGeneratorModeType .CAMERASPACEREFLECTIONVECTOR + "\n";
94275
- definitions += "#define x3d_SphereLocal " + TextureCoordinateGeneratorModeType .SPHERE_LOCAL + "\n";
94276
- definitions += "#define x3d_Coord " + TextureCoordinateGeneratorModeType .COORD + "\n";
94277
- definitions += "#define x3d_CoordEye " + TextureCoordinateGeneratorModeType .COORD_EYE + "\n";
94278
- definitions += "#define x3d_Noise " + TextureCoordinateGeneratorModeType .NOISE + "\n";
94279
- definitions += "#define x3d_NoiseEye " + TextureCoordinateGeneratorModeType .NOISE_EYE + "\n";
94280
- definitions += "#define x3d_SphereReflect " + TextureCoordinateGeneratorModeType .SPHERE_REFLECT + "\n";
94281
- definitions += "#define x3d_SphereReflectLocal " + TextureCoordinateGeneratorModeType .SPHERE_REFLECT_LOCAL + "\n";
94282
-
94283
- // Legacy
94284
- definitions += "#define x3d_GeometryPoints 0\n";
94285
- definitions += "#define x3d_GeometryLines 1\n";
94286
- definitions += "#define x3d_NoneClipPlane vec4 (88.0, 51.0, 68.0, 33.0)\n";
94287
- definitions += "#define x3d_NoneFog 0\n";
94288
- definitions += "#define x3d_NoneLight 0\n";
94289
- definitions += "#define x3d_NoneTexture 0\n";
94511
+ const defines = /* glsl */ `
94512
+ ${options .map (option => `#define ${option}`) .join ("\n")}
94513
+ #define x3d_MaxLights ${browser .getMaxLights ()}
94514
+ `
94290
94515
 
94291
94516
  // Adjust precision of struct types;
94292
94517
 
@@ -94297,12 +94522,12 @@ const ShaderSource =
94297
94522
  precisionInt = matchInt ?.[1] ?? "mediump";
94298
94523
 
94299
94524
  const types = Types_glsl
94300
- .replace (/mediump\s+(float|vec2|vec3|mat3|mat4)/g, precisionFloat + " $1")
94301
- .replace (/mediump\s+(int)/g, precisionInt + " $1");
94525
+ .replace (/mediump\s+(float|vec2|vec3|mat3|mat4)/g, `${precisionFloat} \$1`)
94526
+ .replace (/mediump\s+(int)/g, `${precisionInt} \$1`);
94302
94527
 
94303
- const lines = (match [1] .match (/\n/g) || [ ]) .length + 1;
94528
+ const lines = (match [1] .match (/\n/g) ?.length ?? 0) + 1;
94304
94529
 
94305
- return `${match [1]}${constants}${definitions}${types}#line ${lines + 1} -1\n${source .substring (match [0] .length)}`;
94530
+ return `${match [1]}${defines}${types}#line ${lines + 1} -1\n${source .substring (match [0] .length)}`;
94306
94531
  },
94307
94532
  };
94308
94533
 
@@ -94319,14 +94544,6 @@ const ShaderSource_default_ = ShaderSource;
94319
94544
 
94320
94545
  x_ite_Namespace .add ("ShaderSource", "x_ite/Browser/Shaders/ShaderSource", ShaderSource_default_);
94321
94546
  /* harmony default export */ const Shaders_ShaderSource = (ShaderSource_default_);
94322
- ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/TexturingConfiguration.js
94323
- // The numbers must remain in single digits, otherwise the number base must
94324
- // be increased in the number output for the material shader key.
94325
-
94326
- const maxTextureTransforms = 4;
94327
- const maxTexCoords = 4;
94328
- const maxTextures = 4;
94329
-
94330
94547
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Fragment1.glsl.js
94331
94548
 
94332
94549
 
@@ -94837,19 +95054,19 @@ uniform x3d_NormalTextureParameters x3d_NormalTexture;
94837
95054
  NormalInfo getNormalInfo(const in float normalScale){
94838
95055
  #if defined(X3D_NORMAL_TEXTURE)
94839
95056
  vec3 UV=getTexCoord(x3d_NormalTexture.textureTransformMapping,x3d_NormalTexture.textureCoordinateMapping);
94840
- #else
94841
- vec3 UV=vec3(0.0);
94842
- #endif
94843
95057
  #if defined(X3D_NORMAL_TEXTURE_FLIP_Y)
94844
95058
  UV.t=1.0-UV.t;
94845
95059
  #endif
95060
+ #else
95061
+ vec3 UV=vertex;
95062
+ #endif
94846
95063
  vec3 n,t,b,ng;
94847
95064
  #if defined(X3D_TANGENTS)
94848
95065
  t=normalize(TBN[0]);b=normalize(TBN[1]);ng=normalize(TBN[2]);
94849
95066
  #else
94850
95067
  vec2 uv_dx=dFdx(UV.st);vec2 uv_dy=dFdy(UV.st);if(length(uv_dx)<=1e-2)uv_dx=vec2(1.0,0.0);if(length(uv_dy)<=1e-2)uv_dy=vec2(0.0,1.0);vec3 t_=(uv_dy.t*dFdx(vertex)-uv_dx.t*dFdy(vertex))/(uv_dx.s*uv_dy.t-uv_dy.s*uv_dx.t);ng=normalize(normal);t=normalize(t_-ng*dot(ng,t_));b=cross(ng,t);
94851
95068
  #endif
94852
- if(gl_FrontFacing==false){t*=-1.0;b*=-1.0;ng*=-1.0;}NormalInfo info;info.ng=ng;
95069
+ if(gl_FrontFacing==false){t=-t;b=-b;ng=-ng;}NormalInfo info;info.ng=ng;
94853
95070
  #if defined(X3D_NORMAL_TEXTURE)
94854
95071
  #if __VERSION__==100
94855
95072
  #if defined(X3D_NORMAL_TEXTURE_2D)
@@ -95923,14 +96140,14 @@ x_ite_Namespace .add ("Unlit2.fs", "assets/shaders/webgl2/Unlit2.fs", Unlit2_fs_
95923
96140
  /* harmony default export */ const Unlit2_fs = (Unlit2_fs_default_);
95924
96141
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/BRDF2.glsl.js
95925
96142
  const BRDF2_glsl_default_ = /* glsl */ `
95926
- const float M_PI=3.1415926535897932384626433832795;float max3(const in vec3 value){return max(max(value.x,value.y),value.z);}vec3 F_Schlick(const in vec3 f0,const in vec3 f90,const in float VdotH){return f0+(f90-f0)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}float F_Schlick(const in float f0,const in float f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=x*x2*x2;return f0+(f90-f0)*x5;}float F_Schlick(const in float f0,const in float VdotH){float f90=1.0;return F_Schlick(f0,f90,VdotH);}vec3 F_Schlick(const in vec3 f0,const in float f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=x*x2*x2;return f0+(f90-f0)*x5;}vec3 F_Schlick(const in vec3 f0,const in float VdotH){float f90=1.0;return F_Schlick(f0,f90,VdotH);}vec3 Schlick_to_F0(const in vec3 f,const in vec3 f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=clamp(x*x2*x2,0.0,0.9999);return(f-f90*x5)/(1.0-x5);}float Schlick_to_F0(const in float f,const in float f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=clamp(x*x2*x2,0.0,0.9999);return(f-f90*x5)/(1.0-x5);}vec3 Schlick_to_F0(const in vec3 f,const in float VdotH){return Schlick_to_F0(f,vec3(1.0),VdotH);}float Schlick_to_F0(const in float f,const in float VdotH){return Schlick_to_F0(f,1.0,VdotH);}float V_GGX(const in float NdotL,const in float NdotV,const in float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGX=GGXV+GGXL;if(GGX>0.0){return 0.5/GGX;}return 0.0;}float D_GGX(const in float NdotH,const in float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float f=(NdotH*NdotH)*(alphaRoughnessSq-1.0)+1.0;return alphaRoughnessSq/(M_PI*f*f);}
96143
+ const float M_PI=3.1415926535897932384626433832795;float max3(const in vec3 value){return max(max(value.x,value.y),value.z);}vec3 rgb_mix(const in vec3 base,const in vec3 layer,const in vec3 rgb_alpha){float rgb_alpha_max=max(rgb_alpha.r,max(rgb_alpha.g,rgb_alpha.b));return(1.0-rgb_alpha_max)*base+rgb_alpha*layer;}vec3 F_Schlick(const in vec3 f0,const in vec3 f90,const in float VdotH){return f0+(f90-f0)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}float F_Schlick(const in float f0,const in float f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=x*x2*x2;return f0+(f90-f0)*x5;}float F_Schlick(const in float f0,const in float VdotH){float f90=1.0;return F_Schlick(f0,f90,VdotH);}vec3 F_Schlick(const in vec3 f0,const in float f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=x*x2*x2;return f0+(f90-f0)*x5;}vec3 F_Schlick(const in vec3 f0,const in float VdotH){float f90=1.0;return F_Schlick(f0,f90,VdotH);}vec3 Schlick_to_F0(const in vec3 f,const in vec3 f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=clamp(x*x2*x2,0.0,0.9999);return(f-f90*x5)/(1.0-x5);}float Schlick_to_F0(const in float f,const in float f90,const in float VdotH){float x=clamp(1.0-VdotH,0.0,1.0);float x2=x*x;float x5=clamp(x*x2*x2,0.0,0.9999);return(f-f90*x5)/(1.0-x5);}vec3 Schlick_to_F0(const in vec3 f,const in float VdotH){return Schlick_to_F0(f,vec3(1.0),VdotH);}float Schlick_to_F0(const in float f,const in float VdotH){return Schlick_to_F0(f,1.0,VdotH);}float V_GGX(const in float NdotL,const in float NdotV,const in float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-alphaRoughnessSq)+alphaRoughnessSq);float GGX=GGXV+GGXL;if(GGX>0.0){return 0.5/GGX;}return 0.0;}float D_GGX(const in float NdotH,const in float alphaRoughness){float alphaRoughnessSq=alphaRoughness*alphaRoughness;float f=(NdotH*NdotH)*(alphaRoughnessSq-1.0)+1.0;return alphaRoughnessSq/(M_PI*f*f);}
95927
96144
  #if defined(X3D_LIGHTING)
95928
- vec3 BRDF_lambertian(const in vec3 f0,const in vec3 f90,const in vec3 diffuseColor,const in float specularWeight,const in float VdotH){return(1.0-specularWeight*F_Schlick(f0,f90,VdotH))*(diffuseColor/M_PI);}vec3 BRDF_specularGGX(const in vec3 f0,const in vec3 f90,const in float alphaRoughness,const in float specularWeight,const in float VdotH,const in float NdotL,const in float NdotV,const in float NdotH){vec3 F=F_Schlick(f0,f90,VdotH);float Vis=V_GGX(NdotL,NdotV,alphaRoughness);float D=D_GGX(NdotH,alphaRoughness);return specularWeight*F*Vis*D;}
96145
+ vec3 BRDF_lambertian(const in vec3 diffuseColor){return diffuseColor/M_PI;}vec3 BRDF_specularGGX(const in float alphaRoughness,const in float NdotL,const in float NdotV,const in float NdotH){float Vis=V_GGX(NdotL,NdotV,alphaRoughness);float D=D_GGX(NdotH,alphaRoughness);return vec3(Vis*D);}
95929
96146
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95930
96147
  vec3 BRDF_lambertianIridescence(const in vec3 f0,const in vec3 f90,const in vec3 iridescenceFresnel,const in float iridescenceFactor,const in vec3 diffuseColor,const in float specularWeight,const in float VdotH){vec3 iridescenceFresnelMax=vec3(max(max(iridescenceFresnel.r,iridescenceFresnel.g),iridescenceFresnel.b));vec3 schlickFresnel=F_Schlick(f0,f90,VdotH);vec3 F=mix(schlickFresnel,iridescenceFresnelMax,iridescenceFactor);return(1.0-specularWeight*F)*(diffuseColor/M_PI);}vec3 BRDF_specularGGXIridescence(const in vec3 f0,const in vec3 f90,const in vec3 iridescenceFresnel,const in float alphaRoughness,const in float iridescenceFactor,const in float specularWeight,const in float VdotH,const in float NdotL,const in float NdotV,const in float NdotH){vec3 F=mix(F_Schlick(f0,f90,VdotH),iridescenceFresnel,iridescenceFactor);float Vis=V_GGX(NdotL,NdotV,alphaRoughness);float D=D_GGX(NdotH,alphaRoughness);return specularWeight*F*Vis*D;}
95931
96148
  #endif
95932
96149
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
95933
- float D_GGX_anisotropic(const in float NdotH,const in float TdotH,const in float BdotH,const in float anisotropy,const in float at,const in float ab){float a2=at*ab;vec3 f=vec3(ab*TdotH,at*BdotH,a2*NdotH);float w2=a2/dot(f,f);return a2*w2*w2/M_PI;}float V_GGX_anisotropic(const in float NdotL,const in float NdotV,const in float BdotV,const in float TdotV,const in float TdotL,const in float BdotL,const in float at,const in float ab){float GGXV=NdotL*length(vec3(at*TdotV,ab*BdotV,NdotV));float GGXL=NdotV*length(vec3(at*TdotL,ab*BdotL,NdotL));float v=0.5/(GGXV+GGXL);return clamp(v,0.0,1.0);}vec3 BRDF_specularGGXAnisotropy(const in vec3 f0,const in vec3 f90,const in float alphaRoughness,const in float anisotropy,const in vec3 n,const in vec3 v,const in vec3 l,const in vec3 h,const in vec3 t,const in vec3 b){float at=mix(alphaRoughness,1.0,anisotropy*anisotropy);float ab=clamp(alphaRoughness,0.001,1.0);float NdotL=clamp(dot(n,l),0.0,1.0);float NdotH=clamp(dot(n,h),0.001,1.0);float NdotV=dot(n,v);float VdotH=clamp(dot(v,h),0.0,1.0);float V=V_GGX_anisotropic(NdotL,NdotV,dot(b,v),dot(t,v),dot(t,l),dot(b,l),at,ab);float D=D_GGX_anisotropic(NdotH,dot(t,h),dot(b,h),anisotropy,at,ab);vec3 F=F_Schlick(f0,f90,VdotH);return F*V*D;}
96150
+ float D_GGX_anisotropic(const in float NdotH,const in float TdotH,const in float BdotH,const in float anisotropy,const in float at,const in float ab){float a2=at*ab;vec3 f=vec3(ab*TdotH,at*BdotH,a2*NdotH);float w2=a2/dot(f,f);return a2*w2*w2/M_PI;}float V_GGX_anisotropic(const in float NdotL,const in float NdotV,const in float BdotV,const in float TdotV,const in float TdotL,const in float BdotL,const in float at,const in float ab){float GGXV=NdotL*length(vec3(at*TdotV,ab*BdotV,NdotV));float GGXL=NdotV*length(vec3(at*TdotL,ab*BdotL,NdotL));float v=0.5/(GGXV+GGXL);return clamp(v,0.0,1.0);}vec3 BRDF_specularGGXAnisotropy(const in float alphaRoughness,const in float anisotropy,const in vec3 n,const in vec3 v,const in vec3 l,const in vec3 h,const in vec3 t,const in vec3 b){float at=mix(alphaRoughness,1.0,anisotropy*anisotropy);float ab=clamp(alphaRoughness,0.001,1.0);float NdotL=clamp(dot(n,l),0.0,1.0);float NdotH=clamp(dot(n,h),0.001,1.0);float NdotV=dot(n,v);float V=V_GGX_anisotropic(NdotL,NdotV,dot(b,v),dot(t,v),dot(t,l),dot(b,l),at,ab);float D=D_GGX_anisotropic(NdotH,dot(t,h),dot(b,h),anisotropy,at,ab);return vec3(V*D);}
95934
96151
  #endif
95935
96152
  #if defined(X3D_SHEEN_MATERIAL_EXT)
95936
96153
  float lambdaSheenNumericHelper(const in float x,const in float alphaG){float oneMinusAlphaSq=(1.0-alphaG)*(1.0-alphaG);float a=mix(21.5473,25.3245,oneMinusAlphaSq);float b=mix(3.82987,3.32435,oneMinusAlphaSq);float c=mix(0.19823,0.16801,oneMinusAlphaSq);float d=mix(-1.97760,-1.27393,oneMinusAlphaSq);float e=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}float lambdaSheen(const in float cosTheta,const in float alphaG){if(abs(cosTheta)<0.5)return exp(lambdaSheenNumericHelper(cosTheta,alphaG));else return exp(2.0*lambdaSheenNumericHelper(0.5,alphaG)-lambdaSheenNumericHelper(1.0-cosTheta,alphaG));}float V_Sheen(const in float NdotL,const in float NdotV,in float sheenRoughness){sheenRoughness=max(sheenRoughness,0.000001);float alphaG=sheenRoughness*sheenRoughness;return clamp(1.0/((1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG))*(4.0*NdotV*NdotL)),0.0,1.0);}float D_Charlie(in float sheenRoughness,const in float NdotH){sheenRoughness=max(sheenRoughness,0.000001);float alphaG=sheenRoughness*sheenRoughness;float invR=1.0/alphaG;float cos2h=NdotH*NdotH;float sin2h=1.0-cos2h;return(2.0+invR)*pow(sin2h,invR*0.5)/(2.0*M_PI);}vec3 BRDF_specularSheen(const in vec3 sheenColor,const in float sheenRoughness,const in float NdotL,const in float NdotV,const in float NdotH){float sheenDistribution=D_Charlie(sheenRoughness,NdotH);float sheenVisibility=V_Sheen(NdotL,NdotV,sheenRoughness);return sheenColor*sheenDistribution*sheenVisibility;}
@@ -95968,36 +96185,26 @@ if(!x3d_EnvironmentLightSource.specularTextureLinear)textureColor=sRGBToLinear(t
95968
96185
  #endif
95969
96186
  return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}
95970
96187
  #if defined(X3D_SHEEN_MATERIAL_EXT)
95971
- vec3 getSheenLight(const in vec3 reflection,const in float lod){return vec3(0.5)*(lod/float(x3d_EnvironmentLightSource.specularTextureLevels))*x3d_EnvironmentLightSource.intensity;}
95972
- #endif
95973
- vec3 getIBLRadianceGGX(const in vec3 n,const in vec3 v,const in float roughness,const in vec3 F0,const in float specularWeight){float NdotV=clamp(dot(n,v),0.0,1.0);float lod=roughness*float(x3d_EnvironmentLightSource.specularTextureLevels);vec3 reflection=normalize(reflect(-v,n));vec2 brdfSamplePoint=clamp(vec2(NdotV,roughness),vec2(0.0),vec2(1.0));
96188
+ vec3 getSheenLight(const in vec3 reflection,const in float lod){vec3 texCoord=x3d_EnvironmentLightSource.rotation*reflection*vec3(-1.0,1.0,1.0);
95974
96189
  #if __VERSION__==100
95975
- vec2 f_ab=texture2D(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96190
+ vec3 textureColor=textureCubeLodEXT(x3d_EnvironmentLightSource.diffuseTexture,texCoord,lod).rgb;
95976
96191
  #else
95977
- vec2 f_ab=texture(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96192
+ vec3 textureColor=textureLod(x3d_EnvironmentLightSource.diffuseTexture,texCoord,lod).rgb;
95978
96193
  #endif
95979
- vec3 specularLight=getSpecularLight(reflection,lod);vec3 Fr=max(vec3(1.0-roughness),F0)-F0;vec3 k_S=F0+Fr*pow(1.0-NdotV,5.0);vec3 FssEss=k_S*f_ab.x+f_ab.y;return specularWeight*specularLight*FssEss;}vec3 getIBLRadianceLambertian(const in vec3 n,const in vec3 v,const in float roughness,const in vec3 diffuseColor,const in vec3 F0,const in float specularWeight){float NdotV=clamp(dot(n,v),0.0,1.0);vec2 brdfSamplePoint=clamp(vec2(NdotV,roughness),vec2(0.0),vec2(1.0));
95980
- #if __VERSION__==100
95981
- vec2 f_ab=texture2D(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96194
+ #if defined(X3D_COLORSPACE_SRGB)
96195
+ if(x3d_EnvironmentLightSource.diffuseTextureLinear)textureColor=linearToSRGB(textureColor);
95982
96196
  #else
95983
- vec2 f_ab=texture(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96197
+ if(!x3d_EnvironmentLightSource.diffuseTextureLinear)textureColor=sRGBToLinear(textureColor);
95984
96198
  #endif
95985
- vec3 irradiance=getDiffuseLight(n);vec3 Fr=max(vec3(1.0-roughness),F0)-F0;vec3 k_S=F0+Fr*pow(1.0-NdotV,5.0);vec3 FssEss=specularWeight*k_S*f_ab.x+f_ab.y;float Ems=(1.0-(f_ab.x+f_ab.y));vec3 F_avg=specularWeight*(F0+(1.0-F0)/21.0);vec3 FmsEms=Ems*FssEss*F_avg/(1.0-F_avg*Ems);vec3 k_D=diffuseColor*(1.0-FssEss+FmsEms);return(FmsEms+k_D)*irradiance;}
95986
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95987
- vec3 getIBLRadianceGGXIridescence(const in vec3 n,const in vec3 v,const in float roughness,const in vec3 F0,const in vec3 iridescenceFresnel,const in float iridescenceFactor,const in float specularWeight){float NdotV=clamp(dot(n,v),0.0,1.0);float lod=roughness*float(x3d_EnvironmentLightSource.specularTextureLevels);vec3 reflection=normalize(reflect(-v,n));vec2 brdfSamplePoint=clamp(vec2(NdotV,roughness),vec2(0.0),vec2(1.0));
95988
- #if __VERSION__==100
95989
- vec2 f_ab=texture2D(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
95990
- #else
95991
- vec2 f_ab=texture(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96199
+ return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}
95992
96200
  #endif
95993
- vec3 specularLight=getSpecularLight(reflection,lod);vec3 Fr=max(vec3(1.0-roughness),F0)-F0;vec3 k_S=mix(F0+Fr*pow(1.0-NdotV,5.0),iridescenceFresnel,iridescenceFactor);vec3 FssEss=k_S*f_ab.x+f_ab.y;return specularWeight*specularLight*FssEss;}vec3 getIBLRadianceLambertianIridescence(const in vec3 n,const in vec3 v,const in float roughness,const in vec3 diffuseColor,const in vec3 F0,const in vec3 iridescenceF0,const in float iridescenceFactor,const in float specularWeight){float NdotV=clamp(dot(n,v),0.0,1.0);vec2 brdfSamplePoint=clamp(vec2(NdotV,roughness),vec2(0.0,0.0),vec2(1.0,1.0));
96201
+ vec3 getIBLGGXFresnel(const in vec3 n,const in vec3 v,const in float roughness,const in vec3 F0,const in float specularWeight){float NdotV=clamp(dot(n,v),0.0,1.0);vec2 brdfSamplePoint=clamp(vec2(NdotV,roughness),vec2(0.0),vec2(1.0));
95994
96202
  #if __VERSION__==100
95995
96203
  vec2 f_ab=texture2D(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
95996
96204
  #else
95997
96205
  vec2 f_ab=texture(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
95998
96206
  #endif
95999
- vec3 irradiance=getDiffuseLight(n);vec3 iridescenceF0Max=vec3(max(max(iridescenceF0.r,iridescenceF0.g),iridescenceF0.b));vec3 mixedF0=mix(F0,iridescenceF0Max,iridescenceFactor);vec3 Fr=max(vec3(1.0-roughness),mixedF0)-mixedF0;vec3 k_S=mixedF0+Fr*pow(1.0-NdotV,5.0);vec3 FssEss=specularWeight*k_S*f_ab.x+f_ab.y;float Ems=(1.0-(f_ab.x+f_ab.y));vec3 F_avg=specularWeight*(mixedF0+(1.0-mixedF0)/21.0);vec3 FmsEms=Ems*FssEss*F_avg/(1.0-F_avg*Ems);vec3 k_D=diffuseColor*(1.0-FssEss+FmsEms);return(FmsEms+k_D)*irradiance;}
96000
- #endif
96207
+ vec3 Fr=max(vec3(1.0-roughness),F0)-F0;vec3 k_S=F0+Fr*pow(1.0-NdotV,5.0);vec3 FssEss=specularWeight*(k_S*f_ab.x+f_ab.y);float Ems=(1.0-(f_ab.x+f_ab.y));vec3 F_avg=specularWeight*(F0+(1.0-F0)/21.0);vec3 FmsEms=Ems*FssEss*F_avg/(1.0-F_avg*Ems);return FssEss+FmsEms;}vec3 getIBLRadianceGGX(const in vec3 n,const in vec3 v,const in float roughness){float NdotV=clamp(dot(n,v),0.0,1.0);float lod=sqrt(roughness)*float(x3d_EnvironmentLightSource.specularTextureLevels);vec3 reflection=normalize(reflect(-v,n));vec3 specularLight=getSpecularLight(reflection,lod);return specularLight;}
96001
96208
  #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96002
96209
  uniform sampler2D x3d_TransmissionFramebufferSamplerEXT;uniform ivec2 x3d_TransmissionFramebufferSizeEXT;uniform ivec4 x3d_Viewport;vec3 getTransmissionSample(in vec2 fragCoord,const in float roughness,const in float ior){fragCoord=fragCoord*vec2(x3d_Viewport.zw)/vec2(x3d_TransmissionFramebufferSizeEXT)+vec2(x3d_Viewport.xy)/vec2(x3d_Viewport.zw);
96003
96210
  #if __VERSION__==100
@@ -96025,16 +96232,10 @@ vec2 brdf=texture(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96025
96232
  vec3 specularColor=f0*brdf.x+f90*brdf.y;return(1.0-specularColor)*attenuatedColor*baseColor;}
96026
96233
  #endif
96027
96234
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
96028
- vec3 getIBLRadianceAnisotropy(const in vec3 n,const in vec3 v,const in float roughness,const in float anisotropy,const in vec3 anisotropyDirection,const in vec3 F0,const in float specularWeight){float NdotV=clamp(dot(n,v),0.0,1.0);float tangentRoughness=mix(roughness,1.0,anisotropy*anisotropy);vec3 anisotropicTangent=cross(anisotropyDirection,v);vec3 anisotropicNormal=cross(anisotropicTangent,anisotropyDirection);float bendFactor=1.0-anisotropy*(1.0-roughness);float bendFactorPow4=bendFactor*bendFactor*bendFactor*bendFactor;vec3 bentNormal=normalize(mix(anisotropicNormal,n,bendFactorPow4));float lod=roughness*float(x3d_EnvironmentLightSource.specularTextureLevels);vec3 reflection=normalize(reflect(-v,bentNormal));vec2 brdfSamplePoint=clamp(vec2(NdotV,roughness),vec2(0.0),vec2(1.0));
96029
- #if __VERSION__==100
96030
- vec2 f_ab=texture2D(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96031
- #else
96032
- vec2 f_ab=texture(x3d_EnvironmentLightSource.GGXLUTTexture,brdfSamplePoint).rg;
96033
- #endif
96034
- vec3 specularLight=getSpecularLight(reflection,lod);vec3 Fr=max(vec3(1.0-roughness),F0)-F0;vec3 k_S=F0+Fr*pow(1.0-NdotV,5.0);vec3 FssEss=k_S*f_ab.x+f_ab.y;return specularWeight*specularLight*FssEss;}
96235
+ vec3 getIBLRadianceAnisotropy(const in vec3 n,const in vec3 v,const in float roughness,const in float anisotropy,const in vec3 anisotropyDirection){float NdotV=clamp(dot(n,v),0.0,1.0);float tangentRoughness=mix(roughness,1.0,anisotropy*anisotropy);vec3 anisotropicTangent=cross(anisotropyDirection,v);vec3 anisotropicNormal=cross(anisotropicTangent,anisotropyDirection);float bendFactor=1.0-anisotropy*(1.0-roughness);float bendFactorPow4=bendFactor*bendFactor*bendFactor*bendFactor;vec3 bentNormal=normalize(mix(anisotropicNormal,n,bendFactorPow4));float lod=sqrt(roughness)*float(x3d_EnvironmentLightSource.specularTextureLevels);vec3 reflection=normalize(reflect(-v,bentNormal));vec3 specularLight=getSpecularLight(reflection,lod);return specularLight;}
96035
96236
  #endif
96036
96237
  #if defined(X3D_SHEEN_MATERIAL_EXT)
96037
- vec3 getIBLRadianceCharlie(const in vec3 n,const in vec3 v,const in float sheenRoughness,const in vec3 sheenColor){float NdotV=clamp(dot(n,v),0.0,1.0);float lod=sheenRoughness*float(x3d_EnvironmentLightSource.specularTextureLevels);vec3 reflection=normalize(reflect(-v,n));vec2 brdfSamplePoint=clamp(vec2(NdotV,sheenRoughness),vec2(0.0),vec2(1.0));
96238
+ vec3 getIBLRadianceCharlie(const in vec3 n,const in vec3 v,const in float sheenRoughness,const in vec3 sheenColor){float NdotV=clamp(dot(n,v),0.0,1.0);float lod=sheenRoughness*float(x3d_EnvironmentLightSource.diffuseTextureLevels);vec3 reflection=normalize(reflect(-v,n));vec2 brdfSamplePoint=clamp(vec2(NdotV,sheenRoughness),vec2(0.0),vec2(1.0));
96038
96239
  #if __VERSION__==100
96039
96240
  float brdf=texture2D(x3d_EnvironmentLightSource.CharlieLUTTexture,brdfSamplePoint).b;
96040
96241
  #else
@@ -96062,7 +96263,7 @@ x_ite_Namespace .add ("Iridescence2.glsl", "assets/shaders/webgl2/pbr/Iridescenc
96062
96263
 
96063
96264
 
96064
96265
  const MaterialInfo2_glsl_default_ = /* glsl */ `
96065
- struct MaterialInfo{float ior;float perceptualRoughness;vec3 f0;float alphaRoughness;vec3 c_diff;vec3 f90;float metallic;vec3 baseColor;float sheenRoughnessFactor;vec3 sheenColorFactor;vec3 clearcoatF0;vec3 clearcoatF90;float clearcoatFactor;vec3 clearcoatNormal;float clearcoatRoughness;float specularWeight;float transmissionFactor;float thickness;vec3 attenuationColor;float attenuationDistance;float iridescenceFactor;float iridescenceIor;float iridescenceThickness;vec3 anisotropicT;vec3 anisotropicB;float anisotropyStrength;float dispersion;};
96266
+ struct MaterialInfo{float ior;float perceptualRoughness;vec3 f0_dielectric;float alphaRoughness;float fresnel_w;vec3 f90;vec3 f90_dielectric;float metallic;vec3 baseColor;float sheenRoughnessFactor;vec3 sheenColorFactor;vec3 clearcoatF0;vec3 clearcoatF90;float clearcoatFactor;vec3 clearcoatNormal;float clearcoatRoughness;float specularWeight;float transmissionFactor;float thickness;vec3 attenuationColor;float attenuationDistance;float iridescenceFactor;float iridescenceIor;float iridescenceThickness;float diffuseTransmissionFactor;vec3 diffuseTransmissionColorFactor;vec3 anisotropicT;vec3 anisotropicB;float anisotropyStrength;float dispersion;};
96066
96267
  #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
96067
96268
  ${MaterialTextures .texture ("x3d_DiffuseTexture", "rgba", "linear")}
96068
96269
  #elif defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
@@ -96093,11 +96294,11 @@ baseColor=getTextureColor(baseColor,vec4(vec3(1.0),alpha));
96093
96294
  return baseColor;}
96094
96295
  #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
96095
96296
  ${MaterialTextures .texture ("x3d_SpecularGlossinessTexture", "rgba", "linear")}
96096
- MaterialInfo getSpecularGlossinessInfo(in MaterialInfo info){info.f0=x3d_Material.specularColor;info.perceptualRoughness=x3d_Material.glossiness;
96297
+ MaterialInfo getSpecularGlossinessInfo(in MaterialInfo info){info.f0_dielectric=x3d_Material.specularColor;info.perceptualRoughness=x3d_Material.glossiness;
96097
96298
  #if defined(X3D_SPECULAR_GLOSSINESS_TEXTURE)
96098
- vec4 sgSample=getSpecularGlossinessTexture();info.perceptualRoughness*=sgSample.a;info.f0*=sgSample.rgb;
96299
+ vec4 sgSample=getSpecularGlossinessTexture();info.perceptualRoughness*=sgSample.a;info.f0_dielectric*=sgSample.rgb;
96099
96300
  #endif
96100
- info.perceptualRoughness=1.0-info.perceptualRoughness;info.c_diff=info.baseColor.rgb*(1.0-max(max(info.f0.r,info.f0.g),info.f0.b));return info;}
96301
+ info.perceptualRoughness=1.0-info.perceptualRoughness;return info;}
96101
96302
  #endif
96102
96303
  #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
96103
96304
  ${MaterialTextures .texture ("x3d_MetallicRoughnessTexture")}
@@ -96105,7 +96306,7 @@ MaterialInfo getMetallicRoughnessInfo(in MaterialInfo info){info.metallic=x3d_Ma
96105
96306
  #if defined(X3D_METALLIC_ROUGHNESS_TEXTURE)
96106
96307
  vec4 mrSample=getMetallicRoughnessTexture();info.metallic*=mrSample.b;info.perceptualRoughness*=mrSample.g;
96107
96308
  #endif
96108
- info.c_diff=mix(info.baseColor.rgb,vec3(0.0),info.metallic);info.f0=mix(info.f0,info.baseColor.rgb,info.metallic);return info;}
96309
+ return info;}
96109
96310
  #endif
96110
96311
  ${MaterialTextures .texture ("x3d_EmissiveTexture", "rgb", "linear")}
96111
96312
  #if defined(X3D_EMISSIVE_STRENGTH_MATERIAL_EXT)
@@ -96128,7 +96329,7 @@ return 1.0;
96128
96329
  #endif
96129
96330
  }
96130
96331
  #if defined(X3D_IOR_MATERIAL_EXT)
96131
- uniform float x3d_IorEXT;MaterialInfo getIorInfo(in MaterialInfo info){info.f0=vec3(pow((x3d_IorEXT-1.0)/(x3d_IorEXT+1.0),2.0));info.ior=x3d_IorEXT;return info;}
96332
+ uniform float x3d_IorEXT;MaterialInfo getIorInfo(in MaterialInfo info){info.f0_dielectric=vec3(pow((x3d_IorEXT-1.0)/(x3d_IorEXT+1.0),2.0));info.ior=x3d_IorEXT;return info;}
96132
96333
  #endif
96133
96334
  #if defined(X3D_SHEEN_MATERIAL_EXT)
96134
96335
  ${MaterialTextures .texture ("x3d_SheenColorTextureEXT",
@@ -96149,6 +96350,19 @@ return texture(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;
96149
96350
  #endif
96150
96351
  }
96151
96352
  #endif
96353
+ #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
96354
+ ${MaterialTextures .texture ("x3d_DiffuseTransmissionTextureEXT",
96355
+ "a")}
96356
+ ${MaterialTextures .texture ("x3d_DiffuseTransmissionColorTextureEXT", "rgb", "linear")}
96357
+ uniform float x3d_DiffuseTransmissionEXT;uniform vec3 x3d_DiffuseTransmissionColorEXT;MaterialInfo getDiffuseTransmissionInfo(in MaterialInfo info){info.diffuseTransmissionFactor=x3d_DiffuseTransmissionEXT;info.diffuseTransmissionColorFactor=x3d_DiffuseTransmissionColorEXT;
96358
+ #if defined(X3D_DIFFUSE_TRANSMISSION_TEXTURE_EXT)
96359
+ info.diffuseTransmissionFactor*=getDiffuseTransmissionTextureEXT();
96360
+ #endif
96361
+ #if defined(X3D_DIFFUSE_TRANSMISSION_COLOR_TEXTURE_EXT)
96362
+ info.diffuseTransmissionColorFactor*=getDiffuseTransmissionColorTextureEXT();
96363
+ #endif
96364
+ return info;}
96365
+ #endif
96152
96366
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96153
96367
  ${MaterialTextures .texture ("x3d_ClearcoatTextureEXT",
96154
96368
  "r")}
@@ -96184,7 +96398,7 @@ specularTexture.a=getSpecularTextureEXT();
96184
96398
  #if defined(X3D_SPECULAR_COLOR_TEXTURE_EXT)
96185
96399
  specularTexture.rgb=getSpecularColorTextureEXT();
96186
96400
  #endif
96187
- vec3 dielectricSpecularF0=min(info.f0*x3d_SpecularColorEXT*specularTexture.rgb,vec3(1.0));info.f0=mix(dielectricSpecularF0,info.baseColor.rgb,info.metallic);info.specularWeight=x3d_SpecularEXT*specularTexture.a;info.c_diff=mix(info.baseColor.rgb,vec3(0.0),info.metallic);return info;}
96401
+ info.f0_dielectric=min(info.f0_dielectric*x3d_SpecularColorEXT*specularTexture.rgb,vec3(1.0));info.specularWeight=x3d_SpecularEXT*specularTexture.a;info.f90_dielectric=vec3(info.specularWeight);return info;}
96188
96402
  #endif
96189
96403
  #if defined(X3D_VOLUME_MATERIAL_EXT)
96190
96404
  ${MaterialTextures .texture ("x3d_ThicknessTextureEXT", "g")}
@@ -96258,12 +96472,11 @@ vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
96258
96472
  #if defined(X3D_TEXTURE_PROJECTION)
96259
96473
  baseColor.rgb*=getTextureProjectorColor();
96260
96474
  #endif
96261
- #if!defined(X3D_UNLIT_MATERIAL_EXT)
96262
- vec3 v=normalize(-vertex);
96475
+ vec3 color=vec3(0.0);vec3 v=normalize(-vertex);
96263
96476
  #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)||defined(X3D_ANISOTROPY_MATERIAL_EXT)||defined(X3D_CLEARCOAT_MATERIAL_EXT)
96264
96477
  NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.0,1.0);
96265
96478
  #endif
96266
- MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
96479
+ MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0_dielectric=vec3(0.04);materialInfo.specularWeight=1.0;materialInfo.f90=vec3(1.0);materialInfo.f90_dielectric=materialInfo.f90;
96267
96480
  #if defined(X3D_IOR_MATERIAL_EXT)
96268
96481
  materialInfo=getIorInfo(materialInfo);
96269
96482
  #endif
@@ -96291,80 +96504,100 @@ materialInfo=getVolumeInfo(materialInfo);
96291
96504
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96292
96505
  materialInfo=getIridescenceInfo(materialInfo);
96293
96506
  #endif
96507
+ #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
96508
+ materialInfo=getDiffuseTransmissionInfo(materialInfo);
96509
+ #endif
96294
96510
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
96295
96511
  materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
96296
96512
  #endif
96297
- materialInfo.perceptualRoughness=clamp(materialInfo.perceptualRoughness,0.0,1.0);materialInfo.metallic=clamp(materialInfo.metallic,0.0,1.0);materialInfo.alphaRoughness=materialInfo.perceptualRoughness*materialInfo.perceptualRoughness;float reflectance=max3(materialInfo.f0);materialInfo.f90=vec3(1.0);vec3 f_specular=vec3(0.0);vec3 f_diffuse=vec3(0.0);vec3 f_emissive=vec3(0.0);vec3 f_clearcoat=vec3(0.0);vec3 f_sheen=vec3(0.0);vec3 f_transmission=vec3(0.0);float albedoSheenScaling=1.0;
96513
+ materialInfo.perceptualRoughness=clamp(materialInfo.perceptualRoughness,0.0,1.0);materialInfo.metallic=clamp(materialInfo.metallic,0.0,1.0);materialInfo.alphaRoughness=materialInfo.perceptualRoughness*materialInfo.perceptualRoughness;float reflectance=max3(materialInfo.f0_dielectric);vec3 f_specular_dielectric=vec3(0.0);vec3 f_specular_metal=vec3(0.0);vec3 f_diffuse=vec3(0.0);vec3 f_dielectric_brdf_ibl=vec3(0.0);vec3 f_metal_brdf_ibl=vec3(0.0);vec3 f_emissive=vec3(0.0);vec3 clearcoat_brdf=vec3(0.0);vec3 f_sheen=vec3(0.0);vec3 f_specular_transmission=vec3(0.0);vec3 f_diffuse_transmission=vec3(0.0);float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);float albedoSheenScaling=1.0;float diffuseTransmissionThickness=1.0;
96298
96514
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)&&(defined(X3D_USE_IBL)||defined(X3D_LIGHTING))
96299
- vec3 iridescenceFresnel=evalIridescence(1.0,materialInfo.iridescenceIor,NdotV,materialInfo.iridescenceThickness,materialInfo.f0);vec3 iridescenceF0=Schlick_to_F0(iridescenceFresnel,NdotV);if(materialInfo.iridescenceThickness==0.0)materialInfo.iridescenceFactor=0.0;
96515
+ vec3 iridescenceFresnel_dielectric=evalIridescence(1.0,materialInfo.iridescenceIor,NdotV,materialInfo.iridescenceThickness,materialInfo.f0_dielectric);vec3 iridescenceFresnel_metallic=evalIridescence(1.0,materialInfo.iridescenceIor,NdotV,materialInfo.iridescenceThickness,baseColor.rgb);if(materialInfo.iridescenceThickness==0.0)materialInfo.iridescenceFactor=0.0;
96516
+ #endif
96517
+ #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
96518
+ #if defined(X3D_VOLUME_MATERIAL_EXT)
96519
+ diffuseTransmissionThickness=materialInfo.thickness*(length(vec3(u_ModelMatrix[0].xyz))+length(vec3(u_ModelMatrix[1].xyz))+length(vec3(u_ModelMatrix[2].xyz)))/3.0;
96520
+ #endif
96521
+ #endif
96522
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96523
+ clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));
96300
96524
  #endif
96301
96525
  #if defined(X3D_USE_IBL)
96302
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96303
- f_specular+=getIBLRadianceGGXIridescence(n,v,materialInfo.perceptualRoughness,materialInfo.f0,iridescenceFresnel,materialInfo.iridescenceFactor,materialInfo.specularWeight);f_diffuse+=getIBLRadianceLambertianIridescence(n,v,materialInfo.perceptualRoughness,materialInfo.c_diff,materialInfo.f0,iridescenceF0,materialInfo.iridescenceFactor,materialInfo.specularWeight);
96304
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
96305
- f_specular+=getIBLRadianceAnisotropy(n,v,materialInfo.perceptualRoughness,materialInfo.anisotropyStrength,materialInfo.anisotropicB,materialInfo.f0,materialInfo.specularWeight);f_diffuse+=getIBLRadianceLambertian(n,v,materialInfo.perceptualRoughness,materialInfo.c_diff,materialInfo.f0,materialInfo.specularWeight);
96526
+ f_diffuse=getDiffuseLight(n)*baseColor.rgb;
96527
+ #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
96528
+ vec3 diffuseTransmissionIBL=getDiffuseLight(-n)*materialInfo.diffuseTransmissionColorFactor;
96529
+ #if defined(X3D_VOLUME_MATERIAL_EXT)
96530
+ diffuseTransmissionIBL=applyVolumeAttenuation(diffuseTransmissionIBL,diffuseTransmissionThickness,materialInfo.attenuationColor,materialInfo.attenuationDistance);
96531
+ #endif
96532
+ f_diffuse=mix(f_diffuse,diffuseTransmissionIBL,materialInfo.diffuseTransmissionFactor);
96533
+ #endif
96534
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96535
+ f_specular_transmission+=getIBLVolumeRefraction(n,v,materialInfo.perceptualRoughness,baseColor.rgb,materialInfo.f0_dielectric,materialInfo.f90,vertex,x3d_ModelViewMatrix,x3d_ProjectionMatrix,materialInfo.ior,materialInfo.thickness,materialInfo.attenuationColor,materialInfo.attenuationDistance,materialInfo.dispersion);f_diffuse=mix(f_diffuse,f_specular_transmission,materialInfo.transmissionFactor);
96536
+ #endif
96537
+ #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
96538
+ f_specular_metal=getIBLRadianceAnisotropy(n,v,materialInfo.perceptualRoughness,materialInfo.anisotropyStrength,materialInfo.anisotropicB);f_specular_dielectric=f_specular_metal;
96306
96539
  #else
96307
- f_specular+=getIBLRadianceGGX(n,v,materialInfo.perceptualRoughness,materialInfo.f0,materialInfo.specularWeight);f_diffuse+=getIBLRadianceLambertian(n,v,materialInfo.perceptualRoughness,materialInfo.c_diff,materialInfo.f0,materialInfo.specularWeight);
96540
+ f_specular_metal=getIBLRadianceGGX(n,v,materialInfo.perceptualRoughness);f_specular_dielectric=f_specular_metal;
96541
+ #endif
96542
+ vec3 f_metal_fresnel_ibl=getIBLGGXFresnel(n,v,materialInfo.perceptualRoughness,baseColor.rgb,1.0);f_metal_brdf_ibl=f_metal_fresnel_ibl*f_specular_metal;vec3 f_dielectric_fresnel_ibl=getIBLGGXFresnel(n,v,materialInfo.perceptualRoughness,materialInfo.f0_dielectric,materialInfo.specularWeight);f_dielectric_brdf_ibl=mix(f_diffuse,f_specular_dielectric,f_dielectric_fresnel_ibl);
96543
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96544
+ f_metal_brdf_ibl=mix(f_metal_brdf_ibl,f_specular_metal*iridescenceFresnel_metallic,materialInfo.iridescenceFactor);f_dielectric_brdf_ibl=mix(f_dielectric_brdf_ibl,rgb_mix(f_diffuse,f_specular_dielectric,iridescenceFresnel_dielectric),materialInfo.iridescenceFactor);
96308
96545
  #endif
96309
96546
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96310
- f_clearcoat+=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness,materialInfo.clearcoatF0,1.0);
96547
+ clearcoat_brdf=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness);
96311
96548
  #endif
96312
96549
  #if defined(X3D_SHEEN_MATERIAL_EXT)
96313
- f_sheen+=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
96550
+ f_sheen=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
96314
96551
  #endif
96315
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96316
- f_transmission+=getIBLVolumeRefraction(n,v,materialInfo.perceptualRoughness,materialInfo.c_diff,materialInfo.f0,materialInfo.f90,vertex,x3d_ModelViewMatrix,x3d_ProjectionMatrix,materialInfo.ior,materialInfo.thickness,materialInfo.attenuationColor,materialInfo.attenuationDistance,materialInfo.dispersion);
96552
+ color=mix(f_dielectric_brdf_ibl,f_metal_brdf_ibl,materialInfo.metallic);color=f_sheen+color*albedoSheenScaling;color=mix(color,clearcoat_brdf,clearcoatFactor*clearcoatFresnel);
96317
96553
  #endif
96554
+ #if defined(X3D_OCCLUSION_TEXTURE)
96555
+ float ao=getOcclusionFactor();color*=1.0+x3d_Material.occlusionStrength*(ao-1.0);
96318
96556
  #endif
96319
- vec3 f_diffuse_ibl=f_diffuse;vec3 f_specular_ibl=f_specular;vec3 f_sheen_ibl=f_sheen;vec3 f_clearcoat_ibl=f_clearcoat;f_diffuse=vec3(0.0);f_specular=vec3(0.0);f_sheen=vec3(0.0);f_clearcoat=vec3(0.0);
96557
+ f_diffuse=vec3(0.0);f_specular_dielectric=vec3(0.0);f_specular_metal=vec3(0.0);vec3 f_dielectric_brdf=vec3(0.0);vec3 f_metal_brdf=vec3(0.0);
96320
96558
  #if defined(X3D_LIGHTING)
96321
- for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 pointToLight;float distanceToLight;if(light.type!=x3d_DirectionalLight){pointToLight=light.location-vertex;distanceToLight=length(light.matrix*pointToLight);}else{pointToLight=-light.direction;distanceToLight=-1.0;}if(distanceToLight<=light.radius||light.radius<0.0){vec3 l=normalize(pointToLight);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.0,1.0);float NdotH=clamp(dot(n,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);if(NdotL>0.0||NdotV>0.0){vec3 intensity=getLightIntensity(light,l,distanceToLight);
96559
+ for(int i=0;i<X3D_NUM_LIGHTS;++i){x3d_LightSourceParameters light=x3d_LightSource[i];vec3 pointToLight;float distanceToLight;if(light.type!=x3d_DirectionalLight){pointToLight=light.location-vertex;distanceToLight=length(light.matrix*pointToLight);}else{pointToLight=-light.direction;distanceToLight=-1.0;}if(distanceToLight<=light.radius||light.radius<0.0){vec3 l=normalize(pointToLight);vec3 h=normalize(l+v);float NdotL=clamp(dot(n,l),0.0,1.0);float NdotH=clamp(dot(n,h),0.0,1.0);float VdotH=clamp(dot(v,h),0.0,1.0);vec3 dielectric_fresnel=F_Schlick(materialInfo.f0_dielectric*materialInfo.specularWeight,materialInfo.f90_dielectric,abs(VdotH));vec3 metal_fresnel=F_Schlick(baseColor.rgb,vec3(1.0),abs(VdotH));vec3 lightIntensity=getLightIntensity(light,l,distanceToLight);
96322
96560
  #if defined(X3D_SHADOWS)
96323
- intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
96561
+ lightIntensity=mix(lightIntensity,light.shadowColor,getShadowIntensity(i,light));
96324
96562
  #endif
96325
- vec3 l_diffuse=vec3(0.0);vec3 l_specular=vec3(0.0);
96326
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96327
- l_diffuse+=intensity*NdotL*BRDF_lambertianIridescence(materialInfo.f0,materialInfo.f90,iridescenceFresnel,materialInfo.iridescenceFactor,materialInfo.c_diff,materialInfo.specularWeight,VdotH);l_specular+=intensity*NdotL*BRDF_specularGGXIridescence(materialInfo.f0,materialInfo.f90,iridescenceFresnel,materialInfo.alphaRoughness,materialInfo.iridescenceFactor,materialInfo.specularWeight,VdotH,NdotL,NdotV,NdotH);
96328
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
96329
- l_diffuse+=intensity*NdotL*BRDF_lambertian(materialInfo.f0,materialInfo.f90,materialInfo.c_diff,materialInfo.specularWeight,VdotH);l_specular+=intensity*NdotL*BRDF_specularGGXAnisotropy(materialInfo.f0,materialInfo.f90,materialInfo.alphaRoughness,materialInfo.anisotropyStrength,n,v,l,h,materialInfo.anisotropicT,materialInfo.anisotropicB);
96330
- #else
96331
- l_diffuse+=intensity*NdotL*BRDF_lambertian(materialInfo.f0,materialInfo.f90,materialInfo.c_diff,materialInfo.specularWeight,VdotH);l_specular+=intensity*NdotL*BRDF_specularGGX(materialInfo.f0,materialInfo.f90,materialInfo.alphaRoughness,materialInfo.specularWeight,VdotH,NdotL,NdotV,NdotH);
96563
+ vec3 l_diffuse=lightIntensity*NdotL*BRDF_lambertian(baseColor.rgb);vec3 l_specular_dielectric=vec3(0.0);vec3 l_specular_metal=vec3(0.0);vec3 l_dielectric_brdf=vec3(0.0);vec3 l_metal_brdf=vec3(0.0);vec3 l_clearcoat_brdf=vec3(0.0);vec3 l_sheen=vec3(0.0);float l_albedoSheenScaling=1.0;
96564
+ #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
96565
+ vec3 diffuse_btdf=lightIntensity*clamp(dot(-n,l),0.0,1.0)*BRDF_lambertian(materialInfo.diffuseTransmissionColorFactor);
96566
+ #if defined(X3D_VOLUME_MATERIAL_EXT)
96567
+ diffuse_btdf=applyVolumeAttenuation(diffuse_btdf,diffuseTransmissionThickness,materialInfo.attenuationColor,materialInfo.attenuationDistance);
96332
96568
  #endif
96333
- #if defined(X3D_SHEEN_MATERIAL_EXT)
96334
- f_sheen+=intensity*getPunctualRadianceSheen(materialInfo.sheenColorFactor,materialInfo.sheenRoughnessFactor,NdotL,NdotV,NdotH);float l_albedoSheenScaling=min(1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor),1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotL,materialInfo.sheenRoughnessFactor));l_diffuse*=l_albedoSheenScaling;l_specular*=l_albedoSheenScaling;
96569
+ l_diffuse=mix(l_diffuse,diffuse_btdf,materialInfo.diffuseTransmissionFactor);
96335
96570
  #endif
96336
- f_diffuse+=l_diffuse;f_specular+=l_specular;
96337
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96338
- f_clearcoat+=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
96339
- #endif
96340
- }
96341
96571
  #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96342
- vec3 transmissionRay=getVolumeTransmissionRay(n,v,materialInfo.thickness,materialInfo.ior,x3d_ModelViewMatrix);pointToLight-=transmissionRay;l=normalize(pointToLight);vec3 intensity=getLightIntensity(light,pointToLight,distanceToLight);vec3 transmittedLight=intensity*getPunctualRadianceTransmission(n,v,l,materialInfo.alphaRoughness,materialInfo.f0,materialInfo.f90,materialInfo.c_diff,materialInfo.ior);
96572
+ vec3 transmissionRay=getVolumeTransmissionRay(n,v,materialInfo.thickness,materialInfo.ior,x3d_ModelViewMatrix);pointToLight-=transmissionRay;l=normalize(pointToLight);vec3 transmittedLight=lightIntensity*getPunctualRadianceTransmission(n,v,l,materialInfo.alphaRoughness,materialInfo.f0_dielectric,materialInfo.f90,baseColor.rgb,materialInfo.ior);
96343
96573
  #if defined(X3D_VOLUME_MATERIAL_EXT)
96344
96574
  transmittedLight=applyVolumeAttenuation(transmittedLight,length(transmissionRay),materialInfo.attenuationColor,materialInfo.attenuationDistance);
96345
96575
  #endif
96346
- f_transmission+=transmittedLight;
96576
+ l_diffuse=mix(l_diffuse,transmittedLight,materialInfo.transmissionFactor);
96347
96577
  #endif
96348
- }}
96349
- #endif
96350
- f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
96351
- #if defined(X3D_OCCLUSION_TEXTURE)
96352
- float ao=getOcclusionFactor();float occlusionStrength=x3d_Material.occlusionStrength;diffuse=f_diffuse+mix(f_diffuse_ibl,f_diffuse_ibl*ao,occlusionStrength)*albedoSheenScaling;specular=f_specular+mix(f_specular_ibl,f_specular_ibl*ao,occlusionStrength)*albedoSheenScaling;sheen=f_sheen+mix(f_sheen_ibl,f_sheen_ibl*ao,occlusionStrength);clearcoat=f_clearcoat+mix(f_clearcoat_ibl,f_clearcoat_ibl*ao,occlusionStrength);
96578
+ vec3 intensity=getLightIntensity(light,l,length(light.matrix*pointToLight));
96579
+ #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
96580
+ l_specular_metal=intensity*NdotL*BRDF_specularGGXAnisotropy(materialInfo.alphaRoughness,materialInfo.anisotropyStrength,n,v,l,h,materialInfo.anisotropicT,materialInfo.anisotropicB);l_specular_dielectric=l_specular_metal;
96353
96581
  #else
96354
- diffuse=f_diffuse_ibl*albedoSheenScaling+f_diffuse;specular=f_specular_ibl*albedoSheenScaling+f_specular;sheen=f_sheen_ibl+f_sheen;clearcoat=f_clearcoat_ibl+f_clearcoat;
96582
+ l_specular_metal=intensity*NdotL*BRDF_specularGGX(materialInfo.alphaRoughness,NdotL,NdotV,NdotH);l_specular_dielectric=l_specular_metal;
96583
+ #endif
96584
+ l_metal_brdf=metal_fresnel*l_specular_metal;l_dielectric_brdf=mix(l_diffuse,l_specular_dielectric,dielectric_fresnel);
96585
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96586
+ l_metal_brdf=mix(l_metal_brdf,l_specular_metal*iridescenceFresnel_metallic,materialInfo.iridescenceFactor);l_dielectric_brdf=mix(l_dielectric_brdf,rgb_mix(l_diffuse,l_specular_dielectric,iridescenceFresnel_dielectric),materialInfo.iridescenceFactor);
96355
96587
  #endif
96356
96588
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96357
- clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));clearcoat*=clearcoatFactor;
96589
+ l_clearcoat_brdf=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
96358
96590
  #endif
96359
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96360
- diffuse=mix(diffuse,f_transmission,materialInfo.transmissionFactor);
96591
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96592
+ l_sheen=intensity*getPunctualRadianceSheen(materialInfo.sheenColorFactor,materialInfo.sheenRoughnessFactor,NdotL,NdotV,NdotH);l_albedoSheenScaling=min(1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor),1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotL,materialInfo.sheenRoughnessFactor));
96361
96593
  #endif
96594
+ vec3 l_color=mix(l_dielectric_brdf,l_metal_brdf,materialInfo.metallic);l_color=l_sheen+l_color*l_albedoSheenScaling;l_color=mix(l_color,l_clearcoat_brdf,clearcoatFactor*clearcoatFresnel);color+=l_color;}}
96362
96595
  #endif
96363
- vec3 color=vec3(0.0);
96596
+ f_emissive=getEmissiveColor();
96364
96597
  #if defined(X3D_UNLIT_MATERIAL_EXT)
96365
96598
  color=baseColor.rgb;
96366
96599
  #else
96367
- color=f_emissive+diffuse+specular;color=sheen+color;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
96600
+ color=f_emissive*(1.0-clearcoatFactor*clearcoatFresnel)+color;
96368
96601
  #endif
96369
96602
  return vec4(color,baseColor.a);}void main(){fragment_main();}`
96370
96603
  ;
@@ -96378,12 +96611,12 @@ float applyIorToRoughness(const in float roughness,const in float ior){return ro
96378
96611
  #endif
96379
96612
  #if defined(X3D_LIGHTING)
96380
96613
  #pragma X3D include "../common/Lighting.glsl"
96381
- vec3 getLightIntensity(const in x3d_LightSourceParameters light,const in vec3 pointToLight,const in float distanceToLight){float attenuationFactor=1.0;float spotFactor=1.0;if(light.type!=x3d_DirectionalLight){attenuationFactor=getAttenuation(light.attenuation,distanceToLight);}if(light.type==x3d_SpotLight){spotFactor=getSpotFactor(pointToLight,light.direction,light.cutOffAngle,light.beamWidth);}return attenuationFactor*spotFactor*light.intensity*light.color;}
96614
+ float getAttenuationPBR(const in vec3 attenuation,const in float distanceToLight,const in float radius){float d=dot(attenuation,vec3(1.0,distanceToLight,distanceToLight*distanceToLight));if(radius<=0.0)return 1.0/d;return max(min(1.0-pow(distanceToLight/radius,4.0),1.0),0.0)/d;}vec3 getLightIntensity(const in x3d_LightSourceParameters light,const in vec3 pointToLight,const in float distanceToLight){float attenuationFactor=1.0;float spotFactor=1.0;if(light.type!=x3d_DirectionalLight){attenuationFactor=getAttenuationPBR(light.attenuation,distanceToLight,light.radius);}if(light.type==x3d_SpotLight){spotFactor=getSpotFactor(pointToLight,light.direction,light.cutOffAngle,light.beamWidth);}return attenuationFactor*spotFactor*light.intensity*light.color;}
96382
96615
  #if defined(X3D_SHEEN_MATERIAL_EXT)
96383
96616
  vec3 getPunctualRadianceSheen(const in vec3 sheenColor,const in float sheenRoughness,const in float NdotL,const in float NdotV,const in float NdotH){return NdotL*BRDF_specularSheen(sheenColor,sheenRoughness,NdotL,NdotV,NdotH);}
96384
96617
  #endif
96385
96618
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96386
- vec3 getPunctualRadianceClearCoat(const in vec3 clearcoatNormal,const in vec3 v,const in vec3 l,const in vec3 h,const in float VdotH,const in vec3 f0,const in vec3 f90,const in float clearcoatRoughness){float NdotL=clamp(dot(clearcoatNormal,l),0.0,1.0);float NdotV=clamp(dot(clearcoatNormal,v),0.0,1.0);float NdotH=clamp(dot(clearcoatNormal,h),0.0,1.0);return NdotL*BRDF_specularGGX(f0,f90,clearcoatRoughness*clearcoatRoughness,1.0,VdotH,NdotL,NdotV,NdotH);}
96619
+ vec3 getPunctualRadianceClearCoat(const in vec3 clearcoatNormal,const in vec3 v,const in vec3 l,const in vec3 h,const in float VdotH,const in vec3 f0,const in vec3 f90,const in float clearcoatRoughness){float NdotL=clamp(dot(clearcoatNormal,l),0.0,1.0);float NdotV=clamp(dot(clearcoatNormal,v),0.0,1.0);float NdotH=clamp(dot(clearcoatNormal,h),0.0,1.0);return NdotL*BRDF_specularGGX(clearcoatRoughness*clearcoatRoughness,NdotL,NdotV,NdotH);}
96387
96620
  #endif
96388
96621
  #endif
96389
96622
  #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
@@ -96717,18 +96950,16 @@ Object .assign (ShaderCompiler .prototype,
96717
96950
 
96718
96951
  source = "";
96719
96952
 
96720
- for (let i = 0, length = lines .length; i < length; ++ i)
96953
+ for (const [i, line] of lines .entries ())
96721
96954
  {
96722
- const
96723
- line = lines [i],
96724
- match = line .match (include);
96955
+ const match = line .match (include);
96725
96956
 
96726
96957
  if (match)
96727
96958
  {
96728
- source += "#line 1 " + this .sourceFileNumbers [match [1]] + "\n";
96959
+ source += `#line 1 ${this .sourceFileNumbers [match [1]]}\n`;
96729
96960
  source += this .process (this .includes [match [1]], this .sourceFileNumbers [match [1]]);
96730
96961
  source += "\n";
96731
- source += "#line " + (i + 2) + " " + parent + "\n";
96962
+ source += `#line ${i + 2} ${parent}\n`;
96732
96963
  }
96733
96964
  else
96734
96965
  {
@@ -96747,7 +96978,7 @@ const ShaderCompiler_default_ = ShaderCompiler;
96747
96978
  x_ite_Namespace .add ("ShaderCompiler", "x_ite/Browser/Shaders/ShaderCompiler", ShaderCompiler_default_);
96748
96979
  /* harmony default export */ const Shaders_ShaderCompiler = (ShaderCompiler_default_);
96749
96980
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/ShaderPart.js
96750
- /* provided dependency */ var ShaderPart_$ = __webpack_require__(439);
96981
+ /* provided dependency */ var ShaderPart_$ = __webpack_require__(812);
96751
96982
  /*******************************************************************************
96752
96983
  *
96753
96984
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97418,7 +97649,7 @@ const X3DAppearanceNode_default_ = X3DAppearanceNode;
97418
97649
  x_ite_Namespace .add ("X3DAppearanceNode", "x_ite/Components/Shape/X3DAppearanceNode", X3DAppearanceNode_default_);
97419
97650
  /* harmony default export */ const Shape_X3DAppearanceNode = (X3DAppearanceNode_default_);
97420
97651
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/Appearance.js
97421
- /* provided dependency */ var Appearance_$ = __webpack_require__(439);
97652
+ /* provided dependency */ var Appearance_$ = __webpack_require__(812);
97422
97653
  /*******************************************************************************
97423
97654
  *
97424
97655
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98520,6 +98751,7 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98520
98751
 
98521
98752
  if (numEnvironmentLights)
98522
98753
  {
98754
+ // Although we count this kind of light here, only one is supported.
98523
98755
  options .push ("X3D_USE_IBL")
98524
98756
  options .push (`X3D_NUM_ENVIRONMENT_LIGHTS ${Math .min (numEnvironmentLights, browser .getMaxLights ())}`);
98525
98757
  }
@@ -106342,8 +106574,8 @@ const GifMedia_default_ = GifMedia;
106342
106574
  x_ite_Namespace .add ("GifMedia", "x_ite/Browser/Texturing/GifMedia", GifMedia_default_);
106343
106575
  /* harmony default export */ const Texturing_GifMedia = (GifMedia_default_);
106344
106576
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/MovieTexture.js
106345
- /* provided dependency */ var MovieTexture_$ = __webpack_require__(439);
106346
- /* provided dependency */ var SuperGif = __webpack_require__(448);
106577
+ /* provided dependency */ var MovieTexture_$ = __webpack_require__(812);
106578
+ /* provided dependency */ var SuperGif = __webpack_require__(807);
106347
106579
  /*******************************************************************************
106348
106580
  *
106349
106581
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109650,6 +109882,7 @@ x_ite_Namespace .add ("fr", "locale/fr", fr_default_);
109650
109882
 
109651
109883
 
109652
109884
  const locales = new Map ([
109885
+ ["en", undefined], // default language
109653
109886
  ["de", de],
109654
109887
  ["fr", fr],
109655
109888
  ]);
@@ -109660,7 +109893,7 @@ function getLanguage ()
109660
109893
  {
109661
109894
  const language = value .split ("-") [0];
109662
109895
 
109663
- if (locales .get (language))
109896
+ if (locales .has (language))
109664
109897
  return language;
109665
109898
  }
109666
109899
 
@@ -109675,7 +109908,7 @@ const gettext_default_ = (string) => locale .get (string) || string;
109675
109908
  x_ite_Namespace .add ("gettext", "locale/gettext", gettext_default_);
109676
109909
  /* harmony default export */ const gettext = (gettext_default_);
109677
109910
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserTimings.js
109678
- /* provided dependency */ var BrowserTimings_$ = __webpack_require__(439);
109911
+ /* provided dependency */ var BrowserTimings_$ = __webpack_require__(812);
109679
109912
  /*******************************************************************************
109680
109913
  *
109681
109914
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110309,7 +110542,7 @@ const TextCompression_default_ = TextCompression;
110309
110542
  x_ite_Namespace .add ("TextCompression", "x_ite/Browser/Core/TextCompression", TextCompression_default_);
110310
110543
  /* harmony default export */ const Core_TextCompression = (TextCompression_default_);
110311
110544
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserOptions.js
110312
- /* provided dependency */ var BrowserOptions_$ = __webpack_require__(439);
110545
+ /* provided dependency */ var BrowserOptions_$ = __webpack_require__(812);
110313
110546
  /*******************************************************************************
110314
110547
  *
110315
110548
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110943,7 +111176,7 @@ const RenderingProperties_default_ = RenderingProperties;
110943
111176
  x_ite_Namespace .add ("RenderingProperties", "x_ite/Browser/Core/RenderingProperties", RenderingProperties_default_);
110944
111177
  /* harmony default export */ const Core_RenderingProperties = (RenderingProperties_default_);
110945
111178
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/Notification.js
110946
- /* provided dependency */ var Notification_$ = __webpack_require__(439);
111179
+ /* provided dependency */ var Notification_$ = __webpack_require__(812);
110947
111180
  /*******************************************************************************
110948
111181
  *
110949
111182
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111066,8 +111299,8 @@ const Notification_default_ = Notification;
111066
111299
  x_ite_Namespace .add ("Notification", "x_ite/Browser/Core/Notification", Notification_default_);
111067
111300
  /* harmony default export */ const Core_Notification = (Notification_default_);
111068
111301
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/ContextMenu.js
111069
- /* provided dependency */ var jquery_fullscreen = __webpack_require__(531);
111070
- /* provided dependency */ var ContextMenu_$ = __webpack_require__(439);
111302
+ /* provided dependency */ var jquery_fullscreen = __webpack_require__(48);
111303
+ /* provided dependency */ var ContextMenu_$ = __webpack_require__(812);
111071
111304
  /*******************************************************************************
111072
111305
  *
111073
111306
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113812,7 +114045,7 @@ const DataStorage_default_ = DataStorage;
113812
114045
  x_ite_Namespace .add ("DataStorage", "standard/Utility/DataStorage", DataStorage_default_);
113813
114046
  /* harmony default export */ const Utility_DataStorage = (DataStorage_default_);
113814
114047
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/X3DCoreContext.js
113815
- /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(439);
114048
+ /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(812);
113816
114049
  /*******************************************************************************
113817
114050
  *
113818
114051
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114916,14 +115149,14 @@ Object .assign (Object .setPrototypeOf (ConeOptions .prototype, Base_X3DBaseNode
114916
115149
  getSideGeometry ()
114917
115150
  {
114918
115151
  if (!this .sideGeometry)
114919
- this .eventsProcessed ();
115152
+ this .build ();
114920
115153
 
114921
115154
  return this .sideGeometry;
114922
115155
  },
114923
115156
  getBottomGeometry ()
114924
115157
  {
114925
115158
  if (!this .bottomGeometry)
114926
- this .eventsProcessed ();
115159
+ this .build ();
114927
115160
 
114928
115161
  return this .bottomGeometry;
114929
115162
  },
@@ -115073,7 +115306,7 @@ Object .assign (Object .setPrototypeOf (ConeOptions .prototype, Base_X3DBaseNode
115073
115306
 
115074
115307
  point .push (new Numbers_Vector3 (0, 1, 0));
115075
115308
  },
115076
- eventsProcessed ()
115309
+ build ()
115077
115310
  {
115078
115311
  this .sideGeometry = new Geometry3D_IndexedFaceSet (this .getExecutionContext ());
115079
115312
  this .sideGeometry ._texCoord = new Texturing_TextureCoordinate (this .getExecutionContext ());
@@ -115105,6 +115338,11 @@ Object .assign (Object .setPrototypeOf (ConeOptions .prototype, Base_X3DBaseNode
115105
115338
  sideGeometry .setup ();
115106
115339
  bottomGeometry .setup ();
115107
115340
  },
115341
+ eventsProcessed ()
115342
+ {
115343
+ this .sideGeometry = null;
115344
+ this .bottomGeometry = null;
115345
+ },
115108
115346
  });
115109
115347
 
115110
115348
  Object .defineProperties (ConeOptions,
@@ -115198,21 +115436,21 @@ Object .assign (Object .setPrototypeOf (CylinderOptions .prototype, Base_X3DBase
115198
115436
  getSideGeometry ()
115199
115437
  {
115200
115438
  if (!this .sideGeometry)
115201
- this .eventsProcessed ();
115439
+ this .build ();
115202
115440
 
115203
115441
  return this .sideGeometry;
115204
115442
  },
115205
115443
  getTopGeometry ()
115206
115444
  {
115207
115445
  if (!this .topGeometry)
115208
- this .eventsProcessed ();
115446
+ this .build ();
115209
115447
 
115210
115448
  return this .topGeometry;
115211
115449
  },
115212
115450
  getBottomGeometry ()
115213
115451
  {
115214
115452
  if (!this .bottomGeometry)
115215
- this .eventsProcessed ();
115453
+ this .build ();
115216
115454
 
115217
115455
  return this .bottomGeometry;
115218
115456
  },
@@ -115401,7 +115639,7 @@ Object .assign (Object .setPrototypeOf (CylinderOptions .prototype, Base_X3DBase
115401
115639
  point .push (new Numbers_Vector3 (p .imag, 1, p .real));
115402
115640
  }
115403
115641
  },
115404
- eventsProcessed ()
115642
+ build ()
115405
115643
  {
115406
115644
  this .sideGeometry = new Geometry3D_IndexedFaceSet (this .getExecutionContext ());
115407
115645
  this .sideGeometry ._texCoord = new Texturing_TextureCoordinate (this .getExecutionContext ());
@@ -115440,6 +115678,12 @@ Object .assign (Object .setPrototypeOf (CylinderOptions .prototype, Base_X3DBase
115440
115678
  bottomGeometry .setup ();
115441
115679
  topGeometry .setup ();
115442
115680
  },
115681
+ eventsProcessed ()
115682
+ {
115683
+ this .sideGeometry = null;
115684
+ this .bottomGeometry = null;
115685
+ this .topGeometry = null;
115686
+ },
115443
115687
  });
115444
115688
 
115445
115689
  Object .defineProperties (CylinderOptions,
@@ -115533,7 +115777,7 @@ Object .assign (Object .setPrototypeOf (QuadSphereOptions .prototype, Base_X3DBa
115533
115777
  getGeometry ()
115534
115778
  {
115535
115779
  if (!this .geometry)
115536
- this .eventsProcessed ();
115780
+ this .build ();
115537
115781
 
115538
115782
  return this .geometry;
115539
115783
  },
@@ -115710,7 +115954,7 @@ Object .assign (Object .setPrototypeOf (QuadSphereOptions .prototype, Base_X3DBa
115710
115954
  // South pole
115711
115955
  point .push (new Numbers_Vector3 (0, -1, 0));
115712
115956
  },
115713
- eventsProcessed ()
115957
+ build ()
115714
115958
  {
115715
115959
  this .geometry = new Geometry3D_IndexedFaceSet (this .getExecutionContext ());
115716
115960
  this .geometry ._texCoord = new Texturing_TextureCoordinate (this .getExecutionContext ());
@@ -115732,6 +115976,10 @@ Object .assign (Object .setPrototypeOf (QuadSphereOptions .prototype, Base_X3DBa
115732
115976
  coord .setup ();
115733
115977
  geometry .setup ();
115734
115978
  },
115979
+ eventsProcessed ()
115980
+ {
115981
+ this .geometry = null;
115982
+ },
115735
115983
  });
115736
115984
 
115737
115985
  Object .defineProperties (QuadSphereOptions,
@@ -116380,14 +116628,14 @@ function tbProjectToSphere (r, x, y)
116380
116628
  {
116381
116629
  const d = Math .hypot (x, y);
116382
116630
 
116383
- if (d < r * Math .sqrt (0.5)) // Inside sphere
116631
+ if (d < r * Math .SQRT1_2) // Inside sphere
116384
116632
  {
116385
116633
  return Math .sqrt (r * r - d * d);
116386
116634
  }
116387
116635
 
116388
116636
  // On hyperbola
116389
116637
 
116390
- const t = r / Math .sqrt (2);
116638
+ const t = r / Math .SQRT2;
116391
116639
 
116392
116640
  return t * t / d;
116393
116641
  }
@@ -116398,8 +116646,8 @@ const X3DViewer_default_ = X3DViewer;
116398
116646
  x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DViewer_default_);
116399
116647
  /* harmony default export */ const Navigation_X3DViewer = (X3DViewer_default_);
116400
116648
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/ExamineViewer.js
116401
- /* provided dependency */ var jquery_mousewheel = __webpack_require__(583);
116402
- /* provided dependency */ var ExamineViewer_$ = __webpack_require__(439);
116649
+ /* provided dependency */ var jquery_mousewheel = __webpack_require__(354);
116650
+ /* provided dependency */ var ExamineViewer_$ = __webpack_require__(812);
116403
116651
  /*******************************************************************************
116404
116652
  *
116405
116653
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117315,8 +117563,8 @@ const ExamineViewer_default_ = ExamineViewer;
117315
117563
  x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer", ExamineViewer_default_);
117316
117564
  /* harmony default export */ const Navigation_ExamineViewer = (ExamineViewer_default_);
117317
117565
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/X3DFlyViewer.js
117318
- /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(583);
117319
- /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(439);
117566
+ /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(354);
117567
+ /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(812);
117320
117568
  /*******************************************************************************
117321
117569
  *
117322
117570
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118331,8 +118579,8 @@ const FlyViewer_default_ = FlyViewer;
118331
118579
  x_ite_Namespace .add ("FlyViewer", "x_ite/Browser/Navigation/FlyViewer", FlyViewer_default_);
118332
118580
  /* harmony default export */ const Navigation_FlyViewer = (FlyViewer_default_);
118333
118581
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/PlaneViewer.js
118334
- /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(583);
118335
- /* provided dependency */ var PlaneViewer_$ = __webpack_require__(439);
118582
+ /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(354);
118583
+ /* provided dependency */ var PlaneViewer_$ = __webpack_require__(812);
118336
118584
  /*******************************************************************************
118337
118585
  *
118338
118586
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118663,8 +118911,8 @@ const NoneViewer_default_ = NoneViewer;
118663
118911
  x_ite_Namespace .add ("NoneViewer", "x_ite/Browser/Navigation/NoneViewer", NoneViewer_default_);
118664
118912
  /* harmony default export */ const Navigation_NoneViewer = (NoneViewer_default_);
118665
118913
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/LookAtViewer.js
118666
- /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(583);
118667
- /* provided dependency */ var LookAtViewer_$ = __webpack_require__(439);
118914
+ /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(354);
118915
+ /* provided dependency */ var LookAtViewer_$ = __webpack_require__(812);
118668
118916
  /*******************************************************************************
118669
118917
  *
118670
118918
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119803,8 +120051,8 @@ const X3DPickingContext_default_ = X3DPickingContext;
119803
120051
  x_ite_Namespace .add ("X3DPickingContext", "x_ite/Browser/Picking/X3DPickingContext", X3DPickingContext_default_);
119804
120052
  /* harmony default export */ const Picking_X3DPickingContext = (X3DPickingContext_default_);
119805
120053
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js
119806
- /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(583);
119807
- /* provided dependency */ var PointingDevice_$ = __webpack_require__(439);
120054
+ /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(354);
120055
+ /* provided dependency */ var PointingDevice_$ = __webpack_require__(812);
119808
120056
  /*******************************************************************************
119809
120057
  *
119810
120058
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121105,7 +121353,7 @@ const MultiSampleFrameBuffer_default_ = MultiSampleFrameBuffer;
121105
121353
  x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFrameBuffer", MultiSampleFrameBuffer_default_);
121106
121354
  /* harmony default export */ const Rendering_MultiSampleFrameBuffer = (MultiSampleFrameBuffer_default_);
121107
121355
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/X3DRenderingContext.js
121108
- /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(439);
121356
+ /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(812);
121109
121357
  /*******************************************************************************
121110
121358
  *
121111
121359
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121160,7 +121408,6 @@ x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFram
121160
121408
 
121161
121409
 
121162
121410
  const
121163
- _viewport = Symbol (),
121164
121411
  _frameBuffer = Symbol (),
121165
121412
  _transmissionBuffer = Symbol (),
121166
121413
  _resizer = Symbol (),
@@ -121246,7 +121493,7 @@ Object .assign (X3DRenderingContext .prototype,
121246
121493
  },
121247
121494
  getMaxClipPlanes ()
121248
121495
  {
121249
- return 6;
121496
+ return maxClipPlanes;
121250
121497
  },
121251
121498
  getDepthSize ()
121252
121499
  {
@@ -122112,7 +122359,7 @@ const X3DSoundContext_default_ = X3DSoundContext;
122112
122359
  x_ite_Namespace .add ("X3DSoundContext", "x_ite/Browser/Sound/X3DSoundContext", X3DSoundContext_default_);
122113
122360
  /* harmony default export */ const Sound_X3DSoundContext = (X3DSoundContext_default_);
122114
122361
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/KTXDecoder.js
122115
- /* provided dependency */ var KTXDecoder_$ = __webpack_require__(439);
122362
+ /* provided dependency */ var KTXDecoder_$ = __webpack_require__(812);
122116
122363
  const KTXDecoder_default_ = class KTXDecoder
122117
122364
  {
122118
122365
  constructor (gl, externalKtxlib, scriptDir)
@@ -123726,7 +123973,7 @@ const Components_default_ = Components;
123726
123973
  x_ite_Namespace .add ("Components", "x_ite/Components", Components_default_);
123727
123974
  /* harmony default export */ const x_ite_Components = ((/* unused pure expression or super */ null && (Components_default_)));
123728
123975
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/DOMIntegration.js
123729
- /* provided dependency */ var DOMIntegration_$ = __webpack_require__(439);
123976
+ /* provided dependency */ var DOMIntegration_$ = __webpack_require__(812);
123730
123977
  /*******************************************************************************
123731
123978
  * MIT License
123732
123979
  *
@@ -124994,7 +125241,7 @@ const FieldTypes_default_ = new Configuration_FieldTypesArray (Object .values (x
124994
125241
  x_ite_Namespace .add ("FieldTypes", "x_ite/Configuration/FieldTypes", FieldTypes_default_);
124995
125242
  /* harmony default export */ const FieldTypes = (FieldTypes_default_);
124996
125243
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/X3DBrowser.js
124997
- /* provided dependency */ var X3DBrowser_$ = __webpack_require__(439);
125244
+ /* provided dependency */ var X3DBrowser_$ = __webpack_require__(812);
124998
125245
  /*******************************************************************************
124999
125246
  *
125000
125247
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125065,6 +125312,7 @@ x_ite_Namespace .add ("FieldTypes", "x_ite/Configuration/FieldTypes", FieldTypes
125065
125312
 
125066
125313
 
125067
125314
 
125315
+
125068
125316
 
125069
125317
 
125070
125318
  const
@@ -125263,7 +125511,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
125263
125511
  {
125264
125512
  function loadComponents (components, seen)
125265
125513
  {
125266
- return Promise .all (components .map (component => loadComponent .call (this, component, seen)))
125514
+ return Promise .all (components .map (component => loadComponent .call (this, component, seen)));
125267
125515
  }
125268
125516
 
125269
125517
  async function loadComponent ({ name, providerURL, external, dependencies }, seen)
@@ -125279,7 +125527,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
125279
125527
  {
125280
125528
  case "NODE":
125281
125529
  {
125282
- __webpack_require__.g .require (__webpack_require__.g .require ("url") .fileURLToPath (providerURL))
125530
+ __webpack_require__.g .require (__webpack_require__.g .require ("url") .fileURLToPath (providerURL));
125283
125531
  break;
125284
125532
  }
125285
125533
  case "BROWSER":
@@ -125314,7 +125562,10 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
125314
125562
  }
125315
125563
 
125316
125564
  // Load array of component names.
125317
- return loadComponents .call (this, component, new Set ());
125565
+ return Promise .all ([
125566
+ MikkTSpace .initialize (), // Required by Rendering component.
125567
+ loadComponents .call (this, component, new Set ()),
125568
+ ]);
125318
125569
  };
125319
125570
  })(),
125320
125571
  addConcreteNode (ConcreteNode)
@@ -126052,7 +126303,7 @@ const X3DBrowser_default_ = X3DBrowser;
126052
126303
  x_ite_Namespace .add ("X3DBrowser", "x_ite/Browser/X3DBrowser", X3DBrowser_default_);
126053
126304
  /* harmony default export */ const Browser_X3DBrowser = (X3DBrowser_default_);
126054
126305
  ;// CONCATENATED MODULE: ./src/x_ite/X3DCanvasElement.js
126055
- /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(439);
126306
+ /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(812);
126056
126307
  /*******************************************************************************
126057
126308
  *
126058
126309
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126204,8 +126455,8 @@ const X3DCanvasElement_default_ = X3DCanvasElement;
126204
126455
  x_ite_Namespace .add ("X3DCanvasElement", "x_ite/X3DCanvasElement", X3DCanvasElement_default_);
126205
126456
  /* harmony default export */ const x_ite_X3DCanvasElement = (X3DCanvasElement_default_);
126206
126457
  ;// CONCATENATED MODULE: ./src/lib/jquery.js
126207
- /* provided dependency */ var jquery_$ = __webpack_require__(439);
126208
- /* provided dependency */ var pako = __webpack_require__(964);
126458
+ /* provided dependency */ var jquery_$ = __webpack_require__(812);
126459
+ /* provided dependency */ var pako = __webpack_require__(552);
126209
126460
  Object .assign (jquery_$,
126210
126461
  {
126211
126462
  decodeText (input)
@@ -126282,14 +126533,14 @@ const jquery_default_ = jquery_$;
126282
126533
  x_ite_Namespace .add ("jquery", "lib/jquery", jquery_default_);
126283
126534
  /* harmony default export */ const jquery = ((/* unused pure expression or super */ null && (jquery_default_)));
126284
126535
  ;// CONCATENATED MODULE: ./src/lib/libtess.js
126285
- /* provided dependency */ var libtess_libtess = __webpack_require__(12);
126536
+ /* provided dependency */ var libtess_libtess = __webpack_require__(193);
126286
126537
  const libtess_default_ = libtess_libtess;
126287
126538
  ;
126288
126539
 
126289
126540
  x_ite_Namespace .add ("libtess", "lib/libtess", libtess_default_);
126290
126541
  /* harmony default export */ const lib_libtess = ((/* unused pure expression or super */ null && (libtess_default_)));
126291
126542
  ;// CONCATENATED MODULE: ./src/x_ite/X3D.js
126292
- /* provided dependency */ var X3D_$ = __webpack_require__(439);
126543
+ /* provided dependency */ var X3D_$ = __webpack_require__(812);
126293
126544
  /*******************************************************************************
126294
126545
  *
126295
126546
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126597,7 +126848,7 @@ Object .assign (X3D,
126597
126848
 
126598
126849
  // Assign X3D to global namespace.
126599
126850
 
126600
- window [Symbol .for ("X_ITE.X3D-10.1.0")] = x_ite_X3D;
126851
+ window [Symbol .for ("X_ITE.X3D-10.2.0")] = x_ite_X3D;
126601
126852
 
126602
126853
  customElements .define ("x3d-canvas", x_ite_X3DCanvasElement);
126603
126854