x_ite 10.0.1 → 10.0.3

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 (50) hide show
  1. package/README.md +5 -5
  2. package/dist/X3DUOM.xml +1095 -0
  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 +14 -14
  6. package/dist/assets/components/CADGeometry.min.js +1 -1
  7. package/dist/assets/components/CubeMapTexturing.js +25 -25
  8. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  9. package/dist/assets/components/DIS.js +37 -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 +18 -18
  14. package/dist/assets/components/Geometry2D.min.js +1 -1
  15. package/dist/assets/components/Geospatial.js +33 -33
  16. package/dist/assets/components/Geospatial.min.js +1 -1
  17. package/dist/assets/components/HAnim.js +30 -24
  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 +23 -23
  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 +25 -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 +24 -24
  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 +31 -27
  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 +94 -176
  42. package/dist/assets/components/X_ITE.min.js +1 -1
  43. package/dist/x_ite.css +1 -1
  44. package/dist/x_ite.d.ts +844 -59
  45. package/dist/x_ite.js +1256 -1220
  46. package/dist/x_ite.min.js +1 -1
  47. package/dist/x_ite.min.mjs +1 -1
  48. package/dist/x_ite.mjs +1256 -1220
  49. package/dist/x_ite.zip +0 -0
  50. package/package.json +3 -2
package/dist/x_ite.mjs CHANGED
@@ -1,9 +1,9 @@
1
- /* X_ITE v10.0.1 */var __webpack_modules__ = ({
1
+ /* X_ITE v10.0.3 */var __webpack_modules__ = ({
2
2
 
3
- /***/ 318:
3
+ /***/ 68:
4
4
  /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
5
5
 
6
- /* provided dependency */ var jQuery = __webpack_require__(126);
6
+ /* provided dependency */ var jQuery = __webpack_require__(376);
7
7
  /**
8
8
  * @preserve jquery.fullscreen 1.1.5
9
9
  * https://github.com/code-lts/jquery-fullscreen-plugin
@@ -199,7 +199,7 @@ installFullScreenHandlers();
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 644:
202
+ /***/ 302:
203
203
  /***/ ((module, exports, __webpack_require__) => {
204
204
 
205
205
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -213,7 +213,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
213
213
  (function (factory) {
214
214
  if ( true ) {
215
215
  // AMD. Register as an anonymous module.
216
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(126)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
216
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(376)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
217
217
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
218
218
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
219
219
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -424,7 +424,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
424
424
 
425
425
  /***/ }),
426
426
 
427
- /***/ 126:
427
+ /***/ 376:
428
428
  /***/ (function(module, exports) {
429
429
 
430
430
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -11148,7 +11148,7 @@ return jQuery;
11148
11148
 
11149
11149
  /***/ }),
11150
11150
 
11151
- /***/ 727:
11151
+ /***/ 229:
11152
11152
  /***/ ((module) => {
11153
11153
 
11154
11154
  /**
@@ -15927,7 +15927,7 @@ if (true) {
15927
15927
 
15928
15928
  /***/ }),
15929
15929
 
15930
- /***/ 406:
15930
+ /***/ 860:
15931
15931
  /***/ (function(__unused_webpack_module, exports) {
15932
15932
 
15933
15933
 
@@ -19172,7 +19172,7 @@ if (true) {
19172
19172
 
19173
19173
  /***/ }),
19174
19174
 
19175
- /***/ 577:
19175
+ /***/ 123:
19176
19176
  /***/ (function(module, exports) {
19177
19177
 
19178
19178
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -20297,7 +20297,7 @@ Object .defineProperty (Namespace, "add",
20297
20297
  }
20298
20298
  else
20299
20299
  {
20300
- const X3D = window [Symbol .for ("X_ITE.X3D-10.0.1")];
20300
+ const X3D = window [Symbol .for ("X_ITE.X3D-10.0.3")];
20301
20301
 
20302
20302
  if (X3D)
20303
20303
  X3D [name] = module;
@@ -21708,32 +21708,18 @@ Object .assign (X3DObject .prototype,
21708
21708
  },
21709
21709
  getUserData (key)
21710
21710
  {
21711
- return this [_userData] .get (key)
21712
- ?? this [_userData] .map ?.get (key);
21711
+ return this [_userData] .get (key);
21713
21712
  },
21714
21713
  setUserData (key, value)
21715
21714
  {
21716
- try
21717
- {
21718
- if (this [_userData] === X3DObject .prototype [_userData])
21719
- this [_userData] = new WeakMap ();
21720
-
21721
- this [_userData] .set (key, value);
21722
- }
21723
- catch
21724
- {
21725
- if (!this [_userData] .map)
21726
- this [_userData] .map = new Map ();
21715
+ if (this [_userData] === X3DObject .prototype [_userData])
21716
+ this [_userData] = new Map ();
21727
21717
 
21728
- this [_userData] .map .set (key, value);
21729
- }
21718
+ this [_userData] .set (key, value);
21730
21719
  },
21731
21720
  removeUserData (key)
21732
21721
  {
21733
- if (this [_userData] .delete (key))
21734
- return;
21735
-
21736
- this [_userData] .map ?.delete (key);
21722
+ this [_userData] .delete (key);
21737
21723
  },
21738
21724
  toString (options = Object .prototype)
21739
21725
  {
@@ -21786,7 +21772,7 @@ Object .assign (X3DObject .prototype,
21786
21772
  dispose ()
21787
21773
  {
21788
21774
  this [_interests] .clear ();
21789
- this [_userData] .map ?.clear ();
21775
+ this [_userData] .clear ();
21790
21776
  },
21791
21777
  });
21792
21778
 
@@ -23581,6 +23567,22 @@ Object .assign (Color3 .prototype,
23581
23567
 
23582
23568
  return this;
23583
23569
  },
23570
+ linearToSRGB (color = new Color3 ())
23571
+ {
23572
+ color [_r] = Math .pow (this [_r], 1 / 2.2);
23573
+ color [_g] = Math .pow (this [_g], 1 / 2.2);
23574
+ color [_b] = Math .pow (this [_b], 1 / 2.2);
23575
+
23576
+ return color;
23577
+ },
23578
+ sRGBToLinear (color = new Color3 ())
23579
+ {
23580
+ color [_r] = Math .pow (this [_r], 2.2);
23581
+ color [_g] = Math .pow (this [_g], 2.2);
23582
+ color [_b] = Math .pow (this [_b], 2.2);
23583
+
23584
+ return color;
23585
+ },
23584
23586
  toString ()
23585
23587
  {
23586
23588
  return this [_r] + " " +
@@ -23780,6 +23782,14 @@ Object .assign (Object .setPrototypeOf (SFColor .prototype, Base_X3DField .proto
23780
23782
  this .getValue () .setHSV (h, s, v);
23781
23783
  this .addEvent ();
23782
23784
  },
23785
+ linearToSRGB ()
23786
+ {
23787
+ return new SFColor (this .getValue () .linearToSRGB ());
23788
+ },
23789
+ sRGBToLinear ()
23790
+ {
23791
+ return new SFColor (this .getValue () .sRGBToLinear ());
23792
+ },
23783
23793
  lerp: (() =>
23784
23794
  {
23785
23795
  const
@@ -24034,6 +24044,22 @@ Object .assign (Color4 .prototype,
24034
24044
 
24035
24045
  return this;
24036
24046
  },
24047
+ linearToSRGB (color = new Color4 ())
24048
+ {
24049
+ Numbers_Color3 .prototype .linearToSRGB .call (this, color);
24050
+
24051
+ color [_a] = this [_a];
24052
+
24053
+ return color;
24054
+ },
24055
+ sRGBToLinear (color = new Color4 ())
24056
+ {
24057
+ Numbers_Color3 .prototype .sRGBToLinear .call (this, color);
24058
+
24059
+ color [_a] = this [_a];
24060
+
24061
+ return color;
24062
+ },
24037
24063
  toString ()
24038
24064
  {
24039
24065
  return this [Color4_r] + " " +
@@ -24204,6 +24230,14 @@ Object .assign (Object .setPrototypeOf (SFColorRGBA .prototype, Base_X3DField .p
24204
24230
  this .getValue () .setHSVA (h, s, v, a);
24205
24231
  this .addEvent ();
24206
24232
  },
24233
+ linearToSRGB ()
24234
+ {
24235
+ return new SFColorRGBA (this .getValue () .linearToSRGB ());
24236
+ },
24237
+ sRGBToLinear ()
24238
+ {
24239
+ return new SFColorRGBA (this .getValue () .sRGBToLinear ());
24240
+ },
24207
24241
  lerp: (() =>
24208
24242
  {
24209
24243
  const
@@ -34229,7 +34263,7 @@ const X3DBaseNode_default_ = X3DBaseNode;
34229
34263
  x_ite_Namespace .add ("X3DBaseNode", "x_ite/Base/X3DBaseNode", X3DBaseNode_default_);
34230
34264
  /* harmony default export */ const Base_X3DBaseNode = (X3DBaseNode_default_);
34231
34265
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Legacy.js
34232
- /* provided dependency */ var $ = __webpack_require__(126);
34266
+ /* provided dependency */ var $ = __webpack_require__(376);
34233
34267
  /*******************************************************************************
34234
34268
  *
34235
34269
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34366,7 +34400,7 @@ x_ite_Namespace .add ("Legacy", "x_ite/Browser/Legacy", Legacy_default_);
34366
34400
  *
34367
34401
  ******************************************************************************/
34368
34402
 
34369
- const BROWSER_VERSION_default_ = "10.0.1";
34403
+ const BROWSER_VERSION_default_ = "10.0.3";
34370
34404
  ;
34371
34405
 
34372
34406
  x_ite_Namespace .add ("BROWSER_VERSION", "x_ite/BROWSER_VERSION", BROWSER_VERSION_default_);
@@ -37552,7 +37586,7 @@ const X3DBindableNode_default_ = X3DBindableNode;
37552
37586
  x_ite_Namespace .add ("X3DBindableNode", "x_ite/Components/Core/X3DBindableNode", X3DBindableNode_default_);
37553
37587
  /* harmony default export */ const Core_X3DBindableNode = (X3DBindableNode_default_);
37554
37588
  ;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle3.js
37555
- /* provided dependency */ var libtess = __webpack_require__(727);
37589
+ /* provided dependency */ var libtess = __webpack_require__(229);
37556
37590
  /*******************************************************************************
37557
37591
  *
37558
37592
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40122,7 +40156,7 @@ const X3DProtoDeclaration_default_ = X3DProtoDeclaration;
40122
40156
  x_ite_Namespace .add ("X3DProtoDeclaration", "x_ite/Prototype/X3DProtoDeclaration", X3DProtoDeclaration_default_);
40123
40157
  /* harmony default export */ const Prototype_X3DProtoDeclaration = (X3DProtoDeclaration_default_);
40124
40158
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/X3DParser.js
40125
- /* provided dependency */ var X3DParser_$ = __webpack_require__(126);
40159
+ /* provided dependency */ var X3DParser_$ = __webpack_require__(376);
40126
40160
  /*******************************************************************************
40127
40161
  *
40128
40162
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40380,7 +40414,7 @@ const Expressions_default_ = Expressions;
40380
40414
  x_ite_Namespace .add ("Expressions", "x_ite/Parser/Expressions", Expressions_default_);
40381
40415
  /* harmony default export */ const Parser_Expressions = (Expressions_default_);
40382
40416
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/VRMLParser.js
40383
- /* provided dependency */ var VRMLParser_$ = __webpack_require__(126);
40417
+ /* provided dependency */ var VRMLParser_$ = __webpack_require__(376);
40384
40418
  /*******************************************************************************
40385
40419
  *
40386
40420
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43080,7 +43114,7 @@ const VRMLParser_default_ = VRMLParser;
43080
43114
  x_ite_Namespace .add ("VRMLParser", "x_ite/Parser/VRMLParser", VRMLParser_default_);
43081
43115
  /* harmony default export */ const Parser_VRMLParser = (VRMLParser_default_);
43082
43116
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/XMLParser.js
43083
- /* provided dependency */ var XMLParser_$ = __webpack_require__(126);
43117
+ /* provided dependency */ var XMLParser_$ = __webpack_require__(376);
43084
43118
  /*******************************************************************************
43085
43119
  *
43086
43120
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45256,7 +45290,7 @@ const URLs_default_ = URLs;
45256
45290
  x_ite_Namespace .add ("URLs", "x_ite/Browser/Networking/URLs", URLs_default_);
45257
45291
  /* harmony default export */ const Networking_URLs = (URLs_default_);
45258
45292
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLTF2Parser.js
45259
- /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(126);
45293
+ /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(376);
45260
45294
  /*******************************************************************************
45261
45295
  *
45262
45296
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45561,7 +45595,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45561
45595
  case "KHR_materials_sheen":
45562
45596
  case "KHR_materials_specular":
45563
45597
  case "KHR_materials_transmission":
45564
- case "KHR_materials_unlit":
45565
45598
  case "KHR_materials_volume":
45566
45599
  {
45567
45600
  const component = browser .getComponent ("X_ITE", 1);
@@ -46256,7 +46289,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46256
46289
 
46257
46290
  appearanceNode ._alphaMode = this .stringValue (material .alphaMode, "OPAQUE");
46258
46291
  appearanceNode ._alphaCutoff = this .numberValue (material .alphaCutoff, 0.5);
46259
- appearanceNode ._material = materialNode;
46292
+ appearanceNode ._material = this .khrMaterialsUnlitObject (material .extensions ?.KHR_materials_unlit, materialNode);
46260
46293
  appearanceNode ._textureTransform = this .createMultiTextureTransform (materialNode);
46261
46294
 
46262
46295
  appearanceNode .setup ();
@@ -46429,9 +46462,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46429
46462
  case "KHR_materials_transmission":
46430
46463
  this .khrMaterialsTransmission (value, materialNode);
46431
46464
  break;
46432
- case "KHR_materials_unlit":
46433
- this .khrMaterialsUnlitObject (value, materialNode);
46434
- break;
46435
46465
  case "KHR_materials_volume":
46436
46466
  this .khrMaterialsVolumeObject (value, materialNode);
46437
46467
  break;
@@ -46590,14 +46620,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46590
46620
 
46591
46621
  materialNode ._extensions .push (extension);
46592
46622
  },
46593
- khrMaterialsUnlitObject (KHR_materials_unlit, materialNode)
46594
- {
46595
- const extension = this .getScene () .createNode ("UnlitMaterialExtension", false);
46596
-
46597
- extension .setup ();
46598
-
46599
- materialNode ._extensions .push (extension);
46600
- },
46601
46623
  khrMaterialsVolumeObject (KHR_materials_volume, materialNode)
46602
46624
  {
46603
46625
  const extension = this .getScene () .createNode ("VolumeMaterialExtension", false);
@@ -46616,6 +46638,27 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46616
46638
 
46617
46639
  materialNode ._extensions .push (extension);
46618
46640
  },
46641
+ khrMaterialsUnlitObject (KHR_materials_unlit, materialNode)
46642
+ {
46643
+ if (!KHR_materials_unlit)
46644
+ return materialNode;
46645
+
46646
+ const unlitMaterialNode = this .getScene () .createNode ("UnlitMaterial", false);
46647
+
46648
+ unlitMaterialNode ._emissiveColor = materialNode ._baseColor;
46649
+ unlitMaterialNode ._emissiveTextureMapping = materialNode ._baseTextureMapping;
46650
+ unlitMaterialNode ._emissiveTexture = materialNode ._baseTexture;
46651
+ unlitMaterialNode ._normalScale = materialNode ._normalScale;
46652
+ unlitMaterialNode ._normalTextureMapping = materialNode ._normalTextureMapping;
46653
+ unlitMaterialNode ._normalTexture = materialNode ._normalTexture;
46654
+ unlitMaterialNode ._transparency = materialNode ._transparency;
46655
+
46656
+ unlitMaterialNode .setup ();
46657
+
46658
+ materialNode .dispose ();
46659
+
46660
+ return unlitMaterialNode;
46661
+ },
46619
46662
  textureTransformObject (KHR_texture_transform, texCoord)
46620
46663
  {
46621
46664
  if (!(KHR_texture_transform instanceof Object))
@@ -47733,12 +47776,12 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47733
47776
  },
47734
47777
  hasTextures (materialNode)
47735
47778
  {
47736
- // Test PhysicalMaterial, ...
47779
+ // Test PhysicalMaterial, UnlitMaterial ...
47737
47780
 
47738
47781
  if (+materialNode .getTextureBits ())
47739
47782
  return true;
47740
47783
 
47741
- if (materialNode ._extensions .some (extension => +extension .getValue () .getTextureBits ()))
47784
+ if (materialNode ._extensions ?.some (extension => +extension .getValue () .getTextureBits ()))
47742
47785
  return true;
47743
47786
 
47744
47787
  return false;
@@ -48890,7 +48933,7 @@ const GLTF2Parser_default_ = GLTF2Parser;
48890
48933
  x_ite_Namespace .add ("GLTF2Parser", "x_ite/Parser/GLTF2Parser", GLTF2Parser_default_);
48891
48934
  /* harmony default export */ const Parser_GLTF2Parser = (GLTF2Parser_default_);
48892
48935
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLB2Parser.js
48893
- /* provided dependency */ var GLB2Parser_$ = __webpack_require__(126);
48936
+ /* provided dependency */ var GLB2Parser_$ = __webpack_require__(376);
48894
48937
  /*******************************************************************************
48895
48938
  *
48896
48939
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49042,7 +49085,7 @@ const GLB2Parser_default_ = GLB2Parser;
49042
49085
  x_ite_Namespace .add ("GLB2Parser", "x_ite/Parser/GLB2Parser", GLB2Parser_default_);
49043
49086
  /* harmony default export */ const Parser_GLB2Parser = (GLB2Parser_default_);
49044
49087
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/OBJParser.js
49045
- /* provided dependency */ var OBJParser_$ = __webpack_require__(126);
49088
+ /* provided dependency */ var OBJParser_$ = __webpack_require__(376);
49046
49089
  /*******************************************************************************
49047
49090
  *
49048
49091
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50730,6 +50773,8 @@ x_ite_Namespace .add ("STLBParser", "x_ite/Parser/STLBParser", STLBParser_defaul
50730
50773
 
50731
50774
 
50732
50775
 
50776
+
50777
+
50733
50778
  /*
50734
50779
  * Grammar
50735
50780
  */
@@ -50896,6 +50941,14 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
50896
50941
  return value;
50897
50942
  }
50898
50943
  },
50944
+ convertFDC (f_dc)
50945
+ {
50946
+ // https://github.com/graphdeco-inria/gaussian-splatting/issues/485
50947
+
50948
+ const C0 = 0.28209479177387814;
50949
+
50950
+ return 0.5 + C0 * f_dc;
50951
+ },
50899
50952
  header (elements)
50900
50953
  {
50901
50954
  PLYAParser_Grammar .ply .parse (this);
@@ -51095,20 +51148,20 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
51095
51148
  async parseVertices ({ count, properties })
51096
51149
  {
51097
51150
  const
51098
- browser = this .getBrowser (),
51099
- scene = this .getScene (),
51100
- colors = [ ],
51101
- texCoord = scene .createNode ("TextureCoordinate"),
51102
- texCoords = [ ],
51103
- normal = scene .createNode ("Normal"),
51104
- normals = [ ],
51105
- coord = scene .createNode ("Coordinate"),
51106
- points = [ ],
51107
- attributes = new Map ();
51151
+ browser = this .getBrowser (),
51152
+ scene = this .getScene (),
51153
+ colors = [ ],
51154
+ texCoord = scene .createNode ("TextureCoordinate"),
51155
+ texCoords = [ ],
51156
+ normal = scene .createNode ("Normal"),
51157
+ normals = [ ],
51158
+ coord = scene .createNode ("Coordinate"),
51159
+ points = [ ],
51160
+ attributes = new Map ();
51108
51161
 
51109
51162
  for (const { name } of properties)
51110
51163
  {
51111
- if (name .match (/^(?:red|green|blue|alpha|r|g|b|a|s|t|u|v|nx|ny|nz|x|y|z)$/))
51164
+ if (name .match (/^(?:red|green|blue|alpha|r|g|b|a|f_dc_0|f_dc_1|f_dc_2|opacity|s|t|u|v|nx|ny|nz|x|y|z)$/))
51112
51165
  continue;
51113
51166
 
51114
51167
  attributes .set (name, [ ]);
@@ -51134,6 +51187,13 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
51134
51187
  case "r": case "g": case "b": case "a":
51135
51188
  colors .push (this .convertColor (this .value, type));
51136
51189
  break;
51190
+ case "f_dc_0": case "f_dc_1": case "f_dc_2":
51191
+ colors .push (this .convertFDC (this .convertColor (this .value, type)));
51192
+ break;
51193
+ case "opacity":
51194
+ // https://github.com/antimatter15/splat/blob/main/convert.py
51195
+ colors .push (1 / (1 + Math .exp (-this .value)));
51196
+ break;
51137
51197
  case "s": case "t":
51138
51198
  case "u": case "v":
51139
51199
  texCoords .push (this .value);
@@ -51173,7 +51233,7 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
51173
51233
  // Geometric properties
51174
51234
 
51175
51235
  const
51176
- pAlpha = properties .some (p => p .name .match (/^(?:alpha|a)$/)),
51236
+ pAlpha = properties .some (p => p .name .match (/^(?:alpha|a|opacity)$/)),
51177
51237
  alpha = pAlpha && colors .some ((v, i) => i % 4 === 3 && v < 1),
51178
51238
  color = scene .createNode (alpha ? "ColorRGBA" : "Color");
51179
51239
 
@@ -52400,8 +52460,8 @@ const MatrixStack_default_ = MatrixStack;
52400
52460
  x_ite_Namespace .add ("MatrixStack", "standard/Math/Utility/MatrixStack", MatrixStack_default_);
52401
52461
  /* harmony default export */ const Utility_MatrixStack = (MatrixStack_default_);
52402
52462
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/SVGParser.js
52403
- /* provided dependency */ var SVGParser_$ = __webpack_require__(126);
52404
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(727);
52463
+ /* provided dependency */ var SVGParser_$ = __webpack_require__(376);
52464
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(229);
52405
52465
  /*******************************************************************************
52406
52466
  *
52407
52467
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55172,7 +55232,7 @@ const SVGParser_default_ = SVGParser;
55172
55232
  x_ite_Namespace .add ("SVGParser", "x_ite/Parser/SVGParser", SVGParser_default_);
55173
55233
  /* harmony default export */ const Parser_SVGParser = (SVGParser_default_);
55174
55234
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GoldenGate.js
55175
- /* provided dependency */ var GoldenGate_$ = __webpack_require__(126);
55235
+ /* provided dependency */ var GoldenGate_$ = __webpack_require__(376);
55176
55236
  /*******************************************************************************
55177
55237
  *
55178
55238
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56901,6 +56961,7 @@ function X3DRenderObject (executionContext)
56901
56961
  const browser = executionContext .getBrowser ();
56902
56962
 
56903
56963
  this .renderKey = "";
56964
+ this .renderAndGlobalLightsKey = "";
56904
56965
  this .renderCount = 0;
56905
56966
  this .viewVolumes = [ ];
56906
56967
  this .projectionMatrix = new Utility_MatrixStack (Numbers_Matrix4);
@@ -56914,12 +56975,13 @@ function X3DRenderObject (executionContext)
56914
56975
  this .hitRay = new Geometry_Line3 (Numbers_Vector3 .Zero, Numbers_Vector3 .Zero);
56915
56976
  this .sensors = [[ ]];
56916
56977
  this .viewpointGroups = [ ];
56917
- this .localObjectsKeys = [ ];
56978
+ this .lights = [ ];
56918
56979
  this .globalLightsKeys = [ ];
56919
56980
  this .globalLights = [ ];
56981
+ this .localObjectsKeys = [ ];
56920
56982
  this .localObjects = [ ];
56921
- this .lights = [ ];
56922
56983
  this .globalShadows = [ false ];
56984
+ this .globalShadow = false;
56923
56985
  this .localShadows = [ false ];
56924
56986
  this .localFogs = [ null ];
56925
56987
  this .layouts = [ ];
@@ -56954,6 +57016,7 @@ Object .assign (X3DRenderObject .prototype,
56954
57016
  const browser = this .getBrowser ();
56955
57017
 
56956
57018
  browser .getRenderingProperties () ._LogarithmicDepthBuffer .addInterest ("set_renderKey__", this);
57019
+ browser .getBrowserOptions () ._ColorSpace .addInterest ("set_renderKey__", this);
56957
57020
  browser .getBrowserOptions () ._OrderIndependentTransparency .addInterest ("set_renderKey__", this);
56958
57021
  browser .getBrowserOptions () ._ToneMapping .addInterest ("set_renderKey__", this);
56959
57022
 
@@ -56979,9 +57042,22 @@ Object .assign (X3DRenderObject .prototype,
56979
57042
 
56980
57043
  let renderKey = "";
56981
57044
 
56982
- renderKey += this .logarithmicDepthBuffer ? 1 : 0;
57045
+ renderKey += this .logarithmicDepthBuffer ? 1 : 0;
56983
57046
  renderKey += this .orderIndependentTransparency ? 1 : 0;
56984
57047
 
57048
+ switch (browser .getBrowserOption ("ColorSpace"))
57049
+ {
57050
+ case "SRGB":
57051
+ renderKey += 0;
57052
+ break;
57053
+ default: // LINEAR_WHEN_PHYSICAL_MATERIAL
57054
+ renderKey += 1;
57055
+ break;
57056
+ case "LINEAR":
57057
+ renderKey += 2;
57058
+ break;
57059
+ }
57060
+
56985
57061
  switch (browser .getBrowserOption ("ToneMapping"))
56986
57062
  {
56987
57063
  default: // NONE
@@ -57015,6 +57091,10 @@ Object .assign (X3DRenderObject .prototype,
57015
57091
  {
57016
57092
  return this .renderKey;
57017
57093
  },
57094
+ getRenderAndGlobalLightsKey ()
57095
+ {
57096
+ return this .renderAndGlobalLightsKey;
57097
+ },
57018
57098
  getRenderCount ()
57019
57099
  {
57020
57100
  return this .renderCount;
@@ -57081,10 +57161,18 @@ Object .assign (X3DRenderObject .prototype,
57081
57161
  {
57082
57162
  return this .viewpointGroups;
57083
57163
  },
57164
+ getLights ()
57165
+ {
57166
+ return this .lights;
57167
+ },
57084
57168
  getGlobalLights ()
57085
57169
  {
57086
57170
  return this .globalLights;
57087
57171
  },
57172
+ getGlobalLightsKeys ()
57173
+ {
57174
+ return this .globalLightsKeys;
57175
+ },
57088
57176
  getLocalObjects ()
57089
57177
  {
57090
57178
  return this .localObjects;
@@ -57093,10 +57181,6 @@ Object .assign (X3DRenderObject .prototype,
57093
57181
  {
57094
57182
  return this .localObjectsKeys;
57095
57183
  },
57096
- getLights ()
57097
- {
57098
- return this .lights;
57099
- },
57100
57184
  pushGlobalShadows (value)
57101
57185
  {
57102
57186
  this .globalShadows .push (value || this .globalShadows .at (-1));
@@ -57105,6 +57189,10 @@ Object .assign (X3DRenderObject .prototype,
57105
57189
  {
57106
57190
  return this .globalShadows;
57107
57191
  },
57192
+ getGlobalShadow ()
57193
+ {
57194
+ return this .globalShadow;
57195
+ },
57108
57196
  pushLocalShadows (value)
57109
57197
  {
57110
57198
  this .localShadows .push (value || this .localShadows .at (-1));
@@ -57932,7 +58020,6 @@ Object .assign (X3DRenderObject .prototype,
57932
58020
  globalLights = this .globalLights,
57933
58021
  generatedCubeMapTextures = this .generatedCubeMapTextures,
57934
58022
  globalShadows = this .globalShadows,
57935
- shadows = globalShadows .at (-1),
57936
58023
  headlight = this .getNavigationInfo () ._headlight .getValue (),
57937
58024
  oit = frameBuffer .getOIT () && independent;
57938
58025
 
@@ -57964,6 +58051,9 @@ Object .assign (X3DRenderObject .prototype,
57964
58051
  for (const light of globalLights)
57965
58052
  globalLightsKeys .push (light .lightNode .getLightKey ());
57966
58053
 
58054
+ this .renderAndGlobalLightsKey = `.${this .renderKey}.${globalLightsKeys .sort () .join ("")}.`;
58055
+ this .globalShadow = globalShadows .at (-1);
58056
+
57967
58057
  // Set global uniforms.
57968
58058
 
57969
58059
  this .viewportArray .set (viewport);
@@ -57971,34 +58061,6 @@ Object .assign (X3DRenderObject .prototype,
57971
58061
  this .viewMatrixArray .set (this .getViewMatrix () .get ());
57972
58062
  this .cameraSpaceMatrixArray .set (this .getCameraSpaceMatrix () .get ());
57973
58063
 
57974
- // Prepare opaque objects.
57975
-
57976
- const
57977
- opaqueShapes = this .opaqueShapes,
57978
- numOpaqueShapes = this .numOpaqueShapes;
57979
-
57980
- for (let i = 0; i < numOpaqueShapes; ++ i)
57981
- {
57982
- const renderContext = opaqueShapes [i];
57983
-
57984
- renderContext .shadows = renderContext .shadows || shadows;
57985
- renderContext .objectsKeys .push (... globalLightsKeys);
57986
- }
57987
-
57988
- // Prepare transparent objects.
57989
-
57990
- const
57991
- transparentShapes = this .transparentShapes,
57992
- numTransparentShapes = this .numTransparentShapes;
57993
-
57994
- for (let i = 0; i < numTransparentShapes; ++ i)
57995
- {
57996
- const renderContext = transparentShapes [i];
57997
-
57998
- renderContext .shadows = renderContext .shadows || shadows;
57999
- renderContext .objectsKeys .push (... globalLightsKeys);
58000
- }
58001
-
58002
58064
  // DRAW
58003
58065
 
58004
58066
  if (independent && this .transmission)
@@ -58017,13 +58079,13 @@ Object .assign (X3DRenderObject .prototype,
58017
58079
  gl .bindTexture (gl .TEXTURE_2D, transmissionBuffer .getColorTexture ());
58018
58080
  gl .generateMipmap (gl .TEXTURE_2D);
58019
58081
 
58020
- this .drawShapes (gl, browser, true, frameBuffer, 0, oit, viewport, opaqueShapes, numOpaqueShapes, transparentShapes, numTransparentShapes, this .transparencySorter);
58082
+ this .drawShapes (gl, browser, true, frameBuffer, 0, oit, viewport, this .opaqueShapes, this .numOpaqueShapes, this .transparentShapes, this .numTransparentShapes, this .transparencySorter);
58021
58083
  }
58022
58084
  else
58023
58085
  {
58024
58086
  // Draw with sorted blend or OIT.
58025
58087
 
58026
- this .drawShapes (gl, browser, independent, frameBuffer, 0, oit, viewport, opaqueShapes, numOpaqueShapes, transparentShapes, numTransparentShapes, this .transparencySorter);
58088
+ this .drawShapes (gl, browser, independent, frameBuffer, 0, oit, viewport, this .opaqueShapes, this .numOpaqueShapes, this .transparentShapes, this .numTransparentShapes, this .transparencySorter);
58027
58089
  }
58028
58090
 
58029
58091
  // POST DRAW
@@ -61947,8 +62009,7 @@ function X3DBackgroundNode (executionContext)
61947
62009
  this .textureNodes = new Array (6);
61948
62010
  this .textureBits = new Utility_BitSet ();
61949
62011
  this .sphereContext = new Rendering_GeometryContext ({ colorMaterial: true });
61950
- this .sphereAlphaContext = new Rendering_GeometryContext ({ colorMaterial: true, alphaMode: Shape_AlphaMode .BLEND });
61951
- this .texturesContext = new Rendering_GeometryContext ({ });
62012
+ this .texturesContext = new Rendering_GeometryContext ({ objectsKeys: this .sphereContext .objectsKeys});
61952
62013
  }
61953
62014
 
61954
62015
  Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBindableNode .prototype),
@@ -62300,26 +62361,20 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62300
62361
  {
62301
62362
  const
62302
62363
  localObjects = renderObject .getLocalObjects (),
62303
- clipPlanes = this .clipPlanes;
62364
+ clipPlanes = this .clipPlanes,
62365
+ objectsKeys = this .sphereContext .objectsKeys;
62304
62366
 
62305
62367
  let c = 0;
62306
62368
 
62307
- for (let l = 0, length = localObjects .length; l < length; ++ l)
62369
+ for (const localObject of localObjects)
62308
62370
  {
62309
- if (localObjects [l] .isClipped)
62310
- clipPlanes [c ++] = localObjects [l];
62371
+ if (localObject .isClipped)
62372
+ clipPlanes [c ++] = localObject;
62311
62373
  }
62312
62374
 
62313
- clipPlanes .length = c;
62314
-
62315
- for (let i = 0; i < c; ++ i)
62316
- {
62317
- this .sphereContext .objectsKeys [i] = 0;
62318
- this .texturesContext .objectsKeys [i] = 0;
62319
- }
62320
-
62321
- this .sphereContext .objectsKeys .length = c;
62322
- this .texturesContext .objectsKeys .length = c;
62375
+ clipPlanes .length = c;
62376
+ objectsKeys .length = c;
62377
+ objectsKeys .fill (0);
62323
62378
  return;
62324
62379
  }
62325
62380
  }
@@ -62378,9 +62433,14 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62378
62433
  return;
62379
62434
 
62380
62435
  const
62381
- browser = this .getBrowser (),
62382
- gl = browser .getContext (),
62383
- shaderNode = browser .getDefaultMaterial () .getShader (transparency ? this .sphereAlphaContext : this .sphereContext);
62436
+ browser = this .getBrowser (),
62437
+ gl = browser .getContext (),
62438
+ sphereContext = this .sphereContext;
62439
+
62440
+ sphereContext .alphaMode = transparency ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62441
+ sphereContext .renderObject = renderObject;
62442
+
62443
+ const shaderNode = browser .getDefaultMaterial () .getShader (sphereContext);
62384
62444
 
62385
62445
  shaderNode .enable (gl);
62386
62446
  shaderNode .setClipPlanes (gl, this .clipPlanes);
@@ -62428,8 +62488,9 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62428
62488
  {
62429
62489
  const textureNode = this .textureNodes [i];
62430
62490
 
62431
- texturesContext .alphaMode = textureNode ._transparent .getValue () ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62432
- texturesContext .textureNode = textureNode;
62491
+ texturesContext .alphaMode = textureNode ._transparent .getValue () ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62492
+ texturesContext .textureNode = textureNode;
62493
+ texturesContext .renderObject = renderObject;
62433
62494
 
62434
62495
  const shaderNode = browser .getDefaultMaterial () .getShader (texturesContext);
62435
62496
 
@@ -63139,7 +63200,7 @@ const X3DTexture2DNode_default_ = X3DTexture2DNode;
63139
63200
  x_ite_Namespace .add ("X3DTexture2DNode", "x_ite/Components/Texturing/X3DTexture2DNode", X3DTexture2DNode_default_);
63140
63201
  /* harmony default export */ const Texturing_X3DTexture2DNode = (X3DTexture2DNode_default_);
63141
63202
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/ImageTexture.js
63142
- /* provided dependency */ var ImageTexture_$ = __webpack_require__(126);
63203
+ /* provided dependency */ var ImageTexture_$ = __webpack_require__(376);
63143
63204
  /*******************************************************************************
63144
63205
  *
63145
63206
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66723,7 +66784,7 @@ const X3DWorld_default_ = X3DWorld;
66723
66784
  x_ite_Namespace .add ("X3DWorld", "x_ite/Execution/X3DWorld", X3DWorld_default_);
66724
66785
  /* harmony default export */ const Execution_X3DWorld = (X3DWorld_default_);
66725
66786
  ;// CONCATENATED MODULE: ./src/x_ite/InputOutput/FileLoader.js
66726
- /* provided dependency */ var FileLoader_$ = __webpack_require__(126);
66787
+ /* provided dependency */ var FileLoader_$ = __webpack_require__(376);
66727
66788
  /*******************************************************************************
66728
66789
  *
66729
66790
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67657,7 +67718,7 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
67657
67718
  x_ite_Namespace .add ("ProtoDeclarationArray", "x_ite/Prototype/ProtoDeclarationArray", ProtoDeclarationArray_default_);
67658
67719
  /* harmony default export */ const Prototype_ProtoDeclarationArray = (ProtoDeclarationArray_default_);
67659
67720
  ;// CONCATENATED MODULE: ./src/x_ite/Routing/X3DRoute.js
67660
- /* provided dependency */ var X3DRoute_$ = __webpack_require__(126);
67721
+ /* provided dependency */ var X3DRoute_$ = __webpack_require__(376);
67661
67722
  /*******************************************************************************
67662
67723
  *
67663
67724
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81409,6 +81470,9 @@ x_ite_Namespace .add ("DirectionalLight", "x_ite/Components/Lighting/Directional
81409
81470
 
81410
81471
 
81411
81472
 
81473
+ /**
81474
+ * THIS NODE IS STILL EXPERIMENTAL.
81475
+ */
81412
81476
 
81413
81477
  const EnvironmentLights = Utility_ObjectCache (EnvironmentLightContainer);
81414
81478
 
@@ -90308,6 +90372,10 @@ x_ite_Namespace .add ("PointSet", "x_ite/Components/Rendering/PointSet", PointSe
90308
90372
 
90309
90373
 
90310
90374
 
90375
+ /**
90376
+ * THIS NODE IS STILL EXPERIMENTAL.
90377
+ */
90378
+
90311
90379
  function Tangent (executionContext)
90312
90380
  {
90313
90381
  Rendering_X3DGeometricPropertyNode .call (this, executionContext);
@@ -91105,7 +91173,7 @@ const MaterialTextures_default_ = {
91105
91173
  "x3d_TransmissionTextureEXT",
91106
91174
  "x3d_ThicknessTextureEXT",
91107
91175
  ],
91108
- texture (name, components = "rgba", colorspace = "")
91176
+ texture (name, components = "rgba", colorSpace = "")
91109
91177
  {
91110
91178
  const ext = !!name .match (/EXT$/);
91111
91179
 
@@ -91143,15 +91211,29 @@ vec4 textureColor=texture(${name}${EXT} .textureCube,texCoord);
91143
91211
  #endif
91144
91212
  ${type}
91145
91213
  textureColorComponents=textureColor.${components};
91214
+ #if defined(X3D_COLORSPACE_SRGB)
91146
91215
  #if defined(${define}${_EXT}_LINEAR)
91147
- #if ${colorspace === "sRGB" ? 1 : 0}
91148
- textureColorComponents=linearTosRGB(textureColorComponents);
91216
+ #if ${colorSpace === "sRGB" || colorSpace === "linear" ? 1 : 0}
91217
+ textureColorComponents=linearToSRGB(textureColorComponents);
91218
+ #endif
91219
+ #endif
91220
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
91221
+ #if defined(${define}${_EXT}_LINEAR)
91222
+ #if ${colorSpace === "sRGB" ? 1 : 0}
91223
+ textureColorComponents=linearToSRGB(textureColorComponents);
91149
91224
  #endif
91150
91225
  #else
91151
- #if ${colorspace === "linear" ? 1 : 0}
91226
+ #if ${colorSpace === "linear" ? 1 : 0}
91152
91227
  textureColorComponents=sRGBToLinear(textureColorComponents);
91153
91228
  #endif
91154
91229
  #endif
91230
+ #elif defined(X3D_COLORSPACE_LINEAR)
91231
+ #if!defined(${define}${_EXT}_LINEAR)
91232
+ #if ${colorSpace === "sRGB" || colorSpace === "linear" ? 1 : 0}
91233
+ textureColorComponents=sRGBToLinear(textureColorComponents);
91234
+ #endif
91235
+ #endif
91236
+ #endif
91155
91237
  return textureColorComponents;}
91156
91238
  #endif
91157
91239
  `
@@ -91186,7 +91268,7 @@ mediump samplerCube textureCube;
91186
91268
  x_ite_Namespace .add ("MaterialTextures", "assets/shaders/MaterialTextures", MaterialTextures_default_);
91187
91269
  /* harmony default export */ const MaterialTextures = (MaterialTextures_default_);
91188
91270
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js
91189
- /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(126);
91271
+ /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(376);
91190
91272
  /*******************************************************************************
91191
91273
  *
91192
91274
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91441,7 +91523,7 @@ Object .assign (X3DProgrammableShaderObject .prototype,
91441
91523
  "x3d_TransmissionFramebufferSizeEXT",
91442
91524
  "x3d_ThicknessEXT",
91443
91525
  "x3d_AttenuationDistanceEXT",
91444
- "x3d_AttenuationColoEXT",
91526
+ "x3d_AttenuationColorEXT",
91445
91527
  ];
91446
91528
 
91447
91529
  for (const name of commonUniforms)
@@ -93473,6 +93555,10 @@ x_ite_Namespace .add ("Matrix4VertexAttribute", "x_ite/Components/Shaders/Matrix
93473
93555
 
93474
93556
 
93475
93557
 
93558
+ /**
93559
+ * THIS NODE IS NOT SUPPORTED.
93560
+ */
93561
+
93476
93562
  function PackagedShader (executionContext)
93477
93563
  {
93478
93564
  Shaders_X3DShaderNode .call (this, executionContext);
@@ -93605,6 +93691,10 @@ x_ite_Namespace .add ("PackagedShader", "x_ite/Components/Shaders/PackagedShader
93605
93691
 
93606
93692
 
93607
93693
 
93694
+ /**
93695
+ * THIS NODE IS NOT SUPPORTED.
93696
+ */
93697
+
93608
93698
  function ProgramShader (executionContext)
93609
93699
  {
93610
93700
  Shaders_X3DShaderNode .call (this, executionContext);
@@ -94297,7 +94387,7 @@ finalColor.a=1.0;
94297
94387
  #if defined(X3D_ALPHA_MODE_MASK)
94298
94388
  if(finalColor.a<x3d_AlphaCutoff)discard;finalColor.a=1.0;
94299
94389
  #endif
94300
- gl_FragColor=finalColor;
94390
+ finalColor.rgb=toneMap(finalColor.rgb);gl_FragColor=finalColor;
94301
94391
  #if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)
94302
94392
  gl_FragDepthEXT=log2(depth)*x3d_LogarithmicFarFactor1_2;
94303
94393
  #endif
@@ -94306,55 +94396,6 @@ gl_FragDepthEXT=log2(depth)*x3d_LogarithmicFarFactor1_2;
94306
94396
 
94307
94397
  x_ite_Namespace .add ("Fragment1.glsl", "assets/shaders/webgl1/common/Fragment1.glsl", Fragment1_glsl_default_);
94308
94398
  /* harmony default export */ const Fragment1_glsl = (Fragment1_glsl_default_);
94309
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Shadow1.glsl.js
94310
- const Shadow1_glsl_default_ = /* glsl */ `
94311
- #if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
94312
- uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){
94313
- #if X3D_NUM_LIGHTS>0
94314
- if(index==0)return texture2D(x3d_ShadowMap[0],shadowCoord).r;
94315
- #endif
94316
- #if X3D_NUM_LIGHTS>1
94317
- if(index==1)return texture2D(x3d_ShadowMap[1],shadowCoord).r;
94318
- #endif
94319
- #if X3D_NUM_LIGHTS>2
94320
- if(index==2)return texture2D(x3d_ShadowMap[2],shadowCoord).r;
94321
- #endif
94322
- #if X3D_NUM_LIGHTS>3
94323
- if(index==3)return texture2D(x3d_ShadowMap[3],shadowCoord).r;
94324
- #endif
94325
- #if X3D_NUM_LIGHTS>4
94326
- if(index==4)return texture2D(x3d_ShadowMap[4],shadowCoord).r;
94327
- #endif
94328
- #if X3D_NUM_LIGHTS>5
94329
- if(index==5)return texture2D(x3d_ShadowMap[5],shadowCoord).r;
94330
- #endif
94331
- #if X3D_NUM_LIGHTS>6
94332
- if(index==6)return texture2D(x3d_ShadowMap[6],shadowCoord).r;
94333
- #endif
94334
- #if X3D_NUM_LIGHTS>7
94335
- if(index==7)return texture2D(x3d_ShadowMap[7],shadowCoord).r;
94336
- #endif
94337
- return 0.0;}float texture2DCompare(const in int index,const in vec2 texCoord,const in float compare){float shadowDepth=getShadowDepth(index,texCoord);return(1.0-step(1.0,shadowDepth))*step(shadowDepth,compare);}float texture2DShadowLerp(const in int index,const in vec2 texelSize,const in float shadowMapSize,const in vec2 texCoord,const in float compare){const vec2 offset=vec2(0.0,1.0);vec2 centroidTexCoord=floor(texCoord*shadowMapSize+0.5)/shadowMapSize;float lb=texture2DCompare(index,centroidTexCoord+texelSize*offset.xx,compare);float lt=texture2DCompare(index,centroidTexCoord+texelSize*offset.xy,compare);float rb=texture2DCompare(index,centroidTexCoord+texelSize*offset.yx,compare);float rt=texture2DCompare(index,centroidTexCoord+texelSize*offset.yy,compare);vec2 f=fract(texCoord*shadowMapSize+0.5);float a=mix(lb,lt,f.y);float b=mix(rb,rt,f.y);float c=mix(a,b,f.x);return c;}vec2 cubeToUVCompact(in vec3 v,const float texelSizeY){vec3 absV=abs(v);float scaleToCube=1.0/max(absV.x,max(absV.y,absV.z));absV*=scaleToCube;v*=scaleToCube*(1.0-2.0*texelSizeY);vec2 planar=v.xy;float almostATexel=1.5*texelSizeY;float almostOne=1.0-almostATexel;if(absV.z>=almostOne){if(v.z>0.0)planar.x=4.0-v.x;}else if(absV.x>=almostOne){float signX=sign(v.x);planar.x=v.z*signX+2.0*signX;}else if(absV.y>=almostOne){float signY=sign(v.y);planar.x=(v.x+0.5+signY)*2.0;planar.y=v.z*signY-2.0;}return vec2(0.125,0.25)*planar+vec2(0.375,0.75);}mat4 getPointLightRotations(const in vec3 vector){mat4 rotations[6];rotations[0]=mat4(0,0,1,0,0,1,0,0,-1,0,0,0,0,0,0,1);rotations[1]=mat4(0,0,-1,0,0,1,0,0,1,0,0,0,0,0,0,1);rotations[2]=mat4(-1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1);rotations[3]=mat4(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);rotations[4]=mat4(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);rotations[5]=mat4(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);vec3 a=abs(vector.xyz);if(a.x>a.y){if(a.x>a.z)return vector.x>0.0?rotations[1]:rotations[0];else return vector.z>0.0?rotations[2]:rotations[3];}else{if(a.y>a.z)return vector.y>0.0?rotations[5]:rotations[4];else return vector.z>0.0?rotations[2]:rotations[3];}return rotations[3];}float getShadowIntensity(const in int index,const in x3d_LightSourceParameters light){if(light.type==x3d_PointLight){const mat4 biasMatrix=mat4(0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.5,0.5,1.0);const mat4 projectionMatrix=mat4(1.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,-1.000025000312504,-1.0,0,0.0,-0.25000312503906297,0.0);vec2 texelSize=vec2(1.0)/(float(light.shadowMapSize)*vec2(4.0,2.0));vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);vec3 lightToPosition=shadowCoord.xyz;shadowCoord=biasMatrix*(projectionMatrix*(getPointLightRotations(lightToPosition)*shadowCoord));shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;
94338
- #if defined(X3D_PCF_FILTERING)||defined(X3D_PCF_SOFT_FILTERING)
94339
- vec2 offset=vec2(-1,1)*(texelSize.y*42.0);float value=(texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxx,texelSize.y),shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;
94340
- #else
94341
- float value=texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z);return light.shadowIntensity*value;
94342
- #endif
94343
- }else{
94344
- #if defined(X3D_PCF_FILTERING)
94345
- vec2 texelSize=vec2(1.0)/vec2(light.shadowMapSize);vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;vec2 d0=-texelSize;vec2 d1=texelSize;float value=(texture2DCompare(index,shadowCoord.xy+d0,shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(0.0,d0.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d1.x,d0.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d0.x,0.0),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy,shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d1.x,0.0),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(d0.x,d1.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+vec2(0.0,d1.y),shadowCoord.z)+texture2DCompare(index,shadowCoord.xy+d1,shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;
94346
- #elif defined(X3D_PCF_SOFT_FILTERING)
94347
- vec2 texelSize=vec2(1.0)/vec2(light.shadowMapSize);vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;vec2 d0=-texelSize;vec2 d1=texelSize;float value=(texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+d0,shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(0.0,d0.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d1.x,d0.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d0.x,0.0),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy,shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d1.x,0.0),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(d0.x,d1.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+vec2(0.0,d1.y),shadowCoord.z)+texture2DShadowLerp(index,texelSize,float(shadowMapSize),shadowCoord.xy+d1,shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;
94348
- #else
94349
- vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;if(any(greaterThan(abs(shadowCoord.xy-0.5),vec2(0.5))))return 0.0;float value=texture2DCompare(index,shadowCoord.xy,shadowCoord.z);return light.shadowIntensity*value;
94350
- #endif
94351
- }return 0.0;}
94352
- #endif
94353
- `
94354
- ;
94355
-
94356
- x_ite_Namespace .add ("Shadow1.glsl", "assets/shaders/webgl1/common/Shadow1.glsl", Shadow1_glsl_default_);
94357
- /* harmony default export */ const Shadow1_glsl = (Shadow1_glsl_default_);
94358
94399
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Texture1.glsl.js
94359
94400
 
94360
94401
 
@@ -94413,10 +94454,20 @@ textureColor = texture2D (x3d_Texture2D [${i}], texCoord .st);
94413
94454
  #elif defined (X3D_TEXTURE${i}_CUBE)
94414
94455
  textureColor = textureCube (x3d_TextureCube [${i}], texCoord .stp);
94415
94456
  #endif
94457
+ #if defined (X3D_COLORSPACE_SRGB)
94458
+ #if defined (X3D_TEXTURE${i}_LINEAR)
94459
+ textureColor = linearToSRGB (textureColor);
94460
+ #endif
94461
+ #elif defined (X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
94416
94462
  #if defined (X3D_PHYSICAL_MATERIAL) && !defined (X3D_TEXTURE${i}_LINEAR)
94417
94463
  textureColor = sRGBToLinear (textureColor);
94418
94464
  #elif !defined (X3D_PHYSICAL_MATERIAL) && defined (X3D_TEXTURE${i}_LINEAR)
94419
- textureColor = linearTosRGB (textureColor);
94465
+ textureColor = linearToSRGB (textureColor);
94466
+ #endif
94467
+ #elif defined (X3D_COLORSPACE_LINEAR)
94468
+ #if !defined (X3D_TEXTURE${i}_LINEAR)
94469
+ textureColor = sRGBToLinear (textureColor);
94470
+ #endif
94420
94471
  #endif
94421
94472
  }
94422
94473
  #endif
@@ -94444,10 +94495,16 @@ textureColor = texture2D (x3d_TextureProjectorTexture [${i}], texCoord);
94444
94495
  #endif
94445
94496
  `) .join ("\n")}
94446
94497
  return textureColor;}vec3 getTextureProjectorColor(){vec3 currentColor=vec3(1.0);vec3 N=gl_FrontFacing?normal:-normal;for(int i=0;i<X3D_NUM_TEXTURE_PROJECTORS;++i){vec4 texCoord=x3d_TextureProjectorMatrix[i]*vec4(vertex,1.0);texCoord.stp/=texCoord.q;texCoord.p=clamp(texCoord.p,x3d_TextureProjectorParams[i].x,x3d_TextureProjectorParams[i].y);if(any(greaterThan(abs(texCoord.stp-0.5),vec3(0.5))))continue;vec3 p=x3d_TextureProjectorLocation[i]-vertex;if(dot(N,p)<0.0)continue;vec4 T=getTextureProjectorTexture(i,texCoord.st);
94498
+ #if defined(X3D_COLORSPACE_SRGB)
94499
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
94500
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
94447
94501
  #if defined(X3D_PHYSICAL_MATERIAL)
94448
94502
  if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
94449
94503
  #else
94450
- if(bool(x3d_TextureProjectorParams[i].z))T=linearTosRGB(T);
94504
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
94505
+ #endif
94506
+ #elif defined(X3D_COLORSPACE_LINEAR)
94507
+ if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
94451
94508
  #endif
94452
94509
  currentColor*=mix(vec3(1.0),T.rgb*x3d_TextureProjectorColor[i],T.a*x3d_TextureProjectorIntensity[i]);}return currentColor;}
94453
94510
  #endif
@@ -94677,6 +94734,7 @@ finalColor.a=1.0;
94677
94734
  #if defined(X3D_ALPHA_MODE_MASK)
94678
94735
  if(finalColor.a<x3d_AlphaCutoff)discard;finalColor.a=1.0;
94679
94736
  #endif
94737
+ finalColor.rgb=toneMap(finalColor.rgb);
94680
94738
  #if defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)
94681
94739
  float a=finalColor.a;float w=weight(gl_FragCoord.z,a);finalColor.rgb*=a;finalColor*=w;x3d_FragData0=vec4(finalColor.rgb,a);x3d_FragData1=vec4(finalColor.a);
94682
94740
  #else
@@ -94880,7 +94938,36 @@ x_ite_Namespace .add ("PointSize2.glsl", "assets/shaders/webgl2/common/PointSize
94880
94938
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Shadow2.glsl.js
94881
94939
  const Shadow2_glsl_default_ = /* glsl */ `
94882
94940
  #if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
94883
- uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){switch(index){
94941
+ uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];
94942
+ #if __VERSION__==100
94943
+ float getShadowDepth(const in int index,const in vec2 shadowCoord){
94944
+ #if X3D_NUM_LIGHTS>0
94945
+ if(index==0)return texture2D(x3d_ShadowMap[0],shadowCoord).r;
94946
+ #endif
94947
+ #if X3D_NUM_LIGHTS>1
94948
+ if(index==1)return texture2D(x3d_ShadowMap[1],shadowCoord).r;
94949
+ #endif
94950
+ #if X3D_NUM_LIGHTS>2
94951
+ if(index==2)return texture2D(x3d_ShadowMap[2],shadowCoord).r;
94952
+ #endif
94953
+ #if X3D_NUM_LIGHTS>3
94954
+ if(index==3)return texture2D(x3d_ShadowMap[3],shadowCoord).r;
94955
+ #endif
94956
+ #if X3D_NUM_LIGHTS>4
94957
+ if(index==4)return texture2D(x3d_ShadowMap[4],shadowCoord).r;
94958
+ #endif
94959
+ #if X3D_NUM_LIGHTS>5
94960
+ if(index==5)return texture2D(x3d_ShadowMap[5],shadowCoord).r;
94961
+ #endif
94962
+ #if X3D_NUM_LIGHTS>6
94963
+ if(index==6)return texture2D(x3d_ShadowMap[6],shadowCoord).r;
94964
+ #endif
94965
+ #if X3D_NUM_LIGHTS>7
94966
+ if(index==7)return texture2D(x3d_ShadowMap[7],shadowCoord).r;
94967
+ #endif
94968
+ return 0.0;}
94969
+ #else
94970
+ float getShadowDepth(const in int index,const in vec2 shadowCoord){switch(index){
94884
94971
  #if X3D_NUM_LIGHTS>0
94885
94972
  case 0:{return texture(x3d_ShadowMap[0],shadowCoord).r;}
94886
94973
  #endif
@@ -94905,7 +94992,9 @@ case 6:{return texture(x3d_ShadowMap[6],shadowCoord).r;}
94905
94992
  #if X3D_NUM_LIGHTS>7
94906
94993
  case 7:{return texture(x3d_ShadowMap[7],shadowCoord).r;}
94907
94994
  #endif
94908
- default:{return 0.0;}}}float texture2DCompare(const in int index,const in vec2 texCoord,const in float compare){float shadowDepth=getShadowDepth(index,texCoord);return(1.0-step(1.0,shadowDepth))*step(shadowDepth,compare);}float texture2DShadowLerp(const in int index,const in vec2 texelSize,const in float shadowMapSize,const in vec2 texCoord,const in float compare){const vec2 offset=vec2(0.0,1.0);vec2 centroidTexCoord=floor(texCoord*shadowMapSize+0.5)/shadowMapSize;float lb=texture2DCompare(index,centroidTexCoord+texelSize*offset.xx,compare);float lt=texture2DCompare(index,centroidTexCoord+texelSize*offset.xy,compare);float rb=texture2DCompare(index,centroidTexCoord+texelSize*offset.yx,compare);float rt=texture2DCompare(index,centroidTexCoord+texelSize*offset.yy,compare);vec2 f=fract(texCoord*shadowMapSize+0.5);float a=mix(lb,lt,f.y);float b=mix(rb,rt,f.y);float c=mix(a,b,f.x);return c;}vec2 cubeToUVCompact(in vec3 v,const float texelSizeY){vec3 absV=abs(v);float scaleToCube=1.0/max(absV.x,max(absV.y,absV.z));absV*=scaleToCube;v*=scaleToCube*(1.0-2.0*texelSizeY);vec2 planar=v.xy;float almostATexel=1.5*texelSizeY;float almostOne=1.0-almostATexel;if(absV.z>=almostOne){if(v.z>0.0)planar.x=4.0-v.x;}else if(absV.x>=almostOne){float signX=sign(v.x);planar.x=v.z*signX+2.0*signX;}else if(absV.y>=almostOne){float signY=sign(v.y);planar.x=(v.x+0.5+signY)*2.0;planar.y=v.z*signY-2.0;}return vec2(0.125,0.25)*planar+vec2(0.375,0.75);}mat4 getPointLightRotations(const in vec3 vector){mat4 rotations[6];rotations[0]=mat4(0,0,1,0,0,1,0,0,-1,0,0,0,0,0,0,1);rotations[1]=mat4(0,0,-1,0,0,1,0,0,1,0,0,0,0,0,0,1);rotations[2]=mat4(-1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1);rotations[3]=mat4(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);rotations[4]=mat4(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);rotations[5]=mat4(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);vec3 a=abs(vector.xyz);if(a.x>a.y){if(a.x>a.z)return vector.x>0.0?rotations[1]:rotations[0];else return vector.z>0.0?rotations[2]:rotations[3];}else{if(a.y>a.z)return vector.y>0.0?rotations[5]:rotations[4];else return vector.z>0.0?rotations[2]:rotations[3];}return rotations[3];}float getShadowIntensity(const in int index,const in x3d_LightSourceParameters light){if(light.type==x3d_PointLight){const mat4 biasMatrix=mat4(0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.5,0.5,1.0);const mat4 projectionMatrix=mat4(1.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,-1.000025000312504,-1.0,0,0.0,-0.25000312503906297,0.0);vec2 texelSize=vec2(1.0)/(float(light.shadowMapSize)*vec2(4.0,2.0));vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);vec3 lightToPosition=shadowCoord.xyz;shadowCoord=biasMatrix*(projectionMatrix*(getPointLightRotations(lightToPosition)*shadowCoord));shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;
94995
+ default:{return 0.0;}}}
94996
+ #endif
94997
+ float texture2DCompare(const in int index,const in vec2 texCoord,const in float compare){float shadowDepth=getShadowDepth(index,texCoord);return(1.0-step(1.0,shadowDepth))*step(shadowDepth,compare);}float texture2DShadowLerp(const in int index,const in vec2 texelSize,const in float shadowMapSize,const in vec2 texCoord,const in float compare){const vec2 offset=vec2(0.0,1.0);vec2 centroidTexCoord=floor(texCoord*shadowMapSize+0.5)/shadowMapSize;float lb=texture2DCompare(index,centroidTexCoord+texelSize*offset.xx,compare);float lt=texture2DCompare(index,centroidTexCoord+texelSize*offset.xy,compare);float rb=texture2DCompare(index,centroidTexCoord+texelSize*offset.yx,compare);float rt=texture2DCompare(index,centroidTexCoord+texelSize*offset.yy,compare);vec2 f=fract(texCoord*shadowMapSize+0.5);float a=mix(lb,lt,f.y);float b=mix(rb,rt,f.y);float c=mix(a,b,f.x);return c;}vec2 cubeToUVCompact(in vec3 v,const float texelSizeY){vec3 absV=abs(v);float scaleToCube=1.0/max(absV.x,max(absV.y,absV.z));absV*=scaleToCube;v*=scaleToCube*(1.0-2.0*texelSizeY);vec2 planar=v.xy;float almostATexel=1.5*texelSizeY;float almostOne=1.0-almostATexel;if(absV.z>=almostOne){if(v.z>0.0)planar.x=4.0-v.x;}else if(absV.x>=almostOne){float signX=sign(v.x);planar.x=v.z*signX+2.0*signX;}else if(absV.y>=almostOne){float signY=sign(v.y);planar.x=(v.x+0.5+signY)*2.0;planar.y=v.z*signY-2.0;}return vec2(0.125,0.25)*planar+vec2(0.375,0.75);}mat4 getPointLightRotations(const in vec3 vector){mat4 rotations[6];rotations[0]=mat4(0,0,1,0,0,1,0,0,-1,0,0,0,0,0,0,1);rotations[1]=mat4(0,0,-1,0,0,1,0,0,1,0,0,0,0,0,0,1);rotations[2]=mat4(-1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1);rotations[3]=mat4(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);rotations[4]=mat4(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);rotations[5]=mat4(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);vec3 a=abs(vector.xyz);if(a.x>a.y){if(a.x>a.z)return vector.x>0.0?rotations[1]:rotations[0];else return vector.z>0.0?rotations[2]:rotations[3];}else{if(a.y>a.z)return vector.y>0.0?rotations[5]:rotations[4];else return vector.z>0.0?rotations[2]:rotations[3];}return rotations[3];}float getShadowIntensity(const in int index,const in x3d_LightSourceParameters light){if(light.type==x3d_PointLight){const mat4 biasMatrix=mat4(0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.5,0.5,1.0);const mat4 projectionMatrix=mat4(1.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,-1.000025000312504,-1.0,0,0.0,-0.25000312503906297,0.0);vec2 texelSize=vec2(1.0)/(float(light.shadowMapSize)*vec2(4.0,2.0));vec4 shadowCoord=light.shadowMatrix*vec4(vertex,1.0);vec3 lightToPosition=shadowCoord.xyz;shadowCoord=biasMatrix*(projectionMatrix*(getPointLightRotations(lightToPosition)*shadowCoord));shadowCoord.z-=light.shadowBias;shadowCoord.xyz/=shadowCoord.w;
94909
94998
  #if defined(X3D_PCF_FILTERING)||defined(X3D_PCF_SOFT_FILTERING)
94910
94999
  vec2 offset=vec2(-1,1)*(texelSize.y*42.0);float value=(texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yyx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxy,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.xxx,texelSize.y),shadowCoord.z)+texture2DCompare(index,cubeToUVCompact(lightToPosition+offset.yxx,texelSize.y),shadowCoord.z))*(1.0/9.0);return light.shadowIntensity*value;
94911
95000
  #else
@@ -95029,10 +95118,20 @@ textureColor = texture (x3d_Texture3D [${i}], texCoord .stp);
95029
95118
  #elif defined (X3D_TEXTURE${i}_CUBE)
95030
95119
  textureColor = texture (x3d_TextureCube [${i}], texCoord .stp);
95031
95120
  #endif
95121
+ #if defined (X3D_COLORSPACE_SRGB)
95122
+ #if defined (X3D_TEXTURE${i}_LINEAR)
95123
+ textureColor = linearToSRGB (textureColor);
95124
+ #endif
95125
+ #elif defined (X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
95032
95126
  #if defined (X3D_PHYSICAL_MATERIAL) && !defined (X3D_TEXTURE${i}_LINEAR)
95033
95127
  textureColor = sRGBToLinear (textureColor);
95034
95128
  #elif !defined (X3D_PHYSICAL_MATERIAL) && defined (X3D_TEXTURE${i}_LINEAR)
95035
- textureColor = linearTosRGB (textureColor);
95129
+ textureColor = linearToSRGB (textureColor);
95130
+ #endif
95131
+ #elif defined (X3D_COLORSPACE_LINEAR)
95132
+ #if !defined (X3D_TEXTURE${i}_LINEAR)
95133
+ textureColor = sRGBToLinear (textureColor);
95134
+ #endif
95036
95135
  #endif
95037
95136
  break;
95038
95137
  }
@@ -95060,10 +95159,16 @@ break;
95060
95159
  #endif
95061
95160
  `) .join ("\n")}
95062
95161
  }return textureColor;}vec3 getTextureProjectorColor(){vec3 currentColor=vec3(1.0);vec3 N=gl_FrontFacing?normal:-normal;for(int i=0;i<X3D_NUM_TEXTURE_PROJECTORS;++i){vec4 texCoord=x3d_TextureProjectorMatrix[i]*vec4(vertex,1.0);texCoord.stp/=texCoord.q;texCoord.p=clamp(texCoord.p,x3d_TextureProjectorParams[i].x,x3d_TextureProjectorParams[i].y);if(any(greaterThan(abs(texCoord.stp-0.5),vec3(0.5))))continue;vec3 p=x3d_TextureProjectorLocation[i]-vertex;if(dot(N,p)<0.0)continue;vec4 T=getTextureProjectorTexture(i,texCoord.st);
95162
+ #if defined(X3D_COLORSPACE_SRGB)
95163
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
95164
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
95063
95165
  #if defined(X3D_PHYSICAL_MATERIAL)
95064
95166
  if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
95065
95167
  #else
95066
- if(bool(x3d_TextureProjectorParams[i].z))T=linearTosRGB(T);
95168
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
95169
+ #endif
95170
+ #elif defined(X3D_COLORSPACE_LINEAR)
95171
+ if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
95067
95172
  #endif
95068
95173
  currentColor*=mix(vec3(1.0),T.rgb*x3d_TextureProjectorColor[i],T.a*x3d_TextureProjectorIntensity[i]);}return currentColor;}
95069
95174
  #endif
@@ -95308,141 +95413,18 @@ backColor=getMaterialColor(-normal,vertex,x3d_Material);
95308
95413
 
95309
95414
  x_ite_Namespace .add ("Gouraud1.vs", "assets/shaders/webgl1/Gouraud1.vs", Gouraud1_vs_default_);
95310
95415
  /* harmony default export */ const Gouraud1_vs = (Gouraud1_vs_default_);
95311
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/PBR1.fs.js
95312
- const PBR1_fs_default_ = /* glsl */ `
95416
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Physical1.fs.js
95417
+ const Physical1_fs_default_ = /* glsl */ `
95313
95418
  #extension GL_OES_standard_derivatives:enable
95314
95419
  #extension GL_EXT_frag_depth:enable
95315
95420
  #extension GL_EXT_shader_texture_lod:enable
95316
95421
  precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
95317
- #pragma X3D include "common/Fragment.glsl"
95318
- #pragma X3D include "common/Normal.glsl"
95319
- #pragma X3D include "common/Shadow.glsl"
95320
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95321
- uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
95322
- #endif
95323
- #if defined(X3D_LIGHTING)
95324
- uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
95325
- #endif
95326
- uniform x3d_PhysicalMaterialParameters x3d_Material;
95327
- #pragma X3D include "pbr/BRDF.glsl"
95328
- #pragma X3D include "pbr/MaterialInfo.glsl"
95329
- #pragma X3D include "pbr/Punctual.glsl"
95330
- #pragma X3D include "pbr/IBL.glsl"
95331
- #pragma X3D include "pbr/Iridescence.glsl"
95332
- vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
95333
- #if defined(X3D_TEXTURE_PROJECTION)
95334
- baseColor.rgb*=getTextureProjectorColor();
95335
- #endif
95336
- vec3 v=normalize(-vertex);
95337
- #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)||defined(X3D_ANISOTROPY_MATERIAL_EXT)||defined(X3D_CLEARCOAT_MATERIAL_EXT)
95338
- NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.0,1.0);
95339
- #endif
95340
- MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
95341
- #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
95342
- materialInfo=getMetallicRoughnessInfo(materialInfo);
95343
- #endif
95344
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95345
- materialInfo=getSheenInfo(materialInfo);
95346
- #endif
95347
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95348
- materialInfo=getClearCoatInfo(materialInfo,normalInfo);
95349
- #endif
95350
- #if defined(X3D_SPECULAR_MATERIAL_EXT)
95351
- materialInfo=getSpecularInfo(materialInfo);
95352
- #endif
95353
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95354
- materialInfo=getTransmissionInfo(materialInfo);
95355
- #endif
95356
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95357
- materialInfo=getVolumeInfo(materialInfo);
95358
- #endif
95359
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95360
- materialInfo=getIridescenceInfo(materialInfo);
95361
- #endif
95362
- #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
95363
- materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
95364
- #endif
95365
- 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;
95366
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)&&(defined(X3D_USE_IBL)||defined(X3D_LIGHTING))
95367
- 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;
95368
- #endif
95369
- #if defined(X3D_USE_IBL)
95370
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95371
- 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);
95372
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95373
- 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);
95374
- #else
95375
- 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);
95376
- #endif
95377
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95378
- f_clearcoat+=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness,materialInfo.clearcoatF0,1.0);
95379
- #endif
95380
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95381
- f_sheen+=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
95382
- #endif
95383
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95384
- 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);
95385
- #endif
95386
- #endif
95387
- 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);
95388
- #if defined(X3D_LIGHTING)
95389
- 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);
95390
- #if defined(X3D_SHADOWS)
95391
- intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
95392
- #endif
95393
- vec3 l_diffuse=vec3(0.0);vec3 l_specular=vec3(0.0);
95394
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95395
- 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);
95396
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95397
- 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);
95398
- #else
95399
- 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);
95400
- #endif
95401
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95402
- 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;
95403
- #endif
95404
- f_diffuse+=l_diffuse;f_specular+=l_specular;
95405
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95406
- f_clearcoat+=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
95407
- #endif
95408
- }
95409
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95410
- 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);
95411
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95412
- transmittedLight=applyVolumeAttenuation(transmittedLight,length(transmissionRay),materialInfo.attenuationColor,materialInfo.attenuationDistance);
95413
- #endif
95414
- f_transmission+=transmittedLight;
95415
- #endif
95416
- }}
95417
- #endif
95418
- f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
95419
- #if defined(X3D_OCCLUSION_TEXTURE)
95420
- 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);
95421
- #else
95422
- 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;
95423
- #endif
95424
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95425
- clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));clearcoat*=clearcoatFactor;
95426
- #endif
95427
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95428
- diffuse=mix(diffuse,f_transmission,materialInfo.transmissionFactor);
95429
- #endif
95430
- vec3 color=vec3(0.0);
95431
- #if defined(X3D_UNLIT_MATERIAL_EXT)
95432
- color=baseColor.rgb;
95433
- #else
95434
- color=f_emissive+diffuse+specular;color=sheen+color;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
95435
- #endif
95436
- #if defined(X3D_LINEAR_OUTPUT)
95437
- return vec4(color,baseColor.a);
95438
- #else
95439
- return vec4(toneMap(color),baseColor.a);
95440
- #endif
95441
- }void main(){fragment_main();}`
95422
+ #pragma X3D include "pbr/PBR.glsl"
95423
+ `
95442
95424
  ;
95443
95425
 
95444
- x_ite_Namespace .add ("PBR1.fs", "assets/shaders/webgl1/PBR1.fs", PBR1_fs_default_);
95445
- /* harmony default export */ const PBR1_fs = (PBR1_fs_default_);
95426
+ x_ite_Namespace .add ("Physical1.fs", "assets/shaders/webgl1/Physical1.fs", Physical1_fs_default_);
95427
+ /* harmony default export */ const Physical1_fs = (Physical1_fs_default_);
95446
95428
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Phong1.fs.js
95447
95429
 
95448
95430
 
@@ -95737,144 +95719,15 @@ precision highp float;precision highp int;precision highp sampler2D;uniform samp
95737
95719
 
95738
95720
  x_ite_Namespace .add ("OITCompose2.fs", "assets/shaders/webgl2/OITCompose2.fs", OITCompose2_fs_default_);
95739
95721
  /* harmony default export */ const OITCompose2_fs = (OITCompose2_fs_default_);
95740
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/PBR2.fs.js
95741
- const PBR2_fs_default_ = /* glsl */ `#version 300 es
95722
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Physical2.js
95723
+ const Physical2_default_ = /* glsl */ `#version 300 es
95742
95724
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
95743
- #pragma X3D include "common/Fragment.glsl"
95744
- #pragma X3D include "common/Normal.glsl"
95745
- #pragma X3D include "common/Shadow.glsl"
95746
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95747
- uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
95748
- #endif
95749
- #if defined(X3D_LIGHTING)
95750
- uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
95751
- #endif
95752
- uniform x3d_PhysicalMaterialParameters x3d_Material;
95753
- #pragma X3D include "pbr/BRDF.glsl"
95754
- #pragma X3D include "pbr/MaterialInfo.glsl"
95755
- #pragma X3D include "pbr/Punctual.glsl"
95756
- #pragma X3D include "pbr/IBL.glsl"
95757
- #pragma X3D include "pbr/Iridescence.glsl"
95758
- vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
95759
- #if defined(X3D_TEXTURE_PROJECTION)
95760
- baseColor.rgb*=getTextureProjectorColor();
95761
- #endif
95762
- vec3 v=normalize(-vertex);
95763
- #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)||defined(X3D_ANISOTROPY_MATERIAL_EXT)||defined(X3D_CLEARCOAT_MATERIAL_EXT)
95764
- NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.0,1.0);
95765
- #endif
95766
- MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
95767
- #if defined(X3D_IOR_MATERIAL_EXT)
95768
- materialInfo=getIorInfo(materialInfo);
95769
- #endif
95770
- #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
95771
- materialInfo=getSpecularGlossinessInfo(materialInfo);
95772
- #endif
95773
- #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
95774
- materialInfo=getMetallicRoughnessInfo(materialInfo);
95775
- #endif
95776
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95777
- materialInfo=getSheenInfo(materialInfo);
95778
- #endif
95779
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95780
- materialInfo=getClearCoatInfo(materialInfo,normalInfo);
95781
- #endif
95782
- #if defined(X3D_SPECULAR_MATERIAL_EXT)
95783
- materialInfo=getSpecularInfo(materialInfo);
95784
- #endif
95785
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95786
- materialInfo=getTransmissionInfo(materialInfo);
95787
- #endif
95788
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95789
- materialInfo=getVolumeInfo(materialInfo);
95790
- #endif
95791
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95792
- materialInfo=getIridescenceInfo(materialInfo);
95793
- #endif
95794
- #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
95795
- materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
95796
- #endif
95797
- 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;
95798
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)&&(defined(X3D_USE_IBL)||defined(X3D_LIGHTING))
95799
- 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;
95800
- #endif
95801
- #if defined(X3D_USE_IBL)
95802
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95803
- 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);
95804
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95805
- 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);
95806
- #else
95807
- 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);
95808
- #endif
95809
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95810
- f_clearcoat+=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness,materialInfo.clearcoatF0,1.0);
95811
- #endif
95812
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95813
- f_sheen+=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
95814
- #endif
95815
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95816
- 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);
95817
- #endif
95818
- #endif
95819
- 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);
95820
- #if defined(X3D_LIGHTING)
95821
- 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);
95822
- #if defined(X3D_SHADOWS)
95823
- intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
95824
- #endif
95825
- vec3 l_diffuse=vec3(0.0);vec3 l_specular=vec3(0.0);
95826
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95827
- 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);
95828
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95829
- 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);
95830
- #else
95831
- 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);
95832
- #endif
95833
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95834
- 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;
95835
- #endif
95836
- f_diffuse+=l_diffuse;f_specular+=l_specular;
95837
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95838
- f_clearcoat+=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
95839
- #endif
95840
- }
95841
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95842
- 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);
95843
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95844
- transmittedLight=applyVolumeAttenuation(transmittedLight,length(transmissionRay),materialInfo.attenuationColor,materialInfo.attenuationDistance);
95845
- #endif
95846
- f_transmission+=transmittedLight;
95847
- #endif
95848
- }}
95849
- #endif
95850
- f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
95851
- #if defined(X3D_OCCLUSION_TEXTURE)
95852
- 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);
95853
- #else
95854
- 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;
95855
- #endif
95856
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95857
- clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));clearcoat*=clearcoatFactor;
95858
- #endif
95859
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95860
- diffuse=mix(diffuse,f_transmission,materialInfo.transmissionFactor);
95861
- #endif
95862
- vec3 color=vec3(0.0);
95863
- #if defined(X3D_UNLIT_MATERIAL_EXT)
95864
- color=baseColor.rgb;
95865
- #else
95866
- color=f_emissive+diffuse+specular;color=sheen+color;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
95867
- #endif
95868
- #if defined(X3D_LINEAR_OUTPUT)
95869
- return vec4(color,baseColor.a);
95870
- #else
95871
- return vec4(toneMap(color),baseColor.a);
95872
- #endif
95873
- }void main(){fragment_main();}`
95725
+ #pragma X3D include "pbr/PBR.glsl"
95726
+ `
95874
95727
  ;
95875
95728
 
95876
- x_ite_Namespace .add ("PBR2.fs", "assets/shaders/webgl2/PBR2.fs", PBR2_fs_default_);
95877
- /* harmony default export */ const PBR2_fs = (PBR2_fs_default_);
95729
+ x_ite_Namespace .add ("Physical2", "assets/shaders/webgl2/Physical2", Physical2_default_);
95730
+ /* harmony default export */ const Physical2 = (Physical2_default_);
95878
95731
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Phong2.fs.js
95879
95732
 
95880
95733
 
@@ -96071,13 +95924,23 @@ vec3 textureColor=textureCube(x3d_EnvironmentLightSource.diffuseTexture,texCoord
96071
95924
  #else
96072
95925
  vec3 textureColor=texture(x3d_EnvironmentLightSource.diffuseTexture,texCoord).rgb;
96073
95926
  #endif
96074
- if(!x3d_EnvironmentLightSource.diffuseTextureLinear)textureColor=sRGBToLinear(textureColor);return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}vec3 getSpecularLight(const in vec3 reflection,const in float lod){vec3 texCoord=x3d_EnvironmentLightSource.rotation*reflection*vec3(-1.0,1.0,1.0);
95927
+ #if defined(X3D_COLORSPACE_SRGB)
95928
+ if(x3d_EnvironmentLightSource.diffuseTextureLinear)textureColor=linearToSRGB(textureColor);
95929
+ #else
95930
+ if(!x3d_EnvironmentLightSource.diffuseTextureLinear)textureColor=sRGBToLinear(textureColor);
95931
+ #endif
95932
+ return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}vec3 getSpecularLight(const in vec3 reflection,const in float lod){vec3 texCoord=x3d_EnvironmentLightSource.rotation*reflection*vec3(-1.0,1.0,1.0);
96075
95933
  #if __VERSION__==100
96076
95934
  vec3 textureColor=textureCubeLodEXT(x3d_EnvironmentLightSource.specularTexture,texCoord,lod).rgb;
96077
95935
  #else
96078
95936
  vec3 textureColor=textureLod(x3d_EnvironmentLightSource.specularTexture,texCoord,lod).rgb;
96079
95937
  #endif
96080
- if(!x3d_EnvironmentLightSource.specularTextureLinear)textureColor=sRGBToLinear(textureColor);return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}
95938
+ #if defined(X3D_COLORSPACE_SRGB)
95939
+ if(x3d_EnvironmentLightSource.specularTextureLinear)textureColor=linearToSRGB(textureColor);
95940
+ #else
95941
+ if(!x3d_EnvironmentLightSource.specularTextureLinear)textureColor=sRGBToLinear(textureColor);
95942
+ #endif
95943
+ return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}
96081
95944
  #if defined(X3D_SHEEN_MATERIAL_EXT)
96082
95945
  vec3 getSheenLight(const in vec3 reflection,const in float lod){return vec3(0.5)*(lod/float(x3d_EnvironmentLightSource.specularTextureLevels))*x3d_EnvironmentLightSource.intensity;}
96083
95946
  #endif
@@ -96116,7 +95979,12 @@ float framebufferSize=max(float(x3d_TransmissionFramebufferSizeEXT.x),float(x3d_
96116
95979
  #else
96117
95980
  int framebufferSize=max(x3d_TransmissionFramebufferSizeEXT.x,x3d_TransmissionFramebufferSizeEXT.y);float framebufferLod=log2(float(framebufferSize))*applyIorToRoughness(roughness,ior);vec3 transmittedLight=textureLod(x3d_TransmissionFramebufferSamplerEXT,fragCoord,framebufferLod).rgb;
96118
95981
  #endif
96119
- return sRGBToLinear(transmittedLight);}vec3 getIBLVolumeRefraction(const in vec3 n,const in vec3 v,const in float perceptualRoughness,const in vec3 baseColor,const in vec3 f0,const in vec3 f90,const in vec3 position,const in mat4 modelMatrix,const in mat4 projMatrix,const in float ior,const in float thickness,const in vec3 attenuationColor,const in float attenuationDistance,const in float dispersion){
95982
+ #if defined(X3D_COLORSPACE_SRGB)
95983
+ return transmittedLight;
95984
+ #else
95985
+ return sRGBToLinear(transmittedLight);
95986
+ #endif
95987
+ }vec3 getIBLVolumeRefraction(const in vec3 n,const in vec3 v,const in float perceptualRoughness,const in vec3 baseColor,const in vec3 f0,const in vec3 f90,const in vec3 position,const in mat4 modelMatrix,const in mat4 projMatrix,const in float ior,const in float thickness,const in vec3 attenuationColor,const in float attenuationDistance,const in float dispersion){
96120
95988
  #if defined(X3D_DISPERSION_MATERIAL_EXT)
96121
95989
  float halfSpread=(ior-1.0)*0.025*dispersion;vec3 iors=vec3(ior-halfSpread,ior,ior+halfSpread);vec3 transmittedLight;float transmissionRayLength;for(int i=0;i<3;i++){vec3 transmissionRay=getVolumeTransmissionRay(n,v,thickness,iors[i],modelMatrix);transmissionRayLength=length(transmissionRay);vec3 refractedRayExit=position+transmissionRay;vec4 ndcPos=projMatrix*vec4(refractedRayExit,1.0);vec2 refractionCoords=ndcPos.xy/ndcPos.w;refractionCoords+=1.0;refractionCoords/=2.0;transmittedLight[i]=getTransmissionSample(refractionCoords,perceptualRoughness,iors[i])[i];}
96122
95990
  #else
@@ -96164,29 +96032,6 @@ const mat3 XYZ_TO_REC709=mat3(3.2404542,-0.9692660,0.0556434,-1.5371385,1.876010
96164
96032
 
96165
96033
  x_ite_Namespace .add ("Iridescence2.glsl", "assets/shaders/webgl2/pbr/Iridescence2.glsl", Iridescence2_glsl_default_);
96166
96034
  /* harmony default export */ const Iridescence2_glsl = (Iridescence2_glsl_default_);
96167
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/Punctual2.glsl.js
96168
- const Punctual2_glsl_default_ = /* glsl */ `
96169
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96170
- float applyIorToRoughness(const in float roughness,const in float ior){return roughness*clamp(ior*2.0-2.0,0.0,1.0);}
96171
- #endif
96172
- #if defined(X3D_LIGHTING)
96173
- #pragma X3D include "../common/Lighting.glsl"
96174
- 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;}
96175
- #if defined(X3D_SHEEN_MATERIAL_EXT)
96176
- 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);}
96177
- #endif
96178
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96179
- 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);}
96180
- #endif
96181
- #endif
96182
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96183
- vec3 getPunctualRadianceTransmission(const in vec3 n,const in vec3 v,const in vec3 l,const in float alphaRoughness,const in vec3 f0,const in vec3 f90,const in vec3 baseColor,const in float ior){float transmissionRoughness=applyIorToRoughness(alphaRoughness,ior);vec3 l_mirror=normalize(l+2.0*n*dot(-l,n));vec3 h=normalize(l_mirror+v);float D=D_GGX(clamp(dot(n,h),0.0,1.0),transmissionRoughness);vec3 F=F_Schlick(f0,f90,clamp(dot(v,h),0.0,1.0));float Vis=V_GGX(clamp(dot(n,l_mirror),0.0,1.0),clamp(dot(n,v),0.0,1.0),transmissionRoughness);return(1.0-F)*baseColor*D*Vis;}vec3 applyVolumeAttenuation(const in vec3 radiance,const in float transmissionDistance,const in vec3 attenuationColor,const in float attenuationDistance){if(attenuationDistance==0.0){return radiance;}else{vec3 attenuationCoefficient=-log(attenuationColor)/attenuationDistance;vec3 transmittance=exp(-attenuationCoefficient*transmissionDistance);return transmittance*radiance;}}vec3 getVolumeTransmissionRay(const in vec3 n,const in vec3 v,const in float thickness,const in float ior,const in mat4 modelMatrix){vec3 refractionVector=refract(-v,normalize(n),1.0/ior);vec3 modelScale;modelScale.x=length(vec3(modelMatrix[0].xyz));modelScale.y=length(vec3(modelMatrix[1].xyz));modelScale.z=length(vec3(modelMatrix[2].xyz));return normalize(refractionVector)*thickness*modelScale;}
96184
- #endif
96185
- `
96186
- ;
96187
-
96188
- x_ite_Namespace .add ("Punctual2.glsl", "assets/shaders/webgl2/pbr/Punctual2.glsl", Punctual2_glsl_default_);
96189
- /* harmony default export */ const Punctual2_glsl = (Punctual2_glsl_default_);
96190
96035
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/MaterialInfo2.glsl.js
96191
96036
 
96192
96037
 
@@ -96270,12 +96115,13 @@ info.sheenColorFactor*=getSheenColorTextureEXT();
96270
96115
  #if defined(X3D_SHEEN_ROUGHNESS_TEXTURE_EXT)
96271
96116
  info.sheenRoughnessFactor*=getSheenRoughnessTextureEXT();
96272
96117
  #endif
96273
- return info;}uniform sampler2D x3d_SheenELUTTextureEXT;
96118
+ return info;}uniform sampler2D x3d_SheenELUTTextureEXT;float albedoSheenScalingLUT(const in float NdotV,const in float sheenRoughnessFactor){
96274
96119
  #if __VERSION__==100
96275
- float albedoSheenScalingLUT(const in float NdotV,const in float sheenRoughnessFactor){return texture2D(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;}
96120
+ return texture2D(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;
96276
96121
  #else
96277
- float albedoSheenScalingLUT(const in float NdotV,const in float sheenRoughnessFactor){return texture(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;}
96122
+ return texture(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;
96278
96123
  #endif
96124
+ }
96279
96125
  #endif
96280
96126
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96281
96127
  ${MaterialTextures .texture ("x3d_ClearcoatTextureEXT",
@@ -96316,7 +96162,7 @@ vec3 dielectricSpecularF0=min(info.f0*x3d_SpecularColorEXT*specularTexture.rgb,v
96316
96162
  #endif
96317
96163
  #if defined(X3D_VOLUME_MATERIAL_EXT)
96318
96164
  ${MaterialTextures .texture ("x3d_ThicknessTextureEXT", "g")}
96319
- uniform float x3d_ThicknessEXT;uniform float x3d_AttenuationDistanceEXT;uniform vec3 x3d_AttenuationColoEXT;MaterialInfo getVolumeInfo(in MaterialInfo info){info.thickness=x3d_ThicknessEXT;info.attenuationDistance=x3d_AttenuationDistanceEXT;info.attenuationColor=x3d_AttenuationColoEXT;
96165
+ uniform float x3d_ThicknessEXT;uniform float x3d_AttenuationDistanceEXT;uniform vec3 x3d_AttenuationColorEXT;MaterialInfo getVolumeInfo(in MaterialInfo info){info.thickness=x3d_ThicknessEXT;info.attenuationDistance=x3d_AttenuationDistanceEXT;info.attenuationColor=x3d_AttenuationColorEXT;
96320
96166
  #if defined(X3D_THICKNESS_TEXTURE_EXT)
96321
96167
  info.thickness*=getThicknessTextureEXT();
96322
96168
  #endif
@@ -96365,9 +96211,166 @@ vec2 directionRotation=x3d_AnisotropyEXT.xy;mat2 rotationMatrix=mat2(directionRo
96365
96211
 
96366
96212
  x_ite_Namespace .add ("MaterialInfo2.glsl", "assets/shaders/webgl2/pbr/MaterialInfo2.glsl", MaterialInfo2_glsl_default_);
96367
96213
  /* harmony default export */ const MaterialInfo2_glsl = (MaterialInfo2_glsl_default_);
96214
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/PBR2.glsl.js
96215
+ const PBR2_glsl_default_ = /* glsl */ `
96216
+ #pragma X3D include "../common/Fragment.glsl"
96217
+ #pragma X3D include "../common/Normal.glsl"
96218
+ #pragma X3D include "../common/Shadow.glsl"
96219
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96220
+ uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
96221
+ #endif
96222
+ #if defined(X3D_LIGHTING)
96223
+ uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
96224
+ #endif
96225
+ uniform x3d_PhysicalMaterialParameters x3d_Material;
96226
+ #pragma X3D include "pbr/BRDF.glsl"
96227
+ #pragma X3D include "pbr/MaterialInfo.glsl"
96228
+ #pragma X3D include "pbr/Punctual.glsl"
96229
+ #pragma X3D include "pbr/IBL.glsl"
96230
+ #pragma X3D include "pbr/Iridescence.glsl"
96231
+ vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
96232
+ #if defined(X3D_TEXTURE_PROJECTION)
96233
+ baseColor.rgb*=getTextureProjectorColor();
96234
+ #endif
96235
+ #if!defined(X3D_UNLIT_MATERIAL_EXT)
96236
+ vec3 v=normalize(-vertex);
96237
+ #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)||defined(X3D_ANISOTROPY_MATERIAL_EXT)||defined(X3D_CLEARCOAT_MATERIAL_EXT)
96238
+ NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.0,1.0);
96239
+ #endif
96240
+ MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
96241
+ #if defined(X3D_IOR_MATERIAL_EXT)
96242
+ materialInfo=getIorInfo(materialInfo);
96243
+ #endif
96244
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
96245
+ materialInfo=getSpecularGlossinessInfo(materialInfo);
96246
+ #endif
96247
+ #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
96248
+ materialInfo=getMetallicRoughnessInfo(materialInfo);
96249
+ #endif
96250
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96251
+ materialInfo=getSheenInfo(materialInfo);
96252
+ #endif
96253
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96254
+ materialInfo=getClearCoatInfo(materialInfo,normalInfo);
96255
+ #endif
96256
+ #if defined(X3D_SPECULAR_MATERIAL_EXT)
96257
+ materialInfo=getSpecularInfo(materialInfo);
96258
+ #endif
96259
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96260
+ materialInfo=getTransmissionInfo(materialInfo);
96261
+ #endif
96262
+ #if defined(X3D_VOLUME_MATERIAL_EXT)
96263
+ materialInfo=getVolumeInfo(materialInfo);
96264
+ #endif
96265
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96266
+ materialInfo=getIridescenceInfo(materialInfo);
96267
+ #endif
96268
+ #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
96269
+ materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
96270
+ #endif
96271
+ 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;
96272
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)&&(defined(X3D_USE_IBL)||defined(X3D_LIGHTING))
96273
+ 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;
96274
+ #endif
96275
+ #if defined(X3D_USE_IBL)
96276
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96277
+ 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);
96278
+ #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
96279
+ 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);
96280
+ #else
96281
+ 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);
96282
+ #endif
96283
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96284
+ f_clearcoat+=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness,materialInfo.clearcoatF0,1.0);
96285
+ #endif
96286
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96287
+ f_sheen+=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
96288
+ #endif
96289
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96290
+ 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);
96291
+ #endif
96292
+ #endif
96293
+ 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);
96294
+ #if defined(X3D_LIGHTING)
96295
+ 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);
96296
+ #if defined(X3D_SHADOWS)
96297
+ intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
96298
+ #endif
96299
+ vec3 l_diffuse=vec3(0.0);vec3 l_specular=vec3(0.0);
96300
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96301
+ 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);
96302
+ #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
96303
+ 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);
96304
+ #else
96305
+ 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);
96306
+ #endif
96307
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96308
+ 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;
96309
+ #endif
96310
+ f_diffuse+=l_diffuse;f_specular+=l_specular;
96311
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96312
+ f_clearcoat+=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
96313
+ #endif
96314
+ }
96315
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96316
+ 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);
96317
+ #if defined(X3D_VOLUME_MATERIAL_EXT)
96318
+ transmittedLight=applyVolumeAttenuation(transmittedLight,length(transmissionRay),materialInfo.attenuationColor,materialInfo.attenuationDistance);
96319
+ #endif
96320
+ f_transmission+=transmittedLight;
96321
+ #endif
96322
+ }}
96323
+ #endif
96324
+ f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
96325
+ #if defined(X3D_OCCLUSION_TEXTURE)
96326
+ 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);
96327
+ #else
96328
+ 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;
96329
+ #endif
96330
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96331
+ clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));clearcoat*=clearcoatFactor;
96332
+ #endif
96333
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96334
+ diffuse=mix(diffuse,f_transmission,materialInfo.transmissionFactor);
96335
+ #endif
96336
+ #endif
96337
+ vec3 color=vec3(0.0);
96338
+ #if defined(X3D_UNLIT_MATERIAL_EXT)
96339
+ color=baseColor.rgb;
96340
+ #else
96341
+ color=f_emissive+diffuse+specular;color=sheen+color;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
96342
+ #endif
96343
+ return vec4(color,baseColor.a);}void main(){fragment_main();}`
96344
+ ;
96345
+
96346
+ x_ite_Namespace .add ("PBR2.glsl", "assets/shaders/webgl2/pbr/PBR2.glsl", PBR2_glsl_default_);
96347
+ /* harmony default export */ const PBR2_glsl = (PBR2_glsl_default_);
96348
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/Punctual2.glsl.js
96349
+ const Punctual2_glsl_default_ = /* glsl */ `
96350
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96351
+ float applyIorToRoughness(const in float roughness,const in float ior){return roughness*clamp(ior*2.0-2.0,0.0,1.0);}
96352
+ #endif
96353
+ #if defined(X3D_LIGHTING)
96354
+ #pragma X3D include "../common/Lighting.glsl"
96355
+ 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;}
96356
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96357
+ 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);}
96358
+ #endif
96359
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96360
+ 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);}
96361
+ #endif
96362
+ #endif
96363
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96364
+ vec3 getPunctualRadianceTransmission(const in vec3 n,const in vec3 v,const in vec3 l,const in float alphaRoughness,const in vec3 f0,const in vec3 f90,const in vec3 baseColor,const in float ior){float transmissionRoughness=applyIorToRoughness(alphaRoughness,ior);vec3 l_mirror=normalize(l+2.0*n*dot(-l,n));vec3 h=normalize(l_mirror+v);float D=D_GGX(clamp(dot(n,h),0.0,1.0),transmissionRoughness);vec3 F=F_Schlick(f0,f90,clamp(dot(v,h),0.0,1.0));float Vis=V_GGX(clamp(dot(n,l_mirror),0.0,1.0),clamp(dot(n,v),0.0,1.0),transmissionRoughness);return(1.0-F)*baseColor*D*Vis;}vec3 applyVolumeAttenuation(const in vec3 radiance,const in float transmissionDistance,const in vec3 attenuationColor,const in float attenuationDistance){if(attenuationDistance==0.0){return radiance;}else{vec3 attenuationCoefficient=log(attenuationColor)/attenuationDistance;vec3 transmittance=exp(attenuationCoefficient*transmissionDistance);return transmittance*radiance;}}vec3 getVolumeTransmissionRay(const in vec3 n,const in vec3 v,const in float thickness,const in float ior,const in mat4 modelMatrix){vec3 refractionVector=refract(-v,normalize(n),1.0/ior);vec3 modelScale;modelScale.x=length(vec3(modelMatrix[0].xyz));modelScale.y=length(vec3(modelMatrix[1].xyz));modelScale.z=length(vec3(modelMatrix[2].xyz));return normalize(refractionVector)*thickness*modelScale;}
96365
+ #endif
96366
+ `
96367
+ ;
96368
+
96369
+ x_ite_Namespace .add ("Punctual2.glsl", "assets/shaders/webgl2/pbr/Punctual2.glsl", Punctual2_glsl_default_);
96370
+ /* harmony default export */ const Punctual2_glsl = (Punctual2_glsl_default_);
96368
96371
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/ToneMapping2.glsl.js
96369
96372
  const ToneMapping2_glsl_default_ = /* glsl */ `
96370
- const float GAMMA=2.2;const float INV_GAMMA=1.0/GAMMA;vec3 linearTosRGB(const in vec3 color){return pow(color,vec3(INV_GAMMA));}vec4 linearTosRGB(const in vec4 color){return vec4(linearTosRGB(color.rgb),color.a);}vec3 sRGBToLinear(const in vec3 color){return pow(color,vec3(GAMMA));}vec4 sRGBToLinear(const in vec4 color){return vec4(sRGBToLinear(color.rgb),color.a);}
96373
+ const float GAMMA=2.2;const float INV_GAMMA=1.0/GAMMA;vec3 linearToSRGB(const in vec3 color){return pow(color,vec3(INV_GAMMA));}vec4 linearToSRGB(const in vec4 color){return vec4(linearToSRGB(color.rgb),color.a);}vec3 sRGBToLinear(const in vec3 color){return pow(color,vec3(GAMMA));}vec4 sRGBToLinear(const in vec4 color){return vec4(sRGBToLinear(color.rgb),color.a);}
96371
96374
  #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
96372
96375
  vec3 toneMapACES_Narkowicz(const in vec3 color){const float A=2.51;const float B=0.03;const float C=2.43;const float D=0.59;const float E=0.14;return clamp((color*(A*color+B))/(color*(C*color+D)+E),0.0,1.0);}
96373
96376
  #endif
@@ -96390,7 +96393,18 @@ color/=0.6;color=toneMapACES_Hill(color);
96390
96393
  #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
96391
96394
  color=toneMap_KhronosPbrNeutral(color);
96392
96395
  #endif
96393
- return linearTosRGB(color);}`
96396
+ #if defined(X3D_COLORSPACE_SRGB)
96397
+ return color;
96398
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
96399
+ #if defined(X3D_PHYSICAL_MATERIAL)
96400
+ return linearToSRGB(color);
96401
+ #else
96402
+ return color;
96403
+ #endif
96404
+ #elif defined(X3D_COLORSPACE_LINEAR)
96405
+ return linearToSRGB(color);
96406
+ #endif
96407
+ }`
96394
96408
  ;
96395
96409
 
96396
96410
  x_ite_Namespace .add ("ToneMapping2.glsl", "assets/shaders/webgl2/pbr/ToneMapping2.glsl", ToneMapping2_glsl_default_);
@@ -96448,7 +96462,6 @@ x_ite_Namespace .add ("ToneMapping2.glsl", "assets/shaders/webgl2/pbr/ToneMappin
96448
96462
 
96449
96463
 
96450
96464
 
96451
-
96452
96465
  /* WebGL 2 */
96453
96466
 
96454
96467
 
@@ -96506,6 +96519,7 @@ x_ite_Namespace .add ("ToneMapping2.glsl", "assets/shaders/webgl2/pbr/ToneMappin
96506
96519
 
96507
96520
 
96508
96521
 
96522
+
96509
96523
  const ShaderRegistry = {
96510
96524
  includes: {
96511
96525
  1: {
@@ -96519,7 +96533,7 @@ const ShaderRegistry = {
96519
96533
  Perlin: Perlin2_glsl,
96520
96534
  Point: Point2_glsl,
96521
96535
  PointSize: PointSize2_glsl,
96522
- Shadow: Shadow1_glsl,
96536
+ Shadow: Shadow2_glsl,
96523
96537
  Texture: Texture1_glsl,
96524
96538
  Vertex: Vertex1_glsl,
96525
96539
  // PBR
@@ -96527,6 +96541,7 @@ const ShaderRegistry = {
96527
96541
  IBL: IBL2_glsl,
96528
96542
  Iridescence: Iridescence2_glsl,
96529
96543
  MaterialInfo: MaterialInfo2_glsl,
96544
+ PBR: PBR2_glsl,
96530
96545
  Punctual: Punctual2_glsl,
96531
96546
  ToneMapping: ToneMapping2_glsl,
96532
96547
  },
@@ -96554,6 +96569,7 @@ const ShaderRegistry = {
96554
96569
  IBL: IBL2_glsl,
96555
96570
  Iridescence: Iridescence2_glsl,
96556
96571
  MaterialInfo: MaterialInfo2_glsl,
96572
+ PBR: PBR2_glsl,
96557
96573
  Punctual: Punctual2_glsl,
96558
96574
  ToneMapping: ToneMapping2_glsl,
96559
96575
  },
@@ -96579,9 +96595,9 @@ const ShaderRegistry = {
96579
96595
  1: {
96580
96596
  Depth: Depth1_fs,
96581
96597
  Gouraud: Gouraud1_fs,
96582
- PBR: PBR1_fs,
96583
96598
  Phong: Phong1_fs,
96584
96599
  Pointing: Pointing1_fs,
96600
+ Physical: Physical1_fs,
96585
96601
  Unlit: Unlit1_fs,
96586
96602
  },
96587
96603
  2: {
@@ -96589,9 +96605,9 @@ const ShaderRegistry = {
96589
96605
  Gouraud: Gouraud2_fs,
96590
96606
  LineTransform: LineTransform2_fs,
96591
96607
  OITCompose: OITCompose2_fs,
96592
- PBR: PBR2_fs,
96593
96608
  Phong: Phong2_fs,
96594
96609
  Pointing: Pointing2_fs,
96610
+ Physical: Physical2,
96595
96611
  Unlit: Unlit2_fs,
96596
96612
  },
96597
96613
  },
@@ -96705,7 +96721,250 @@ const ShaderCompiler_default_ = ShaderCompiler;
96705
96721
  x_ite_Namespace .add ("ShaderCompiler", "x_ite/Browser/Shaders/ShaderCompiler", ShaderCompiler_default_);
96706
96722
  /* harmony default export */ const Shaders_ShaderCompiler = (ShaderCompiler_default_);
96707
96723
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/ShaderPart.js
96708
- /* provided dependency */ var ShaderPart_$ = __webpack_require__(126);
96724
+ /* provided dependency */ var ShaderPart_$ = __webpack_require__(376);
96725
+ /*******************************************************************************
96726
+ *
96727
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
96728
+ *
96729
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
96730
+ *
96731
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
96732
+ *
96733
+ * The copyright notice above does not evidence any actual of intended
96734
+ * publication of such source code, and is an unpublished work by create3000.
96735
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
96736
+ * create3000.
96737
+ *
96738
+ * No permission is granted to copy, distribute, or create derivative works from
96739
+ * the contents of this software, in whole or in part, without the prior written
96740
+ * permission of create3000.
96741
+ *
96742
+ * NON-MILITARY USE ONLY
96743
+ *
96744
+ * All create3000 software are effectively free software with a non-military use
96745
+ * restriction. It is free. Well commented source is provided. You may reuse the
96746
+ * source in any way you please with the exception anything that uses it must be
96747
+ * marked to indicate is contains 'non-military use only' components.
96748
+ *
96749
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
96750
+ *
96751
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
96752
+ *
96753
+ * This file is part of the X_ITE Project.
96754
+ *
96755
+ * X_ITE is free software: you can redistribute it and/or modify it under the
96756
+ * terms of the GNU General Public License version 3 only, as published by the
96757
+ * Free Software Foundation.
96758
+ *
96759
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
96760
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
96761
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
96762
+ * details (a copy is included in the LICENSE file that accompanied this code).
96763
+ *
96764
+ * You should have received a copy of the GNU General Public License version 3
96765
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
96766
+ * copy of the GPLv3 License.
96767
+ *
96768
+ * For Silvio, Joy and Adi.
96769
+ *
96770
+ ******************************************************************************/
96771
+
96772
+
96773
+
96774
+
96775
+
96776
+
96777
+
96778
+
96779
+
96780
+
96781
+
96782
+ const customOptions = [
96783
+ "X3D_GEOMETRY_0D",
96784
+ "X3D_GEOMETRY_1D",
96785
+ "X3D_GEOMETRY_2D",
96786
+ "X3D_GEOMETRY_3D",
96787
+ "X3D_FOG",
96788
+ "X3D_STYLE_PROPERTIES",
96789
+ "X3D_UNLIT_MATERIAL",
96790
+ "X3D_MATERIAL",
96791
+ "X3D_LIGHTING",
96792
+ "X3D_TEXTURE",
96793
+ "X3D_MULTI_TEXTURING",
96794
+ ];
96795
+
96796
+ function ShaderPart (executionContext)
96797
+ {
96798
+ Core_X3DNode .call (this, executionContext);
96799
+ Networking_X3DUrlObject .call (this, executionContext);
96800
+
96801
+ this .addType (Base_X3DConstants .ShaderPart);
96802
+
96803
+ this .options = [ ];
96804
+ }
96805
+
96806
+ Object .assign (Object .setPrototypeOf (ShaderPart .prototype, Core_X3DNode .prototype),
96807
+ Networking_X3DUrlObject .prototype,
96808
+ {
96809
+ initialize ()
96810
+ {
96811
+ Core_X3DNode .prototype .initialize .call (this);
96812
+ Networking_X3DUrlObject .prototype .initialize .call (this);
96813
+
96814
+ if (!this .isPrivate ())
96815
+ this .options = customOptions .slice ();
96816
+
96817
+ this ._type .addInterest ("set_type__", this);
96818
+
96819
+ this .requestImmediateLoad () .catch (Function .prototype);
96820
+ },
96821
+ set_type__ ()
96822
+ {
96823
+ this .setLoadState (Base_X3DConstants .NOT_STARTED_STATE);
96824
+
96825
+ this .requestImmediateLoad () .catch (Function .prototype);
96826
+ },
96827
+ getSourceText ()
96828
+ {
96829
+ return this ._url;
96830
+ },
96831
+ getOptions ()
96832
+ {
96833
+ return this .options;
96834
+ },
96835
+ setOptions (value)
96836
+ {
96837
+ this .options = value;
96838
+ },
96839
+ getShader ()
96840
+ {
96841
+ return this .shader;
96842
+ },
96843
+ getShaderType: (() =>
96844
+ {
96845
+ const shaderTypes = new Map ([
96846
+ ["VERTEX", "VERTEX_SHADER"],
96847
+ ["TESS_CONTROL", "TESS_CONTROL_SHADER"],
96848
+ ["TESS_EVALUATION", "TESS_EVALUATION_SHADER"],
96849
+ ["GEOMETRY", "GEOMETRY_SHADER"],
96850
+ ["FRAGMENT", "FRAGMENT_SHADER"],
96851
+ ["COMPUTE", "COMPUTE_SHADER"],
96852
+ ]);
96853
+
96854
+ return function ()
96855
+ {
96856
+ return shaderTypes .get (this ._type .getValue ()) || "VERTEX_SHADER";
96857
+ };
96858
+ })(),
96859
+ unloadData ()
96860
+ {
96861
+ this .valid = false;
96862
+ },
96863
+ loadData ()
96864
+ {
96865
+ new InputOutput_FileLoader (this) .loadDocument (this ._url,
96866
+ function (data, url)
96867
+ {
96868
+ if (data === null)
96869
+ {
96870
+ // No URL could be loaded.
96871
+ this .setLoadState (Base_X3DConstants .FAILED_STATE);
96872
+ }
96873
+ else
96874
+ {
96875
+ const
96876
+ browser = this .getBrowser (),
96877
+ gl = browser .getContext (),
96878
+ type = this .getShaderType (),
96879
+ options = ["X3D_" + type] .concat (this .options),
96880
+ shaderCompiler = new Shaders_ShaderCompiler (gl),
96881
+ source = Shaders_ShaderSource .getSource (gl, browser, shaderCompiler .process (ShaderPart_$.decodeText (data)), options),
96882
+ shader = gl .createShader (gl [type]);
96883
+
96884
+ gl .deleteShader (this .shader);
96885
+
96886
+ this .shader = shader;
96887
+
96888
+ gl .shaderSource (shader, source);
96889
+ gl .compileShader (shader);
96890
+
96891
+ if (!gl .getShaderParameter (shader, gl .COMPILE_STATUS))
96892
+ {
96893
+ const
96894
+ typeName = this .getTypeName (),
96895
+ name = this .getName (),
96896
+ log = gl .getShaderInfoLog (shader),
96897
+ match = log .match (/(\d+):(\d+)/);
96898
+
96899
+ if (match)
96900
+ {
96901
+ const fileName = shaderCompiler .getSourceFileName (match [1]) || url || this .getExecutionContext () .getWorldURL ();
96902
+
96903
+ throw new Error ("Error in " + typeName + " '" + name + "' in URL '" + fileName + "', line " + match [2] + ", " + log);
96904
+ }
96905
+ else
96906
+ {
96907
+ const fileName = url || this .getExecutionContext () .getWorldURL ();
96908
+
96909
+ throw new Error ("Error in " + typeName + " '" + name + "' in URL '" + fileName + "', " + log);
96910
+ }
96911
+ }
96912
+
96913
+ this .setLoadState (Base_X3DConstants .COMPLETE_STATE);
96914
+ }
96915
+ }
96916
+ .bind (this));
96917
+ },
96918
+ dispose ()
96919
+ {
96920
+ Networking_X3DUrlObject .prototype .dispose .call (this);
96921
+ Core_X3DNode .prototype .dispose .call (this);
96922
+ },
96923
+ });
96924
+
96925
+ Object .defineProperties (ShaderPart,
96926
+ {
96927
+ typeName:
96928
+ {
96929
+ value: "ShaderPart",
96930
+ enumerable: true,
96931
+ },
96932
+ componentInfo:
96933
+ {
96934
+ value: Object .freeze ({ name: "Shaders", level: 1 }),
96935
+ enumerable: true,
96936
+ },
96937
+ containerField:
96938
+ {
96939
+ value: "parts",
96940
+ enumerable: true,
96941
+ },
96942
+ specificationRange:
96943
+ {
96944
+ value: Object .freeze ({ from: "3.0", to: "Infinity" }),
96945
+ enumerable: true,
96946
+ },
96947
+ fieldDefinitions:
96948
+ {
96949
+ value: new Base_FieldDefinitionArray ([
96950
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
96951
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
96952
+ new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "type", new x_ite_Fields .SFString ("VERTEX")),
96953
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "load", new x_ite_Fields .SFBool (true)),
96954
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "url", new x_ite_Fields .MFString ()),
96955
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "autoRefresh", new x_ite_Fields .SFTime ()),
96956
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "autoRefreshTimeLimit", new x_ite_Fields .SFTime (3600)),
96957
+ ]),
96958
+ enumerable: true,
96959
+ },
96960
+ });
96961
+
96962
+ const ShaderPart_default_ = ShaderPart;
96963
+ ;
96964
+
96965
+ x_ite_Namespace .add ("ShaderPart", "x_ite/Components/Shaders/ShaderPart", ShaderPart_default_);
96966
+ /* harmony default export */ const Shaders_ShaderPart = (ShaderPart_default_);
96967
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/ShaderProgram.js
96709
96968
  /*******************************************************************************
96710
96969
  *
96711
96970
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96761,248 +97020,9 @@ x_ite_Namespace .add ("ShaderCompiler", "x_ite/Browser/Shaders/ShaderCompiler",
96761
97020
 
96762
97021
 
96763
97022
 
96764
-
96765
-
96766
- const customOptions = [
96767
- "X3D_GEOMETRY_0D",
96768
- "X3D_GEOMETRY_1D",
96769
- "X3D_GEOMETRY_2D",
96770
- "X3D_GEOMETRY_3D",
96771
- "X3D_FOG",
96772
- "X3D_STYLE_PROPERTIES",
96773
- "X3D_UNLIT_MATERIAL",
96774
- "X3D_MATERIAL",
96775
- "X3D_LIGHTING",
96776
- "X3D_TEXTURE",
96777
- "X3D_MULTI_TEXTURING",
96778
- ];
96779
-
96780
- function ShaderPart (executionContext)
96781
- {
96782
- Core_X3DNode .call (this, executionContext);
96783
- Networking_X3DUrlObject .call (this, executionContext);
96784
-
96785
- this .addType (Base_X3DConstants .ShaderPart);
96786
-
96787
- this .options = [ ];
96788
- }
96789
-
96790
- Object .assign (Object .setPrototypeOf (ShaderPart .prototype, Core_X3DNode .prototype),
96791
- Networking_X3DUrlObject .prototype,
96792
- {
96793
- initialize ()
96794
- {
96795
- Core_X3DNode .prototype .initialize .call (this);
96796
- Networking_X3DUrlObject .prototype .initialize .call (this);
96797
-
96798
- if (!this .isPrivate ())
96799
- this .options = customOptions .slice ();
96800
-
96801
- this ._type .addInterest ("set_type__", this);
96802
-
96803
- this .requestImmediateLoad () .catch (Function .prototype);
96804
- },
96805
- set_type__ ()
96806
- {
96807
- this .setLoadState (Base_X3DConstants .NOT_STARTED_STATE);
96808
-
96809
- this .requestImmediateLoad () .catch (Function .prototype);
96810
- },
96811
- getSourceText ()
96812
- {
96813
- return this ._url;
96814
- },
96815
- getOptions ()
96816
- {
96817
- return this .options;
96818
- },
96819
- setOptions (value)
96820
- {
96821
- this .options = value;
96822
- },
96823
- getShader ()
96824
- {
96825
- return this .shader;
96826
- },
96827
- getShaderType: (() =>
96828
- {
96829
- const shaderTypes = new Map ([
96830
- ["VERTEX", "VERTEX_SHADER"],
96831
- ["TESS_CONTROL", "TESS_CONTROL_SHADER"],
96832
- ["TESS_EVALUATION", "TESS_EVALUATION_SHADER"],
96833
- ["GEOMETRY", "GEOMETRY_SHADER"],
96834
- ["FRAGMENT", "FRAGMENT_SHADER"],
96835
- ["COMPUTE", "COMPUTE_SHADER"],
96836
- ]);
96837
-
96838
- return function ()
96839
- {
96840
- return shaderTypes .get (this ._type .getValue ()) || "VERTEX_SHADER";
96841
- };
96842
- })(),
96843
- unloadData ()
96844
- {
96845
- this .valid = false;
96846
- },
96847
- loadData ()
96848
- {
96849
- new InputOutput_FileLoader (this) .loadDocument (this ._url,
96850
- function (data, url)
96851
- {
96852
- if (data === null)
96853
- {
96854
- // No URL could be loaded.
96855
- this .setLoadState (Base_X3DConstants .FAILED_STATE);
96856
- }
96857
- else
96858
- {
96859
- const
96860
- browser = this .getBrowser (),
96861
- gl = browser .getContext (),
96862
- type = this .getShaderType (),
96863
- options = ["X3D_" + type] .concat (this .options),
96864
- shaderCompiler = new Shaders_ShaderCompiler (gl),
96865
- source = Shaders_ShaderSource .getSource (gl, browser, shaderCompiler .process (ShaderPart_$.decodeText (data)), options),
96866
- shader = gl .createShader (gl [type]);
96867
-
96868
- gl .deleteShader (this .shader);
96869
-
96870
- this .shader = shader;
96871
-
96872
- gl .shaderSource (shader, source);
96873
- gl .compileShader (shader);
96874
-
96875
- if (!gl .getShaderParameter (shader, gl .COMPILE_STATUS))
96876
- {
96877
- const
96878
- typeName = this .getTypeName (),
96879
- name = this .getName (),
96880
- log = gl .getShaderInfoLog (shader),
96881
- match = log .match (/(\d+):(\d+)/);
96882
-
96883
- if (match)
96884
- {
96885
- const fileName = shaderCompiler .getSourceFileName (match [1]) || url || this .getExecutionContext () .getWorldURL ();
96886
-
96887
- throw new Error ("Error in " + typeName + " '" + name + "' in URL '" + fileName + "', line " + match [2] + ", " + log);
96888
- }
96889
- else
96890
- {
96891
- const fileName = url || this .getExecutionContext () .getWorldURL ();
96892
-
96893
- throw new Error ("Error in " + typeName + " '" + name + "' in URL '" + fileName + "', " + log);
96894
- }
96895
- }
96896
-
96897
- this .setLoadState (Base_X3DConstants .COMPLETE_STATE);
96898
- }
96899
- }
96900
- .bind (this));
96901
- },
96902
- dispose ()
96903
- {
96904
- Networking_X3DUrlObject .prototype .dispose .call (this);
96905
- Core_X3DNode .prototype .dispose .call (this);
96906
- },
96907
- });
96908
-
96909
- Object .defineProperties (ShaderPart,
96910
- {
96911
- typeName:
96912
- {
96913
- value: "ShaderPart",
96914
- enumerable: true,
96915
- },
96916
- componentInfo:
96917
- {
96918
- value: Object .freeze ({ name: "Shaders", level: 1 }),
96919
- enumerable: true,
96920
- },
96921
- containerField:
96922
- {
96923
- value: "parts",
96924
- enumerable: true,
96925
- },
96926
- specificationRange:
96927
- {
96928
- value: Object .freeze ({ from: "3.0", to: "Infinity" }),
96929
- enumerable: true,
96930
- },
96931
- fieldDefinitions:
96932
- {
96933
- value: new Base_FieldDefinitionArray ([
96934
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
96935
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
96936
- new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "type", new x_ite_Fields .SFString ("VERTEX")),
96937
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "load", new x_ite_Fields .SFBool (true)),
96938
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "url", new x_ite_Fields .MFString ()),
96939
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "autoRefresh", new x_ite_Fields .SFTime ()),
96940
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "autoRefreshTimeLimit", new x_ite_Fields .SFTime (3600)),
96941
- ]),
96942
- enumerable: true,
96943
- },
96944
- });
96945
-
96946
- const ShaderPart_default_ = ShaderPart;
96947
- ;
96948
-
96949
- x_ite_Namespace .add ("ShaderPart", "x_ite/Components/Shaders/ShaderPart", ShaderPart_default_);
96950
- /* harmony default export */ const Shaders_ShaderPart = (ShaderPart_default_);
96951
- ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/ShaderProgram.js
96952
- /*******************************************************************************
96953
- *
96954
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
96955
- *
96956
- * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
96957
- *
96958
- * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
96959
- *
96960
- * The copyright notice above does not evidence any actual of intended
96961
- * publication of such source code, and is an unpublished work by create3000.
96962
- * This material contains CONFIDENTIAL INFORMATION that is the property of
96963
- * create3000.
96964
- *
96965
- * No permission is granted to copy, distribute, or create derivative works from
96966
- * the contents of this software, in whole or in part, without the prior written
96967
- * permission of create3000.
96968
- *
96969
- * NON-MILITARY USE ONLY
96970
- *
96971
- * All create3000 software are effectively free software with a non-military use
96972
- * restriction. It is free. Well commented source is provided. You may reuse the
96973
- * source in any way you please with the exception anything that uses it must be
96974
- * marked to indicate is contains 'non-military use only' components.
96975
- *
96976
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
96977
- *
96978
- * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
96979
- *
96980
- * This file is part of the X_ITE Project.
96981
- *
96982
- * X_ITE is free software: you can redistribute it and/or modify it under the
96983
- * terms of the GNU General Public License version 3 only, as published by the
96984
- * Free Software Foundation.
96985
- *
96986
- * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
96987
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
96988
- * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
96989
- * details (a copy is included in the LICENSE file that accompanied this code).
96990
- *
96991
- * You should have received a copy of the GNU General Public License version 3
96992
- * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
96993
- * copy of the GPLv3 License.
96994
- *
96995
- * For Silvio, Joy and Adi.
96996
- *
96997
- ******************************************************************************/
96998
-
96999
-
97000
-
97001
-
97002
-
97003
-
97004
-
97005
-
97023
+ /**
97024
+ * THIS NODE IS NOT SUPPORTED.
97025
+ */
97006
97026
 
97007
97027
  function ShaderProgram (executionContext)
97008
97028
  {
@@ -97372,7 +97392,7 @@ const X3DAppearanceNode_default_ = X3DAppearanceNode;
97372
97392
  x_ite_Namespace .add ("X3DAppearanceNode", "x_ite/Components/Shape/X3DAppearanceNode", X3DAppearanceNode_default_);
97373
97393
  /* harmony default export */ const Shape_X3DAppearanceNode = (X3DAppearanceNode_default_);
97374
97394
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/Appearance.js
97375
- /* provided dependency */ var Appearance_$ = __webpack_require__(126);
97395
+ /* provided dependency */ var Appearance_$ = __webpack_require__(376);
97376
97396
  /*******************************************************************************
97377
97397
  *
97378
97398
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98327,16 +98347,14 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98327
98347
  const { renderObject, shadows, fogNode, shapeNode, appearanceNode, textureNode, humanoidNode, objectsKeys } = renderContext;
98328
98348
 
98329
98349
  key += shapeNode .getAlphaMode ();
98330
- key += renderObject .getRenderKey ();
98331
- key += shadows ? 1 : 0;
98350
+ key += renderObject .getRenderAndGlobalLightsKey ();
98351
+ key += shadows || renderObject .getGlobalShadow () ? 1 : 0;
98332
98352
  key += fogNode ?.getFogType () ?? 0;
98333
98353
  key += shapeNode .getShapeKey ();
98334
98354
  key += appearanceNode .getStyleProperties (geometryContext .geometryType) ?.getStyleKey () ?? 0;
98335
98355
  key += appearanceNode .getTextureTransformMapping () .size || 1;
98336
98356
  key += geometryContext .textureCoordinateMapping .size || 1;
98337
- key += ".";
98338
- key += humanoidNode ?.getHumanoidKey () ?? "";
98339
- key += ".";
98357
+ key += humanoidNode ?.getHumanoidKey () ?? "[]";
98340
98358
  key += objectsKeys .sort () .join (""); // ClipPlane, X3DLightNode
98341
98359
  key += ".";
98342
98360
  key += textureNode ? 2 : appearanceNode .getTextureBits () .toString (16);
@@ -98345,11 +98363,13 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98345
98363
  {
98346
98364
  // Rubberband, X3DBackgroundNode
98347
98365
 
98348
- const { alphaMode, textureNode, objectsKeys } = geometryContext;
98366
+ const { renderObject, alphaMode, textureNode, objectsKeys } = geometryContext;
98349
98367
 
98350
98368
  key += alphaMode;
98351
- key += "0000011.0.";
98352
- key += objectsKeys .sort () .join (""); // ClipPlane, X3DLightNode
98369
+ key += ".";
98370
+ key += renderObject .getRenderKey ();
98371
+ key += "..000011[]";
98372
+ key += objectsKeys .sort () .join (""); // ClipPlane
98353
98373
  key += ".";
98354
98374
  key += textureNode ?.getTextureBits () .toString (16) ?? 0;
98355
98375
  }
@@ -98377,9 +98397,36 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98377
98397
  if (geometryContext .hasTangents)
98378
98398
  options .push ("X3D_TANGENTS");
98379
98399
 
98400
+ switch (browser .getBrowserOption ("ColorSpace"))
98401
+ {
98402
+ case "SRGB":
98403
+ options .push ("X3D_COLORSPACE_SRGB");
98404
+ break;
98405
+ default: // LINEAR_WHEN_PHYSICAL_MATERIAL
98406
+ options .push ("X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL");
98407
+ break;
98408
+ case "LINEAR":
98409
+ options .push ("X3D_COLORSPACE_LINEAR");
98410
+ break;
98411
+ }
98412
+
98413
+ switch (browser .getBrowserOption ("ToneMapping"))
98414
+ {
98415
+ default: // NONE
98416
+ break;
98417
+ case "ACES_NARKOWICZ":
98418
+ case "ACES_HILL":
98419
+ case "ACES_HILL_EXPOSURE_BOOST":
98420
+ case "KHR_PBR_NEUTRAL":
98421
+ options .push (`X3D_TONEMAP_${browser .getBrowserOption ("ToneMapping")}`);
98422
+ break;
98423
+ }
98424
+
98380
98425
  if (renderContext)
98381
98426
  {
98382
- const { renderObject, fogNode, shapeNode, appearanceNode, humanoidNode, objectsKeys, textureNode } = renderContext;
98427
+ const { renderObject, fogNode, shapeNode, appearanceNode, humanoidNode, objectsKeys: localObjectsKeys, textureNode } = renderContext;
98428
+
98429
+ const objectsKeys = localObjectsKeys .concat (renderObject .getGlobalLightsKeys ());
98383
98430
 
98384
98431
  if (renderObject .getLogarithmicDepthBuffer ())
98385
98432
  options .push ("X3D_LOGARITHMIC_DEPTH_BUFFER");
@@ -98407,7 +98454,7 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98407
98454
  }
98408
98455
  }
98409
98456
 
98410
- if (renderContext .shadows)
98457
+ if (renderContext .shadows || renderObject .getGlobalShadows () .at (-1))
98411
98458
  options .push ("X3D_SHADOWS", "X3D_PCF_FILTERING");
98412
98459
 
98413
98460
  switch (fogNode ?.getFogType ())
@@ -98513,7 +98560,10 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98513
98560
  }
98514
98561
  else
98515
98562
  {
98516
- const { alphaMode, objectsKeys, textureNode } = geometryContext;
98563
+ const { renderObject, alphaMode, objectsKeys, textureNode } = geometryContext;
98564
+
98565
+ if (renderObject .getLogarithmicDepthBuffer ())
98566
+ options .push ("X3D_LOGARITHMIC_DEPTH_BUFFER");
98517
98567
 
98518
98568
  switch (alphaMode)
98519
98569
  {
@@ -98531,18 +98581,14 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98531
98581
  {
98532
98582
  options .push ("X3D_ALPHA_MODE_BLEND");
98533
98583
 
98534
- if (browser .getBrowserOption ("OrderIndependentTransparency"))
98584
+ if (renderObject .getOrderIndependentTransparency ())
98535
98585
  options .push ("X3D_ORDER_INDEPENDENT_TRANSPARENCY");
98536
98586
 
98537
98587
  break;
98538
98588
  }
98539
98589
  }
98540
98590
 
98541
- const
98542
- numClipPlanes = objectsKeys .reduce ((a, c) => a + (c === 0), 0),
98543
- numLights = objectsKeys .reduce ((a, c) => a + (c === 1), 0),
98544
- numEnvironmentLights = objectsKeys .reduce ((a, c) => a + (c === 2), 0),
98545
- numTextureProjectors = objectsKeys .reduce ((a, c) => a + (c === 3), 0);
98591
+ const numClipPlanes = objectsKeys .reduce ((a, c) => a + (c === 0), 0);
98546
98592
 
98547
98593
  if (numClipPlanes)
98548
98594
  {
@@ -98550,24 +98596,6 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98550
98596
  options .push (`X3D_NUM_CLIP_PLANES ${Math .min (numClipPlanes, browser .getMaxClipPlanes ())}`);
98551
98597
  }
98552
98598
 
98553
- if (numLights)
98554
- {
98555
- options .push ("X3D_LIGHTING")
98556
- options .push (`X3D_NUM_LIGHTS ${Math .min (numLights, browser .getMaxLights ())}`);
98557
- }
98558
-
98559
- if (numEnvironmentLights)
98560
- {
98561
- options .push ("X3D_USE_IBL")
98562
- options .push (`X3D_NUM_ENVIRONMENT_LIGHTS ${Math .min (numEnvironmentLights, browser .getMaxLights ())}`);
98563
- }
98564
-
98565
- if (numTextureProjectors)
98566
- {
98567
- options .push ("X3D_TEXTURE_PROJECTION")
98568
- options .push (`X3D_NUM_TEXTURE_PROJECTORS ${Math .min (numTextureProjectors, browser .getMaxTextures ())}`);
98569
- }
98570
-
98571
98599
  if (textureNode)
98572
98600
  {
98573
98601
  // X3DBackgroundNode textures
@@ -99390,8 +99418,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99390
99418
  set_transparent__ ()
99391
99419
  {
99392
99420
  this .setTransparent (this .getTransparency () ||
99393
- this .baseTextureNode ?.isTransparent () ||
99394
- this .isTransmission ());
99421
+ this .baseTextureNode ?.isTransparent ());
99395
99422
  },
99396
99423
  set_extensions__ ()
99397
99424
  {
@@ -99417,7 +99444,6 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99417
99444
 
99418
99445
  this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes (Base_X3DConstants .TransmissionMaterialExtension)));
99419
99446
 
99420
- this .set_transparent__ ();
99421
99447
  this .set_extensionsKey__ ();
99422
99448
  },
99423
99449
  set_extensionsKey__ ()
@@ -99439,18 +99465,6 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99439
99465
 
99440
99466
  options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_METALLIC_ROUGHNESS");
99441
99467
 
99442
- switch (browser .getBrowserOption ("ToneMapping"))
99443
- {
99444
- default: // NONE
99445
- break;
99446
- case "ACES_NARKOWICZ":
99447
- case "ACES_HILL":
99448
- case "ACES_HILL_EXPOSURE_BOOST":
99449
- case "KHR_PBR_NEUTRAL":
99450
- options .push (`X3D_TONEMAP_${browser .getBrowserOption ("ToneMapping")}`);
99451
- break;
99452
- }
99453
-
99454
99468
  if (+this .getTextureBits ())
99455
99469
  {
99456
99470
  this .baseTextureNode ?.getShaderOptions (options, "BASE");
@@ -99458,7 +99472,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99458
99472
  this .occlusionTextureNode ?.getShaderOptions (options, "OCCLUSION");
99459
99473
  }
99460
99474
 
99461
- const shaderNode = browser .createShader ("PBR", "Default", "PBR", options);
99475
+ const shaderNode = browser .createShader ("Physical", "Default", "Physical", options);
99462
99476
 
99463
99477
  browser .getShaders () .set (key, shaderNode);
99464
99478
 
@@ -100053,230 +100067,234 @@ x_ite_Namespace .add ("X3DShapeNode", "x_ite/Components/Shape/X3DShapeNode", X3D
100053
100067
 
100054
100068
 
100055
100069
 
100056
- function Shape (executionContext)
100057
- {
100058
- Shape_X3DShapeNode .call (this, executionContext);
100059
-
100060
- this .addType (Base_X3DConstants .Shape);
100061
- }
100062
-
100063
- Object .assign (Object .setPrototypeOf (Shape .prototype, Shape_X3DShapeNode .prototype),
100064
- {
100065
- initialize ()
100066
- {
100067
- Shape_X3DShapeNode .prototype .initialize .call (this);
100068
-
100069
- this ._transformSensors_changed .addInterest ("set_transformSensors__", this);
100070
-
100071
- this .set_transformSensors__ ();
100072
- },
100073
- getShapeKey ()
100074
- {
100075
- return 0;
100076
- },
100077
- getNumInstances ()
100078
- {
100079
- return 1;
100080
- },
100081
- set_geometry__ ()
100082
- {
100083
- Shape_X3DShapeNode .prototype .set_geometry__ .call (this);
100084
-
100085
- if (this .getGeometry ())
100086
- delete this .traverse;
100087
- else
100088
- this .traverse = Function .prototype;
100089
- },
100090
- set_transformSensors__ ()
100091
- {
100092
- this .setPickableObject (this .getTransformSensors () .size);
100093
- },
100094
- intersectsBox (box, clipPlanes, modelViewMatrix)
100095
- {
100096
- return this .getGeometry () .intersectsBox (box, clipPlanes, modelViewMatrix);
100097
- },
100098
- traverse (type, renderObject)
100099
- {
100100
- // Always look at ParticleSystem if you do modify something here and there.
100101
-
100102
- switch (type)
100103
- {
100104
- case Rendering_TraverseType .POINTER:
100105
- {
100106
- if (this ._pointerEvents .getValue ())
100107
- renderObject .addPointingShape (this);
100108
-
100109
- break;
100110
- }
100111
- case Rendering_TraverseType .PICKING:
100112
- {
100113
- this .picking (renderObject);
100114
- break;
100115
- }
100116
- case Rendering_TraverseType .COLLISION:
100117
- {
100118
- renderObject .addCollisionShape (this);
100119
- break;
100120
- }
100121
- case Rendering_TraverseType .SHADOW:
100122
- {
100123
- if (this ._castShadow .getValue ())
100124
- renderObject .addShadowShape (this);
100125
-
100126
- break;
100127
- }
100128
- case Rendering_TraverseType .DISPLAY:
100129
- {
100130
- if (renderObject .addDisplayShape (this))
100131
- {
100132
- // Currently used for GeneratedCubeMapTexture.
100133
- this .getAppearance () .traverse (type, renderObject);
100134
- }
100135
-
100136
- break;
100137
- }
100138
- }
100139
-
100140
- // Currently used for ScreenText and Tools.
100141
- this .getGeometry () .traverse (type, renderObject);
100142
- },
100143
- picking (renderObject)
100144
- {
100145
- const modelMatrix = renderObject .getModelViewMatrix () .get ();
100146
-
100147
- if (this .getTransformSensors () .size)
100148
- {
100149
- for (const transformSensorNode of this .getTransformSensors ())
100150
- transformSensorNode .collect (modelMatrix);
100151
- }
100152
-
100153
- const
100154
- browser = this .getBrowser (),
100155
- pickSensorStack = browser .getPickSensors (),
100156
- pickingHierarchy = browser .getPickingHierarchy ();
100157
-
100158
- pickingHierarchy .push (this);
100159
-
100160
- for (const pickSensor of pickSensorStack .at (-1))
100161
- {
100162
- pickSensor .collect (this .getGeometry (), modelMatrix, pickingHierarchy);
100163
- }
100164
-
100165
- pickingHierarchy .pop ();
100166
- },
100167
- displaySimple (gl, renderContext, shaderNode)
100168
- {
100169
- this .getGeometry () .displaySimple (gl, renderContext, shaderNode);
100170
- },
100171
- display (gl, renderContext)
100172
- {
100173
- this .getGeometry () .display (gl, renderContext);
100174
- },
100175
- });
100176
-
100177
- Object .defineProperties (Shape,
100178
- {
100179
- typeName:
100180
- {
100181
- value: "Shape",
100182
- enumerable: true,
100183
- },
100184
- componentInfo:
100185
- {
100186
- value: Object .freeze ({ name: "Shape", level: 1 }),
100187
- enumerable: true,
100188
- },
100189
- containerField:
100190
- {
100191
- value: "children",
100192
- enumerable: true,
100193
- },
100194
- specificationRange:
100195
- {
100196
- value: Object .freeze ({ from: "2.0", to: "Infinity" }),
100197
- enumerable: true,
100198
- },
100199
- fieldDefinitions:
100200
- {
100201
- value: new Base_FieldDefinitionArray ([
100202
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
100203
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "pointerEvents", new x_ite_Fields .SFBool (true)), // skip test
100204
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "castShadow", new x_ite_Fields .SFBool (true)),
100205
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "visible", new x_ite_Fields .SFBool (true)),
100206
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "bboxDisplay", new x_ite_Fields .SFBool ()),
100207
- new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "bboxSize", new x_ite_Fields .SFVec3f (-1, -1, -1)),
100208
- new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "bboxCenter", new x_ite_Fields .SFVec3f ()),
100209
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "appearance", new x_ite_Fields .SFNode ()),
100210
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "geometry", new x_ite_Fields .SFNode ()),
100211
- ]),
100212
- enumerable: true,
100213
- },
100214
- });
100215
-
100216
- const Shape_default_ = Shape;
100217
- ;
100218
-
100219
- x_ite_Namespace .add ("Shape", "x_ite/Components/Shape/Shape", Shape_default_);
100220
- /* harmony default export */ const Shape_Shape = (Shape_default_);
100221
- ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/TwoSidedMaterial.js
100222
- /*******************************************************************************
100223
- *
100224
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100225
- *
100226
- * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
100227
- *
100228
- * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
100229
- *
100230
- * The copyright notice above does not evidence any actual of intended
100231
- * publication of such source code, and is an unpublished work by create3000.
100232
- * This material contains CONFIDENTIAL INFORMATION that is the property of
100233
- * create3000.
100234
- *
100235
- * No permission is granted to copy, distribute, or create derivative works from
100236
- * the contents of this software, in whole or in part, without the prior written
100237
- * permission of create3000.
100238
- *
100239
- * NON-MILITARY USE ONLY
100240
- *
100241
- * All create3000 software are effectively free software with a non-military use
100242
- * restriction. It is free. Well commented source is provided. You may reuse the
100243
- * source in any way you please with the exception anything that uses it must be
100244
- * marked to indicate is contains 'non-military use only' components.
100245
- *
100246
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100247
- *
100248
- * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
100249
- *
100250
- * This file is part of the X_ITE Project.
100251
- *
100252
- * X_ITE is free software: you can redistribute it and/or modify it under the
100253
- * terms of the GNU General Public License version 3 only, as published by the
100254
- * Free Software Foundation.
100255
- *
100256
- * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
100257
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
100258
- * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
100259
- * details (a copy is included in the LICENSE file that accompanied this code).
100260
- *
100261
- * You should have received a copy of the GNU General Public License version 3
100262
- * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
100263
- * copy of the GPLv3 License.
100264
- *
100265
- * For Silvio, Joy and Adi.
100266
- *
100267
- ******************************************************************************/
100268
-
100269
-
100270
-
100271
-
100272
-
100273
-
100274
-
100070
+ function Shape (executionContext)
100071
+ {
100072
+ Shape_X3DShapeNode .call (this, executionContext);
100073
+
100074
+ this .addType (Base_X3DConstants .Shape);
100075
+ }
100076
+
100077
+ Object .assign (Object .setPrototypeOf (Shape .prototype, Shape_X3DShapeNode .prototype),
100078
+ {
100079
+ initialize ()
100080
+ {
100081
+ Shape_X3DShapeNode .prototype .initialize .call (this);
100082
+
100083
+ this ._transformSensors_changed .addInterest ("set_transformSensors__", this);
100084
+
100085
+ this .set_transformSensors__ ();
100086
+ },
100087
+ getShapeKey ()
100088
+ {
100089
+ return 0;
100090
+ },
100091
+ getNumInstances ()
100092
+ {
100093
+ return 1;
100094
+ },
100095
+ set_geometry__ ()
100096
+ {
100097
+ Shape_X3DShapeNode .prototype .set_geometry__ .call (this);
100098
+
100099
+ if (this .getGeometry ())
100100
+ delete this .traverse;
100101
+ else
100102
+ this .traverse = Function .prototype;
100103
+ },
100104
+ set_transformSensors__ ()
100105
+ {
100106
+ this .setPickableObject (this .getTransformSensors () .size);
100107
+ },
100108
+ intersectsBox (box, clipPlanes, modelViewMatrix)
100109
+ {
100110
+ return this .getGeometry () .intersectsBox (box, clipPlanes, modelViewMatrix);
100111
+ },
100112
+ traverse (type, renderObject)
100113
+ {
100114
+ // Always look at ParticleSystem if you do modify something here and there.
100115
+
100116
+ switch (type)
100117
+ {
100118
+ case Rendering_TraverseType .POINTER:
100119
+ {
100120
+ if (this ._pointerEvents .getValue ())
100121
+ renderObject .addPointingShape (this);
100122
+
100123
+ break;
100124
+ }
100125
+ case Rendering_TraverseType .PICKING:
100126
+ {
100127
+ this .picking (renderObject);
100128
+ break;
100129
+ }
100130
+ case Rendering_TraverseType .COLLISION:
100131
+ {
100132
+ renderObject .addCollisionShape (this);
100133
+ break;
100134
+ }
100135
+ case Rendering_TraverseType .SHADOW:
100136
+ {
100137
+ if (this ._castShadow .getValue ())
100138
+ renderObject .addShadowShape (this);
100139
+
100140
+ break;
100141
+ }
100142
+ case Rendering_TraverseType .DISPLAY:
100143
+ {
100144
+ if (renderObject .addDisplayShape (this))
100145
+ {
100146
+ // Currently used for GeneratedCubeMapTexture.
100147
+ this .getAppearance () .traverse (type, renderObject);
100148
+ }
100149
+
100150
+ break;
100151
+ }
100152
+ }
100153
+
100154
+ // Currently used for ScreenText and Tools.
100155
+ this .getGeometry () .traverse (type, renderObject);
100156
+ },
100157
+ picking (renderObject)
100158
+ {
100159
+ const modelMatrix = renderObject .getModelViewMatrix () .get ();
100160
+
100161
+ if (this .getTransformSensors () .size)
100162
+ {
100163
+ for (const transformSensorNode of this .getTransformSensors ())
100164
+ transformSensorNode .collect (modelMatrix);
100165
+ }
100166
+
100167
+ const
100168
+ browser = this .getBrowser (),
100169
+ pickSensorStack = browser .getPickSensors (),
100170
+ pickingHierarchy = browser .getPickingHierarchy ();
100171
+
100172
+ pickingHierarchy .push (this);
100173
+
100174
+ for (const pickSensor of pickSensorStack .at (-1))
100175
+ {
100176
+ pickSensor .collect (this .getGeometry (), modelMatrix, pickingHierarchy);
100177
+ }
100178
+
100179
+ pickingHierarchy .pop ();
100180
+ },
100181
+ displaySimple (gl, renderContext, shaderNode)
100182
+ {
100183
+ this .getGeometry () .displaySimple (gl, renderContext, shaderNode);
100184
+ },
100185
+ display (gl, renderContext)
100186
+ {
100187
+ this .getGeometry () .display (gl, renderContext);
100188
+ },
100189
+ });
100190
+
100191
+ Object .defineProperties (Shape,
100192
+ {
100193
+ typeName:
100194
+ {
100195
+ value: "Shape",
100196
+ enumerable: true,
100197
+ },
100198
+ componentInfo:
100199
+ {
100200
+ value: Object .freeze ({ name: "Shape", level: 1 }),
100201
+ enumerable: true,
100202
+ },
100203
+ containerField:
100204
+ {
100205
+ value: "children",
100206
+ enumerable: true,
100207
+ },
100208
+ specificationRange:
100209
+ {
100210
+ value: Object .freeze ({ from: "2.0", to: "Infinity" }),
100211
+ enumerable: true,
100212
+ },
100213
+ fieldDefinitions:
100214
+ {
100215
+ value: new Base_FieldDefinitionArray ([
100216
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
100217
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "pointerEvents", new x_ite_Fields .SFBool (true)), // skip test
100218
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "castShadow", new x_ite_Fields .SFBool (true)),
100219
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "visible", new x_ite_Fields .SFBool (true)),
100220
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "bboxDisplay", new x_ite_Fields .SFBool ()),
100221
+ new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "bboxSize", new x_ite_Fields .SFVec3f (-1, -1, -1)),
100222
+ new Base_X3DFieldDefinition (Base_X3DConstants .initializeOnly, "bboxCenter", new x_ite_Fields .SFVec3f ()),
100223
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "appearance", new x_ite_Fields .SFNode ()),
100224
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "geometry", new x_ite_Fields .SFNode ()),
100225
+ ]),
100226
+ enumerable: true,
100227
+ },
100228
+ });
100229
+
100230
+ const Shape_default_ = Shape;
100231
+ ;
100232
+
100233
+ x_ite_Namespace .add ("Shape", "x_ite/Components/Shape/Shape", Shape_default_);
100234
+ /* harmony default export */ const Shape_Shape = (Shape_default_);
100235
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/TwoSidedMaterial.js
100236
+ /*******************************************************************************
100237
+ *
100238
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100239
+ *
100240
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
100241
+ *
100242
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
100243
+ *
100244
+ * The copyright notice above does not evidence any actual of intended
100245
+ * publication of such source code, and is an unpublished work by create3000.
100246
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
100247
+ * create3000.
100248
+ *
100249
+ * No permission is granted to copy, distribute, or create derivative works from
100250
+ * the contents of this software, in whole or in part, without the prior written
100251
+ * permission of create3000.
100252
+ *
100253
+ * NON-MILITARY USE ONLY
100254
+ *
100255
+ * All create3000 software are effectively free software with a non-military use
100256
+ * restriction. It is free. Well commented source is provided. You may reuse the
100257
+ * source in any way you please with the exception anything that uses it must be
100258
+ * marked to indicate is contains 'non-military use only' components.
100259
+ *
100260
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100261
+ *
100262
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
100263
+ *
100264
+ * This file is part of the X_ITE Project.
100265
+ *
100266
+ * X_ITE is free software: you can redistribute it and/or modify it under the
100267
+ * terms of the GNU General Public License version 3 only, as published by the
100268
+ * Free Software Foundation.
100269
+ *
100270
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
100271
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
100272
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
100273
+ * details (a copy is included in the LICENSE file that accompanied this code).
100274
+ *
100275
+ * You should have received a copy of the GNU General Public License version 3
100276
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
100277
+ * copy of the GPLv3 License.
100278
+ *
100279
+ * For Silvio, Joy and Adi.
100280
+ *
100281
+ ******************************************************************************/
100282
+
100283
+
100284
+
100285
+
100286
+
100287
+
100288
+
100289
+
100275
100290
 
100291
+ /**
100292
+ * THIS NODE IS DEPRECIATED.
100293
+ */
100276
100294
 
100277
100295
  function TwoSidedMaterial (executionContext)
100278
100296
  {
100279
- console .warn ("TwoSidedMaterial is depreciated, please use Appearance backMaterial field.");
100297
+ console .warn ("TwoSidedMaterial is depreciated, please use Appearance backMaterial field instead.");
100280
100298
 
100281
100299
  Shape_X3DMaterialNode .call (this, executionContext);
100282
100300
 
@@ -105685,6 +105703,10 @@ x_ite_Namespace .add ("SpatialSound", "x_ite/Components/Sound/SpatialSound", Spa
105685
105703
 
105686
105704
 
105687
105705
 
105706
+ /**
105707
+ * THIS NODE IS NOT SUPPORTED.
105708
+ */
105709
+
105688
105710
  function StreamAudioDestination (executionContext)
105689
105711
  {
105690
105712
  Sound_X3DSoundDestinationNode .call (this, executionContext);
@@ -105816,6 +105838,10 @@ x_ite_Namespace .add ("StreamAudioDestination", "x_ite/Components/Sound/StreamAu
105816
105838
 
105817
105839
 
105818
105840
 
105841
+ /**
105842
+ * THIS NODE IS NOT SUPPORTED.
105843
+ */
105844
+
105819
105845
  function StreamAudioSource (executionContext)
105820
105846
  {
105821
105847
  Sound_X3DSoundSourceNode .call (this, executionContext);
@@ -106290,8 +106316,8 @@ const GifMedia_default_ = GifMedia;
106290
106316
  x_ite_Namespace .add ("GifMedia", "x_ite/Browser/Texturing/GifMedia", GifMedia_default_);
106291
106317
  /* harmony default export */ const Texturing_GifMedia = (GifMedia_default_);
106292
106318
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/MovieTexture.js
106293
- /* provided dependency */ var MovieTexture_$ = __webpack_require__(126);
106294
- /* provided dependency */ var SuperGif = __webpack_require__(577);
106319
+ /* provided dependency */ var MovieTexture_$ = __webpack_require__(376);
106320
+ /* provided dependency */ var SuperGif = __webpack_require__(123);
106295
106321
  /*******************************************************************************
106296
106322
  *
106297
106323
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108946,6 +108972,27 @@ const Context =
108946
108972
  gl .drawArraysInstanced = ext .drawArraysInstancedANGLE .bind (ext);
108947
108973
  gl .drawElementsInstanced = ext .drawElementsInstancedANGLE .bind (ext);
108948
108974
  }
108975
+
108976
+ {
108977
+ const ext = gl .getExtension ("WEBGL_color_buffer_float");
108978
+
108979
+ gl .RGBA32F = ext .RGBA32F_EXT;
108980
+ }
108981
+
108982
+ {
108983
+ const ext = gl .getExtension ("WEBGL_draw_buffers");
108984
+
108985
+ gl .MAX_COLOR_ATTACHMENTS = ext .MAX_COLOR_ATTACHMENTS_WEBGL;
108986
+ gl .drawBuffers = ext .drawBuffersWEBGL .bind (ext);
108987
+
108988
+ for (let i = 0, length = gl .getParameter(gl .MAX_COLOR_ATTACHMENTS); i < length; ++ i)
108989
+ {
108990
+ const COLOR_ATTACHMENTi = ext .COLOR_ATTACHMENT0_WEBGL + i;
108991
+
108992
+ if (gl [`COLOR_ATTACHMENT${i}`] === undefined)
108993
+ gl [`COLOR_ATTACHMENT${i}`] = COLOR_ATTACHMENTi;
108994
+ }
108995
+ }
108949
108996
  }
108950
108997
  }
108951
108998
 
@@ -108980,106 +109027,20 @@ const Context =
108980
109027
  gl .HAS_FEATURE_DEPTH_TEXTURE = gl .getVersion () >= 2 || !! gl .getExtension ("WEBGL_depth_texture");
108981
109028
  gl .HAS_FEATURE_FRAG_DEPTH = gl .getVersion () >= 2 || !! gl .getExtension ("EXT_frag_depth");
108982
109029
 
108983
- if (gl .getVersion () === 1)
109030
+ if (mobile)
108984
109031
  {
108985
- const
108986
- color_buffer_float = gl .getExtension ("WEBGL_color_buffer_float"),
108987
- draw_buffers = gl .getExtension ("WEBGL_draw_buffers");
108988
-
108989
- gl .RGBA32F = color_buffer_float .RGBA32F_EXT;
108990
- gl .MAX_COLOR_ATTACHMENTS = draw_buffers .MAX_COLOR_ATTACHMENTS_WEBGL;
108991
- gl .drawBuffers = draw_buffers .drawBuffersWEBGL .bind (draw_buffers);
108992
-
108993
- for (let i = 0, length = gl .getParameter(gl .MAX_COLOR_ATTACHMENTS); i < length; ++ i)
108994
109032
  {
108995
- const COLOR_ATTACHMENTi = draw_buffers .COLOR_ATTACHMENT0_WEBGL + i;
109033
+ const ext = gl .getExtension ("EXT_color_buffer_half_float");
108996
109034
 
108997
- if (gl [`COLOR_ATTACHMENT${i}`] === undefined)
108998
- gl [`COLOR_ATTACHMENT${i}`] = COLOR_ATTACHMENTi;
109035
+ // Use defineProperty to overwrite property.
109036
+ Object .defineProperty (gl, "RGBA32F",
109037
+ {
109038
+ value: gl .getVersion () === 1 ? ext .RGBA16F_EXT : gl .RGBA16F,
109039
+ enumerable: true,
109040
+ });
108999
109041
  }
109000
109042
  }
109001
109043
 
109002
- if (mobile)
109003
- {
109004
- const color_buffer_half_float = gl .getExtension ("EXT_color_buffer_half_float");
109005
-
109006
- Object .defineProperty (gl, "RGBA32F",
109007
- {
109008
- value: gl .getVersion () === 1 ? color_buffer_half_float .RGBA16F_EXT : gl .RGBA16F,
109009
- });
109010
- }
109011
-
109012
- // // Async functions, DOES'NT WORK WELL WITH OPERA!!!
109013
-
109014
- // Object .assign (gl, gl .getVersion () === 1
109015
- // ?
109016
- // {
109017
- // readPixelsAsync: gl .readPixels,
109018
- // }
109019
- // :
109020
- // {
109021
- // clientWaitAsync (sync, flags, timeout)
109022
- // {
109023
- // return new Promise ((resolve, reject) =>
109024
- // {
109025
- // const check = () =>
109026
- // {
109027
- // const result = this .clientWaitSync (sync, flags, 0);
109028
-
109029
- // switch (result)
109030
- // {
109031
- // case this .WAIT_FAILED:
109032
- // {
109033
- // reject (new Error ("clientWaitSync: WAIT_FAILED"));
109034
- // return;
109035
- // }
109036
- // case this .TIMEOUT_EXPIRED:
109037
- // {
109038
- // setTimeout (check, timeout);
109039
- // return;
109040
- // }
109041
- // default:
109042
- // {
109043
- // resolve ();
109044
- // return;
109045
- // }
109046
- // }
109047
- // };
109048
-
109049
- // setTimeout (check);
109050
- // });
109051
- // },
109052
- // async getBufferSubDataAsync (target, buffer, srcByteOffset, dstBuffer, /* optional */ dstOffset, /* optional */ length)
109053
- // {
109054
- // const sync = this .fenceSync (this .SYNC_GPU_COMMANDS_COMPLETE, 0);
109055
-
109056
- // this .flush ();
109057
-
109058
- // await this .clientWaitAsync (sync, 0, 10);
109059
-
109060
- // this .deleteSync (sync);
109061
-
109062
- // this .bindBuffer (target, buffer);
109063
- // this .getBufferSubData (target, srcByteOffset, dstBuffer, dstOffset, length);
109064
- // this .bindBuffer (target, null);
109065
- // },
109066
- // async readPixelsAsync (x, y, w, h, format, type, dest, dstOffset)
109067
- // {
109068
- // const buffer = this .createBuffer ();
109069
-
109070
- // this .bindBuffer (this .PIXEL_PACK_BUFFER, buffer);
109071
- // this .bufferData (this .PIXEL_PACK_BUFFER, dest .byteLength, this .STREAM_READ);
109072
- // this .readPixels (x, y, w, h, format, type, 0);
109073
- // this .bindBuffer (this .PIXEL_PACK_BUFFER, null);
109074
-
109075
- // await this .getBufferSubDataAsync (this .PIXEL_PACK_BUFFER, buffer, 0, dest, dstOffset);
109076
-
109077
- // this .deleteBuffer (buffer);
109078
- // },
109079
- // });
109080
-
109081
- // Return context.
109082
-
109083
109044
  return gl;
109084
109045
  },
109085
109046
  }
@@ -109688,7 +109649,7 @@ const gettext_default_ = (string) => locale .get (string) || string;
109688
109649
  x_ite_Namespace .add ("gettext", "locale/gettext", gettext_default_);
109689
109650
  /* harmony default export */ const gettext = (gettext_default_);
109690
109651
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserTimings.js
109691
- /* provided dependency */ var BrowserTimings_$ = __webpack_require__(126);
109652
+ /* provided dependency */ var BrowserTimings_$ = __webpack_require__(376);
109692
109653
  /*******************************************************************************
109693
109654
  *
109694
109655
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110261,7 +110222,7 @@ const TextureQuality_default_ = TextureQuality;
110261
110222
  x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", TextureQuality_default_);
110262
110223
  /* harmony default export */ const Core_TextureQuality = (TextureQuality_default_);
110263
110224
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserOptions.js
110264
- /* provided dependency */ var BrowserOptions_$ = __webpack_require__(126);
110225
+ /* provided dependency */ var BrowserOptions_$ = __webpack_require__(376);
110265
110226
  /*******************************************************************************
110266
110227
  *
110267
110228
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110319,6 +110280,8 @@ x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", Tex
110319
110280
 
110320
110281
 
110321
110282
 
110283
+ // https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/networking.html#BrowserProperties
110284
+
110322
110285
  function BrowserOptions (executionContext)
110323
110286
  {
110324
110287
  Base_X3DBaseNode .call (this, executionContext);
@@ -110347,27 +110310,27 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110347
110310
  Timings: this ._Timings .getValue (),
110348
110311
  });
110349
110312
 
110350
- this ._Rubberband .addInterest ("set_rubberband__", this);
110351
- this ._Antialiased .addInterest ("set_antialiased__", this);
110352
- this ._PrimitiveQuality .addInterest ("set_primitiveQuality__", this);
110353
- this ._TextureQuality .addInterest ("set_textureQuality__", this);
110354
- this ._Shading .addInterest ("set_shading__", this);
110355
- this ._StraightenHorizon .addInterest ("set_straightenHorizon__", this);
110356
- this ._AutoUpdate .addInterest ("set_autoUpdate__", this);
110357
- this ._ContentScale .addInterest ("set_contentScale__", this);
110358
- this ._Exposure .addInterest ("set_exposure__", this);
110359
- this ._LogarithmicDepthBuffer .addInterest ("set_logarithmicDepthBuffer__", this);
110360
- this ._Multisampling .addInterest ("set_multisampling__", this);
110361
- this ._OrderIndependentTransparency .addInterest ("set_orderIndependentTransparency__", this);
110362
- this ._Timings .addInterest ("set_timings__", this);
110363
-
110364
- this .set_antialiased__ (this ._Antialiased);
110365
- this .set_shading__ (this ._Shading);
110366
- this .set_contentScale__ (this ._ContentScale);
110367
- this .set_exposure__ (this ._Exposure);
110368
- this .set_logarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
110369
- this .set_multisampling__ (this ._Multisampling);
110370
- this .set_orderIndependentTransparency__ (this ._OrderIndependentTransparency);
110313
+ this ._Rubberband .addInterest ("set_Rubberband__", this);
110314
+ this ._Antialiased .addInterest ("set_Antialiased__", this);
110315
+ this ._PrimitiveQuality .addInterest ("set_PrimitiveQuality__", this);
110316
+ this ._TextureQuality .addInterest ("set_TextureQuality__", this);
110317
+ this ._Shading .addInterest ("set_Shading__", this);
110318
+ this ._StraightenHorizon .addInterest ("set_StraightenHorizon__", this);
110319
+ this ._AutoUpdate .addInterest ("set_AutoUpdate__", this);
110320
+ this ._ContentScale .addInterest ("set_ContentScale__", this);
110321
+ this ._Exposure .addInterest ("set_Exposure__", this);
110322
+ this ._LogarithmicDepthBuffer .addInterest ("set_LogarithmicDepthBuffer__", this);
110323
+ this ._Multisampling .addInterest ("set_Multisampling__", this);
110324
+ this ._OrderIndependentTransparency .addInterest ("set_OrderIndependentTransparency__", this);
110325
+ this ._Timings .addInterest ("set_Timings__", this);
110326
+
110327
+ this .set_Antialiased__ (this ._Antialiased);
110328
+ this .set_Shading__ (this ._Shading);
110329
+ this .set_ContentScale__ (this ._ContentScale);
110330
+ this .set_Exposure__ (this ._Exposure);
110331
+ this .set_LogarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
110332
+ this .set_Multisampling__ (this ._Multisampling);
110333
+ this .set_OrderIndependentTransparency__ (this ._OrderIndependentTransparency);
110371
110334
 
110372
110335
  this .reset ();
110373
110336
  },
@@ -110377,6 +110340,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110377
110340
  "Antialiased",
110378
110341
  "AutoUpdate",
110379
110342
  "Cache",
110343
+ "ColorSpace",
110380
110344
  "ContentScale",
110381
110345
  "ContextMenu",
110382
110346
  "Debug",
@@ -110455,15 +110419,15 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110455
110419
  {
110456
110420
  return this .textureQuality;
110457
110421
  },
110458
- set_rubberband__ (rubberband)
110422
+ set_Rubberband__ (rubberband)
110459
110423
  {
110460
110424
  this .localStorage .Rubberband = rubberband .getValue ();
110461
110425
  },
110462
- set_antialiased__ ()
110426
+ set_Antialiased__ ()
110463
110427
  {
110464
- this .set_multisampling__ (this ._Multisampling);
110428
+ this .set_Multisampling__ (this ._Multisampling);
110465
110429
  },
110466
- set_primitiveQuality__ (value)
110430
+ set_PrimitiveQuality__ (value)
110467
110431
  {
110468
110432
  const
110469
110433
  browser = this .getBrowser (),
@@ -110478,7 +110442,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110478
110442
  if (typeof browser .setPrimitiveQuality3D === "function")
110479
110443
  browser .setPrimitiveQuality3D (this .primitiveQuality);
110480
110444
  },
110481
- set_textureQuality__ (value)
110445
+ set_TextureQuality__ (value)
110482
110446
  {
110483
110447
  const
110484
110448
  browser = this .getBrowser (),
@@ -110490,7 +110454,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110490
110454
  if (typeof browser .setTextureQuality === "function")
110491
110455
  browser .setTextureQuality (this .textureQuality);
110492
110456
  },
110493
- set_shading__: (() =>
110457
+ set_Shading__: (() =>
110494
110458
  {
110495
110459
  const strings = {
110496
110460
  [Core_Shading .POINT]: "POINT",
@@ -110512,14 +110476,14 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110512
110476
  browser .setShading (this .shading);
110513
110477
  };
110514
110478
  })(),
110515
- set_straightenHorizon__ (straightenHorizon)
110479
+ set_StraightenHorizon__ (straightenHorizon)
110516
110480
  {
110517
110481
  this .localStorage .StraightenHorizon = straightenHorizon .getValue ();
110518
110482
 
110519
110483
  if (straightenHorizon .getValue ())
110520
110484
  this .getBrowser () .getActiveLayer () ?.straightenView ();
110521
110485
  },
110522
- set_autoUpdate__ (autoUpdate)
110486
+ set_AutoUpdate__ (autoUpdate)
110523
110487
  {
110524
110488
  const events = ["resize", "scroll", "load"]
110525
110489
  .map (event => `${event}.${this .getTypeName ()}${this .getId ()}`)
@@ -110553,7 +110517,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110553
110517
  BrowserOptions_$(window) .off (events);
110554
110518
  }
110555
110519
  },
110556
- set_contentScale__ (contentScale)
110520
+ set_ContentScale__ (contentScale)
110557
110521
  {
110558
110522
  const browser = this .getBrowser ();
110559
110523
 
@@ -110585,7 +110549,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110585
110549
 
110586
110550
  browser .reshape ();
110587
110551
  },
110588
- set_exposure__ ()
110552
+ set_Exposure__ ()
110589
110553
  {
110590
110554
  const
110591
110555
  browser = this .getBrowser (),
@@ -110598,7 +110562,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110598
110562
  gl .uniform1f (shaderNode .x3d_Exposure, exposure);
110599
110563
  }
110600
110564
  },
110601
- set_logarithmicDepthBuffer__ (logarithmicDepthBuffer)
110565
+ set_LogarithmicDepthBuffer__ (logarithmicDepthBuffer)
110602
110566
  {
110603
110567
  const
110604
110568
  browser = this .getBrowser (),
@@ -110606,7 +110570,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110606
110570
 
110607
110571
  browser .getRenderingProperties () ._LogarithmicDepthBuffer = logarithmicDepthBuffer .getValue () && gl .HAS_FEATURE_FRAG_DEPTH;
110608
110572
  },
110609
- set_multisampling__ (multisampling)
110573
+ set_Multisampling__ (multisampling)
110610
110574
  {
110611
110575
  const
110612
110576
  browser = this .getBrowser (),
@@ -110617,11 +110581,11 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110617
110581
 
110618
110582
  browser .reshape ();
110619
110583
  },
110620
- set_orderIndependentTransparency__ ()
110584
+ set_OrderIndependentTransparency__ ()
110621
110585
  {
110622
110586
  this .getBrowser () .reshape ();
110623
110587
  },
110624
- set_timings__ (timings)
110588
+ set_Timings__ (timings)
110625
110589
  {
110626
110590
  this .localStorage .Timings = timings .getValue ();
110627
110591
  },
@@ -110647,10 +110611,12 @@ Object .defineProperties (BrowserOptions,
110647
110611
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "QualityWhenMoving", new x_ite_Fields .SFString ("SAME")),
110648
110612
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Shading", new x_ite_Fields .SFString ("GOURAUD")),
110649
110613
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "MotionBlur", new x_ite_Fields .SFBool ()),
110614
+ // Additional options:
110650
110615
  // Always update geometries, even if browser is not live.
110651
110616
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "AlwaysUpdateGeometries", new x_ite_Fields .SFBool ()),
110652
110617
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "AutoUpdate", new x_ite_Fields .SFBool ()),
110653
110618
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Cache", new x_ite_Fields .SFBool (true)),
110619
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ColorSpace", new x_ite_Fields .SFString ("LINEAR_WHEN_PHYSICAL_MATERIAL")),
110654
110620
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ContentScale", new x_ite_Fields .SFDouble (1)),
110655
110621
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ContextMenu", new x_ite_Fields .SFBool (true)),
110656
110622
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Debug", new x_ite_Fields .SFBool ()),
@@ -110877,7 +110843,7 @@ const RenderingProperties_default_ = RenderingProperties;
110877
110843
  x_ite_Namespace .add ("RenderingProperties", "x_ite/Browser/Core/RenderingProperties", RenderingProperties_default_);
110878
110844
  /* harmony default export */ const Core_RenderingProperties = (RenderingProperties_default_);
110879
110845
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/Notification.js
110880
- /* provided dependency */ var Notification_$ = __webpack_require__(126);
110846
+ /* provided dependency */ var Notification_$ = __webpack_require__(376);
110881
110847
  /*******************************************************************************
110882
110848
  *
110883
110849
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111000,8 +110966,8 @@ const Notification_default_ = Notification;
111000
110966
  x_ite_Namespace .add ("Notification", "x_ite/Browser/Core/Notification", Notification_default_);
111001
110967
  /* harmony default export */ const Core_Notification = (Notification_default_);
111002
110968
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/ContextMenu.js
111003
- /* provided dependency */ var jquery_fullscreen = __webpack_require__(318);
111004
- /* provided dependency */ var ContextMenu_$ = __webpack_require__(126);
110969
+ /* provided dependency */ var jquery_fullscreen = __webpack_require__(68);
110970
+ /* provided dependency */ var ContextMenu_$ = __webpack_require__(376);
111005
110971
  /*******************************************************************************
111006
110972
  *
111007
110973
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113754,7 +113720,7 @@ const DataStorage_default_ = DataStorage;
113754
113720
  x_ite_Namespace .add ("DataStorage", "standard/Utility/DataStorage", DataStorage_default_);
113755
113721
  /* harmony default export */ const Utility_DataStorage = (DataStorage_default_);
113756
113722
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/X3DCoreContext.js
113757
- /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(126);
113723
+ /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(376);
113758
113724
  /*******************************************************************************
113759
113725
  *
113760
113726
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113848,8 +113814,8 @@ function X3DCoreContext (element)
113848
113814
  // Get canvas & context.
113849
113815
 
113850
113816
  const
113851
- browser = X3DCoreContext_$("<div></div>") .addClass ("x_ite-private-browser") .attr ("tabindex", 0),
113852
- surface = X3DCoreContext_$("<div></div>") .addClass ("x_ite-private-surface") .appendTo (browser),
113817
+ browser = X3DCoreContext_$("<div></div>") .addClass ("x_ite-private-browser") .attr ("part", "browser") .attr ("tabindex", 0),
113818
+ surface = X3DCoreContext_$("<div></div>") .addClass ("x_ite-private-surface") .attr ("part", "surface") .appendTo (browser),
113853
113819
  splashScreen = X3DCoreContext_$("<div></div>") .hide () .addClass ("x_ite-private-splash-screen") .appendTo (browser),
113854
113820
  spinner = X3DCoreContext_$("<div></div>") .addClass ("x_ite-private-spinner") .appendTo (splashScreen),
113855
113821
  progress = X3DCoreContext_$("<div></div>") .addClass ("x_ite-private-progress") .appendTo (splashScreen);
@@ -113884,7 +113850,7 @@ function X3DCoreContext (element)
113884
113850
  this [_mobile] = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
113885
113851
  this [_element] = element;
113886
113852
  this [_surface] = surface;
113887
- this [_canvas] = X3DCoreContext_$("<canvas></canvas>") .addClass ("x_ite-private-canvas") .prependTo (surface);
113853
+ this [_canvas] = X3DCoreContext_$("<canvas></canvas>") .attr ("part", "canvas") .addClass ("x_ite-private-canvas") .prependTo (surface);
113888
113854
  this [_context] = Core_Context .create (this [_canvas] [0], WEBGL_VERSION, element .attr ("preserveDrawingBuffer") === "true", this [_mobile]);
113889
113855
  this [_splashScreen] = splashScreen;
113890
113856
 
@@ -114062,6 +114028,12 @@ Object .assign (X3DCoreContext .prototype,
114062
114028
  this .setBrowserOption ("Cache", this .parseBooleanAttribute (newValue, true));
114063
114029
  break;
114064
114030
  }
114031
+ case "colorSpace":
114032
+ case "colorspace":
114033
+ {
114034
+ this .setBrowserOption ("ColorSpace", newValue);
114035
+ break;
114036
+ }
114065
114037
  case "contentScale":
114066
114038
  case "contentscale":
114067
114039
  {
@@ -116328,8 +116300,8 @@ const X3DViewer_default_ = X3DViewer;
116328
116300
  x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DViewer_default_);
116329
116301
  /* harmony default export */ const Navigation_X3DViewer = (X3DViewer_default_);
116330
116302
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/ExamineViewer.js
116331
- /* provided dependency */ var jquery_mousewheel = __webpack_require__(644);
116332
- /* provided dependency */ var ExamineViewer_$ = __webpack_require__(126);
116303
+ /* provided dependency */ var jquery_mousewheel = __webpack_require__(302);
116304
+ /* provided dependency */ var ExamineViewer_$ = __webpack_require__(376);
116333
116305
  /*******************************************************************************
116334
116306
  *
116335
116307
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116392,12 +116364,14 @@ x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DView
116392
116364
 
116393
116365
  typeof jquery_mousewheel; // import plugin
116394
116366
 
116395
- const macOS = /Mac OS X/i .test (navigator .userAgent);
116367
+ const
116368
+ macOS = /Mac OS X/i .test (navigator .userAgent),
116369
+ mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
116396
116370
 
116397
116371
  const
116398
- SPIN_RELEASE_TIME = 20,
116399
- SPIN_ANGLE = Math_Algorithm .radians (2),
116400
- SPIN_FACTOR = 0.4,
116372
+ SPIN_RELEASE_TIME = mobile ? 20 : 25,
116373
+ SPIN_ANGLE = Math_Algorithm .radians (mobile ? 3 : 2),
116374
+ SPIN_FACTOR = mobile ? 0.2 : 0.3,
116401
116375
  SCROLL_FACTOR = macOS ? 1 / 120 : 1 / 20,
116402
116376
  MOVE_TIME = 0.2,
116403
116377
  ROTATE_TIME = 0.2,
@@ -117243,8 +117217,8 @@ const ExamineViewer_default_ = ExamineViewer;
117243
117217
  x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer", ExamineViewer_default_);
117244
117218
  /* harmony default export */ const Navigation_ExamineViewer = (ExamineViewer_default_);
117245
117219
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/X3DFlyViewer.js
117246
- /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(644);
117247
- /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(126);
117220
+ /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(302);
117221
+ /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(376);
117248
117222
  /*******************************************************************************
117249
117223
  *
117250
117224
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117301,6 +117275,7 @@ x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer",
117301
117275
 
117302
117276
 
117303
117277
 
117278
+
117304
117279
  typeof X3DFlyViewer_jquery_mousewheel; // import plugin
117305
117280
 
117306
117281
  const X3DFlyViewer_macOS = /Mac OS X/i .test (navigator .userAgent)
@@ -117340,7 +117315,12 @@ function X3DFlyViewer (executionContext, navigationInfo)
117340
117315
  this .lineVertexBuffer = gl .createBuffer ();
117341
117316
  this .lineVertexArrayObject = new Rendering_VertexArray (gl);
117342
117317
  this .lineVertexArray = new Float32Array (8 * 4) .fill (1);
117343
- this .geometryContext = new Rendering_GeometryContext ({ geometryType: 2, colorMaterial: true });
117318
+
117319
+ this .geometryContext = new Rendering_GeometryContext ({
117320
+ renderObject: this .getActiveLayer (),
117321
+ geometryType: 2,
117322
+ colorMaterial: true,
117323
+ });
117344
117324
 
117345
117325
  gl .bindBuffer (gl .ELEMENT_ARRAY_BUFFER, this .lineIndexBuffer);
117346
117326
  gl .bufferData (gl .ELEMENT_ARRAY_BUFFER, new Uint8Array ([0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7]), gl .STATIC_DRAW);
@@ -118253,8 +118233,8 @@ const FlyViewer_default_ = FlyViewer;
118253
118233
  x_ite_Namespace .add ("FlyViewer", "x_ite/Browser/Navigation/FlyViewer", FlyViewer_default_);
118254
118234
  /* harmony default export */ const Navigation_FlyViewer = (FlyViewer_default_);
118255
118235
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/PlaneViewer.js
118256
- /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(644);
118257
- /* provided dependency */ var PlaneViewer_$ = __webpack_require__(126);
118236
+ /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(302);
118237
+ /* provided dependency */ var PlaneViewer_$ = __webpack_require__(376);
118258
118238
  /*******************************************************************************
118259
118239
  *
118260
118240
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118585,8 +118565,8 @@ const NoneViewer_default_ = NoneViewer;
118585
118565
  x_ite_Namespace .add ("NoneViewer", "x_ite/Browser/Navigation/NoneViewer", NoneViewer_default_);
118586
118566
  /* harmony default export */ const Navigation_NoneViewer = (NoneViewer_default_);
118587
118567
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/LookAtViewer.js
118588
- /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(644);
118589
- /* provided dependency */ var LookAtViewer_$ = __webpack_require__(126);
118568
+ /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(302);
118569
+ /* provided dependency */ var LookAtViewer_$ = __webpack_require__(376);
118590
118570
  /*******************************************************************************
118591
118571
  *
118592
118572
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119174,20 +119154,6 @@ const
119174
119154
  _viewerNode = Symbol (),
119175
119155
  _headlightContainer = Symbol ();
119176
119156
 
119177
- function getHeadlight (browser)
119178
- {
119179
- const headlight = new Lighting_DirectionalLight (browser .getPrivateScene ());
119180
-
119181
- headlight .setup ();
119182
-
119183
- const headlightContainer = headlight .getLights () .pop ();
119184
-
119185
- headlightContainer .set (headlight, null, Numbers_Matrix4 .Identity);
119186
- headlightContainer .dispose = Function .prototype;
119187
-
119188
- return headlightContainer;
119189
- };
119190
-
119191
119157
  function X3DNavigationContext ()
119192
119158
  {
119193
119159
  this .addChildObjects (Base_X3DConstants .outputOnly, "activeLayer", new x_ite_Fields .SFNode (),
@@ -119209,9 +119175,22 @@ Object .assign (X3DNavigationContext .prototype,
119209
119175
  this .initialized () .addInterest ("set_world__", this);
119210
119176
  this .shutdown () .addInterest ("remove_world__", this);
119211
119177
 
119212
- this [_headlightContainer] = getHeadlight (this);
119178
+ this [_headlightContainer] = this .createHeadlight ();
119213
119179
  this [_viewerNode] .setup ();
119214
119180
  },
119181
+ createHeadlight ()
119182
+ {
119183
+ const headlight = new Lighting_DirectionalLight (this .getPrivateScene ());
119184
+
119185
+ headlight .setup ();
119186
+
119187
+ const headlightContainer = headlight .getLights () .pop ();
119188
+
119189
+ headlightContainer .set (headlight, null, Numbers_Matrix4 .Identity);
119190
+ headlightContainer .dispose = Function .prototype;
119191
+
119192
+ return headlightContainer;
119193
+ },
119215
119194
  getHeadlight ()
119216
119195
  {
119217
119196
  return this [_headlightContainer];
@@ -119726,8 +119705,8 @@ const X3DPickingContext_default_ = X3DPickingContext;
119726
119705
  x_ite_Namespace .add ("X3DPickingContext", "x_ite/Browser/Picking/X3DPickingContext", X3DPickingContext_default_);
119727
119706
  /* harmony default export */ const Picking_X3DPickingContext = (X3DPickingContext_default_);
119728
119707
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js
119729
- /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(644);
119730
- /* provided dependency */ var PointingDevice_$ = __webpack_require__(126);
119708
+ /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(302);
119709
+ /* provided dependency */ var PointingDevice_$ = __webpack_require__(376);
119731
119710
  /*******************************************************************************
119732
119711
  *
119733
119712
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120551,14 +120530,11 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
120551
120530
 
120552
120531
  let key = "";
120553
120532
 
120554
- key += numClipPlanes;
120555
- key += ".";
120533
+ key += numClipPlanes; // Could be more than 9.
120534
+ key += humanoidNode ?.getHumanoidKey () ?? "[]";
120556
120535
  key += shapeNode .getShapeKey ();
120557
120536
  key += geometryType;
120558
- key += hasNormals;
120559
- key += ".";
120560
- key += humanoidNode ?.getHumanoidKey () ?? "";
120561
- key += ".";
120537
+ key += hasNormals ? 1 : 0;
120562
120538
 
120563
120539
  if (geometryType >= 2)
120564
120540
  {
@@ -121031,7 +121007,7 @@ const MultiSampleFrameBuffer_default_ = MultiSampleFrameBuffer;
121031
121007
  x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFrameBuffer", MultiSampleFrameBuffer_default_);
121032
121008
  /* harmony default export */ const Rendering_MultiSampleFrameBuffer = (MultiSampleFrameBuffer_default_);
121033
121009
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/X3DRenderingContext.js
121034
- /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(126);
121010
+ /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(376);
121035
121011
  /*******************************************************************************
121036
121012
  *
121037
121013
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121083,6 +121059,8 @@ x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFram
121083
121059
 
121084
121060
 
121085
121061
 
121062
+
121063
+
121086
121064
  const
121087
121065
  _viewport = Symbol (),
121088
121066
  _frameBuffer = Symbol (),
@@ -121096,7 +121074,9 @@ const
121096
121074
 
121097
121075
  function X3DRenderingContext ()
121098
121076
  {
121099
- this [_viewport] = new Numbers_Vector4 (0, 0, 300, 150);
121077
+
121078
+ this .addChildObjects (Base_X3DConstants .outputOnly, "viewport", new x_ite_Fields .MFInt32 (0, 0, 300, 150));
121079
+
121100
121080
  this [_frameBuffer] = new Rendering_MultiSampleFrameBuffer (this, 300, 150, 4);
121101
121081
  this [_localObjects] = [ ]; // shader objects dumpster
121102
121082
  this [_depthShaders] = new Map ();
@@ -121188,7 +121168,7 @@ Object .assign (X3DRenderingContext .prototype,
121188
121168
  },
121189
121169
  getViewport ()
121190
121170
  {
121191
- return this [_viewport];
121171
+ return this ._viewport;
121192
121172
  },
121193
121173
  getLocalObjects ()
121194
121174
  {
@@ -121246,13 +121226,10 @@ Object .assign (X3DRenderingContext .prototype,
121246
121226
 
121247
121227
  let key = "";
121248
121228
 
121249
- key += numClipPlanes;
121250
- key += ".";
121229
+ key += numClipPlanes; // Could be more than 9.
121230
+ key += humanoidNode ?.getHumanoidKey () ?? "[]";
121251
121231
  key += shapeNode .getShapeKey ();
121252
121232
  key += geometryContext .geometryType;
121253
- key += ".";
121254
- key += humanoidNode ?.getHumanoidKey () ?? "";
121255
- key += ".";
121256
121233
 
121257
121234
  if (geometryContext .geometryType >= 2)
121258
121235
  {
@@ -121306,6 +121283,32 @@ Object .assign (X3DRenderingContext .prototype,
121306
121283
 
121307
121284
  return shaderNode;
121308
121285
  },
121286
+ resize (width, height)
121287
+ {
121288
+ return new Promise (resolve =>
121289
+ {
121290
+ const key = Symbol ();
121291
+
121292
+ const test = () =>
121293
+ {
121294
+ if (this ._viewport [2] !== width)
121295
+ return;
121296
+
121297
+ if (this ._viewport [2] !== height)
121298
+ return;
121299
+
121300
+ this ._viewport .removeFieldCallback (key);
121301
+
121302
+ resolve ();
121303
+ }
121304
+
121305
+ this .getElement () .css ({ "width": `${width}px`, "height": `${height}px` });
121306
+
121307
+ this ._viewport .addFieldCallback (key, test);
121308
+
121309
+ test ();
121310
+ });
121311
+ },
121309
121312
  reshape ()
121310
121313
  {
121311
121314
  const
@@ -121316,28 +121319,30 @@ Object .assign (X3DRenderingContext .prototype,
121316
121319
  width = Math .max (canvas .width () * contentScale, 1),
121317
121320
  height = Math .max (canvas .height () * contentScale, 1);
121318
121321
 
121322
+ this .addBrowserEvent ();
121323
+
121319
121324
  canvas .prop ("width", width);
121320
121325
  canvas .prop ("height", height);
121321
121326
 
121322
- this [_viewport] [2] = width;
121323
- this [_viewport] [3] = height;
121327
+ this ._viewport [2] = width;
121328
+ this ._viewport [3] = height;
121324
121329
 
121325
- if (width !== this [_frameBuffer] .getWidth () ||
121326
- height !== this [_frameBuffer] .getHeight () ||
121327
- samples !== this [_frameBuffer] .getSamples () ||
121328
- oit !== this [_frameBuffer] .getOIT ())
121330
+ if (width === this [_frameBuffer] .getWidth () &&
121331
+ height === this [_frameBuffer] .getHeight () &&
121332
+ samples === this [_frameBuffer] .getSamples () &&
121333
+ oit === this [_frameBuffer] .getOIT ())
121329
121334
  {
121330
- this [_frameBuffer] .dispose ();
121331
- this [_frameBuffer] = new Rendering_MultiSampleFrameBuffer (this, width, height, samples, oit);
121332
-
121333
- if (this [_transmissionBuffer])
121334
- {
121335
- this [_transmissionBuffer] .dispose ();
121336
- this [_transmissionBuffer] = new Rendering_TextureBuffer (this, width, height, false, true);
121337
- }
121335
+ return;
121338
121336
  }
121339
121337
 
121340
- this .addBrowserEvent ();
121338
+ this [_frameBuffer] .dispose ();
121339
+ this [_frameBuffer] = new Rendering_MultiSampleFrameBuffer (this, width, height, samples, oit);
121340
+
121341
+ if (!this [_transmissionBuffer])
121342
+ return;
121343
+
121344
+ this [_transmissionBuffer] .dispose ();
121345
+ this [_transmissionBuffer] = new Rendering_TextureBuffer (this, width, height, false, true);
121341
121346
  },
121342
121347
  onfullscreen ()
121343
121348
  {
@@ -121596,7 +121601,7 @@ Object .assign (X3DShadersContext .prototype,
121596
121601
  vertexShader .setup ();
121597
121602
 
121598
121603
  const fragmentShader = new Shaders_ShaderPart (this .getPrivateScene ());
121599
- fragmentShader ._type = "FRAGMENT";
121604
+ fragmentShader ._type = "FRAGMENT";
121600
121605
  fragmentShader ._url .push (encodeURI (fs .startsWith ("data:") ? fs : "data:x-shader/x-fragment," + Shaders_ShaderRegistry .fragment [version] [fs]));
121601
121606
  fragmentShader .setPrivate (true);
121602
121607
  fragmentShader .setName (`${name}FragmentShader`);
@@ -122006,7 +122011,7 @@ const X3DSoundContext_default_ = X3DSoundContext;
122006
122011
  x_ite_Namespace .add ("X3DSoundContext", "x_ite/Browser/Sound/X3DSoundContext", X3DSoundContext_default_);
122007
122012
  /* harmony default export */ const Sound_X3DSoundContext = (X3DSoundContext_default_);
122008
122013
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/KTXDecoder.js
122009
- /* provided dependency */ var KTXDecoder_$ = __webpack_require__(126);
122014
+ /* provided dependency */ var KTXDecoder_$ = __webpack_require__(376);
122010
122015
  const KTXDecoder_default_ = class KTXDecoder
122011
122016
  {
122012
122017
  constructor (gl, externalKtxlib, scriptDir)
@@ -123175,7 +123180,8 @@ function X3DBrowserContext (element)
123175
123180
  Base_X3DConstants .outputOnly, "timeEvents", new Fields_SFTime (),
123176
123181
  Base_X3DConstants .outputOnly, "sensorEvents", new Fields_SFTime (),
123177
123182
  Base_X3DConstants .outputOnly, "displayEvents", new Fields_SFTime (),
123178
- Base_X3DConstants .outputOnly, "finishedEvents", new Fields_SFTime ());
123183
+ Base_X3DConstants .outputOnly, "finishedEvents", new Fields_SFTime (),
123184
+ Base_X3DConstants .outputOnly, "endEvents", new Fields_SFTime ());
123179
123185
 
123180
123186
  this [X3DBrowserContext_tainted] = false;
123181
123187
  this [_previousTime] = 0;
@@ -123260,6 +123266,10 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
123260
123266
  {
123261
123267
  return this ._finishedEvents;
123262
123268
  },
123269
+ endEvents ()
123270
+ {
123271
+ return this ._endEvents;
123272
+ },
123263
123273
  getBrowser ()
123264
123274
  {
123265
123275
  return this;
@@ -123285,6 +123295,21 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
123285
123295
  this [X3DBrowserContext_tainted] = true;
123286
123296
  this [_animFrame] = requestAnimationFrame (this [_renderCallback]);
123287
123297
  },
123298
+ nextFrame ()
123299
+ {
123300
+ return new Promise (resolve =>
123301
+ {
123302
+ const key = Symbol ();
123303
+
123304
+ this .addBrowserEvent ();
123305
+
123306
+ this ._endEvents .addFieldCallback (key, () =>
123307
+ {
123308
+ this ._endEvents .removeFieldCallback (key);
123309
+ resolve ();
123310
+ });
123311
+ });
123312
+ },
123288
123313
  [_limitFrameRate] (now)
123289
123314
  {
123290
123315
  if (now > this [_previousTime])
@@ -123313,7 +123338,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
123313
123338
  this [_systemTime] .stop ();
123314
123339
  this [_browserTime] .start ();
123315
123340
 
123316
- // time
123341
+ // Time
123317
123342
 
123318
123343
  this .advanceTime ();
123319
123344
 
@@ -123360,6 +123385,9 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
123360
123385
  this .getFrameBuffer () .blit ();
123361
123386
  this [_displayTime] .stop ();
123362
123387
 
123388
+ this .addTaintedField (this ._endEvents);
123389
+ this [X3DBrowserContext_processEvents] ();
123390
+
123363
123391
  // Finish
123364
123392
 
123365
123393
  this [_browserTime] .stop ();
@@ -123597,7 +123625,7 @@ const Components_default_ = Components;
123597
123625
  x_ite_Namespace .add ("Components", "x_ite/Components", Components_default_);
123598
123626
  /* harmony default export */ const x_ite_Components = ((/* unused pure expression or super */ null && (Components_default_)));
123599
123627
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/DOMIntegration.js
123600
- /* provided dependency */ var DOMIntegration_$ = __webpack_require__(126);
123628
+ /* provided dependency */ var DOMIntegration_$ = __webpack_require__(376);
123601
123629
  /*******************************************************************************
123602
123630
  * MIT License
123603
123631
  *
@@ -124865,7 +124893,7 @@ const FieldTypes_default_ = new Configuration_FieldTypesArray (Object .values (x
124865
124893
  x_ite_Namespace .add ("FieldTypes", "x_ite/Configuration/FieldTypes", FieldTypes_default_);
124866
124894
  /* harmony default export */ const FieldTypes = (FieldTypes_default_);
124867
124895
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/X3DBrowser.js
124868
- /* provided dependency */ var X3DBrowser_$ = __webpack_require__(126);
124896
+ /* provided dependency */ var X3DBrowser_$ = __webpack_require__(376);
124869
124897
  /*******************************************************************************
124870
124898
  *
124871
124899
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125967,7 +125995,7 @@ const X3DBrowser_default_ = X3DBrowser;
125967
125995
  x_ite_Namespace .add ("X3DBrowser", "x_ite/Browser/X3DBrowser", X3DBrowser_default_);
125968
125996
  /* harmony default export */ const Browser_X3DBrowser = (X3DBrowser_default_);
125969
125997
  ;// CONCATENATED MODULE: ./src/x_ite/X3DCanvasElement.js
125970
- /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(126);
125998
+ /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(376);
125971
125999
  /*******************************************************************************
125972
126000
  *
125973
126001
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126019,13 +126047,19 @@ x_ite_Namespace .add ("X3DBrowser", "x_ite/Browser/X3DBrowser", X3DBrowser_defau
126019
126047
 
126020
126048
  class X3DCanvasElement extends HTMLElement
126021
126049
  {
126050
+ browser;
126051
+
126022
126052
  constructor ()
126023
126053
  {
126024
126054
  try
126025
126055
  {
126026
126056
  super ();
126027
126057
 
126028
- new Browser_X3DBrowser (this)
126058
+ Object .defineProperty (this, "browser",
126059
+ {
126060
+ value: new Browser_X3DBrowser (this),
126061
+ enumerable: true,
126062
+ });
126029
126063
  }
126030
126064
  catch (error)
126031
126065
  {
@@ -126049,6 +126083,8 @@ class X3DCanvasElement extends HTMLElement
126049
126083
  "baseURL",
126050
126084
  "baseurl",
126051
126085
  "cache",
126086
+ "colorSpace",
126087
+ "colorspace",
126052
126088
  "contentScale",
126053
126089
  "contentscale",
126054
126090
  "contextMenu",
@@ -126109,8 +126145,8 @@ const X3DCanvasElement_default_ = X3DCanvasElement;
126109
126145
  x_ite_Namespace .add ("X3DCanvasElement", "x_ite/X3DCanvasElement", X3DCanvasElement_default_);
126110
126146
  /* harmony default export */ const x_ite_X3DCanvasElement = (X3DCanvasElement_default_);
126111
126147
  ;// CONCATENATED MODULE: ./src/lib/jquery.js
126112
- /* provided dependency */ var jquery_$ = __webpack_require__(126);
126113
- /* provided dependency */ var pako = __webpack_require__(406);
126148
+ /* provided dependency */ var jquery_$ = __webpack_require__(376);
126149
+ /* provided dependency */ var pako = __webpack_require__(860);
126114
126150
  Object .assign (jquery_$,
126115
126151
  {
126116
126152
  decodeText (input)
@@ -126187,14 +126223,14 @@ const jquery_default_ = jquery_$;
126187
126223
  x_ite_Namespace .add ("jquery", "lib/jquery", jquery_default_);
126188
126224
  /* harmony default export */ const jquery = ((/* unused pure expression or super */ null && (jquery_default_)));
126189
126225
  ;// CONCATENATED MODULE: ./src/lib/libtess.js
126190
- /* provided dependency */ var libtess_libtess = __webpack_require__(727);
126226
+ /* provided dependency */ var libtess_libtess = __webpack_require__(229);
126191
126227
  const libtess_default_ = libtess_libtess;
126192
126228
  ;
126193
126229
 
126194
126230
  x_ite_Namespace .add ("libtess", "lib/libtess", libtess_default_);
126195
126231
  /* harmony default export */ const lib_libtess = ((/* unused pure expression or super */ null && (libtess_default_)));
126196
126232
  ;// CONCATENATED MODULE: ./src/x_ite/X3D.js
126197
- /* provided dependency */ var X3D_$ = __webpack_require__(126);
126233
+ /* provided dependency */ var X3D_$ = __webpack_require__(376);
126198
126234
  /*******************************************************************************
126199
126235
  *
126200
126236
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126502,7 +126538,7 @@ Object .assign (X3D,
126502
126538
 
126503
126539
  // Assign X3D to global namespace.
126504
126540
 
126505
- window [Symbol .for ("X_ITE.X3D-10.0.1")] = x_ite_X3D;
126541
+ window [Symbol .for ("X_ITE.X3D-10.0.3")] = x_ite_X3D;
126506
126542
 
126507
126543
  customElements .define ("x3d-canvas", x_ite_X3DCanvasElement);
126508
126544