x_ite 10.0.1 → 10.0.2

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 (49) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/components/Annotation.js +13 -13
  3. package/dist/assets/components/Annotation.min.js +1 -1
  4. package/dist/assets/components/CADGeometry.js +14 -14
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +25 -25
  7. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  8. package/dist/assets/components/DIS.js +13 -13
  9. package/dist/assets/components/DIS.min.js +1 -1
  10. package/dist/assets/components/EventUtilities.js +9 -9
  11. package/dist/assets/components/EventUtilities.min.js +1 -1
  12. package/dist/assets/components/Geometry2D.js +18 -18
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +33 -33
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +23 -23
  17. package/dist/assets/components/HAnim.min.js +1 -1
  18. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  19. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  20. package/dist/assets/components/Layout.js +27 -27
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +23 -23
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +26 -26
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +18 -18
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +38 -38
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +24 -24
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/TextureProjection.js +15 -15
  35. package/dist/assets/components/TextureProjection.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +27 -27
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +19 -19
  39. package/dist/assets/components/VolumeRendering.min.js +1 -1
  40. package/dist/assets/components/X_ITE.js +38 -176
  41. package/dist/assets/components/X_ITE.min.js +1 -1
  42. package/dist/x_ite.css +1 -1
  43. package/dist/x_ite.d.ts +784 -65
  44. package/dist/x_ite.js +597 -608
  45. package/dist/x_ite.min.js +1 -1
  46. package/dist/x_ite.min.mjs +1 -1
  47. package/dist/x_ite.mjs +597 -608
  48. package/dist/x_ite.zip +0 -0
  49. package/package.json +1 -1
package/dist/x_ite.mjs CHANGED
@@ -1,9 +1,9 @@
1
- /* X_ITE v10.0.1 */var __webpack_modules__ = ({
1
+ /* X_ITE v10.0.2 */var __webpack_modules__ = ({
2
2
 
3
- /***/ 318:
3
+ /***/ 810:
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__(786);
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
+ /***/ 832:
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__(786)], __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
+ /***/ 786:
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
+ /***/ 315:
11152
11152
  /***/ ((module) => {
11153
11153
 
11154
11154
  /**
@@ -15927,7 +15927,7 @@ if (true) {
15927
15927
 
15928
15928
  /***/ }),
15929
15929
 
15930
- /***/ 406:
15930
+ /***/ 826:
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
+ /***/ 781:
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.2")];
20301
20301
 
20302
20302
  if (X3D)
20303
20303
  X3D [name] = module;
@@ -23581,6 +23581,22 @@ Object .assign (Color3 .prototype,
23581
23581
 
23582
23582
  return this;
23583
23583
  },
23584
+ linearToSRGB (color = new Color3 ())
23585
+ {
23586
+ color [_r] = Math .pow (this [_r], 1 / 2.2);
23587
+ color [_g] = Math .pow (this [_g], 1 / 2.2);
23588
+ color [_b] = Math .pow (this [_b], 1 / 2.2);
23589
+
23590
+ return color;
23591
+ },
23592
+ sRGBToLinear (color = new Color3 ())
23593
+ {
23594
+ color [_r] = Math .pow (this [_r], 2.2);
23595
+ color [_g] = Math .pow (this [_g], 2.2);
23596
+ color [_b] = Math .pow (this [_b], 2.2);
23597
+
23598
+ return color;
23599
+ },
23584
23600
  toString ()
23585
23601
  {
23586
23602
  return this [_r] + " " +
@@ -23780,6 +23796,14 @@ Object .assign (Object .setPrototypeOf (SFColor .prototype, Base_X3DField .proto
23780
23796
  this .getValue () .setHSV (h, s, v);
23781
23797
  this .addEvent ();
23782
23798
  },
23799
+ linearToSRGB ()
23800
+ {
23801
+ return new SFColor (this .getValue () .linearToSRGB ());
23802
+ },
23803
+ sRGBToLinear ()
23804
+ {
23805
+ return new SFColor (this .getValue () .sRGBToLinear ());
23806
+ },
23783
23807
  lerp: (() =>
23784
23808
  {
23785
23809
  const
@@ -24034,6 +24058,22 @@ Object .assign (Color4 .prototype,
24034
24058
 
24035
24059
  return this;
24036
24060
  },
24061
+ linearToSRGB (color = new Color4 ())
24062
+ {
24063
+ Numbers_Color3 .prototype .linearToSRGB .call (this, color);
24064
+
24065
+ color [_a] = this [_a];
24066
+
24067
+ return color;
24068
+ },
24069
+ sRGBToLinear (color = new Color4 ())
24070
+ {
24071
+ Numbers_Color3 .prototype .sRGBToLinear .call (this, color);
24072
+
24073
+ color [_a] = this [_a];
24074
+
24075
+ return color;
24076
+ },
24037
24077
  toString ()
24038
24078
  {
24039
24079
  return this [Color4_r] + " " +
@@ -24204,6 +24244,14 @@ Object .assign (Object .setPrototypeOf (SFColorRGBA .prototype, Base_X3DField .p
24204
24244
  this .getValue () .setHSVA (h, s, v, a);
24205
24245
  this .addEvent ();
24206
24246
  },
24247
+ linearToSRGB ()
24248
+ {
24249
+ return new SFColorRGBA (this .getValue () .linearToSRGB ());
24250
+ },
24251
+ sRGBToLinear ()
24252
+ {
24253
+ return new SFColorRGBA (this .getValue () .sRGBToLinear ());
24254
+ },
24207
24255
  lerp: (() =>
24208
24256
  {
24209
24257
  const
@@ -34229,7 +34277,7 @@ const X3DBaseNode_default_ = X3DBaseNode;
34229
34277
  x_ite_Namespace .add ("X3DBaseNode", "x_ite/Base/X3DBaseNode", X3DBaseNode_default_);
34230
34278
  /* harmony default export */ const Base_X3DBaseNode = (X3DBaseNode_default_);
34231
34279
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Legacy.js
34232
- /* provided dependency */ var $ = __webpack_require__(126);
34280
+ /* provided dependency */ var $ = __webpack_require__(786);
34233
34281
  /*******************************************************************************
34234
34282
  *
34235
34283
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34366,7 +34414,7 @@ x_ite_Namespace .add ("Legacy", "x_ite/Browser/Legacy", Legacy_default_);
34366
34414
  *
34367
34415
  ******************************************************************************/
34368
34416
 
34369
- const BROWSER_VERSION_default_ = "10.0.1";
34417
+ const BROWSER_VERSION_default_ = "10.0.2";
34370
34418
  ;
34371
34419
 
34372
34420
  x_ite_Namespace .add ("BROWSER_VERSION", "x_ite/BROWSER_VERSION", BROWSER_VERSION_default_);
@@ -37552,7 +37600,7 @@ const X3DBindableNode_default_ = X3DBindableNode;
37552
37600
  x_ite_Namespace .add ("X3DBindableNode", "x_ite/Components/Core/X3DBindableNode", X3DBindableNode_default_);
37553
37601
  /* harmony default export */ const Core_X3DBindableNode = (X3DBindableNode_default_);
37554
37602
  ;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle3.js
37555
- /* provided dependency */ var libtess = __webpack_require__(727);
37603
+ /* provided dependency */ var libtess = __webpack_require__(315);
37556
37604
  /*******************************************************************************
37557
37605
  *
37558
37606
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40122,7 +40170,7 @@ const X3DProtoDeclaration_default_ = X3DProtoDeclaration;
40122
40170
  x_ite_Namespace .add ("X3DProtoDeclaration", "x_ite/Prototype/X3DProtoDeclaration", X3DProtoDeclaration_default_);
40123
40171
  /* harmony default export */ const Prototype_X3DProtoDeclaration = (X3DProtoDeclaration_default_);
40124
40172
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/X3DParser.js
40125
- /* provided dependency */ var X3DParser_$ = __webpack_require__(126);
40173
+ /* provided dependency */ var X3DParser_$ = __webpack_require__(786);
40126
40174
  /*******************************************************************************
40127
40175
  *
40128
40176
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40380,7 +40428,7 @@ const Expressions_default_ = Expressions;
40380
40428
  x_ite_Namespace .add ("Expressions", "x_ite/Parser/Expressions", Expressions_default_);
40381
40429
  /* harmony default export */ const Parser_Expressions = (Expressions_default_);
40382
40430
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/VRMLParser.js
40383
- /* provided dependency */ var VRMLParser_$ = __webpack_require__(126);
40431
+ /* provided dependency */ var VRMLParser_$ = __webpack_require__(786);
40384
40432
  /*******************************************************************************
40385
40433
  *
40386
40434
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43080,7 +43128,7 @@ const VRMLParser_default_ = VRMLParser;
43080
43128
  x_ite_Namespace .add ("VRMLParser", "x_ite/Parser/VRMLParser", VRMLParser_default_);
43081
43129
  /* harmony default export */ const Parser_VRMLParser = (VRMLParser_default_);
43082
43130
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/XMLParser.js
43083
- /* provided dependency */ var XMLParser_$ = __webpack_require__(126);
43131
+ /* provided dependency */ var XMLParser_$ = __webpack_require__(786);
43084
43132
  /*******************************************************************************
43085
43133
  *
43086
43134
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45256,7 +45304,7 @@ const URLs_default_ = URLs;
45256
45304
  x_ite_Namespace .add ("URLs", "x_ite/Browser/Networking/URLs", URLs_default_);
45257
45305
  /* harmony default export */ const Networking_URLs = (URLs_default_);
45258
45306
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLTF2Parser.js
45259
- /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(126);
45307
+ /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(786);
45260
45308
  /*******************************************************************************
45261
45309
  *
45262
45310
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45561,7 +45609,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45561
45609
  case "KHR_materials_sheen":
45562
45610
  case "KHR_materials_specular":
45563
45611
  case "KHR_materials_transmission":
45564
- case "KHR_materials_unlit":
45565
45612
  case "KHR_materials_volume":
45566
45613
  {
45567
45614
  const component = browser .getComponent ("X_ITE", 1);
@@ -46256,7 +46303,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46256
46303
 
46257
46304
  appearanceNode ._alphaMode = this .stringValue (material .alphaMode, "OPAQUE");
46258
46305
  appearanceNode ._alphaCutoff = this .numberValue (material .alphaCutoff, 0.5);
46259
- appearanceNode ._material = materialNode;
46306
+ appearanceNode ._material = this .khrMaterialsUnlitObject (material .extensions ?.KHR_materials_unlit, materialNode);
46260
46307
  appearanceNode ._textureTransform = this .createMultiTextureTransform (materialNode);
46261
46308
 
46262
46309
  appearanceNode .setup ();
@@ -46429,9 +46476,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46429
46476
  case "KHR_materials_transmission":
46430
46477
  this .khrMaterialsTransmission (value, materialNode);
46431
46478
  break;
46432
- case "KHR_materials_unlit":
46433
- this .khrMaterialsUnlitObject (value, materialNode);
46434
- break;
46435
46479
  case "KHR_materials_volume":
46436
46480
  this .khrMaterialsVolumeObject (value, materialNode);
46437
46481
  break;
@@ -46590,14 +46634,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46590
46634
 
46591
46635
  materialNode ._extensions .push (extension);
46592
46636
  },
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
46637
  khrMaterialsVolumeObject (KHR_materials_volume, materialNode)
46602
46638
  {
46603
46639
  const extension = this .getScene () .createNode ("VolumeMaterialExtension", false);
@@ -46616,6 +46652,27 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46616
46652
 
46617
46653
  materialNode ._extensions .push (extension);
46618
46654
  },
46655
+ khrMaterialsUnlitObject (KHR_materials_unlit, materialNode)
46656
+ {
46657
+ if (!KHR_materials_unlit)
46658
+ return materialNode;
46659
+
46660
+ const unlitMaterialNode = this .getScene () .createNode ("UnlitMaterial", false);
46661
+
46662
+ unlitMaterialNode ._emissiveColor = materialNode ._baseColor;
46663
+ unlitMaterialNode ._emissiveTextureMapping = materialNode ._baseTextureMapping;
46664
+ unlitMaterialNode ._emissiveTexture = materialNode ._baseTexture;
46665
+ unlitMaterialNode ._normalScale = materialNode ._normalScale;
46666
+ unlitMaterialNode ._normalTextureMapping = materialNode ._normalTextureMapping;
46667
+ unlitMaterialNode ._normalTexture = materialNode ._normalTexture;
46668
+ unlitMaterialNode ._transparency = materialNode ._transparency;
46669
+
46670
+ unlitMaterialNode .setup ();
46671
+
46672
+ materialNode .dispose ();
46673
+
46674
+ return unlitMaterialNode;
46675
+ },
46619
46676
  textureTransformObject (KHR_texture_transform, texCoord)
46620
46677
  {
46621
46678
  if (!(KHR_texture_transform instanceof Object))
@@ -47733,12 +47790,12 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47733
47790
  },
47734
47791
  hasTextures (materialNode)
47735
47792
  {
47736
- // Test PhysicalMaterial, ...
47793
+ // Test PhysicalMaterial, UnlitMaterial ...
47737
47794
 
47738
47795
  if (+materialNode .getTextureBits ())
47739
47796
  return true;
47740
47797
 
47741
- if (materialNode ._extensions .some (extension => +extension .getValue () .getTextureBits ()))
47798
+ if (materialNode ._extensions ?.some (extension => +extension .getValue () .getTextureBits ()))
47742
47799
  return true;
47743
47800
 
47744
47801
  return false;
@@ -48890,7 +48947,7 @@ const GLTF2Parser_default_ = GLTF2Parser;
48890
48947
  x_ite_Namespace .add ("GLTF2Parser", "x_ite/Parser/GLTF2Parser", GLTF2Parser_default_);
48891
48948
  /* harmony default export */ const Parser_GLTF2Parser = (GLTF2Parser_default_);
48892
48949
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLB2Parser.js
48893
- /* provided dependency */ var GLB2Parser_$ = __webpack_require__(126);
48950
+ /* provided dependency */ var GLB2Parser_$ = __webpack_require__(786);
48894
48951
  /*******************************************************************************
48895
48952
  *
48896
48953
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49042,7 +49099,7 @@ const GLB2Parser_default_ = GLB2Parser;
49042
49099
  x_ite_Namespace .add ("GLB2Parser", "x_ite/Parser/GLB2Parser", GLB2Parser_default_);
49043
49100
  /* harmony default export */ const Parser_GLB2Parser = (GLB2Parser_default_);
49044
49101
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/OBJParser.js
49045
- /* provided dependency */ var OBJParser_$ = __webpack_require__(126);
49102
+ /* provided dependency */ var OBJParser_$ = __webpack_require__(786);
49046
49103
  /*******************************************************************************
49047
49104
  *
49048
49105
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52400,8 +52457,8 @@ const MatrixStack_default_ = MatrixStack;
52400
52457
  x_ite_Namespace .add ("MatrixStack", "standard/Math/Utility/MatrixStack", MatrixStack_default_);
52401
52458
  /* harmony default export */ const Utility_MatrixStack = (MatrixStack_default_);
52402
52459
  ;// 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);
52460
+ /* provided dependency */ var SVGParser_$ = __webpack_require__(786);
52461
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(315);
52405
52462
  /*******************************************************************************
52406
52463
  *
52407
52464
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55172,7 +55229,7 @@ const SVGParser_default_ = SVGParser;
55172
55229
  x_ite_Namespace .add ("SVGParser", "x_ite/Parser/SVGParser", SVGParser_default_);
55173
55230
  /* harmony default export */ const Parser_SVGParser = (SVGParser_default_);
55174
55231
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GoldenGate.js
55175
- /* provided dependency */ var GoldenGate_$ = __webpack_require__(126);
55232
+ /* provided dependency */ var GoldenGate_$ = __webpack_require__(786);
55176
55233
  /*******************************************************************************
55177
55234
  *
55178
55235
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56954,6 +57011,7 @@ Object .assign (X3DRenderObject .prototype,
56954
57011
  const browser = this .getBrowser ();
56955
57012
 
56956
57013
  browser .getRenderingProperties () ._LogarithmicDepthBuffer .addInterest ("set_renderKey__", this);
57014
+ browser .getBrowserOptions () ._ColorSpace .addInterest ("set_renderKey__", this);
56957
57015
  browser .getBrowserOptions () ._OrderIndependentTransparency .addInterest ("set_renderKey__", this);
56958
57016
  browser .getBrowserOptions () ._ToneMapping .addInterest ("set_renderKey__", this);
56959
57017
 
@@ -56979,9 +57037,22 @@ Object .assign (X3DRenderObject .prototype,
56979
57037
 
56980
57038
  let renderKey = "";
56981
57039
 
56982
- renderKey += this .logarithmicDepthBuffer ? 1 : 0;
57040
+ renderKey += this .logarithmicDepthBuffer ? 1 : 0;
56983
57041
  renderKey += this .orderIndependentTransparency ? 1 : 0;
56984
57042
 
57043
+ switch (browser .getBrowserOption ("ColorSpace"))
57044
+ {
57045
+ case "SRGB":
57046
+ renderKey += 0;
57047
+ break;
57048
+ default: // LINEAR_WHEN_PHYSICAL_MATERIAL
57049
+ renderKey += 1;
57050
+ break;
57051
+ case "LINEAR":
57052
+ renderKey += 2;
57053
+ break;
57054
+ }
57055
+
56985
57056
  switch (browser .getBrowserOption ("ToneMapping"))
56986
57057
  {
56987
57058
  default: // NONE
@@ -61947,7 +62018,6 @@ function X3DBackgroundNode (executionContext)
61947
62018
  this .textureNodes = new Array (6);
61948
62019
  this .textureBits = new Utility_BitSet ();
61949
62020
  this .sphereContext = new Rendering_GeometryContext ({ colorMaterial: true });
61950
- this .sphereAlphaContext = new Rendering_GeometryContext ({ colorMaterial: true, alphaMode: Shape_AlphaMode .BLEND });
61951
62021
  this .texturesContext = new Rendering_GeometryContext ({ });
61952
62022
  }
61953
62023
 
@@ -62378,9 +62448,14 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62378
62448
  return;
62379
62449
 
62380
62450
  const
62381
- browser = this .getBrowser (),
62382
- gl = browser .getContext (),
62383
- shaderNode = browser .getDefaultMaterial () .getShader (transparency ? this .sphereAlphaContext : this .sphereContext);
62451
+ browser = this .getBrowser (),
62452
+ gl = browser .getContext (),
62453
+ sphereContext = this .sphereContext;
62454
+
62455
+ sphereContext .alphaMode = transparency ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62456
+ sphereContext .renderObject = renderObject;
62457
+
62458
+ const shaderNode = browser .getDefaultMaterial () .getShader (sphereContext);
62384
62459
 
62385
62460
  shaderNode .enable (gl);
62386
62461
  shaderNode .setClipPlanes (gl, this .clipPlanes);
@@ -62428,8 +62503,9 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62428
62503
  {
62429
62504
  const textureNode = this .textureNodes [i];
62430
62505
 
62431
- texturesContext .alphaMode = textureNode ._transparent .getValue () ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62432
- texturesContext .textureNode = textureNode;
62506
+ texturesContext .alphaMode = textureNode ._transparent .getValue () ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62507
+ texturesContext .textureNode = textureNode;
62508
+ texturesContext .renderObject = renderObject;
62433
62509
 
62434
62510
  const shaderNode = browser .getDefaultMaterial () .getShader (texturesContext);
62435
62511
 
@@ -63139,7 +63215,7 @@ const X3DTexture2DNode_default_ = X3DTexture2DNode;
63139
63215
  x_ite_Namespace .add ("X3DTexture2DNode", "x_ite/Components/Texturing/X3DTexture2DNode", X3DTexture2DNode_default_);
63140
63216
  /* harmony default export */ const Texturing_X3DTexture2DNode = (X3DTexture2DNode_default_);
63141
63217
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/ImageTexture.js
63142
- /* provided dependency */ var ImageTexture_$ = __webpack_require__(126);
63218
+ /* provided dependency */ var ImageTexture_$ = __webpack_require__(786);
63143
63219
  /*******************************************************************************
63144
63220
  *
63145
63221
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66723,7 +66799,7 @@ const X3DWorld_default_ = X3DWorld;
66723
66799
  x_ite_Namespace .add ("X3DWorld", "x_ite/Execution/X3DWorld", X3DWorld_default_);
66724
66800
  /* harmony default export */ const Execution_X3DWorld = (X3DWorld_default_);
66725
66801
  ;// CONCATENATED MODULE: ./src/x_ite/InputOutput/FileLoader.js
66726
- /* provided dependency */ var FileLoader_$ = __webpack_require__(126);
66802
+ /* provided dependency */ var FileLoader_$ = __webpack_require__(786);
66727
66803
  /*******************************************************************************
66728
66804
  *
66729
66805
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67657,7 +67733,7 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
67657
67733
  x_ite_Namespace .add ("ProtoDeclarationArray", "x_ite/Prototype/ProtoDeclarationArray", ProtoDeclarationArray_default_);
67658
67734
  /* harmony default export */ const Prototype_ProtoDeclarationArray = (ProtoDeclarationArray_default_);
67659
67735
  ;// CONCATENATED MODULE: ./src/x_ite/Routing/X3DRoute.js
67660
- /* provided dependency */ var X3DRoute_$ = __webpack_require__(126);
67736
+ /* provided dependency */ var X3DRoute_$ = __webpack_require__(786);
67661
67737
  /*******************************************************************************
67662
67738
  *
67663
67739
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91105,7 +91181,7 @@ const MaterialTextures_default_ = {
91105
91181
  "x3d_TransmissionTextureEXT",
91106
91182
  "x3d_ThicknessTextureEXT",
91107
91183
  ],
91108
- texture (name, components = "rgba", colorspace = "")
91184
+ texture (name, components = "rgba", colorSpace = "")
91109
91185
  {
91110
91186
  const ext = !!name .match (/EXT$/);
91111
91187
 
@@ -91143,15 +91219,29 @@ vec4 textureColor=texture(${name}${EXT} .textureCube,texCoord);
91143
91219
  #endif
91144
91220
  ${type}
91145
91221
  textureColorComponents=textureColor.${components};
91222
+ #if defined(X3D_COLORSPACE_SRGB)
91146
91223
  #if defined(${define}${_EXT}_LINEAR)
91147
- #if ${colorspace === "sRGB" ? 1 : 0}
91148
- textureColorComponents=linearTosRGB(textureColorComponents);
91224
+ #if ${colorSpace === "sRGB" || colorSpace === "linear" ? 1 : 0}
91225
+ textureColorComponents=linearToSRGB(textureColorComponents);
91226
+ #endif
91227
+ #endif
91228
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
91229
+ #if defined(${define}${_EXT}_LINEAR)
91230
+ #if ${colorSpace === "sRGB" ? 1 : 0}
91231
+ textureColorComponents=linearToSRGB(textureColorComponents);
91149
91232
  #endif
91150
91233
  #else
91151
- #if ${colorspace === "linear" ? 1 : 0}
91234
+ #if ${colorSpace === "linear" ? 1 : 0}
91235
+ textureColorComponents=sRGBToLinear(textureColorComponents);
91236
+ #endif
91237
+ #endif
91238
+ #elif defined(X3D_COLORSPACE_LINEAR)
91239
+ #if!defined(${define}${_EXT}_LINEAR)
91240
+ #if ${colorSpace === "sRGB" || colorSpace === "linear" ? 1 : 0}
91152
91241
  textureColorComponents=sRGBToLinear(textureColorComponents);
91153
91242
  #endif
91154
91243
  #endif
91244
+ #endif
91155
91245
  return textureColorComponents;}
91156
91246
  #endif
91157
91247
  `
@@ -91186,7 +91276,7 @@ mediump samplerCube textureCube;
91186
91276
  x_ite_Namespace .add ("MaterialTextures", "assets/shaders/MaterialTextures", MaterialTextures_default_);
91187
91277
  /* harmony default export */ const MaterialTextures = (MaterialTextures_default_);
91188
91278
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js
91189
- /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(126);
91279
+ /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(786);
91190
91280
  /*******************************************************************************
91191
91281
  *
91192
91282
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91441,7 +91531,7 @@ Object .assign (X3DProgrammableShaderObject .prototype,
91441
91531
  "x3d_TransmissionFramebufferSizeEXT",
91442
91532
  "x3d_ThicknessEXT",
91443
91533
  "x3d_AttenuationDistanceEXT",
91444
- "x3d_AttenuationColoEXT",
91534
+ "x3d_AttenuationColorEXT",
91445
91535
  ];
91446
91536
 
91447
91537
  for (const name of commonUniforms)
@@ -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,7 @@ 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__(786);
96709
96725
  /*******************************************************************************
96710
96726
  *
96711
96727
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97372,7 +97388,7 @@ const X3DAppearanceNode_default_ = X3DAppearanceNode;
97372
97388
  x_ite_Namespace .add ("X3DAppearanceNode", "x_ite/Components/Shape/X3DAppearanceNode", X3DAppearanceNode_default_);
97373
97389
  /* harmony default export */ const Shape_X3DAppearanceNode = (X3DAppearanceNode_default_);
97374
97390
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/Appearance.js
97375
- /* provided dependency */ var Appearance_$ = __webpack_require__(126);
97391
+ /* provided dependency */ var Appearance_$ = __webpack_require__(786);
97376
97392
  /*******************************************************************************
97377
97393
  *
97378
97394
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98345,10 +98361,11 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98345
98361
  {
98346
98362
  // Rubberband, X3DBackgroundNode
98347
98363
 
98348
- const { alphaMode, textureNode, objectsKeys } = geometryContext;
98364
+ const { renderObject, alphaMode, textureNode, objectsKeys } = geometryContext;
98349
98365
 
98350
98366
  key += alphaMode;
98351
- key += "0000011.0.";
98367
+ key += renderObject .getRenderKey ();
98368
+ key += "000011.0.";
98352
98369
  key += objectsKeys .sort () .join (""); // ClipPlane, X3DLightNode
98353
98370
  key += ".";
98354
98371
  key += textureNode ?.getTextureBits () .toString (16) ?? 0;
@@ -98377,6 +98394,31 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98377
98394
  if (geometryContext .hasTangents)
98378
98395
  options .push ("X3D_TANGENTS");
98379
98396
 
98397
+ switch (browser .getBrowserOption ("ColorSpace"))
98398
+ {
98399
+ case "SRGB":
98400
+ options .push ("X3D_COLORSPACE_SRGB");
98401
+ break;
98402
+ default: // LINEAR_WHEN_PHYSICAL_MATERIAL
98403
+ options .push ("X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL");
98404
+ break;
98405
+ case "LINEAR":
98406
+ options .push ("X3D_COLORSPACE_LINEAR");
98407
+ break;
98408
+ }
98409
+
98410
+ switch (browser .getBrowserOption ("ToneMapping"))
98411
+ {
98412
+ default: // NONE
98413
+ break;
98414
+ case "ACES_NARKOWICZ":
98415
+ case "ACES_HILL":
98416
+ case "ACES_HILL_EXPOSURE_BOOST":
98417
+ case "KHR_PBR_NEUTRAL":
98418
+ options .push (`X3D_TONEMAP_${browser .getBrowserOption ("ToneMapping")}`);
98419
+ break;
98420
+ }
98421
+
98380
98422
  if (renderContext)
98381
98423
  {
98382
98424
  const { renderObject, fogNode, shapeNode, appearanceNode, humanoidNode, objectsKeys, textureNode } = renderContext;
@@ -98513,7 +98555,10 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98513
98555
  }
98514
98556
  else
98515
98557
  {
98516
- const { alphaMode, objectsKeys, textureNode } = geometryContext;
98558
+ const { renderObject, alphaMode, objectsKeys, textureNode } = geometryContext;
98559
+
98560
+ if (renderObject .getLogarithmicDepthBuffer ())
98561
+ options .push ("X3D_LOGARITHMIC_DEPTH_BUFFER");
98517
98562
 
98518
98563
  switch (alphaMode)
98519
98564
  {
@@ -98531,7 +98576,7 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98531
98576
  {
98532
98577
  options .push ("X3D_ALPHA_MODE_BLEND");
98533
98578
 
98534
- if (browser .getBrowserOption ("OrderIndependentTransparency"))
98579
+ if (renderObject .getOrderIndependentTransparency ())
98535
98580
  options .push ("X3D_ORDER_INDEPENDENT_TRANSPARENCY");
98536
98581
 
98537
98582
  break;
@@ -99390,8 +99435,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99390
99435
  set_transparent__ ()
99391
99436
  {
99392
99437
  this .setTransparent (this .getTransparency () ||
99393
- this .baseTextureNode ?.isTransparent () ||
99394
- this .isTransmission ());
99438
+ this .baseTextureNode ?.isTransparent ());
99395
99439
  },
99396
99440
  set_extensions__ ()
99397
99441
  {
@@ -99417,7 +99461,6 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99417
99461
 
99418
99462
  this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes (Base_X3DConstants .TransmissionMaterialExtension)));
99419
99463
 
99420
- this .set_transparent__ ();
99421
99464
  this .set_extensionsKey__ ();
99422
99465
  },
99423
99466
  set_extensionsKey__ ()
@@ -99439,18 +99482,6 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99439
99482
 
99440
99483
  options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_METALLIC_ROUGHNESS");
99441
99484
 
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
99485
  if (+this .getTextureBits ())
99455
99486
  {
99456
99487
  this .baseTextureNode ?.getShaderOptions (options, "BASE");
@@ -99458,7 +99489,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99458
99489
  this .occlusionTextureNode ?.getShaderOptions (options, "OCCLUSION");
99459
99490
  }
99460
99491
 
99461
- const shaderNode = browser .createShader ("PBR", "Default", "PBR", options);
99492
+ const shaderNode = browser .createShader ("Physical", "Default", "Physical", options);
99462
99493
 
99463
99494
  browser .getShaders () .set (key, shaderNode);
99464
99495
 
@@ -100276,7 +100307,7 @@ x_ite_Namespace .add ("Shape", "x_ite/Components/Shape/Shape", Shape_default_);
100276
100307
 
100277
100308
  function TwoSidedMaterial (executionContext)
100278
100309
  {
100279
- console .warn ("TwoSidedMaterial is depreciated, please use Appearance backMaterial field.");
100310
+ console .warn ("TwoSidedMaterial is depreciated, please use Appearance backMaterial field instead.");
100280
100311
 
100281
100312
  Shape_X3DMaterialNode .call (this, executionContext);
100282
100313
 
@@ -106290,8 +106321,8 @@ const GifMedia_default_ = GifMedia;
106290
106321
  x_ite_Namespace .add ("GifMedia", "x_ite/Browser/Texturing/GifMedia", GifMedia_default_);
106291
106322
  /* harmony default export */ const Texturing_GifMedia = (GifMedia_default_);
106292
106323
  ;// 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);
106324
+ /* provided dependency */ var MovieTexture_$ = __webpack_require__(786);
106325
+ /* provided dependency */ var SuperGif = __webpack_require__(781);
106295
106326
  /*******************************************************************************
106296
106327
  *
106297
106328
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108946,6 +108977,27 @@ const Context =
108946
108977
  gl .drawArraysInstanced = ext .drawArraysInstancedANGLE .bind (ext);
108947
108978
  gl .drawElementsInstanced = ext .drawElementsInstancedANGLE .bind (ext);
108948
108979
  }
108980
+
108981
+ {
108982
+ const ext = gl .getExtension ("WEBGL_color_buffer_float");
108983
+
108984
+ gl .RGBA32F = ext .RGBA32F_EXT;
108985
+ }
108986
+
108987
+ {
108988
+ const ext = gl .getExtension ("WEBGL_draw_buffers");
108989
+
108990
+ gl .MAX_COLOR_ATTACHMENTS = ext .MAX_COLOR_ATTACHMENTS_WEBGL;
108991
+ gl .drawBuffers = ext .drawBuffersWEBGL .bind (ext);
108992
+
108993
+ for (let i = 0, length = gl .getParameter(gl .MAX_COLOR_ATTACHMENTS); i < length; ++ i)
108994
+ {
108995
+ const COLOR_ATTACHMENTi = ext .COLOR_ATTACHMENT0_WEBGL + i;
108996
+
108997
+ if (gl [`COLOR_ATTACHMENT${i}`] === undefined)
108998
+ gl [`COLOR_ATTACHMENT${i}`] = COLOR_ATTACHMENTi;
108999
+ }
109000
+ }
108949
109001
  }
108950
109002
  }
108951
109003
 
@@ -108980,106 +109032,20 @@ const Context =
108980
109032
  gl .HAS_FEATURE_DEPTH_TEXTURE = gl .getVersion () >= 2 || !! gl .getExtension ("WEBGL_depth_texture");
108981
109033
  gl .HAS_FEATURE_FRAG_DEPTH = gl .getVersion () >= 2 || !! gl .getExtension ("EXT_frag_depth");
108982
109034
 
108983
- if (gl .getVersion () === 1)
109035
+ if (mobile)
108984
109036
  {
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
109037
  {
108995
- const COLOR_ATTACHMENTi = draw_buffers .COLOR_ATTACHMENT0_WEBGL + i;
109038
+ const ext = gl .getExtension ("EXT_color_buffer_half_float");
108996
109039
 
108997
- if (gl [`COLOR_ATTACHMENT${i}`] === undefined)
108998
- gl [`COLOR_ATTACHMENT${i}`] = COLOR_ATTACHMENTi;
109040
+ // Use defineProperty to overwrite property.
109041
+ Object .defineProperty (gl, "RGBA32F",
109042
+ {
109043
+ value: gl .getVersion () === 1 ? ext .RGBA16F_EXT : gl .RGBA16F,
109044
+ enumerable: true,
109045
+ });
108999
109046
  }
109000
109047
  }
109001
109048
 
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
109049
  return gl;
109084
109050
  },
109085
109051
  }
@@ -109688,7 +109654,7 @@ const gettext_default_ = (string) => locale .get (string) || string;
109688
109654
  x_ite_Namespace .add ("gettext", "locale/gettext", gettext_default_);
109689
109655
  /* harmony default export */ const gettext = (gettext_default_);
109690
109656
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserTimings.js
109691
- /* provided dependency */ var BrowserTimings_$ = __webpack_require__(126);
109657
+ /* provided dependency */ var BrowserTimings_$ = __webpack_require__(786);
109692
109658
  /*******************************************************************************
109693
109659
  *
109694
109660
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110261,7 +110227,7 @@ const TextureQuality_default_ = TextureQuality;
110261
110227
  x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", TextureQuality_default_);
110262
110228
  /* harmony default export */ const Core_TextureQuality = (TextureQuality_default_);
110263
110229
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserOptions.js
110264
- /* provided dependency */ var BrowserOptions_$ = __webpack_require__(126);
110230
+ /* provided dependency */ var BrowserOptions_$ = __webpack_require__(786);
110265
110231
  /*******************************************************************************
110266
110232
  *
110267
110233
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110319,6 +110285,8 @@ x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", Tex
110319
110285
 
110320
110286
 
110321
110287
 
110288
+ // https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/networking.html#BrowserProperties
110289
+
110322
110290
  function BrowserOptions (executionContext)
110323
110291
  {
110324
110292
  Base_X3DBaseNode .call (this, executionContext);
@@ -110347,27 +110315,27 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110347
110315
  Timings: this ._Timings .getValue (),
110348
110316
  });
110349
110317
 
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);
110318
+ this ._Rubberband .addInterest ("set_Rubberband__", this);
110319
+ this ._Antialiased .addInterest ("set_Antialiased__", this);
110320
+ this ._PrimitiveQuality .addInterest ("set_PrimitiveQuality__", this);
110321
+ this ._TextureQuality .addInterest ("set_TextureQuality__", this);
110322
+ this ._Shading .addInterest ("set_Shading__", this);
110323
+ this ._StraightenHorizon .addInterest ("set_StraightenHorizon__", this);
110324
+ this ._AutoUpdate .addInterest ("set_AutoUpdate__", this);
110325
+ this ._ContentScale .addInterest ("set_ContentScale__", this);
110326
+ this ._Exposure .addInterest ("set_Exposure__", this);
110327
+ this ._LogarithmicDepthBuffer .addInterest ("set_LogarithmicDepthBuffer__", this);
110328
+ this ._Multisampling .addInterest ("set_Multisampling__", this);
110329
+ this ._OrderIndependentTransparency .addInterest ("set_OrderIndependentTransparency__", this);
110330
+ this ._Timings .addInterest ("set_Timings__", this);
110331
+
110332
+ this .set_Antialiased__ (this ._Antialiased);
110333
+ this .set_Shading__ (this ._Shading);
110334
+ this .set_ContentScale__ (this ._ContentScale);
110335
+ this .set_Exposure__ (this ._Exposure);
110336
+ this .set_LogarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
110337
+ this .set_Multisampling__ (this ._Multisampling);
110338
+ this .set_OrderIndependentTransparency__ (this ._OrderIndependentTransparency);
110371
110339
 
110372
110340
  this .reset ();
110373
110341
  },
@@ -110377,6 +110345,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110377
110345
  "Antialiased",
110378
110346
  "AutoUpdate",
110379
110347
  "Cache",
110348
+ "ColorSpace",
110380
110349
  "ContentScale",
110381
110350
  "ContextMenu",
110382
110351
  "Debug",
@@ -110455,15 +110424,15 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110455
110424
  {
110456
110425
  return this .textureQuality;
110457
110426
  },
110458
- set_rubberband__ (rubberband)
110427
+ set_Rubberband__ (rubberband)
110459
110428
  {
110460
110429
  this .localStorage .Rubberband = rubberband .getValue ();
110461
110430
  },
110462
- set_antialiased__ ()
110431
+ set_Antialiased__ ()
110463
110432
  {
110464
- this .set_multisampling__ (this ._Multisampling);
110433
+ this .set_Multisampling__ (this ._Multisampling);
110465
110434
  },
110466
- set_primitiveQuality__ (value)
110435
+ set_PrimitiveQuality__ (value)
110467
110436
  {
110468
110437
  const
110469
110438
  browser = this .getBrowser (),
@@ -110478,7 +110447,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110478
110447
  if (typeof browser .setPrimitiveQuality3D === "function")
110479
110448
  browser .setPrimitiveQuality3D (this .primitiveQuality);
110480
110449
  },
110481
- set_textureQuality__ (value)
110450
+ set_TextureQuality__ (value)
110482
110451
  {
110483
110452
  const
110484
110453
  browser = this .getBrowser (),
@@ -110490,7 +110459,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110490
110459
  if (typeof browser .setTextureQuality === "function")
110491
110460
  browser .setTextureQuality (this .textureQuality);
110492
110461
  },
110493
- set_shading__: (() =>
110462
+ set_Shading__: (() =>
110494
110463
  {
110495
110464
  const strings = {
110496
110465
  [Core_Shading .POINT]: "POINT",
@@ -110512,14 +110481,14 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110512
110481
  browser .setShading (this .shading);
110513
110482
  };
110514
110483
  })(),
110515
- set_straightenHorizon__ (straightenHorizon)
110484
+ set_StraightenHorizon__ (straightenHorizon)
110516
110485
  {
110517
110486
  this .localStorage .StraightenHorizon = straightenHorizon .getValue ();
110518
110487
 
110519
110488
  if (straightenHorizon .getValue ())
110520
110489
  this .getBrowser () .getActiveLayer () ?.straightenView ();
110521
110490
  },
110522
- set_autoUpdate__ (autoUpdate)
110491
+ set_AutoUpdate__ (autoUpdate)
110523
110492
  {
110524
110493
  const events = ["resize", "scroll", "load"]
110525
110494
  .map (event => `${event}.${this .getTypeName ()}${this .getId ()}`)
@@ -110553,7 +110522,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110553
110522
  BrowserOptions_$(window) .off (events);
110554
110523
  }
110555
110524
  },
110556
- set_contentScale__ (contentScale)
110525
+ set_ContentScale__ (contentScale)
110557
110526
  {
110558
110527
  const browser = this .getBrowser ();
110559
110528
 
@@ -110585,7 +110554,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110585
110554
 
110586
110555
  browser .reshape ();
110587
110556
  },
110588
- set_exposure__ ()
110557
+ set_Exposure__ ()
110589
110558
  {
110590
110559
  const
110591
110560
  browser = this .getBrowser (),
@@ -110598,7 +110567,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110598
110567
  gl .uniform1f (shaderNode .x3d_Exposure, exposure);
110599
110568
  }
110600
110569
  },
110601
- set_logarithmicDepthBuffer__ (logarithmicDepthBuffer)
110570
+ set_LogarithmicDepthBuffer__ (logarithmicDepthBuffer)
110602
110571
  {
110603
110572
  const
110604
110573
  browser = this .getBrowser (),
@@ -110606,7 +110575,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110606
110575
 
110607
110576
  browser .getRenderingProperties () ._LogarithmicDepthBuffer = logarithmicDepthBuffer .getValue () && gl .HAS_FEATURE_FRAG_DEPTH;
110608
110577
  },
110609
- set_multisampling__ (multisampling)
110578
+ set_Multisampling__ (multisampling)
110610
110579
  {
110611
110580
  const
110612
110581
  browser = this .getBrowser (),
@@ -110617,11 +110586,11 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110617
110586
 
110618
110587
  browser .reshape ();
110619
110588
  },
110620
- set_orderIndependentTransparency__ ()
110589
+ set_OrderIndependentTransparency__ ()
110621
110590
  {
110622
110591
  this .getBrowser () .reshape ();
110623
110592
  },
110624
- set_timings__ (timings)
110593
+ set_Timings__ (timings)
110625
110594
  {
110626
110595
  this .localStorage .Timings = timings .getValue ();
110627
110596
  },
@@ -110647,10 +110616,12 @@ Object .defineProperties (BrowserOptions,
110647
110616
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "QualityWhenMoving", new x_ite_Fields .SFString ("SAME")),
110648
110617
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Shading", new x_ite_Fields .SFString ("GOURAUD")),
110649
110618
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "MotionBlur", new x_ite_Fields .SFBool ()),
110619
+ // Additional options:
110650
110620
  // Always update geometries, even if browser is not live.
110651
110621
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "AlwaysUpdateGeometries", new x_ite_Fields .SFBool ()),
110652
110622
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "AutoUpdate", new x_ite_Fields .SFBool ()),
110653
110623
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Cache", new x_ite_Fields .SFBool (true)),
110624
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ColorSpace", new x_ite_Fields .SFString ("LINEAR_WHEN_PHYSICAL_MATERIAL")),
110654
110625
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ContentScale", new x_ite_Fields .SFDouble (1)),
110655
110626
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ContextMenu", new x_ite_Fields .SFBool (true)),
110656
110627
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Debug", new x_ite_Fields .SFBool ()),
@@ -110877,7 +110848,7 @@ const RenderingProperties_default_ = RenderingProperties;
110877
110848
  x_ite_Namespace .add ("RenderingProperties", "x_ite/Browser/Core/RenderingProperties", RenderingProperties_default_);
110878
110849
  /* harmony default export */ const Core_RenderingProperties = (RenderingProperties_default_);
110879
110850
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/Notification.js
110880
- /* provided dependency */ var Notification_$ = __webpack_require__(126);
110851
+ /* provided dependency */ var Notification_$ = __webpack_require__(786);
110881
110852
  /*******************************************************************************
110882
110853
  *
110883
110854
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111000,8 +110971,8 @@ const Notification_default_ = Notification;
111000
110971
  x_ite_Namespace .add ("Notification", "x_ite/Browser/Core/Notification", Notification_default_);
111001
110972
  /* harmony default export */ const Core_Notification = (Notification_default_);
111002
110973
  ;// 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);
110974
+ /* provided dependency */ var jquery_fullscreen = __webpack_require__(810);
110975
+ /* provided dependency */ var ContextMenu_$ = __webpack_require__(786);
111005
110976
  /*******************************************************************************
111006
110977
  *
111007
110978
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113754,7 +113725,7 @@ const DataStorage_default_ = DataStorage;
113754
113725
  x_ite_Namespace .add ("DataStorage", "standard/Utility/DataStorage", DataStorage_default_);
113755
113726
  /* harmony default export */ const Utility_DataStorage = (DataStorage_default_);
113756
113727
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/X3DCoreContext.js
113757
- /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(126);
113728
+ /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(786);
113758
113729
  /*******************************************************************************
113759
113730
  *
113760
113731
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114062,6 +114033,12 @@ Object .assign (X3DCoreContext .prototype,
114062
114033
  this .setBrowserOption ("Cache", this .parseBooleanAttribute (newValue, true));
114063
114034
  break;
114064
114035
  }
114036
+ case "colorSpace":
114037
+ case "colorspace":
114038
+ {
114039
+ this .setBrowserOption ("ColorSpace", newValue);
114040
+ break;
114041
+ }
114065
114042
  case "contentScale":
114066
114043
  case "contentscale":
114067
114044
  {
@@ -116328,8 +116305,8 @@ const X3DViewer_default_ = X3DViewer;
116328
116305
  x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DViewer_default_);
116329
116306
  /* harmony default export */ const Navigation_X3DViewer = (X3DViewer_default_);
116330
116307
  ;// 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);
116308
+ /* provided dependency */ var jquery_mousewheel = __webpack_require__(832);
116309
+ /* provided dependency */ var ExamineViewer_$ = __webpack_require__(786);
116333
116310
  /*******************************************************************************
116334
116311
  *
116335
116312
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116392,12 +116369,14 @@ x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DView
116392
116369
 
116393
116370
  typeof jquery_mousewheel; // import plugin
116394
116371
 
116395
- const macOS = /Mac OS X/i .test (navigator .userAgent);
116372
+ const
116373
+ macOS = /Mac OS X/i .test (navigator .userAgent),
116374
+ mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
116396
116375
 
116397
116376
  const
116398
- SPIN_RELEASE_TIME = 20,
116399
- SPIN_ANGLE = Math_Algorithm .radians (2),
116400
- SPIN_FACTOR = 0.4,
116377
+ SPIN_RELEASE_TIME = mobile ? 20 : 25,
116378
+ SPIN_ANGLE = Math_Algorithm .radians (mobile ? 3 : 2),
116379
+ SPIN_FACTOR = mobile ? 0.2 : 0.3,
116401
116380
  SCROLL_FACTOR = macOS ? 1 / 120 : 1 / 20,
116402
116381
  MOVE_TIME = 0.2,
116403
116382
  ROTATE_TIME = 0.2,
@@ -117243,8 +117222,8 @@ const ExamineViewer_default_ = ExamineViewer;
117243
117222
  x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer", ExamineViewer_default_);
117244
117223
  /* harmony default export */ const Navigation_ExamineViewer = (ExamineViewer_default_);
117245
117224
  ;// 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);
117225
+ /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(832);
117226
+ /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(786);
117248
117227
  /*******************************************************************************
117249
117228
  *
117250
117229
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117301,6 +117280,7 @@ x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer",
117301
117280
 
117302
117281
 
117303
117282
 
117283
+
117304
117284
  typeof X3DFlyViewer_jquery_mousewheel; // import plugin
117305
117285
 
117306
117286
  const X3DFlyViewer_macOS = /Mac OS X/i .test (navigator .userAgent)
@@ -117340,7 +117320,12 @@ function X3DFlyViewer (executionContext, navigationInfo)
117340
117320
  this .lineVertexBuffer = gl .createBuffer ();
117341
117321
  this .lineVertexArrayObject = new Rendering_VertexArray (gl);
117342
117322
  this .lineVertexArray = new Float32Array (8 * 4) .fill (1);
117343
- this .geometryContext = new Rendering_GeometryContext ({ geometryType: 2, colorMaterial: true });
117323
+
117324
+ this .geometryContext = new Rendering_GeometryContext ({
117325
+ renderObject: this .getActiveLayer (),
117326
+ geometryType: 2,
117327
+ colorMaterial: true,
117328
+ });
117344
117329
 
117345
117330
  gl .bindBuffer (gl .ELEMENT_ARRAY_BUFFER, this .lineIndexBuffer);
117346
117331
  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 +118238,8 @@ const FlyViewer_default_ = FlyViewer;
118253
118238
  x_ite_Namespace .add ("FlyViewer", "x_ite/Browser/Navigation/FlyViewer", FlyViewer_default_);
118254
118239
  /* harmony default export */ const Navigation_FlyViewer = (FlyViewer_default_);
118255
118240
  ;// 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);
118241
+ /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(832);
118242
+ /* provided dependency */ var PlaneViewer_$ = __webpack_require__(786);
118258
118243
  /*******************************************************************************
118259
118244
  *
118260
118245
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118585,8 +118570,8 @@ const NoneViewer_default_ = NoneViewer;
118585
118570
  x_ite_Namespace .add ("NoneViewer", "x_ite/Browser/Navigation/NoneViewer", NoneViewer_default_);
118586
118571
  /* harmony default export */ const Navigation_NoneViewer = (NoneViewer_default_);
118587
118572
  ;// 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);
118573
+ /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(832);
118574
+ /* provided dependency */ var LookAtViewer_$ = __webpack_require__(786);
118590
118575
  /*******************************************************************************
118591
118576
  *
118592
118577
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119726,8 +119711,8 @@ const X3DPickingContext_default_ = X3DPickingContext;
119726
119711
  x_ite_Namespace .add ("X3DPickingContext", "x_ite/Browser/Picking/X3DPickingContext", X3DPickingContext_default_);
119727
119712
  /* harmony default export */ const Picking_X3DPickingContext = (X3DPickingContext_default_);
119728
119713
  ;// 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);
119714
+ /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(832);
119715
+ /* provided dependency */ var PointingDevice_$ = __webpack_require__(786);
119731
119716
  /*******************************************************************************
119732
119717
  *
119733
119718
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121031,7 +121016,7 @@ const MultiSampleFrameBuffer_default_ = MultiSampleFrameBuffer;
121031
121016
  x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFrameBuffer", MultiSampleFrameBuffer_default_);
121032
121017
  /* harmony default export */ const Rendering_MultiSampleFrameBuffer = (MultiSampleFrameBuffer_default_);
121033
121018
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/X3DRenderingContext.js
121034
- /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(126);
121019
+ /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(786);
121035
121020
  /*******************************************************************************
121036
121021
  *
121037
121022
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121316,28 +121301,30 @@ Object .assign (X3DRenderingContext .prototype,
121316
121301
  width = Math .max (canvas .width () * contentScale, 1),
121317
121302
  height = Math .max (canvas .height () * contentScale, 1);
121318
121303
 
121304
+ this .addBrowserEvent ();
121305
+
121319
121306
  canvas .prop ("width", width);
121320
121307
  canvas .prop ("height", height);
121321
121308
 
121322
121309
  this [_viewport] [2] = width;
121323
121310
  this [_viewport] [3] = height;
121324
121311
 
121325
- if (width !== this [_frameBuffer] .getWidth () ||
121326
- height !== this [_frameBuffer] .getHeight () ||
121327
- samples !== this [_frameBuffer] .getSamples () ||
121328
- oit !== this [_frameBuffer] .getOIT ())
121312
+ if (width === this [_frameBuffer] .getWidth () &&
121313
+ height === this [_frameBuffer] .getHeight () &&
121314
+ samples === this [_frameBuffer] .getSamples () &&
121315
+ oit === this [_frameBuffer] .getOIT ())
121329
121316
  {
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
- }
121317
+ return;
121338
121318
  }
121339
121319
 
121340
- this .addBrowserEvent ();
121320
+ this [_frameBuffer] .dispose ();
121321
+ this [_frameBuffer] = new Rendering_MultiSampleFrameBuffer (this, width, height, samples, oit);
121322
+
121323
+ if (!this [_transmissionBuffer])
121324
+ return;
121325
+
121326
+ this [_transmissionBuffer] .dispose ();
121327
+ this [_transmissionBuffer] = new Rendering_TextureBuffer (this, width, height, false, true);
121341
121328
  },
121342
121329
  onfullscreen ()
121343
121330
  {
@@ -121596,7 +121583,7 @@ Object .assign (X3DShadersContext .prototype,
121596
121583
  vertexShader .setup ();
121597
121584
 
121598
121585
  const fragmentShader = new Shaders_ShaderPart (this .getPrivateScene ());
121599
- fragmentShader ._type = "FRAGMENT";
121586
+ fragmentShader ._type = "FRAGMENT";
121600
121587
  fragmentShader ._url .push (encodeURI (fs .startsWith ("data:") ? fs : "data:x-shader/x-fragment," + Shaders_ShaderRegistry .fragment [version] [fs]));
121601
121588
  fragmentShader .setPrivate (true);
121602
121589
  fragmentShader .setName (`${name}FragmentShader`);
@@ -122006,7 +121993,7 @@ const X3DSoundContext_default_ = X3DSoundContext;
122006
121993
  x_ite_Namespace .add ("X3DSoundContext", "x_ite/Browser/Sound/X3DSoundContext", X3DSoundContext_default_);
122007
121994
  /* harmony default export */ const Sound_X3DSoundContext = (X3DSoundContext_default_);
122008
121995
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/KTXDecoder.js
122009
- /* provided dependency */ var KTXDecoder_$ = __webpack_require__(126);
121996
+ /* provided dependency */ var KTXDecoder_$ = __webpack_require__(786);
122010
121997
  const KTXDecoder_default_ = class KTXDecoder
122011
121998
  {
122012
121999
  constructor (gl, externalKtxlib, scriptDir)
@@ -123597,7 +123584,7 @@ const Components_default_ = Components;
123597
123584
  x_ite_Namespace .add ("Components", "x_ite/Components", Components_default_);
123598
123585
  /* harmony default export */ const x_ite_Components = ((/* unused pure expression or super */ null && (Components_default_)));
123599
123586
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/DOMIntegration.js
123600
- /* provided dependency */ var DOMIntegration_$ = __webpack_require__(126);
123587
+ /* provided dependency */ var DOMIntegration_$ = __webpack_require__(786);
123601
123588
  /*******************************************************************************
123602
123589
  * MIT License
123603
123590
  *
@@ -124865,7 +124852,7 @@ const FieldTypes_default_ = new Configuration_FieldTypesArray (Object .values (x
124865
124852
  x_ite_Namespace .add ("FieldTypes", "x_ite/Configuration/FieldTypes", FieldTypes_default_);
124866
124853
  /* harmony default export */ const FieldTypes = (FieldTypes_default_);
124867
124854
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/X3DBrowser.js
124868
- /* provided dependency */ var X3DBrowser_$ = __webpack_require__(126);
124855
+ /* provided dependency */ var X3DBrowser_$ = __webpack_require__(786);
124869
124856
  /*******************************************************************************
124870
124857
  *
124871
124858
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125967,7 +125954,7 @@ const X3DBrowser_default_ = X3DBrowser;
125967
125954
  x_ite_Namespace .add ("X3DBrowser", "x_ite/Browser/X3DBrowser", X3DBrowser_default_);
125968
125955
  /* harmony default export */ const Browser_X3DBrowser = (X3DBrowser_default_);
125969
125956
  ;// CONCATENATED MODULE: ./src/x_ite/X3DCanvasElement.js
125970
- /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(126);
125957
+ /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(786);
125971
125958
  /*******************************************************************************
125972
125959
  *
125973
125960
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126049,6 +126036,8 @@ class X3DCanvasElement extends HTMLElement
126049
126036
  "baseURL",
126050
126037
  "baseurl",
126051
126038
  "cache",
126039
+ "colorSpace",
126040
+ "colorspace",
126052
126041
  "contentScale",
126053
126042
  "contentscale",
126054
126043
  "contextMenu",
@@ -126109,8 +126098,8 @@ const X3DCanvasElement_default_ = X3DCanvasElement;
126109
126098
  x_ite_Namespace .add ("X3DCanvasElement", "x_ite/X3DCanvasElement", X3DCanvasElement_default_);
126110
126099
  /* harmony default export */ const x_ite_X3DCanvasElement = (X3DCanvasElement_default_);
126111
126100
  ;// CONCATENATED MODULE: ./src/lib/jquery.js
126112
- /* provided dependency */ var jquery_$ = __webpack_require__(126);
126113
- /* provided dependency */ var pako = __webpack_require__(406);
126101
+ /* provided dependency */ var jquery_$ = __webpack_require__(786);
126102
+ /* provided dependency */ var pako = __webpack_require__(826);
126114
126103
  Object .assign (jquery_$,
126115
126104
  {
126116
126105
  decodeText (input)
@@ -126187,14 +126176,14 @@ const jquery_default_ = jquery_$;
126187
126176
  x_ite_Namespace .add ("jquery", "lib/jquery", jquery_default_);
126188
126177
  /* harmony default export */ const jquery = ((/* unused pure expression or super */ null && (jquery_default_)));
126189
126178
  ;// CONCATENATED MODULE: ./src/lib/libtess.js
126190
- /* provided dependency */ var libtess_libtess = __webpack_require__(727);
126179
+ /* provided dependency */ var libtess_libtess = __webpack_require__(315);
126191
126180
  const libtess_default_ = libtess_libtess;
126192
126181
  ;
126193
126182
 
126194
126183
  x_ite_Namespace .add ("libtess", "lib/libtess", libtess_default_);
126195
126184
  /* harmony default export */ const lib_libtess = ((/* unused pure expression or super */ null && (libtess_default_)));
126196
126185
  ;// CONCATENATED MODULE: ./src/x_ite/X3D.js
126197
- /* provided dependency */ var X3D_$ = __webpack_require__(126);
126186
+ /* provided dependency */ var X3D_$ = __webpack_require__(786);
126198
126187
  /*******************************************************************************
126199
126188
  *
126200
126189
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126502,7 +126491,7 @@ Object .assign (X3D,
126502
126491
 
126503
126492
  // Assign X3D to global namespace.
126504
126493
 
126505
- window [Symbol .for ("X_ITE.X3D-10.0.1")] = x_ite_X3D;
126494
+ window [Symbol .for ("X_ITE.X3D-10.0.2")] = x_ite_X3D;
126506
126495
 
126507
126496
  customElements .define ("x3d-canvas", x_ite_X3DCanvasElement);
126508
126497