x_ite 10.0.0 → 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.js CHANGED
@@ -1,4 +1,4 @@
1
- /* X_ITE v10.0.0 */(function webpackUniversalModuleDefinition(root, factory) {
1
+ /* X_ITE v10.0.2 */(function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
3
  module.exports = factory();
4
4
  else if(typeof define === 'function' && define.amd)
@@ -11,10 +11,10 @@
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
14
- /***/ 653:
14
+ /***/ 810:
15
15
  /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
16
16
 
17
- /* provided dependency */ var jQuery = __webpack_require__(749);
17
+ /* provided dependency */ var jQuery = __webpack_require__(786);
18
18
  /**
19
19
  * @preserve jquery.fullscreen 1.1.5
20
20
  * https://github.com/code-lts/jquery-fullscreen-plugin
@@ -210,7 +210,7 @@ installFullScreenHandlers();
210
210
 
211
211
  /***/ }),
212
212
 
213
- /***/ 189:
213
+ /***/ 832:
214
214
  /***/ ((module, exports, __webpack_require__) => {
215
215
 
216
216
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -224,7 +224,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
224
224
  (function (factory) {
225
225
  if ( true ) {
226
226
  // AMD. Register as an anonymous module.
227
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(749)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
227
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(786)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
228
228
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
229
229
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
230
230
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -435,7 +435,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
435
435
 
436
436
  /***/ }),
437
437
 
438
- /***/ 749:
438
+ /***/ 786:
439
439
  /***/ (function(module, exports) {
440
440
 
441
441
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -11159,7 +11159,7 @@ return jQuery;
11159
11159
 
11160
11160
  /***/ }),
11161
11161
 
11162
- /***/ 382:
11162
+ /***/ 315:
11163
11163
  /***/ ((module) => {
11164
11164
 
11165
11165
  /**
@@ -15938,7 +15938,7 @@ if (true) {
15938
15938
 
15939
15939
  /***/ }),
15940
15940
 
15941
- /***/ 481:
15941
+ /***/ 826:
15942
15942
  /***/ (function(__unused_webpack_module, exports) {
15943
15943
 
15944
15944
 
@@ -19183,7 +19183,7 @@ if (true) {
19183
19183
 
19184
19184
  /***/ }),
19185
19185
 
19186
- /***/ 862:
19186
+ /***/ 781:
19187
19187
  /***/ (function(module, exports) {
19188
19188
 
19189
19189
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -20311,7 +20311,7 @@ Object .defineProperty (Namespace, "add",
20311
20311
  }
20312
20312
  else
20313
20313
  {
20314
- const X3D = window [Symbol .for ("X_ITE.X3D-10.0.0")];
20314
+ const X3D = window [Symbol .for ("X_ITE.X3D-10.0.2")];
20315
20315
 
20316
20316
  if (X3D)
20317
20317
  X3D [name] = module;
@@ -23595,6 +23595,22 @@ Object .assign (Color3 .prototype,
23595
23595
 
23596
23596
  return this;
23597
23597
  },
23598
+ linearToSRGB (color = new Color3 ())
23599
+ {
23600
+ color [_r] = Math .pow (this [_r], 1 / 2.2);
23601
+ color [_g] = Math .pow (this [_g], 1 / 2.2);
23602
+ color [_b] = Math .pow (this [_b], 1 / 2.2);
23603
+
23604
+ return color;
23605
+ },
23606
+ sRGBToLinear (color = new Color3 ())
23607
+ {
23608
+ color [_r] = Math .pow (this [_r], 2.2);
23609
+ color [_g] = Math .pow (this [_g], 2.2);
23610
+ color [_b] = Math .pow (this [_b], 2.2);
23611
+
23612
+ return color;
23613
+ },
23598
23614
  toString ()
23599
23615
  {
23600
23616
  return this [_r] + " " +
@@ -23794,6 +23810,14 @@ Object .assign (Object .setPrototypeOf (SFColor .prototype, Base_X3DField .proto
23794
23810
  this .getValue () .setHSV (h, s, v);
23795
23811
  this .addEvent ();
23796
23812
  },
23813
+ linearToSRGB ()
23814
+ {
23815
+ return new SFColor (this .getValue () .linearToSRGB ());
23816
+ },
23817
+ sRGBToLinear ()
23818
+ {
23819
+ return new SFColor (this .getValue () .sRGBToLinear ());
23820
+ },
23797
23821
  lerp: (() =>
23798
23822
  {
23799
23823
  const
@@ -24048,6 +24072,22 @@ Object .assign (Color4 .prototype,
24048
24072
 
24049
24073
  return this;
24050
24074
  },
24075
+ linearToSRGB (color = new Color4 ())
24076
+ {
24077
+ Numbers_Color3 .prototype .linearToSRGB .call (this, color);
24078
+
24079
+ color [_a] = this [_a];
24080
+
24081
+ return color;
24082
+ },
24083
+ sRGBToLinear (color = new Color4 ())
24084
+ {
24085
+ Numbers_Color3 .prototype .sRGBToLinear .call (this, color);
24086
+
24087
+ color [_a] = this [_a];
24088
+
24089
+ return color;
24090
+ },
24051
24091
  toString ()
24052
24092
  {
24053
24093
  return this [Color4_r] + " " +
@@ -24218,6 +24258,14 @@ Object .assign (Object .setPrototypeOf (SFColorRGBA .prototype, Base_X3DField .p
24218
24258
  this .getValue () .setHSVA (h, s, v, a);
24219
24259
  this .addEvent ();
24220
24260
  },
24261
+ linearToSRGB ()
24262
+ {
24263
+ return new SFColorRGBA (this .getValue () .linearToSRGB ());
24264
+ },
24265
+ sRGBToLinear ()
24266
+ {
24267
+ return new SFColorRGBA (this .getValue () .sRGBToLinear ());
24268
+ },
24221
24269
  lerp: (() =>
24222
24270
  {
24223
24271
  const
@@ -34243,7 +34291,7 @@ const X3DBaseNode_default_ = X3DBaseNode;
34243
34291
  x_ite_Namespace .add ("X3DBaseNode", "x_ite/Base/X3DBaseNode", X3DBaseNode_default_);
34244
34292
  /* harmony default export */ const Base_X3DBaseNode = (X3DBaseNode_default_);
34245
34293
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Legacy.js
34246
- /* provided dependency */ var $ = __webpack_require__(749);
34294
+ /* provided dependency */ var $ = __webpack_require__(786);
34247
34295
  /*******************************************************************************
34248
34296
  *
34249
34297
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34380,7 +34428,7 @@ x_ite_Namespace .add ("Legacy", "x_ite/Browser/Legacy", Legacy_default_);
34380
34428
  *
34381
34429
  ******************************************************************************/
34382
34430
 
34383
- const BROWSER_VERSION_default_ = "10.0.0";
34431
+ const BROWSER_VERSION_default_ = "10.0.2";
34384
34432
  ;
34385
34433
 
34386
34434
  x_ite_Namespace .add ("BROWSER_VERSION", "x_ite/BROWSER_VERSION", BROWSER_VERSION_default_);
@@ -37566,7 +37614,7 @@ const X3DBindableNode_default_ = X3DBindableNode;
37566
37614
  x_ite_Namespace .add ("X3DBindableNode", "x_ite/Components/Core/X3DBindableNode", X3DBindableNode_default_);
37567
37615
  /* harmony default export */ const Core_X3DBindableNode = (X3DBindableNode_default_);
37568
37616
  ;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle3.js
37569
- /* provided dependency */ var libtess = __webpack_require__(382);
37617
+ /* provided dependency */ var libtess = __webpack_require__(315);
37570
37618
  /*******************************************************************************
37571
37619
  *
37572
37620
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40136,7 +40184,7 @@ const X3DProtoDeclaration_default_ = X3DProtoDeclaration;
40136
40184
  x_ite_Namespace .add ("X3DProtoDeclaration", "x_ite/Prototype/X3DProtoDeclaration", X3DProtoDeclaration_default_);
40137
40185
  /* harmony default export */ const Prototype_X3DProtoDeclaration = (X3DProtoDeclaration_default_);
40138
40186
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/X3DParser.js
40139
- /* provided dependency */ var X3DParser_$ = __webpack_require__(749);
40187
+ /* provided dependency */ var X3DParser_$ = __webpack_require__(786);
40140
40188
  /*******************************************************************************
40141
40189
  *
40142
40190
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40394,7 +40442,7 @@ const Expressions_default_ = Expressions;
40394
40442
  x_ite_Namespace .add ("Expressions", "x_ite/Parser/Expressions", Expressions_default_);
40395
40443
  /* harmony default export */ const Parser_Expressions = (Expressions_default_);
40396
40444
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/VRMLParser.js
40397
- /* provided dependency */ var VRMLParser_$ = __webpack_require__(749);
40445
+ /* provided dependency */ var VRMLParser_$ = __webpack_require__(786);
40398
40446
  /*******************************************************************************
40399
40447
  *
40400
40448
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43094,7 +43142,7 @@ const VRMLParser_default_ = VRMLParser;
43094
43142
  x_ite_Namespace .add ("VRMLParser", "x_ite/Parser/VRMLParser", VRMLParser_default_);
43095
43143
  /* harmony default export */ const Parser_VRMLParser = (VRMLParser_default_);
43096
43144
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/XMLParser.js
43097
- /* provided dependency */ var XMLParser_$ = __webpack_require__(749);
43145
+ /* provided dependency */ var XMLParser_$ = __webpack_require__(786);
43098
43146
  /*******************************************************************************
43099
43147
  *
43100
43148
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45270,7 +45318,7 @@ const URLs_default_ = URLs;
45270
45318
  x_ite_Namespace .add ("URLs", "x_ite/Browser/Networking/URLs", URLs_default_);
45271
45319
  /* harmony default export */ const Networking_URLs = (URLs_default_);
45272
45320
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLTF2Parser.js
45273
- /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(749);
45321
+ /* provided dependency */ var GLTF2Parser_$ = __webpack_require__(786);
45274
45322
  /*******************************************************************************
45275
45323
  *
45276
45324
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45575,7 +45623,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
45575
45623
  case "KHR_materials_sheen":
45576
45624
  case "KHR_materials_specular":
45577
45625
  case "KHR_materials_transmission":
45578
- case "KHR_materials_unlit":
45579
45626
  case "KHR_materials_volume":
45580
45627
  {
45581
45628
  const component = browser .getComponent ("X_ITE", 1);
@@ -46270,7 +46317,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46270
46317
 
46271
46318
  appearanceNode ._alphaMode = this .stringValue (material .alphaMode, "OPAQUE");
46272
46319
  appearanceNode ._alphaCutoff = this .numberValue (material .alphaCutoff, 0.5);
46273
- appearanceNode ._material = materialNode;
46320
+ appearanceNode ._material = this .khrMaterialsUnlitObject (material .extensions ?.KHR_materials_unlit, materialNode);
46274
46321
  appearanceNode ._textureTransform = this .createMultiTextureTransform (materialNode);
46275
46322
 
46276
46323
  appearanceNode .setup ();
@@ -46443,9 +46490,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46443
46490
  case "KHR_materials_transmission":
46444
46491
  this .khrMaterialsTransmission (value, materialNode);
46445
46492
  break;
46446
- case "KHR_materials_unlit":
46447
- this .khrMaterialsUnlitObject (value, materialNode);
46448
- break;
46449
46493
  case "KHR_materials_volume":
46450
46494
  this .khrMaterialsVolumeObject (value, materialNode);
46451
46495
  break;
@@ -46604,14 +46648,6 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46604
46648
 
46605
46649
  materialNode ._extensions .push (extension);
46606
46650
  },
46607
- khrMaterialsUnlitObject (KHR_materials_unlit, materialNode)
46608
- {
46609
- const extension = this .getScene () .createNode ("UnlitMaterialExtension", false);
46610
-
46611
- extension .setup ();
46612
-
46613
- materialNode ._extensions .push (extension);
46614
- },
46615
46651
  khrMaterialsVolumeObject (KHR_materials_volume, materialNode)
46616
46652
  {
46617
46653
  const extension = this .getScene () .createNode ("VolumeMaterialExtension", false);
@@ -46630,6 +46666,27 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
46630
46666
 
46631
46667
  materialNode ._extensions .push (extension);
46632
46668
  },
46669
+ khrMaterialsUnlitObject (KHR_materials_unlit, materialNode)
46670
+ {
46671
+ if (!KHR_materials_unlit)
46672
+ return materialNode;
46673
+
46674
+ const unlitMaterialNode = this .getScene () .createNode ("UnlitMaterial", false);
46675
+
46676
+ unlitMaterialNode ._emissiveColor = materialNode ._baseColor;
46677
+ unlitMaterialNode ._emissiveTextureMapping = materialNode ._baseTextureMapping;
46678
+ unlitMaterialNode ._emissiveTexture = materialNode ._baseTexture;
46679
+ unlitMaterialNode ._normalScale = materialNode ._normalScale;
46680
+ unlitMaterialNode ._normalTextureMapping = materialNode ._normalTextureMapping;
46681
+ unlitMaterialNode ._normalTexture = materialNode ._normalTexture;
46682
+ unlitMaterialNode ._transparency = materialNode ._transparency;
46683
+
46684
+ unlitMaterialNode .setup ();
46685
+
46686
+ materialNode .dispose ();
46687
+
46688
+ return unlitMaterialNode;
46689
+ },
46633
46690
  textureTransformObject (KHR_texture_transform, texCoord)
46634
46691
  {
46635
46692
  if (!(KHR_texture_transform instanceof Object))
@@ -47747,12 +47804,12 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
47747
47804
  },
47748
47805
  hasTextures (materialNode)
47749
47806
  {
47750
- // Test PhysicalMaterial, ...
47807
+ // Test PhysicalMaterial, UnlitMaterial ...
47751
47808
 
47752
47809
  if (+materialNode .getTextureBits ())
47753
47810
  return true;
47754
47811
 
47755
- if (materialNode ._extensions .some (extension => +extension .getValue () .getTextureBits ()))
47812
+ if (materialNode ._extensions ?.some (extension => +extension .getValue () .getTextureBits ()))
47756
47813
  return true;
47757
47814
 
47758
47815
  return false;
@@ -48904,7 +48961,7 @@ const GLTF2Parser_default_ = GLTF2Parser;
48904
48961
  x_ite_Namespace .add ("GLTF2Parser", "x_ite/Parser/GLTF2Parser", GLTF2Parser_default_);
48905
48962
  /* harmony default export */ const Parser_GLTF2Parser = (GLTF2Parser_default_);
48906
48963
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GLB2Parser.js
48907
- /* provided dependency */ var GLB2Parser_$ = __webpack_require__(749);
48964
+ /* provided dependency */ var GLB2Parser_$ = __webpack_require__(786);
48908
48965
  /*******************************************************************************
48909
48966
  *
48910
48967
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49056,7 +49113,7 @@ const GLB2Parser_default_ = GLB2Parser;
49056
49113
  x_ite_Namespace .add ("GLB2Parser", "x_ite/Parser/GLB2Parser", GLB2Parser_default_);
49057
49114
  /* harmony default export */ const Parser_GLB2Parser = (GLB2Parser_default_);
49058
49115
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/OBJParser.js
49059
- /* provided dependency */ var OBJParser_$ = __webpack_require__(749);
49116
+ /* provided dependency */ var OBJParser_$ = __webpack_require__(786);
49060
49117
  /*******************************************************************************
49061
49118
  *
49062
49119
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52414,8 +52471,8 @@ const MatrixStack_default_ = MatrixStack;
52414
52471
  x_ite_Namespace .add ("MatrixStack", "standard/Math/Utility/MatrixStack", MatrixStack_default_);
52415
52472
  /* harmony default export */ const Utility_MatrixStack = (MatrixStack_default_);
52416
52473
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/SVGParser.js
52417
- /* provided dependency */ var SVGParser_$ = __webpack_require__(749);
52418
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(382);
52474
+ /* provided dependency */ var SVGParser_$ = __webpack_require__(786);
52475
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(315);
52419
52476
  /*******************************************************************************
52420
52477
  *
52421
52478
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55186,7 +55243,7 @@ const SVGParser_default_ = SVGParser;
55186
55243
  x_ite_Namespace .add ("SVGParser", "x_ite/Parser/SVGParser", SVGParser_default_);
55187
55244
  /* harmony default export */ const Parser_SVGParser = (SVGParser_default_);
55188
55245
  ;// CONCATENATED MODULE: ./src/x_ite/Parser/GoldenGate.js
55189
- /* provided dependency */ var GoldenGate_$ = __webpack_require__(749);
55246
+ /* provided dependency */ var GoldenGate_$ = __webpack_require__(786);
55190
55247
  /*******************************************************************************
55191
55248
  *
55192
55249
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56968,6 +57025,7 @@ Object .assign (X3DRenderObject .prototype,
56968
57025
  const browser = this .getBrowser ();
56969
57026
 
56970
57027
  browser .getRenderingProperties () ._LogarithmicDepthBuffer .addInterest ("set_renderKey__", this);
57028
+ browser .getBrowserOptions () ._ColorSpace .addInterest ("set_renderKey__", this);
56971
57029
  browser .getBrowserOptions () ._OrderIndependentTransparency .addInterest ("set_renderKey__", this);
56972
57030
  browser .getBrowserOptions () ._ToneMapping .addInterest ("set_renderKey__", this);
56973
57031
 
@@ -56993,9 +57051,22 @@ Object .assign (X3DRenderObject .prototype,
56993
57051
 
56994
57052
  let renderKey = "";
56995
57053
 
56996
- renderKey += this .logarithmicDepthBuffer ? 1 : 0;
57054
+ renderKey += this .logarithmicDepthBuffer ? 1 : 0;
56997
57055
  renderKey += this .orderIndependentTransparency ? 1 : 0;
56998
57056
 
57057
+ switch (browser .getBrowserOption ("ColorSpace"))
57058
+ {
57059
+ case "SRGB":
57060
+ renderKey += 0;
57061
+ break;
57062
+ default: // LINEAR_WHEN_PHYSICAL_MATERIAL
57063
+ renderKey += 1;
57064
+ break;
57065
+ case "LINEAR":
57066
+ renderKey += 2;
57067
+ break;
57068
+ }
57069
+
56999
57070
  switch (browser .getBrowserOption ("ToneMapping"))
57000
57071
  {
57001
57072
  default: // NONE
@@ -61961,7 +62032,6 @@ function X3DBackgroundNode (executionContext)
61961
62032
  this .textureNodes = new Array (6);
61962
62033
  this .textureBits = new Utility_BitSet ();
61963
62034
  this .sphereContext = new Rendering_GeometryContext ({ colorMaterial: true });
61964
- this .sphereAlphaContext = new Rendering_GeometryContext ({ colorMaterial: true, alphaMode: Shape_AlphaMode .BLEND });
61965
62035
  this .texturesContext = new Rendering_GeometryContext ({ });
61966
62036
  }
61967
62037
 
@@ -62392,9 +62462,14 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62392
62462
  return;
62393
62463
 
62394
62464
  const
62395
- browser = this .getBrowser (),
62396
- gl = browser .getContext (),
62397
- shaderNode = browser .getDefaultMaterial () .getShader (transparency ? this .sphereAlphaContext : this .sphereContext);
62465
+ browser = this .getBrowser (),
62466
+ gl = browser .getContext (),
62467
+ sphereContext = this .sphereContext;
62468
+
62469
+ sphereContext .alphaMode = transparency ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62470
+ sphereContext .renderObject = renderObject;
62471
+
62472
+ const shaderNode = browser .getDefaultMaterial () .getShader (sphereContext);
62398
62473
 
62399
62474
  shaderNode .enable (gl);
62400
62475
  shaderNode .setClipPlanes (gl, this .clipPlanes);
@@ -62442,8 +62517,9 @@ Object .assign (Object .setPrototypeOf (X3DBackgroundNode .prototype, Core_X3DBi
62442
62517
  {
62443
62518
  const textureNode = this .textureNodes [i];
62444
62519
 
62445
- texturesContext .alphaMode = textureNode ._transparent .getValue () ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62446
- texturesContext .textureNode = textureNode;
62520
+ texturesContext .alphaMode = textureNode ._transparent .getValue () ? Shape_AlphaMode .BLEND : Shape_AlphaMode .OPAQUE;
62521
+ texturesContext .textureNode = textureNode;
62522
+ texturesContext .renderObject = renderObject;
62447
62523
 
62448
62524
  const shaderNode = browser .getDefaultMaterial () .getShader (texturesContext);
62449
62525
 
@@ -63153,7 +63229,7 @@ const X3DTexture2DNode_default_ = X3DTexture2DNode;
63153
63229
  x_ite_Namespace .add ("X3DTexture2DNode", "x_ite/Components/Texturing/X3DTexture2DNode", X3DTexture2DNode_default_);
63154
63230
  /* harmony default export */ const Texturing_X3DTexture2DNode = (X3DTexture2DNode_default_);
63155
63231
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/ImageTexture.js
63156
- /* provided dependency */ var ImageTexture_$ = __webpack_require__(749);
63232
+ /* provided dependency */ var ImageTexture_$ = __webpack_require__(786);
63157
63233
  /*******************************************************************************
63158
63234
  *
63159
63235
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66737,7 +66813,7 @@ const X3DWorld_default_ = X3DWorld;
66737
66813
  x_ite_Namespace .add ("X3DWorld", "x_ite/Execution/X3DWorld", X3DWorld_default_);
66738
66814
  /* harmony default export */ const Execution_X3DWorld = (X3DWorld_default_);
66739
66815
  ;// CONCATENATED MODULE: ./src/x_ite/InputOutput/FileLoader.js
66740
- /* provided dependency */ var FileLoader_$ = __webpack_require__(749);
66816
+ /* provided dependency */ var FileLoader_$ = __webpack_require__(786);
66741
66817
  /*******************************************************************************
66742
66818
  *
66743
66819
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67671,7 +67747,7 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
67671
67747
  x_ite_Namespace .add ("ProtoDeclarationArray", "x_ite/Prototype/ProtoDeclarationArray", ProtoDeclarationArray_default_);
67672
67748
  /* harmony default export */ const Prototype_ProtoDeclarationArray = (ProtoDeclarationArray_default_);
67673
67749
  ;// CONCATENATED MODULE: ./src/x_ite/Routing/X3DRoute.js
67674
- /* provided dependency */ var X3DRoute_$ = __webpack_require__(749);
67750
+ /* provided dependency */ var X3DRoute_$ = __webpack_require__(786);
67675
67751
  /*******************************************************************************
67676
67752
  *
67677
67753
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91119,7 +91195,7 @@ const MaterialTextures_default_ = {
91119
91195
  "x3d_TransmissionTextureEXT",
91120
91196
  "x3d_ThicknessTextureEXT",
91121
91197
  ],
91122
- texture (name, components = "rgba", colorspace = "")
91198
+ texture (name, components = "rgba", colorSpace = "")
91123
91199
  {
91124
91200
  const ext = !!name .match (/EXT$/);
91125
91201
 
@@ -91157,15 +91233,29 @@ vec4 textureColor=texture(${name}${EXT} .textureCube,texCoord);
91157
91233
  #endif
91158
91234
  ${type}
91159
91235
  textureColorComponents=textureColor.${components};
91236
+ #if defined(X3D_COLORSPACE_SRGB)
91160
91237
  #if defined(${define}${_EXT}_LINEAR)
91161
- #if ${colorspace === "sRGB" ? 1 : 0}
91162
- textureColorComponents=linearTosRGB(textureColorComponents);
91238
+ #if ${colorSpace === "sRGB" || colorSpace === "linear" ? 1 : 0}
91239
+ textureColorComponents=linearToSRGB(textureColorComponents);
91240
+ #endif
91241
+ #endif
91242
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
91243
+ #if defined(${define}${_EXT}_LINEAR)
91244
+ #if ${colorSpace === "sRGB" ? 1 : 0}
91245
+ textureColorComponents=linearToSRGB(textureColorComponents);
91163
91246
  #endif
91164
91247
  #else
91165
- #if ${colorspace === "linear" ? 1 : 0}
91248
+ #if ${colorSpace === "linear" ? 1 : 0}
91249
+ textureColorComponents=sRGBToLinear(textureColorComponents);
91250
+ #endif
91251
+ #endif
91252
+ #elif defined(X3D_COLORSPACE_LINEAR)
91253
+ #if!defined(${define}${_EXT}_LINEAR)
91254
+ #if ${colorSpace === "sRGB" || colorSpace === "linear" ? 1 : 0}
91166
91255
  textureColorComponents=sRGBToLinear(textureColorComponents);
91167
91256
  #endif
91168
91257
  #endif
91258
+ #endif
91169
91259
  return textureColorComponents;}
91170
91260
  #endif
91171
91261
  `
@@ -91200,7 +91290,7 @@ mediump samplerCube textureCube;
91200
91290
  x_ite_Namespace .add ("MaterialTextures", "assets/shaders/MaterialTextures", MaterialTextures_default_);
91201
91291
  /* harmony default export */ const MaterialTextures = (MaterialTextures_default_);
91202
91292
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js
91203
- /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(749);
91293
+ /* provided dependency */ var X3DProgrammableShaderObject_$ = __webpack_require__(786);
91204
91294
  /*******************************************************************************
91205
91295
  *
91206
91296
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91455,7 +91545,7 @@ Object .assign (X3DProgrammableShaderObject .prototype,
91455
91545
  "x3d_TransmissionFramebufferSizeEXT",
91456
91546
  "x3d_ThicknessEXT",
91457
91547
  "x3d_AttenuationDistanceEXT",
91458
- "x3d_AttenuationColoEXT",
91548
+ "x3d_AttenuationColorEXT",
91459
91549
  ];
91460
91550
 
91461
91551
  for (const name of commonUniforms)
@@ -94311,7 +94401,7 @@ finalColor.a=1.0;
94311
94401
  #if defined(X3D_ALPHA_MODE_MASK)
94312
94402
  if(finalColor.a<x3d_AlphaCutoff)discard;finalColor.a=1.0;
94313
94403
  #endif
94314
- gl_FragColor=finalColor;
94404
+ finalColor.rgb=toneMap(finalColor.rgb);gl_FragColor=finalColor;
94315
94405
  #if defined(X3D_LOGARITHMIC_DEPTH_BUFFER)
94316
94406
  gl_FragDepthEXT=log2(depth)*x3d_LogarithmicFarFactor1_2;
94317
94407
  #endif
@@ -94320,55 +94410,6 @@ gl_FragDepthEXT=log2(depth)*x3d_LogarithmicFarFactor1_2;
94320
94410
 
94321
94411
  x_ite_Namespace .add ("Fragment1.glsl", "assets/shaders/webgl1/common/Fragment1.glsl", Fragment1_glsl_default_);
94322
94412
  /* harmony default export */ const Fragment1_glsl = (Fragment1_glsl_default_);
94323
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Shadow1.glsl.js
94324
- const Shadow1_glsl_default_ = /* glsl */ `
94325
- #if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
94326
- uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){
94327
- #if X3D_NUM_LIGHTS>0
94328
- if(index==0)return texture2D(x3d_ShadowMap[0],shadowCoord).r;
94329
- #endif
94330
- #if X3D_NUM_LIGHTS>1
94331
- if(index==1)return texture2D(x3d_ShadowMap[1],shadowCoord).r;
94332
- #endif
94333
- #if X3D_NUM_LIGHTS>2
94334
- if(index==2)return texture2D(x3d_ShadowMap[2],shadowCoord).r;
94335
- #endif
94336
- #if X3D_NUM_LIGHTS>3
94337
- if(index==3)return texture2D(x3d_ShadowMap[3],shadowCoord).r;
94338
- #endif
94339
- #if X3D_NUM_LIGHTS>4
94340
- if(index==4)return texture2D(x3d_ShadowMap[4],shadowCoord).r;
94341
- #endif
94342
- #if X3D_NUM_LIGHTS>5
94343
- if(index==5)return texture2D(x3d_ShadowMap[5],shadowCoord).r;
94344
- #endif
94345
- #if X3D_NUM_LIGHTS>6
94346
- if(index==6)return texture2D(x3d_ShadowMap[6],shadowCoord).r;
94347
- #endif
94348
- #if X3D_NUM_LIGHTS>7
94349
- if(index==7)return texture2D(x3d_ShadowMap[7],shadowCoord).r;
94350
- #endif
94351
- 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;
94352
- #if defined(X3D_PCF_FILTERING)||defined(X3D_PCF_SOFT_FILTERING)
94353
- 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;
94354
- #else
94355
- float value=texture2DCompare(index,cubeToUVCompact(lightToPosition,texelSize.y),shadowCoord.z);return light.shadowIntensity*value;
94356
- #endif
94357
- }else{
94358
- #if defined(X3D_PCF_FILTERING)
94359
- 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;
94360
- #elif defined(X3D_PCF_SOFT_FILTERING)
94361
- 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;
94362
- #else
94363
- 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;
94364
- #endif
94365
- }return 0.0;}
94366
- #endif
94367
- `
94368
- ;
94369
-
94370
- x_ite_Namespace .add ("Shadow1.glsl", "assets/shaders/webgl1/common/Shadow1.glsl", Shadow1_glsl_default_);
94371
- /* harmony default export */ const Shadow1_glsl = (Shadow1_glsl_default_);
94372
94413
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/common/Texture1.glsl.js
94373
94414
 
94374
94415
 
@@ -94427,10 +94468,20 @@ textureColor = texture2D (x3d_Texture2D [${i}], texCoord .st);
94427
94468
  #elif defined (X3D_TEXTURE${i}_CUBE)
94428
94469
  textureColor = textureCube (x3d_TextureCube [${i}], texCoord .stp);
94429
94470
  #endif
94471
+ #if defined (X3D_COLORSPACE_SRGB)
94472
+ #if defined (X3D_TEXTURE${i}_LINEAR)
94473
+ textureColor = linearToSRGB (textureColor);
94474
+ #endif
94475
+ #elif defined (X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
94430
94476
  #if defined (X3D_PHYSICAL_MATERIAL) && !defined (X3D_TEXTURE${i}_LINEAR)
94431
94477
  textureColor = sRGBToLinear (textureColor);
94432
94478
  #elif !defined (X3D_PHYSICAL_MATERIAL) && defined (X3D_TEXTURE${i}_LINEAR)
94433
- textureColor = linearTosRGB (textureColor);
94479
+ textureColor = linearToSRGB (textureColor);
94480
+ #endif
94481
+ #elif defined (X3D_COLORSPACE_LINEAR)
94482
+ #if !defined (X3D_TEXTURE${i}_LINEAR)
94483
+ textureColor = sRGBToLinear (textureColor);
94484
+ #endif
94434
94485
  #endif
94435
94486
  }
94436
94487
  #endif
@@ -94458,10 +94509,16 @@ textureColor = texture2D (x3d_TextureProjectorTexture [${i}], texCoord);
94458
94509
  #endif
94459
94510
  `) .join ("\n")}
94460
94511
  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);
94512
+ #if defined(X3D_COLORSPACE_SRGB)
94513
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
94514
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
94461
94515
  #if defined(X3D_PHYSICAL_MATERIAL)
94462
94516
  if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
94463
94517
  #else
94464
- if(bool(x3d_TextureProjectorParams[i].z))T=linearTosRGB(T);
94518
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
94519
+ #endif
94520
+ #elif defined(X3D_COLORSPACE_LINEAR)
94521
+ if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
94465
94522
  #endif
94466
94523
  currentColor*=mix(vec3(1.0),T.rgb*x3d_TextureProjectorColor[i],T.a*x3d_TextureProjectorIntensity[i]);}return currentColor;}
94467
94524
  #endif
@@ -94691,6 +94748,7 @@ finalColor.a=1.0;
94691
94748
  #if defined(X3D_ALPHA_MODE_MASK)
94692
94749
  if(finalColor.a<x3d_AlphaCutoff)discard;finalColor.a=1.0;
94693
94750
  #endif
94751
+ finalColor.rgb=toneMap(finalColor.rgb);
94694
94752
  #if defined(X3D_ORDER_INDEPENDENT_TRANSPARENCY)
94695
94753
  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);
94696
94754
  #else
@@ -94894,7 +94952,36 @@ x_ite_Namespace .add ("PointSize2.glsl", "assets/shaders/webgl2/common/PointSize
94894
94952
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/common/Shadow2.glsl.js
94895
94953
  const Shadow2_glsl_default_ = /* glsl */ `
94896
94954
  #if defined(X3D_FRAGMENT_SHADER)&&defined(X3D_SHADOWS)
94897
- uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];float getShadowDepth(const in int index,const in vec2 shadowCoord){switch(index){
94955
+ uniform sampler2D x3d_ShadowMap[X3D_NUM_LIGHTS];
94956
+ #if __VERSION__==100
94957
+ float getShadowDepth(const in int index,const in vec2 shadowCoord){
94958
+ #if X3D_NUM_LIGHTS>0
94959
+ if(index==0)return texture2D(x3d_ShadowMap[0],shadowCoord).r;
94960
+ #endif
94961
+ #if X3D_NUM_LIGHTS>1
94962
+ if(index==1)return texture2D(x3d_ShadowMap[1],shadowCoord).r;
94963
+ #endif
94964
+ #if X3D_NUM_LIGHTS>2
94965
+ if(index==2)return texture2D(x3d_ShadowMap[2],shadowCoord).r;
94966
+ #endif
94967
+ #if X3D_NUM_LIGHTS>3
94968
+ if(index==3)return texture2D(x3d_ShadowMap[3],shadowCoord).r;
94969
+ #endif
94970
+ #if X3D_NUM_LIGHTS>4
94971
+ if(index==4)return texture2D(x3d_ShadowMap[4],shadowCoord).r;
94972
+ #endif
94973
+ #if X3D_NUM_LIGHTS>5
94974
+ if(index==5)return texture2D(x3d_ShadowMap[5],shadowCoord).r;
94975
+ #endif
94976
+ #if X3D_NUM_LIGHTS>6
94977
+ if(index==6)return texture2D(x3d_ShadowMap[6],shadowCoord).r;
94978
+ #endif
94979
+ #if X3D_NUM_LIGHTS>7
94980
+ if(index==7)return texture2D(x3d_ShadowMap[7],shadowCoord).r;
94981
+ #endif
94982
+ return 0.0;}
94983
+ #else
94984
+ float getShadowDepth(const in int index,const in vec2 shadowCoord){switch(index){
94898
94985
  #if X3D_NUM_LIGHTS>0
94899
94986
  case 0:{return texture(x3d_ShadowMap[0],shadowCoord).r;}
94900
94987
  #endif
@@ -94919,7 +95006,9 @@ case 6:{return texture(x3d_ShadowMap[6],shadowCoord).r;}
94919
95006
  #if X3D_NUM_LIGHTS>7
94920
95007
  case 7:{return texture(x3d_ShadowMap[7],shadowCoord).r;}
94921
95008
  #endif
94922
- 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;
95009
+ default:{return 0.0;}}}
95010
+ #endif
95011
+ 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;
94923
95012
  #if defined(X3D_PCF_FILTERING)||defined(X3D_PCF_SOFT_FILTERING)
94924
95013
  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;
94925
95014
  #else
@@ -95043,10 +95132,20 @@ textureColor = texture (x3d_Texture3D [${i}], texCoord .stp);
95043
95132
  #elif defined (X3D_TEXTURE${i}_CUBE)
95044
95133
  textureColor = texture (x3d_TextureCube [${i}], texCoord .stp);
95045
95134
  #endif
95135
+ #if defined (X3D_COLORSPACE_SRGB)
95136
+ #if defined (X3D_TEXTURE${i}_LINEAR)
95137
+ textureColor = linearToSRGB (textureColor);
95138
+ #endif
95139
+ #elif defined (X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
95046
95140
  #if defined (X3D_PHYSICAL_MATERIAL) && !defined (X3D_TEXTURE${i}_LINEAR)
95047
95141
  textureColor = sRGBToLinear (textureColor);
95048
95142
  #elif !defined (X3D_PHYSICAL_MATERIAL) && defined (X3D_TEXTURE${i}_LINEAR)
95049
- textureColor = linearTosRGB (textureColor);
95143
+ textureColor = linearToSRGB (textureColor);
95144
+ #endif
95145
+ #elif defined (X3D_COLORSPACE_LINEAR)
95146
+ #if !defined (X3D_TEXTURE${i}_LINEAR)
95147
+ textureColor = sRGBToLinear (textureColor);
95148
+ #endif
95050
95149
  #endif
95051
95150
  break;
95052
95151
  }
@@ -95074,10 +95173,16 @@ break;
95074
95173
  #endif
95075
95174
  `) .join ("\n")}
95076
95175
  }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);
95176
+ #if defined(X3D_COLORSPACE_SRGB)
95177
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
95178
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
95077
95179
  #if defined(X3D_PHYSICAL_MATERIAL)
95078
95180
  if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
95079
95181
  #else
95080
- if(bool(x3d_TextureProjectorParams[i].z))T=linearTosRGB(T);
95182
+ if(bool(x3d_TextureProjectorParams[i].z))T=linearToSRGB(T);
95183
+ #endif
95184
+ #elif defined(X3D_COLORSPACE_LINEAR)
95185
+ if(!bool(x3d_TextureProjectorParams[i].z))T=sRGBToLinear(T);
95081
95186
  #endif
95082
95187
  currentColor*=mix(vec3(1.0),T.rgb*x3d_TextureProjectorColor[i],T.a*x3d_TextureProjectorIntensity[i]);}return currentColor;}
95083
95188
  #endif
@@ -95322,141 +95427,18 @@ backColor=getMaterialColor(-normal,vertex,x3d_Material);
95322
95427
 
95323
95428
  x_ite_Namespace .add ("Gouraud1.vs", "assets/shaders/webgl1/Gouraud1.vs", Gouraud1_vs_default_);
95324
95429
  /* harmony default export */ const Gouraud1_vs = (Gouraud1_vs_default_);
95325
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/PBR1.fs.js
95326
- const PBR1_fs_default_ = /* glsl */ `
95430
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Physical1.fs.js
95431
+ const Physical1_fs_default_ = /* glsl */ `
95327
95432
  #extension GL_OES_standard_derivatives:enable
95328
95433
  #extension GL_EXT_frag_depth:enable
95329
95434
  #extension GL_EXT_shader_texture_lod:enable
95330
95435
  precision highp float;precision highp int;precision highp sampler2D;precision highp samplerCube;
95331
- #pragma X3D include "common/Fragment.glsl"
95332
- #pragma X3D include "common/Normal.glsl"
95333
- #pragma X3D include "common/Shadow.glsl"
95334
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95335
- uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
95336
- #endif
95337
- #if defined(X3D_LIGHTING)
95338
- uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
95339
- #endif
95340
- uniform x3d_PhysicalMaterialParameters x3d_Material;
95341
- #pragma X3D include "pbr/BRDF.glsl"
95342
- #pragma X3D include "pbr/MaterialInfo.glsl"
95343
- #pragma X3D include "pbr/Punctual.glsl"
95344
- #pragma X3D include "pbr/IBL.glsl"
95345
- #pragma X3D include "pbr/Iridescence.glsl"
95346
- vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
95347
- #if defined(X3D_TEXTURE_PROJECTION)
95348
- baseColor.rgb*=getTextureProjectorColor();
95349
- #endif
95350
- vec3 v=normalize(-vertex);
95351
- #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)||defined(X3D_ANISOTROPY_MATERIAL_EXT)||defined(X3D_CLEARCOAT_MATERIAL_EXT)
95352
- NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.0,1.0);
95353
- #endif
95354
- MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
95355
- #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
95356
- materialInfo=getMetallicRoughnessInfo(materialInfo);
95357
- #endif
95358
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95359
- materialInfo=getSheenInfo(materialInfo);
95360
- #endif
95361
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95362
- materialInfo=getClearCoatInfo(materialInfo,normalInfo);
95363
- #endif
95364
- #if defined(X3D_SPECULAR_MATERIAL_EXT)
95365
- materialInfo=getSpecularInfo(materialInfo);
95366
- #endif
95367
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95368
- materialInfo=getTransmissionInfo(materialInfo);
95369
- #endif
95370
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95371
- materialInfo=getVolumeInfo(materialInfo);
95372
- #endif
95373
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95374
- materialInfo=getIridescenceInfo(materialInfo);
95375
- #endif
95376
- #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
95377
- materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
95378
- #endif
95379
- 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;
95380
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)&&(defined(X3D_USE_IBL)||defined(X3D_LIGHTING))
95381
- 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;
95382
- #endif
95383
- #if defined(X3D_USE_IBL)
95384
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95385
- 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);
95386
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95387
- 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);
95388
- #else
95389
- 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);
95390
- #endif
95391
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95392
- f_clearcoat+=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness,materialInfo.clearcoatF0,1.0);
95393
- #endif
95394
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95395
- f_sheen+=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
95396
- #endif
95397
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95398
- 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);
95399
- #endif
95400
- #endif
95401
- 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);
95402
- #if defined(X3D_LIGHTING)
95403
- 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);
95404
- #if defined(X3D_SHADOWS)
95405
- intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
95406
- #endif
95407
- vec3 l_diffuse=vec3(0.0);vec3 l_specular=vec3(0.0);
95408
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95409
- 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);
95410
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95411
- 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);
95412
- #else
95413
- 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);
95414
- #endif
95415
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95416
- 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;
95417
- #endif
95418
- f_diffuse+=l_diffuse;f_specular+=l_specular;
95419
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95420
- f_clearcoat+=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
95421
- #endif
95422
- }
95423
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95424
- 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);
95425
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95426
- transmittedLight=applyVolumeAttenuation(transmittedLight,length(transmissionRay),materialInfo.attenuationColor,materialInfo.attenuationDistance);
95427
- #endif
95428
- f_transmission+=transmittedLight;
95429
- #endif
95430
- }}
95431
- #endif
95432
- f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
95433
- #if defined(X3D_OCCLUSION_TEXTURE)
95434
- 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);
95435
- #else
95436
- 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;
95437
- #endif
95438
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95439
- clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));clearcoat*=clearcoatFactor;
95440
- #endif
95441
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95442
- diffuse=mix(diffuse,f_transmission,materialInfo.transmissionFactor);
95443
- #endif
95444
- vec3 color=vec3(0.0);
95445
- #if defined(X3D_UNLIT_MATERIAL_EXT)
95446
- color=baseColor.rgb;
95447
- #else
95448
- color=f_emissive+diffuse+specular;color=sheen+color;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
95449
- #endif
95450
- #if defined(X3D_LINEAR_OUTPUT)
95451
- return vec4(color,baseColor.a);
95452
- #else
95453
- return vec4(toneMap(color),baseColor.a);
95454
- #endif
95455
- }void main(){fragment_main();}`
95436
+ #pragma X3D include "pbr/PBR.glsl"
95437
+ `
95456
95438
  ;
95457
95439
 
95458
- x_ite_Namespace .add ("PBR1.fs", "assets/shaders/webgl1/PBR1.fs", PBR1_fs_default_);
95459
- /* harmony default export */ const PBR1_fs = (PBR1_fs_default_);
95440
+ x_ite_Namespace .add ("Physical1.fs", "assets/shaders/webgl1/Physical1.fs", Physical1_fs_default_);
95441
+ /* harmony default export */ const Physical1_fs = (Physical1_fs_default_);
95460
95442
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl1/Phong1.fs.js
95461
95443
 
95462
95444
 
@@ -95751,144 +95733,15 @@ precision highp float;precision highp int;precision highp sampler2D;uniform samp
95751
95733
 
95752
95734
  x_ite_Namespace .add ("OITCompose2.fs", "assets/shaders/webgl2/OITCompose2.fs", OITCompose2_fs_default_);
95753
95735
  /* harmony default export */ const OITCompose2_fs = (OITCompose2_fs_default_);
95754
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/PBR2.fs.js
95755
- const PBR2_fs_default_ = /* glsl */ `#version 300 es
95736
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Physical2.js
95737
+ const Physical2_default_ = /* glsl */ `#version 300 es
95756
95738
  precision highp float;precision highp int;precision highp sampler2D;precision highp sampler3D;precision highp samplerCube;
95757
- #pragma X3D include "common/Fragment.glsl"
95758
- #pragma X3D include "common/Normal.glsl"
95759
- #pragma X3D include "common/Shadow.glsl"
95760
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95761
- uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
95762
- #endif
95763
- #if defined(X3D_LIGHTING)
95764
- uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
95765
- #endif
95766
- uniform x3d_PhysicalMaterialParameters x3d_Material;
95767
- #pragma X3D include "pbr/BRDF.glsl"
95768
- #pragma X3D include "pbr/MaterialInfo.glsl"
95769
- #pragma X3D include "pbr/Punctual.glsl"
95770
- #pragma X3D include "pbr/IBL.glsl"
95771
- #pragma X3D include "pbr/Iridescence.glsl"
95772
- vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
95773
- #if defined(X3D_TEXTURE_PROJECTION)
95774
- baseColor.rgb*=getTextureProjectorColor();
95775
- #endif
95776
- vec3 v=normalize(-vertex);
95777
- #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)||defined(X3D_ANISOTROPY_MATERIAL_EXT)||defined(X3D_CLEARCOAT_MATERIAL_EXT)
95778
- NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.0,1.0);
95779
- #endif
95780
- MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
95781
- #if defined(X3D_IOR_MATERIAL_EXT)
95782
- materialInfo=getIorInfo(materialInfo);
95783
- #endif
95784
- #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
95785
- materialInfo=getSpecularGlossinessInfo(materialInfo);
95786
- #endif
95787
- #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
95788
- materialInfo=getMetallicRoughnessInfo(materialInfo);
95789
- #endif
95790
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95791
- materialInfo=getSheenInfo(materialInfo);
95792
- #endif
95793
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95794
- materialInfo=getClearCoatInfo(materialInfo,normalInfo);
95795
- #endif
95796
- #if defined(X3D_SPECULAR_MATERIAL_EXT)
95797
- materialInfo=getSpecularInfo(materialInfo);
95798
- #endif
95799
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95800
- materialInfo=getTransmissionInfo(materialInfo);
95801
- #endif
95802
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95803
- materialInfo=getVolumeInfo(materialInfo);
95804
- #endif
95805
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95806
- materialInfo=getIridescenceInfo(materialInfo);
95807
- #endif
95808
- #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
95809
- materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
95810
- #endif
95811
- 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;
95812
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)&&(defined(X3D_USE_IBL)||defined(X3D_LIGHTING))
95813
- 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;
95814
- #endif
95815
- #if defined(X3D_USE_IBL)
95816
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95817
- 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);
95818
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95819
- 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);
95820
- #else
95821
- 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);
95822
- #endif
95823
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95824
- f_clearcoat+=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness,materialInfo.clearcoatF0,1.0);
95825
- #endif
95826
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95827
- f_sheen+=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
95828
- #endif
95829
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95830
- 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);
95831
- #endif
95832
- #endif
95833
- 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);
95834
- #if defined(X3D_LIGHTING)
95835
- 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);
95836
- #if defined(X3D_SHADOWS)
95837
- intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
95838
- #endif
95839
- vec3 l_diffuse=vec3(0.0);vec3 l_specular=vec3(0.0);
95840
- #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
95841
- 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);
95842
- #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
95843
- 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);
95844
- #else
95845
- 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);
95846
- #endif
95847
- #if defined(X3D_SHEEN_MATERIAL_EXT)
95848
- 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;
95849
- #endif
95850
- f_diffuse+=l_diffuse;f_specular+=l_specular;
95851
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95852
- f_clearcoat+=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
95853
- #endif
95854
- }
95855
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95856
- 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);
95857
- #if defined(X3D_VOLUME_MATERIAL_EXT)
95858
- transmittedLight=applyVolumeAttenuation(transmittedLight,length(transmissionRay),materialInfo.attenuationColor,materialInfo.attenuationDistance);
95859
- #endif
95860
- f_transmission+=transmittedLight;
95861
- #endif
95862
- }}
95863
- #endif
95864
- f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
95865
- #if defined(X3D_OCCLUSION_TEXTURE)
95866
- 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);
95867
- #else
95868
- 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;
95869
- #endif
95870
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
95871
- clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));clearcoat*=clearcoatFactor;
95872
- #endif
95873
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
95874
- diffuse=mix(diffuse,f_transmission,materialInfo.transmissionFactor);
95875
- #endif
95876
- vec3 color=vec3(0.0);
95877
- #if defined(X3D_UNLIT_MATERIAL_EXT)
95878
- color=baseColor.rgb;
95879
- #else
95880
- color=f_emissive+diffuse+specular;color=sheen+color;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
95881
- #endif
95882
- #if defined(X3D_LINEAR_OUTPUT)
95883
- return vec4(color,baseColor.a);
95884
- #else
95885
- return vec4(toneMap(color),baseColor.a);
95886
- #endif
95887
- }void main(){fragment_main();}`
95739
+ #pragma X3D include "pbr/PBR.glsl"
95740
+ `
95888
95741
  ;
95889
95742
 
95890
- x_ite_Namespace .add ("PBR2.fs", "assets/shaders/webgl2/PBR2.fs", PBR2_fs_default_);
95891
- /* harmony default export */ const PBR2_fs = (PBR2_fs_default_);
95743
+ x_ite_Namespace .add ("Physical2", "assets/shaders/webgl2/Physical2", Physical2_default_);
95744
+ /* harmony default export */ const Physical2 = (Physical2_default_);
95892
95745
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/Phong2.fs.js
95893
95746
 
95894
95747
 
@@ -96085,13 +95938,23 @@ vec3 textureColor=textureCube(x3d_EnvironmentLightSource.diffuseTexture,texCoord
96085
95938
  #else
96086
95939
  vec3 textureColor=texture(x3d_EnvironmentLightSource.diffuseTexture,texCoord).rgb;
96087
95940
  #endif
96088
- 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);
95941
+ #if defined(X3D_COLORSPACE_SRGB)
95942
+ if(x3d_EnvironmentLightSource.diffuseTextureLinear)textureColor=linearToSRGB(textureColor);
95943
+ #else
95944
+ if(!x3d_EnvironmentLightSource.diffuseTextureLinear)textureColor=sRGBToLinear(textureColor);
95945
+ #endif
95946
+ 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);
96089
95947
  #if __VERSION__==100
96090
95948
  vec3 textureColor=textureCubeLodEXT(x3d_EnvironmentLightSource.specularTexture,texCoord,lod).rgb;
96091
95949
  #else
96092
95950
  vec3 textureColor=textureLod(x3d_EnvironmentLightSource.specularTexture,texCoord,lod).rgb;
96093
95951
  #endif
96094
- if(!x3d_EnvironmentLightSource.specularTextureLinear)textureColor=sRGBToLinear(textureColor);return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}
95952
+ #if defined(X3D_COLORSPACE_SRGB)
95953
+ if(x3d_EnvironmentLightSource.specularTextureLinear)textureColor=linearToSRGB(textureColor);
95954
+ #else
95955
+ if(!x3d_EnvironmentLightSource.specularTextureLinear)textureColor=sRGBToLinear(textureColor);
95956
+ #endif
95957
+ return textureColor*x3d_EnvironmentLightSource.color*x3d_EnvironmentLightSource.intensity;}
96095
95958
  #if defined(X3D_SHEEN_MATERIAL_EXT)
96096
95959
  vec3 getSheenLight(const in vec3 reflection,const in float lod){return vec3(0.5)*(lod/float(x3d_EnvironmentLightSource.specularTextureLevels))*x3d_EnvironmentLightSource.intensity;}
96097
95960
  #endif
@@ -96130,7 +95993,12 @@ float framebufferSize=max(float(x3d_TransmissionFramebufferSizeEXT.x),float(x3d_
96130
95993
  #else
96131
95994
  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;
96132
95995
  #endif
96133
- 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){
95996
+ #if defined(X3D_COLORSPACE_SRGB)
95997
+ return transmittedLight;
95998
+ #else
95999
+ return sRGBToLinear(transmittedLight);
96000
+ #endif
96001
+ }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){
96134
96002
  #if defined(X3D_DISPERSION_MATERIAL_EXT)
96135
96003
  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];}
96136
96004
  #else
@@ -96178,29 +96046,6 @@ const mat3 XYZ_TO_REC709=mat3(3.2404542,-0.9692660,0.0556434,-1.5371385,1.876010
96178
96046
 
96179
96047
  x_ite_Namespace .add ("Iridescence2.glsl", "assets/shaders/webgl2/pbr/Iridescence2.glsl", Iridescence2_glsl_default_);
96180
96048
  /* harmony default export */ const Iridescence2_glsl = (Iridescence2_glsl_default_);
96181
- ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/Punctual2.glsl.js
96182
- const Punctual2_glsl_default_ = /* glsl */ `
96183
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96184
- float applyIorToRoughness(const in float roughness,const in float ior){return roughness*clamp(ior*2.0-2.0,0.0,1.0);}
96185
- #endif
96186
- #if defined(X3D_LIGHTING)
96187
- #pragma X3D include "../common/Lighting.glsl"
96188
- 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;}
96189
- #if defined(X3D_SHEEN_MATERIAL_EXT)
96190
- 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);}
96191
- #endif
96192
- #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96193
- 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);}
96194
- #endif
96195
- #endif
96196
- #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96197
- 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;}
96198
- #endif
96199
- `
96200
- ;
96201
-
96202
- x_ite_Namespace .add ("Punctual2.glsl", "assets/shaders/webgl2/pbr/Punctual2.glsl", Punctual2_glsl_default_);
96203
- /* harmony default export */ const Punctual2_glsl = (Punctual2_glsl_default_);
96204
96049
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/MaterialInfo2.glsl.js
96205
96050
 
96206
96051
 
@@ -96284,12 +96129,13 @@ info.sheenColorFactor*=getSheenColorTextureEXT();
96284
96129
  #if defined(X3D_SHEEN_ROUGHNESS_TEXTURE_EXT)
96285
96130
  info.sheenRoughnessFactor*=getSheenRoughnessTextureEXT();
96286
96131
  #endif
96287
- return info;}uniform sampler2D x3d_SheenELUTTextureEXT;
96132
+ return info;}uniform sampler2D x3d_SheenELUTTextureEXT;float albedoSheenScalingLUT(const in float NdotV,const in float sheenRoughnessFactor){
96288
96133
  #if __VERSION__==100
96289
- float albedoSheenScalingLUT(const in float NdotV,const in float sheenRoughnessFactor){return texture2D(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;}
96134
+ return texture2D(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;
96290
96135
  #else
96291
- float albedoSheenScalingLUT(const in float NdotV,const in float sheenRoughnessFactor){return texture(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;}
96136
+ return texture(x3d_SheenELUTTextureEXT,vec2(NdotV,sheenRoughnessFactor)).r;
96292
96137
  #endif
96138
+ }
96293
96139
  #endif
96294
96140
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96295
96141
  ${MaterialTextures .texture ("x3d_ClearcoatTextureEXT",
@@ -96330,7 +96176,7 @@ vec3 dielectricSpecularF0=min(info.f0*x3d_SpecularColorEXT*specularTexture.rgb,v
96330
96176
  #endif
96331
96177
  #if defined(X3D_VOLUME_MATERIAL_EXT)
96332
96178
  ${MaterialTextures .texture ("x3d_ThicknessTextureEXT", "g")}
96333
- 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;
96179
+ 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;
96334
96180
  #if defined(X3D_THICKNESS_TEXTURE_EXT)
96335
96181
  info.thickness*=getThicknessTextureEXT();
96336
96182
  #endif
@@ -96379,9 +96225,166 @@ vec2 directionRotation=x3d_AnisotropyEXT.xy;mat2 rotationMatrix=mat2(directionRo
96379
96225
 
96380
96226
  x_ite_Namespace .add ("MaterialInfo2.glsl", "assets/shaders/webgl2/pbr/MaterialInfo2.glsl", MaterialInfo2_glsl_default_);
96381
96227
  /* harmony default export */ const MaterialInfo2_glsl = (MaterialInfo2_glsl_default_);
96228
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/PBR2.glsl.js
96229
+ const PBR2_glsl_default_ = /* glsl */ `
96230
+ #pragma X3D include "../common/Fragment.glsl"
96231
+ #pragma X3D include "../common/Normal.glsl"
96232
+ #pragma X3D include "../common/Shadow.glsl"
96233
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96234
+ uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;
96235
+ #endif
96236
+ #if defined(X3D_LIGHTING)
96237
+ uniform x3d_LightSourceParameters x3d_LightSource[X3D_NUM_LIGHTS];
96238
+ #endif
96239
+ uniform x3d_PhysicalMaterialParameters x3d_Material;
96240
+ #pragma X3D include "pbr/BRDF.glsl"
96241
+ #pragma X3D include "pbr/MaterialInfo.glsl"
96242
+ #pragma X3D include "pbr/Punctual.glsl"
96243
+ #pragma X3D include "pbr/IBL.glsl"
96244
+ #pragma X3D include "pbr/Iridescence.glsl"
96245
+ vec4 getMaterialColor(){vec4 baseColor=getBaseColor();
96246
+ #if defined(X3D_TEXTURE_PROJECTION)
96247
+ baseColor.rgb*=getTextureProjectorColor();
96248
+ #endif
96249
+ #if!defined(X3D_UNLIT_MATERIAL_EXT)
96250
+ vec3 v=normalize(-vertex);
96251
+ #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)||defined(X3D_ANISOTROPY_MATERIAL_EXT)||defined(X3D_CLEARCOAT_MATERIAL_EXT)
96252
+ NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.0,1.0);
96253
+ #endif
96254
+ MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0=vec3(0.04);materialInfo.specularWeight=1.0;
96255
+ #if defined(X3D_IOR_MATERIAL_EXT)
96256
+ materialInfo=getIorInfo(materialInfo);
96257
+ #endif
96258
+ #if defined(X3D_MATERIAL_SPECULAR_GLOSSINESS)
96259
+ materialInfo=getSpecularGlossinessInfo(materialInfo);
96260
+ #endif
96261
+ #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
96262
+ materialInfo=getMetallicRoughnessInfo(materialInfo);
96263
+ #endif
96264
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96265
+ materialInfo=getSheenInfo(materialInfo);
96266
+ #endif
96267
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96268
+ materialInfo=getClearCoatInfo(materialInfo,normalInfo);
96269
+ #endif
96270
+ #if defined(X3D_SPECULAR_MATERIAL_EXT)
96271
+ materialInfo=getSpecularInfo(materialInfo);
96272
+ #endif
96273
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96274
+ materialInfo=getTransmissionInfo(materialInfo);
96275
+ #endif
96276
+ #if defined(X3D_VOLUME_MATERIAL_EXT)
96277
+ materialInfo=getVolumeInfo(materialInfo);
96278
+ #endif
96279
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96280
+ materialInfo=getIridescenceInfo(materialInfo);
96281
+ #endif
96282
+ #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
96283
+ materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
96284
+ #endif
96285
+ 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;
96286
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)&&(defined(X3D_USE_IBL)||defined(X3D_LIGHTING))
96287
+ 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;
96288
+ #endif
96289
+ #if defined(X3D_USE_IBL)
96290
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96291
+ 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);
96292
+ #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
96293
+ 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);
96294
+ #else
96295
+ 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);
96296
+ #endif
96297
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96298
+ f_clearcoat+=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness,materialInfo.clearcoatF0,1.0);
96299
+ #endif
96300
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96301
+ f_sheen+=getIBLRadianceCharlie(n,v,materialInfo.sheenRoughnessFactor,materialInfo.sheenColorFactor);albedoSheenScaling=1.0-max3(materialInfo.sheenColorFactor)*albedoSheenScalingLUT(NdotV,materialInfo.sheenRoughnessFactor);
96302
+ #endif
96303
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96304
+ 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);
96305
+ #endif
96306
+ #endif
96307
+ 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);
96308
+ #if defined(X3D_LIGHTING)
96309
+ 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);
96310
+ #if defined(X3D_SHADOWS)
96311
+ intensity=mix(intensity,light.shadowColor,getShadowIntensity(i,light));
96312
+ #endif
96313
+ vec3 l_diffuse=vec3(0.0);vec3 l_specular=vec3(0.0);
96314
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
96315
+ 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);
96316
+ #elif defined(X3D_ANISOTROPY_MATERIAL_EXT)
96317
+ 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);
96318
+ #else
96319
+ 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);
96320
+ #endif
96321
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96322
+ 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;
96323
+ #endif
96324
+ f_diffuse+=l_diffuse;f_specular+=l_specular;
96325
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96326
+ f_clearcoat+=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
96327
+ #endif
96328
+ }
96329
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96330
+ 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);
96331
+ #if defined(X3D_VOLUME_MATERIAL_EXT)
96332
+ transmittedLight=applyVolumeAttenuation(transmittedLight,length(transmissionRay),materialInfo.attenuationColor,materialInfo.attenuationDistance);
96333
+ #endif
96334
+ f_transmission+=transmittedLight;
96335
+ #endif
96336
+ }}
96337
+ #endif
96338
+ f_emissive=getEmissiveColor();float clearcoatFactor=0.0;vec3 clearcoatFresnel=vec3(0.0);vec3 diffuse;vec3 specular;vec3 sheen;vec3 clearcoat;
96339
+ #if defined(X3D_OCCLUSION_TEXTURE)
96340
+ 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);
96341
+ #else
96342
+ 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;
96343
+ #endif
96344
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96345
+ clearcoatFactor=materialInfo.clearcoatFactor;clearcoatFresnel=F_Schlick(materialInfo.clearcoatF0,materialInfo.clearcoatF90,clamp(dot(materialInfo.clearcoatNormal,v),0.0,1.0));clearcoat*=clearcoatFactor;
96346
+ #endif
96347
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96348
+ diffuse=mix(diffuse,f_transmission,materialInfo.transmissionFactor);
96349
+ #endif
96350
+ #endif
96351
+ vec3 color=vec3(0.0);
96352
+ #if defined(X3D_UNLIT_MATERIAL_EXT)
96353
+ color=baseColor.rgb;
96354
+ #else
96355
+ color=f_emissive+diffuse+specular;color=sheen+color;color=color*(1.0-clearcoatFactor*clearcoatFresnel)+clearcoat;
96356
+ #endif
96357
+ return vec4(color,baseColor.a);}void main(){fragment_main();}`
96358
+ ;
96359
+
96360
+ x_ite_Namespace .add ("PBR2.glsl", "assets/shaders/webgl2/pbr/PBR2.glsl", PBR2_glsl_default_);
96361
+ /* harmony default export */ const PBR2_glsl = (PBR2_glsl_default_);
96362
+ ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/Punctual2.glsl.js
96363
+ const Punctual2_glsl_default_ = /* glsl */ `
96364
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96365
+ float applyIorToRoughness(const in float roughness,const in float ior){return roughness*clamp(ior*2.0-2.0,0.0,1.0);}
96366
+ #endif
96367
+ #if defined(X3D_LIGHTING)
96368
+ #pragma X3D include "../common/Lighting.glsl"
96369
+ 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;}
96370
+ #if defined(X3D_SHEEN_MATERIAL_EXT)
96371
+ 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);}
96372
+ #endif
96373
+ #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
96374
+ 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);}
96375
+ #endif
96376
+ #endif
96377
+ #if defined(X3D_TRANSMISSION_MATERIAL_EXT)
96378
+ 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;}
96379
+ #endif
96380
+ `
96381
+ ;
96382
+
96383
+ x_ite_Namespace .add ("Punctual2.glsl", "assets/shaders/webgl2/pbr/Punctual2.glsl", Punctual2_glsl_default_);
96384
+ /* harmony default export */ const Punctual2_glsl = (Punctual2_glsl_default_);
96382
96385
  ;// CONCATENATED MODULE: ./src/assets/shaders/webgl2/pbr/ToneMapping2.glsl.js
96383
96386
  const ToneMapping2_glsl_default_ = /* glsl */ `
96384
- 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);}
96387
+ 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);}
96385
96388
  #if defined(X3D_TONEMAP_ACES_NARKOWICZ)
96386
96389
  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);}
96387
96390
  #endif
@@ -96404,7 +96407,18 @@ color/=0.6;color=toneMapACES_Hill(color);
96404
96407
  #if defined(X3D_TONEMAP_KHR_PBR_NEUTRAL)
96405
96408
  color=toneMap_KhronosPbrNeutral(color);
96406
96409
  #endif
96407
- return linearTosRGB(color);}`
96410
+ #if defined(X3D_COLORSPACE_SRGB)
96411
+ return color;
96412
+ #elif defined(X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL)
96413
+ #if defined(X3D_PHYSICAL_MATERIAL)
96414
+ return linearToSRGB(color);
96415
+ #else
96416
+ return color;
96417
+ #endif
96418
+ #elif defined(X3D_COLORSPACE_LINEAR)
96419
+ return linearToSRGB(color);
96420
+ #endif
96421
+ }`
96408
96422
  ;
96409
96423
 
96410
96424
  x_ite_Namespace .add ("ToneMapping2.glsl", "assets/shaders/webgl2/pbr/ToneMapping2.glsl", ToneMapping2_glsl_default_);
@@ -96462,7 +96476,6 @@ x_ite_Namespace .add ("ToneMapping2.glsl", "assets/shaders/webgl2/pbr/ToneMappin
96462
96476
 
96463
96477
 
96464
96478
 
96465
-
96466
96479
  /* WebGL 2 */
96467
96480
 
96468
96481
 
@@ -96520,6 +96533,7 @@ x_ite_Namespace .add ("ToneMapping2.glsl", "assets/shaders/webgl2/pbr/ToneMappin
96520
96533
 
96521
96534
 
96522
96535
 
96536
+
96523
96537
  const ShaderRegistry = {
96524
96538
  includes: {
96525
96539
  1: {
@@ -96533,7 +96547,7 @@ const ShaderRegistry = {
96533
96547
  Perlin: Perlin2_glsl,
96534
96548
  Point: Point2_glsl,
96535
96549
  PointSize: PointSize2_glsl,
96536
- Shadow: Shadow1_glsl,
96550
+ Shadow: Shadow2_glsl,
96537
96551
  Texture: Texture1_glsl,
96538
96552
  Vertex: Vertex1_glsl,
96539
96553
  // PBR
@@ -96541,6 +96555,7 @@ const ShaderRegistry = {
96541
96555
  IBL: IBL2_glsl,
96542
96556
  Iridescence: Iridescence2_glsl,
96543
96557
  MaterialInfo: MaterialInfo2_glsl,
96558
+ PBR: PBR2_glsl,
96544
96559
  Punctual: Punctual2_glsl,
96545
96560
  ToneMapping: ToneMapping2_glsl,
96546
96561
  },
@@ -96568,6 +96583,7 @@ const ShaderRegistry = {
96568
96583
  IBL: IBL2_glsl,
96569
96584
  Iridescence: Iridescence2_glsl,
96570
96585
  MaterialInfo: MaterialInfo2_glsl,
96586
+ PBR: PBR2_glsl,
96571
96587
  Punctual: Punctual2_glsl,
96572
96588
  ToneMapping: ToneMapping2_glsl,
96573
96589
  },
@@ -96593,9 +96609,9 @@ const ShaderRegistry = {
96593
96609
  1: {
96594
96610
  Depth: Depth1_fs,
96595
96611
  Gouraud: Gouraud1_fs,
96596
- PBR: PBR1_fs,
96597
96612
  Phong: Phong1_fs,
96598
96613
  Pointing: Pointing1_fs,
96614
+ Physical: Physical1_fs,
96599
96615
  Unlit: Unlit1_fs,
96600
96616
  },
96601
96617
  2: {
@@ -96603,9 +96619,9 @@ const ShaderRegistry = {
96603
96619
  Gouraud: Gouraud2_fs,
96604
96620
  LineTransform: LineTransform2_fs,
96605
96621
  OITCompose: OITCompose2_fs,
96606
- PBR: PBR2_fs,
96607
96622
  Phong: Phong2_fs,
96608
96623
  Pointing: Pointing2_fs,
96624
+ Physical: Physical2,
96609
96625
  Unlit: Unlit2_fs,
96610
96626
  },
96611
96627
  },
@@ -96719,7 +96735,7 @@ const ShaderCompiler_default_ = ShaderCompiler;
96719
96735
  x_ite_Namespace .add ("ShaderCompiler", "x_ite/Browser/Shaders/ShaderCompiler", ShaderCompiler_default_);
96720
96736
  /* harmony default export */ const Shaders_ShaderCompiler = (ShaderCompiler_default_);
96721
96737
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shaders/ShaderPart.js
96722
- /* provided dependency */ var ShaderPart_$ = __webpack_require__(749);
96738
+ /* provided dependency */ var ShaderPart_$ = __webpack_require__(786);
96723
96739
  /*******************************************************************************
96724
96740
  *
96725
96741
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97386,7 +97402,7 @@ const X3DAppearanceNode_default_ = X3DAppearanceNode;
97386
97402
  x_ite_Namespace .add ("X3DAppearanceNode", "x_ite/Components/Shape/X3DAppearanceNode", X3DAppearanceNode_default_);
97387
97403
  /* harmony default export */ const Shape_X3DAppearanceNode = (X3DAppearanceNode_default_);
97388
97404
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Shape/Appearance.js
97389
- /* provided dependency */ var Appearance_$ = __webpack_require__(749);
97405
+ /* provided dependency */ var Appearance_$ = __webpack_require__(786);
97390
97406
  /*******************************************************************************
97391
97407
  *
97392
97408
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98359,10 +98375,11 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98359
98375
  {
98360
98376
  // Rubberband, X3DBackgroundNode
98361
98377
 
98362
- const { alphaMode, textureNode, objectsKeys } = geometryContext;
98378
+ const { renderObject, alphaMode, textureNode, objectsKeys } = geometryContext;
98363
98379
 
98364
98380
  key += alphaMode;
98365
- key += "0000011.0.";
98381
+ key += renderObject .getRenderKey ();
98382
+ key += "000011.0.";
98366
98383
  key += objectsKeys .sort () .join (""); // ClipPlane, X3DLightNode
98367
98384
  key += ".";
98368
98385
  key += textureNode ?.getTextureBits () .toString (16) ?? 0;
@@ -98391,6 +98408,31 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98391
98408
  if (geometryContext .hasTangents)
98392
98409
  options .push ("X3D_TANGENTS");
98393
98410
 
98411
+ switch (browser .getBrowserOption ("ColorSpace"))
98412
+ {
98413
+ case "SRGB":
98414
+ options .push ("X3D_COLORSPACE_SRGB");
98415
+ break;
98416
+ default: // LINEAR_WHEN_PHYSICAL_MATERIAL
98417
+ options .push ("X3D_COLORSPACE_LINEAR_WHEN_PHYSICAL_MATERIAL");
98418
+ break;
98419
+ case "LINEAR":
98420
+ options .push ("X3D_COLORSPACE_LINEAR");
98421
+ break;
98422
+ }
98423
+
98424
+ switch (browser .getBrowserOption ("ToneMapping"))
98425
+ {
98426
+ default: // NONE
98427
+ break;
98428
+ case "ACES_NARKOWICZ":
98429
+ case "ACES_HILL":
98430
+ case "ACES_HILL_EXPOSURE_BOOST":
98431
+ case "KHR_PBR_NEUTRAL":
98432
+ options .push (`X3D_TONEMAP_${browser .getBrowserOption ("ToneMapping")}`);
98433
+ break;
98434
+ }
98435
+
98394
98436
  if (renderContext)
98395
98437
  {
98396
98438
  const { renderObject, fogNode, shapeNode, appearanceNode, humanoidNode, objectsKeys, textureNode } = renderContext;
@@ -98527,7 +98569,10 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98527
98569
  }
98528
98570
  else
98529
98571
  {
98530
- const { alphaMode, objectsKeys, textureNode } = geometryContext;
98572
+ const { renderObject, alphaMode, objectsKeys, textureNode } = geometryContext;
98573
+
98574
+ if (renderObject .getLogarithmicDepthBuffer ())
98575
+ options .push ("X3D_LOGARITHMIC_DEPTH_BUFFER");
98531
98576
 
98532
98577
  switch (alphaMode)
98533
98578
  {
@@ -98545,7 +98590,7 @@ Object .assign (Object .setPrototypeOf (X3DMaterialNode .prototype, Shape_X3DApp
98545
98590
  {
98546
98591
  options .push ("X3D_ALPHA_MODE_BLEND");
98547
98592
 
98548
- if (browser .getBrowserOption ("OrderIndependentTransparency"))
98593
+ if (renderObject .getOrderIndependentTransparency ())
98549
98594
  options .push ("X3D_ORDER_INDEPENDENT_TRANSPARENCY");
98550
98595
 
98551
98596
  break;
@@ -99404,8 +99449,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99404
99449
  set_transparent__ ()
99405
99450
  {
99406
99451
  this .setTransparent (this .getTransparency () ||
99407
- this .baseTextureNode ?.isTransparent () ||
99408
- this .isTransmission ());
99452
+ this .baseTextureNode ?.isTransparent ());
99409
99453
  },
99410
99454
  set_extensions__ ()
99411
99455
  {
@@ -99431,7 +99475,6 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99431
99475
 
99432
99476
  this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes (Base_X3DConstants .TransmissionMaterialExtension)));
99433
99477
 
99434
- this .set_transparent__ ();
99435
99478
  this .set_extensionsKey__ ();
99436
99479
  },
99437
99480
  set_extensionsKey__ ()
@@ -99453,18 +99496,6 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99453
99496
 
99454
99497
  options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_METALLIC_ROUGHNESS");
99455
99498
 
99456
- switch (browser .getBrowserOption ("ToneMapping"))
99457
- {
99458
- default: // NONE
99459
- break;
99460
- case "ACES_NARKOWICZ":
99461
- case "ACES_HILL":
99462
- case "ACES_HILL_EXPOSURE_BOOST":
99463
- case "KHR_PBR_NEUTRAL":
99464
- options .push (`X3D_TONEMAP_${browser .getBrowserOption ("ToneMapping")}`);
99465
- break;
99466
- }
99467
-
99468
99499
  if (+this .getTextureBits ())
99469
99500
  {
99470
99501
  this .baseTextureNode ?.getShaderOptions (options, "BASE");
@@ -99472,7 +99503,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
99472
99503
  this .occlusionTextureNode ?.getShaderOptions (options, "OCCLUSION");
99473
99504
  }
99474
99505
 
99475
- const shaderNode = browser .createShader ("PBR", "Default", "PBR", options);
99506
+ const shaderNode = browser .createShader ("Physical", "Default", "Physical", options);
99476
99507
 
99477
99508
  browser .getShaders () .set (key, shaderNode);
99478
99509
 
@@ -100290,7 +100321,7 @@ x_ite_Namespace .add ("Shape", "x_ite/Components/Shape/Shape", Shape_default_);
100290
100321
 
100291
100322
  function TwoSidedMaterial (executionContext)
100292
100323
  {
100293
- console .warn ("TwoSidedMaterial is depreciated, please use Appearance backMaterial field.");
100324
+ console .warn ("TwoSidedMaterial is depreciated, please use Appearance backMaterial field instead.");
100294
100325
 
100295
100326
  Shape_X3DMaterialNode .call (this, executionContext);
100296
100327
 
@@ -106304,8 +106335,8 @@ const GifMedia_default_ = GifMedia;
106304
106335
  x_ite_Namespace .add ("GifMedia", "x_ite/Browser/Texturing/GifMedia", GifMedia_default_);
106305
106336
  /* harmony default export */ const Texturing_GifMedia = (GifMedia_default_);
106306
106337
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing/MovieTexture.js
106307
- /* provided dependency */ var MovieTexture_$ = __webpack_require__(749);
106308
- /* provided dependency */ var SuperGif = __webpack_require__(862);
106338
+ /* provided dependency */ var MovieTexture_$ = __webpack_require__(786);
106339
+ /* provided dependency */ var SuperGif = __webpack_require__(781);
106309
106340
  /*******************************************************************************
106310
106341
  *
106311
106342
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108960,6 +108991,27 @@ const Context =
108960
108991
  gl .drawArraysInstanced = ext .drawArraysInstancedANGLE .bind (ext);
108961
108992
  gl .drawElementsInstanced = ext .drawElementsInstancedANGLE .bind (ext);
108962
108993
  }
108994
+
108995
+ {
108996
+ const ext = gl .getExtension ("WEBGL_color_buffer_float");
108997
+
108998
+ gl .RGBA32F = ext .RGBA32F_EXT;
108999
+ }
109000
+
109001
+ {
109002
+ const ext = gl .getExtension ("WEBGL_draw_buffers");
109003
+
109004
+ gl .MAX_COLOR_ATTACHMENTS = ext .MAX_COLOR_ATTACHMENTS_WEBGL;
109005
+ gl .drawBuffers = ext .drawBuffersWEBGL .bind (ext);
109006
+
109007
+ for (let i = 0, length = gl .getParameter(gl .MAX_COLOR_ATTACHMENTS); i < length; ++ i)
109008
+ {
109009
+ const COLOR_ATTACHMENTi = ext .COLOR_ATTACHMENT0_WEBGL + i;
109010
+
109011
+ if (gl [`COLOR_ATTACHMENT${i}`] === undefined)
109012
+ gl [`COLOR_ATTACHMENT${i}`] = COLOR_ATTACHMENTi;
109013
+ }
109014
+ }
108963
109015
  }
108964
109016
  }
108965
109017
 
@@ -108994,106 +109046,20 @@ const Context =
108994
109046
  gl .HAS_FEATURE_DEPTH_TEXTURE = gl .getVersion () >= 2 || !! gl .getExtension ("WEBGL_depth_texture");
108995
109047
  gl .HAS_FEATURE_FRAG_DEPTH = gl .getVersion () >= 2 || !! gl .getExtension ("EXT_frag_depth");
108996
109048
 
108997
- if (gl .getVersion () === 1)
109049
+ if (mobile)
108998
109050
  {
108999
- const
109000
- color_buffer_float = gl .getExtension ("WEBGL_color_buffer_float"),
109001
- draw_buffers = gl .getExtension ("WEBGL_draw_buffers");
109002
-
109003
- gl .RGBA32F = color_buffer_float .RGBA32F_EXT;
109004
- gl .MAX_COLOR_ATTACHMENTS = draw_buffers .MAX_COLOR_ATTACHMENTS_WEBGL;
109005
- gl .drawBuffers = draw_buffers .drawBuffersWEBGL .bind (draw_buffers);
109006
-
109007
- for (let i = 0, length = gl .getParameter(gl .MAX_COLOR_ATTACHMENTS); i < length; ++ i)
109008
109051
  {
109009
- const COLOR_ATTACHMENTi = draw_buffers .COLOR_ATTACHMENT0_WEBGL + i;
109052
+ const ext = gl .getExtension ("EXT_color_buffer_half_float");
109010
109053
 
109011
- if (gl [`COLOR_ATTACHMENT${i}`] === undefined)
109012
- gl [`COLOR_ATTACHMENT${i}`] = COLOR_ATTACHMENTi;
109054
+ // Use defineProperty to overwrite property.
109055
+ Object .defineProperty (gl, "RGBA32F",
109056
+ {
109057
+ value: gl .getVersion () === 1 ? ext .RGBA16F_EXT : gl .RGBA16F,
109058
+ enumerable: true,
109059
+ });
109013
109060
  }
109014
109061
  }
109015
109062
 
109016
- if (mobile)
109017
- {
109018
- const color_buffer_half_float = gl .getExtension ("EXT_color_buffer_half_float");
109019
-
109020
- Object .defineProperty (gl, "RGBA32F",
109021
- {
109022
- value: gl .getVersion () === 1 ? color_buffer_half_float .RGBA16F_EXT : gl .RGBA16F,
109023
- });
109024
- }
109025
-
109026
- // // Async functions, DOES'NT WORK WELL WITH OPERA!!!
109027
-
109028
- // Object .assign (gl, gl .getVersion () === 1
109029
- // ?
109030
- // {
109031
- // readPixelsAsync: gl .readPixels,
109032
- // }
109033
- // :
109034
- // {
109035
- // clientWaitAsync (sync, flags, timeout)
109036
- // {
109037
- // return new Promise ((resolve, reject) =>
109038
- // {
109039
- // const check = () =>
109040
- // {
109041
- // const result = this .clientWaitSync (sync, flags, 0);
109042
-
109043
- // switch (result)
109044
- // {
109045
- // case this .WAIT_FAILED:
109046
- // {
109047
- // reject (new Error ("clientWaitSync: WAIT_FAILED"));
109048
- // return;
109049
- // }
109050
- // case this .TIMEOUT_EXPIRED:
109051
- // {
109052
- // setTimeout (check, timeout);
109053
- // return;
109054
- // }
109055
- // default:
109056
- // {
109057
- // resolve ();
109058
- // return;
109059
- // }
109060
- // }
109061
- // };
109062
-
109063
- // setTimeout (check);
109064
- // });
109065
- // },
109066
- // async getBufferSubDataAsync (target, buffer, srcByteOffset, dstBuffer, /* optional */ dstOffset, /* optional */ length)
109067
- // {
109068
- // const sync = this .fenceSync (this .SYNC_GPU_COMMANDS_COMPLETE, 0);
109069
-
109070
- // this .flush ();
109071
-
109072
- // await this .clientWaitAsync (sync, 0, 10);
109073
-
109074
- // this .deleteSync (sync);
109075
-
109076
- // this .bindBuffer (target, buffer);
109077
- // this .getBufferSubData (target, srcByteOffset, dstBuffer, dstOffset, length);
109078
- // this .bindBuffer (target, null);
109079
- // },
109080
- // async readPixelsAsync (x, y, w, h, format, type, dest, dstOffset)
109081
- // {
109082
- // const buffer = this .createBuffer ();
109083
-
109084
- // this .bindBuffer (this .PIXEL_PACK_BUFFER, buffer);
109085
- // this .bufferData (this .PIXEL_PACK_BUFFER, dest .byteLength, this .STREAM_READ);
109086
- // this .readPixels (x, y, w, h, format, type, 0);
109087
- // this .bindBuffer (this .PIXEL_PACK_BUFFER, null);
109088
-
109089
- // await this .getBufferSubDataAsync (this .PIXEL_PACK_BUFFER, buffer, 0, dest, dstOffset);
109090
-
109091
- // this .deleteBuffer (buffer);
109092
- // },
109093
- // });
109094
-
109095
- // Return context.
109096
-
109097
109063
  return gl;
109098
109064
  },
109099
109065
  }
@@ -109702,7 +109668,7 @@ const gettext_default_ = (string) => locale .get (string) || string;
109702
109668
  x_ite_Namespace .add ("gettext", "locale/gettext", gettext_default_);
109703
109669
  /* harmony default export */ const gettext = (gettext_default_);
109704
109670
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserTimings.js
109705
- /* provided dependency */ var BrowserTimings_$ = __webpack_require__(749);
109671
+ /* provided dependency */ var BrowserTimings_$ = __webpack_require__(786);
109706
109672
  /*******************************************************************************
109707
109673
  *
109708
109674
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110275,7 +110241,7 @@ const TextureQuality_default_ = TextureQuality;
110275
110241
  x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", TextureQuality_default_);
110276
110242
  /* harmony default export */ const Core_TextureQuality = (TextureQuality_default_);
110277
110243
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/BrowserOptions.js
110278
- /* provided dependency */ var BrowserOptions_$ = __webpack_require__(749);
110244
+ /* provided dependency */ var BrowserOptions_$ = __webpack_require__(786);
110279
110245
  /*******************************************************************************
110280
110246
  *
110281
110247
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110333,6 +110299,8 @@ x_ite_Namespace .add ("TextureQuality", "x_ite/Browser/Core/TextureQuality", Tex
110333
110299
 
110334
110300
 
110335
110301
 
110302
+ // https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/networking.html#BrowserProperties
110303
+
110336
110304
  function BrowserOptions (executionContext)
110337
110305
  {
110338
110306
  Base_X3DBaseNode .call (this, executionContext);
@@ -110361,27 +110329,27 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110361
110329
  Timings: this ._Timings .getValue (),
110362
110330
  });
110363
110331
 
110364
- this ._Rubberband .addInterest ("set_rubberband__", this);
110365
- this ._Antialiased .addInterest ("set_antialiased__", this);
110366
- this ._PrimitiveQuality .addInterest ("set_primitiveQuality__", this);
110367
- this ._TextureQuality .addInterest ("set_textureQuality__", this);
110368
- this ._Shading .addInterest ("set_shading__", this);
110369
- this ._StraightenHorizon .addInterest ("set_straightenHorizon__", this);
110370
- this ._AutoUpdate .addInterest ("set_autoUpdate__", this);
110371
- this ._ContentScale .addInterest ("set_contentScale__", this);
110372
- this ._Exposure .addInterest ("set_exposure__", this);
110373
- this ._LogarithmicDepthBuffer .addInterest ("set_logarithmicDepthBuffer__", this);
110374
- this ._Multisampling .addInterest ("set_multisampling__", this);
110375
- this ._OrderIndependentTransparency .addInterest ("set_orderIndependentTransparency__", this);
110376
- this ._Timings .addInterest ("set_timings__", this);
110377
-
110378
- this .set_antialiased__ (this ._Antialiased);
110379
- this .set_shading__ (this ._Shading);
110380
- this .set_contentScale__ (this ._ContentScale);
110381
- this .set_exposure__ (this ._Exposure);
110382
- this .set_logarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
110383
- this .set_multisampling__ (this ._Multisampling);
110384
- this .set_orderIndependentTransparency__ (this ._OrderIndependentTransparency);
110332
+ this ._Rubberband .addInterest ("set_Rubberband__", this);
110333
+ this ._Antialiased .addInterest ("set_Antialiased__", this);
110334
+ this ._PrimitiveQuality .addInterest ("set_PrimitiveQuality__", this);
110335
+ this ._TextureQuality .addInterest ("set_TextureQuality__", this);
110336
+ this ._Shading .addInterest ("set_Shading__", this);
110337
+ this ._StraightenHorizon .addInterest ("set_StraightenHorizon__", this);
110338
+ this ._AutoUpdate .addInterest ("set_AutoUpdate__", this);
110339
+ this ._ContentScale .addInterest ("set_ContentScale__", this);
110340
+ this ._Exposure .addInterest ("set_Exposure__", this);
110341
+ this ._LogarithmicDepthBuffer .addInterest ("set_LogarithmicDepthBuffer__", this);
110342
+ this ._Multisampling .addInterest ("set_Multisampling__", this);
110343
+ this ._OrderIndependentTransparency .addInterest ("set_OrderIndependentTransparency__", this);
110344
+ this ._Timings .addInterest ("set_Timings__", this);
110345
+
110346
+ this .set_Antialiased__ (this ._Antialiased);
110347
+ this .set_Shading__ (this ._Shading);
110348
+ this .set_ContentScale__ (this ._ContentScale);
110349
+ this .set_Exposure__ (this ._Exposure);
110350
+ this .set_LogarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
110351
+ this .set_Multisampling__ (this ._Multisampling);
110352
+ this .set_OrderIndependentTransparency__ (this ._OrderIndependentTransparency);
110385
110353
 
110386
110354
  this .reset ();
110387
110355
  },
@@ -110391,6 +110359,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110391
110359
  "Antialiased",
110392
110360
  "AutoUpdate",
110393
110361
  "Cache",
110362
+ "ColorSpace",
110394
110363
  "ContentScale",
110395
110364
  "ContextMenu",
110396
110365
  "Debug",
@@ -110469,15 +110438,15 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110469
110438
  {
110470
110439
  return this .textureQuality;
110471
110440
  },
110472
- set_rubberband__ (rubberband)
110441
+ set_Rubberband__ (rubberband)
110473
110442
  {
110474
110443
  this .localStorage .Rubberband = rubberband .getValue ();
110475
110444
  },
110476
- set_antialiased__ ()
110445
+ set_Antialiased__ ()
110477
110446
  {
110478
- this .set_multisampling__ (this ._Multisampling);
110447
+ this .set_Multisampling__ (this ._Multisampling);
110479
110448
  },
110480
- set_primitiveQuality__ (value)
110449
+ set_PrimitiveQuality__ (value)
110481
110450
  {
110482
110451
  const
110483
110452
  browser = this .getBrowser (),
@@ -110492,7 +110461,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110492
110461
  if (typeof browser .setPrimitiveQuality3D === "function")
110493
110462
  browser .setPrimitiveQuality3D (this .primitiveQuality);
110494
110463
  },
110495
- set_textureQuality__ (value)
110464
+ set_TextureQuality__ (value)
110496
110465
  {
110497
110466
  const
110498
110467
  browser = this .getBrowser (),
@@ -110504,7 +110473,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110504
110473
  if (typeof browser .setTextureQuality === "function")
110505
110474
  browser .setTextureQuality (this .textureQuality);
110506
110475
  },
110507
- set_shading__: (() =>
110476
+ set_Shading__: (() =>
110508
110477
  {
110509
110478
  const strings = {
110510
110479
  [Core_Shading .POINT]: "POINT",
@@ -110526,14 +110495,14 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110526
110495
  browser .setShading (this .shading);
110527
110496
  };
110528
110497
  })(),
110529
- set_straightenHorizon__ (straightenHorizon)
110498
+ set_StraightenHorizon__ (straightenHorizon)
110530
110499
  {
110531
110500
  this .localStorage .StraightenHorizon = straightenHorizon .getValue ();
110532
110501
 
110533
110502
  if (straightenHorizon .getValue ())
110534
110503
  this .getBrowser () .getActiveLayer () ?.straightenView ();
110535
110504
  },
110536
- set_autoUpdate__ (autoUpdate)
110505
+ set_AutoUpdate__ (autoUpdate)
110537
110506
  {
110538
110507
  const events = ["resize", "scroll", "load"]
110539
110508
  .map (event => `${event}.${this .getTypeName ()}${this .getId ()}`)
@@ -110567,7 +110536,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110567
110536
  BrowserOptions_$(window) .off (events);
110568
110537
  }
110569
110538
  },
110570
- set_contentScale__ (contentScale)
110539
+ set_ContentScale__ (contentScale)
110571
110540
  {
110572
110541
  const browser = this .getBrowser ();
110573
110542
 
@@ -110599,7 +110568,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110599
110568
 
110600
110569
  browser .reshape ();
110601
110570
  },
110602
- set_exposure__ ()
110571
+ set_Exposure__ ()
110603
110572
  {
110604
110573
  const
110605
110574
  browser = this .getBrowser (),
@@ -110612,7 +110581,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110612
110581
  gl .uniform1f (shaderNode .x3d_Exposure, exposure);
110613
110582
  }
110614
110583
  },
110615
- set_logarithmicDepthBuffer__ (logarithmicDepthBuffer)
110584
+ set_LogarithmicDepthBuffer__ (logarithmicDepthBuffer)
110616
110585
  {
110617
110586
  const
110618
110587
  browser = this .getBrowser (),
@@ -110620,7 +110589,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110620
110589
 
110621
110590
  browser .getRenderingProperties () ._LogarithmicDepthBuffer = logarithmicDepthBuffer .getValue () && gl .HAS_FEATURE_FRAG_DEPTH;
110622
110591
  },
110623
- set_multisampling__ (multisampling)
110592
+ set_Multisampling__ (multisampling)
110624
110593
  {
110625
110594
  const
110626
110595
  browser = this .getBrowser (),
@@ -110631,11 +110600,11 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
110631
110600
 
110632
110601
  browser .reshape ();
110633
110602
  },
110634
- set_orderIndependentTransparency__ ()
110603
+ set_OrderIndependentTransparency__ ()
110635
110604
  {
110636
110605
  this .getBrowser () .reshape ();
110637
110606
  },
110638
- set_timings__ (timings)
110607
+ set_Timings__ (timings)
110639
110608
  {
110640
110609
  this .localStorage .Timings = timings .getValue ();
110641
110610
  },
@@ -110661,10 +110630,12 @@ Object .defineProperties (BrowserOptions,
110661
110630
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "QualityWhenMoving", new x_ite_Fields .SFString ("SAME")),
110662
110631
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Shading", new x_ite_Fields .SFString ("GOURAUD")),
110663
110632
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "MotionBlur", new x_ite_Fields .SFBool ()),
110633
+ // Additional options:
110664
110634
  // Always update geometries, even if browser is not live.
110665
110635
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "AlwaysUpdateGeometries", new x_ite_Fields .SFBool ()),
110666
110636
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "AutoUpdate", new x_ite_Fields .SFBool ()),
110667
110637
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Cache", new x_ite_Fields .SFBool (true)),
110638
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ColorSpace", new x_ite_Fields .SFString ("LINEAR_WHEN_PHYSICAL_MATERIAL")),
110668
110639
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ContentScale", new x_ite_Fields .SFDouble (1)),
110669
110640
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "ContextMenu", new x_ite_Fields .SFBool (true)),
110670
110641
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "Debug", new x_ite_Fields .SFBool ()),
@@ -110891,7 +110862,7 @@ const RenderingProperties_default_ = RenderingProperties;
110891
110862
  x_ite_Namespace .add ("RenderingProperties", "x_ite/Browser/Core/RenderingProperties", RenderingProperties_default_);
110892
110863
  /* harmony default export */ const Core_RenderingProperties = (RenderingProperties_default_);
110893
110864
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/Notification.js
110894
- /* provided dependency */ var Notification_$ = __webpack_require__(749);
110865
+ /* provided dependency */ var Notification_$ = __webpack_require__(786);
110895
110866
  /*******************************************************************************
110896
110867
  *
110897
110868
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111014,8 +110985,8 @@ const Notification_default_ = Notification;
111014
110985
  x_ite_Namespace .add ("Notification", "x_ite/Browser/Core/Notification", Notification_default_);
111015
110986
  /* harmony default export */ const Core_Notification = (Notification_default_);
111016
110987
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/ContextMenu.js
111017
- /* provided dependency */ var jquery_fullscreen = __webpack_require__(653);
111018
- /* provided dependency */ var ContextMenu_$ = __webpack_require__(749);
110988
+ /* provided dependency */ var jquery_fullscreen = __webpack_require__(810);
110989
+ /* provided dependency */ var ContextMenu_$ = __webpack_require__(786);
111019
110990
  /*******************************************************************************
111020
110991
  *
111021
110992
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113768,7 +113739,7 @@ const DataStorage_default_ = DataStorage;
113768
113739
  x_ite_Namespace .add ("DataStorage", "standard/Utility/DataStorage", DataStorage_default_);
113769
113740
  /* harmony default export */ const Utility_DataStorage = (DataStorage_default_);
113770
113741
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Core/X3DCoreContext.js
113771
- /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(749);
113742
+ /* provided dependency */ var X3DCoreContext_$ = __webpack_require__(786);
113772
113743
  /*******************************************************************************
113773
113744
  *
113774
113745
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114076,6 +114047,12 @@ Object .assign (X3DCoreContext .prototype,
114076
114047
  this .setBrowserOption ("Cache", this .parseBooleanAttribute (newValue, true));
114077
114048
  break;
114078
114049
  }
114050
+ case "colorSpace":
114051
+ case "colorspace":
114052
+ {
114053
+ this .setBrowserOption ("ColorSpace", newValue);
114054
+ break;
114055
+ }
114079
114056
  case "contentScale":
114080
114057
  case "contentscale":
114081
114058
  {
@@ -116342,8 +116319,8 @@ const X3DViewer_default_ = X3DViewer;
116342
116319
  x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DViewer_default_);
116343
116320
  /* harmony default export */ const Navigation_X3DViewer = (X3DViewer_default_);
116344
116321
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/ExamineViewer.js
116345
- /* provided dependency */ var jquery_mousewheel = __webpack_require__(189);
116346
- /* provided dependency */ var ExamineViewer_$ = __webpack_require__(749);
116322
+ /* provided dependency */ var jquery_mousewheel = __webpack_require__(832);
116323
+ /* provided dependency */ var ExamineViewer_$ = __webpack_require__(786);
116347
116324
  /*******************************************************************************
116348
116325
  *
116349
116326
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116406,12 +116383,14 @@ x_ite_Namespace .add ("X3DViewer", "x_ite/Browser/Navigation/X3DViewer", X3DView
116406
116383
 
116407
116384
  typeof jquery_mousewheel; // import plugin
116408
116385
 
116409
- const macOS = /Mac OS X/i .test (navigator .userAgent);
116386
+ const
116387
+ macOS = /Mac OS X/i .test (navigator .userAgent),
116388
+ mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
116410
116389
 
116411
116390
  const
116412
- SPIN_RELEASE_TIME = 20,
116413
- SPIN_ANGLE = Math_Algorithm .radians (2),
116414
- SPIN_FACTOR = 0.4,
116391
+ SPIN_RELEASE_TIME = mobile ? 20 : 25,
116392
+ SPIN_ANGLE = Math_Algorithm .radians (mobile ? 3 : 2),
116393
+ SPIN_FACTOR = mobile ? 0.2 : 0.3,
116415
116394
  SCROLL_FACTOR = macOS ? 1 / 120 : 1 / 20,
116416
116395
  MOVE_TIME = 0.2,
116417
116396
  ROTATE_TIME = 0.2,
@@ -117257,8 +117236,8 @@ const ExamineViewer_default_ = ExamineViewer;
117257
117236
  x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer", ExamineViewer_default_);
117258
117237
  /* harmony default export */ const Navigation_ExamineViewer = (ExamineViewer_default_);
117259
117238
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/X3DFlyViewer.js
117260
- /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(189);
117261
- /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(749);
117239
+ /* provided dependency */ var X3DFlyViewer_jquery_mousewheel = __webpack_require__(832);
117240
+ /* provided dependency */ var X3DFlyViewer_$ = __webpack_require__(786);
117262
117241
  /*******************************************************************************
117263
117242
  *
117264
117243
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117315,6 +117294,7 @@ x_ite_Namespace .add ("ExamineViewer", "x_ite/Browser/Navigation/ExamineViewer",
117315
117294
 
117316
117295
 
117317
117296
 
117297
+
117318
117298
  typeof X3DFlyViewer_jquery_mousewheel; // import plugin
117319
117299
 
117320
117300
  const X3DFlyViewer_macOS = /Mac OS X/i .test (navigator .userAgent)
@@ -117354,7 +117334,12 @@ function X3DFlyViewer (executionContext, navigationInfo)
117354
117334
  this .lineVertexBuffer = gl .createBuffer ();
117355
117335
  this .lineVertexArrayObject = new Rendering_VertexArray (gl);
117356
117336
  this .lineVertexArray = new Float32Array (8 * 4) .fill (1);
117357
- this .geometryContext = new Rendering_GeometryContext ({ geometryType: 2, colorMaterial: true });
117337
+
117338
+ this .geometryContext = new Rendering_GeometryContext ({
117339
+ renderObject: this .getActiveLayer (),
117340
+ geometryType: 2,
117341
+ colorMaterial: true,
117342
+ });
117358
117343
 
117359
117344
  gl .bindBuffer (gl .ELEMENT_ARRAY_BUFFER, this .lineIndexBuffer);
117360
117345
  gl .bufferData (gl .ELEMENT_ARRAY_BUFFER, new Uint8Array ([0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7]), gl .STATIC_DRAW);
@@ -118267,8 +118252,8 @@ const FlyViewer_default_ = FlyViewer;
118267
118252
  x_ite_Namespace .add ("FlyViewer", "x_ite/Browser/Navigation/FlyViewer", FlyViewer_default_);
118268
118253
  /* harmony default export */ const Navigation_FlyViewer = (FlyViewer_default_);
118269
118254
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/PlaneViewer.js
118270
- /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(189);
118271
- /* provided dependency */ var PlaneViewer_$ = __webpack_require__(749);
118255
+ /* provided dependency */ var PlaneViewer_jquery_mousewheel = __webpack_require__(832);
118256
+ /* provided dependency */ var PlaneViewer_$ = __webpack_require__(786);
118272
118257
  /*******************************************************************************
118273
118258
  *
118274
118259
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118599,8 +118584,8 @@ const NoneViewer_default_ = NoneViewer;
118599
118584
  x_ite_Namespace .add ("NoneViewer", "x_ite/Browser/Navigation/NoneViewer", NoneViewer_default_);
118600
118585
  /* harmony default export */ const Navigation_NoneViewer = (NoneViewer_default_);
118601
118586
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Navigation/LookAtViewer.js
118602
- /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(189);
118603
- /* provided dependency */ var LookAtViewer_$ = __webpack_require__(749);
118587
+ /* provided dependency */ var LookAtViewer_jquery_mousewheel = __webpack_require__(832);
118588
+ /* provided dependency */ var LookAtViewer_$ = __webpack_require__(786);
118604
118589
  /*******************************************************************************
118605
118590
  *
118606
118591
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119740,8 +119725,8 @@ const X3DPickingContext_default_ = X3DPickingContext;
119740
119725
  x_ite_Namespace .add ("X3DPickingContext", "x_ite/Browser/Picking/X3DPickingContext", X3DPickingContext_default_);
119741
119726
  /* harmony default export */ const Picking_X3DPickingContext = (X3DPickingContext_default_);
119742
119727
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js
119743
- /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(189);
119744
- /* provided dependency */ var PointingDevice_$ = __webpack_require__(749);
119728
+ /* provided dependency */ var PointingDevice_jquery_mousewheel = __webpack_require__(832);
119729
+ /* provided dependency */ var PointingDevice_$ = __webpack_require__(786);
119745
119730
  /*******************************************************************************
119746
119731
  *
119747
119732
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121045,7 +121030,7 @@ const MultiSampleFrameBuffer_default_ = MultiSampleFrameBuffer;
121045
121030
  x_ite_Namespace .add ("MultiSampleFrameBuffer", "x_ite/Rendering/MultiSampleFrameBuffer", MultiSampleFrameBuffer_default_);
121046
121031
  /* harmony default export */ const Rendering_MultiSampleFrameBuffer = (MultiSampleFrameBuffer_default_);
121047
121032
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Rendering/X3DRenderingContext.js
121048
- /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(749);
121033
+ /* provided dependency */ var X3DRenderingContext_$ = __webpack_require__(786);
121049
121034
  /*******************************************************************************
121050
121035
  *
121051
121036
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121330,28 +121315,30 @@ Object .assign (X3DRenderingContext .prototype,
121330
121315
  width = Math .max (canvas .width () * contentScale, 1),
121331
121316
  height = Math .max (canvas .height () * contentScale, 1);
121332
121317
 
121318
+ this .addBrowserEvent ();
121319
+
121333
121320
  canvas .prop ("width", width);
121334
121321
  canvas .prop ("height", height);
121335
121322
 
121336
121323
  this [_viewport] [2] = width;
121337
121324
  this [_viewport] [3] = height;
121338
121325
 
121339
- if (width !== this [_frameBuffer] .getWidth () ||
121340
- height !== this [_frameBuffer] .getHeight () ||
121341
- samples !== this [_frameBuffer] .getSamples () ||
121342
- oit !== this [_frameBuffer] .getOIT ())
121326
+ if (width === this [_frameBuffer] .getWidth () &&
121327
+ height === this [_frameBuffer] .getHeight () &&
121328
+ samples === this [_frameBuffer] .getSamples () &&
121329
+ oit === this [_frameBuffer] .getOIT ())
121343
121330
  {
121344
- this [_frameBuffer] .dispose ();
121345
- this [_frameBuffer] = new Rendering_MultiSampleFrameBuffer (this, width, height, samples, oit);
121346
-
121347
- if (this [_transmissionBuffer])
121348
- {
121349
- this [_transmissionBuffer] .dispose ();
121350
- this [_transmissionBuffer] = new Rendering_TextureBuffer (this, width, height, false, true);
121351
- }
121331
+ return;
121352
121332
  }
121353
121333
 
121354
- this .addBrowserEvent ();
121334
+ this [_frameBuffer] .dispose ();
121335
+ this [_frameBuffer] = new Rendering_MultiSampleFrameBuffer (this, width, height, samples, oit);
121336
+
121337
+ if (!this [_transmissionBuffer])
121338
+ return;
121339
+
121340
+ this [_transmissionBuffer] .dispose ();
121341
+ this [_transmissionBuffer] = new Rendering_TextureBuffer (this, width, height, false, true);
121355
121342
  },
121356
121343
  onfullscreen ()
121357
121344
  {
@@ -121610,7 +121597,7 @@ Object .assign (X3DShadersContext .prototype,
121610
121597
  vertexShader .setup ();
121611
121598
 
121612
121599
  const fragmentShader = new Shaders_ShaderPart (this .getPrivateScene ());
121613
- fragmentShader ._type = "FRAGMENT";
121600
+ fragmentShader ._type = "FRAGMENT";
121614
121601
  fragmentShader ._url .push (encodeURI (fs .startsWith ("data:") ? fs : "data:x-shader/x-fragment," + Shaders_ShaderRegistry .fragment [version] [fs]));
121615
121602
  fragmentShader .setPrivate (true);
121616
121603
  fragmentShader .setName (`${name}FragmentShader`);
@@ -122020,7 +122007,7 @@ const X3DSoundContext_default_ = X3DSoundContext;
122020
122007
  x_ite_Namespace .add ("X3DSoundContext", "x_ite/Browser/Sound/X3DSoundContext", X3DSoundContext_default_);
122021
122008
  /* harmony default export */ const Sound_X3DSoundContext = (X3DSoundContext_default_);
122022
122009
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing/KTXDecoder.js
122023
- /* provided dependency */ var KTXDecoder_$ = __webpack_require__(749);
122010
+ /* provided dependency */ var KTXDecoder_$ = __webpack_require__(786);
122024
122011
  const KTXDecoder_default_ = class KTXDecoder
122025
122012
  {
122026
122013
  constructor (gl, externalKtxlib, scriptDir)
@@ -123611,7 +123598,7 @@ const Components_default_ = Components;
123611
123598
  x_ite_Namespace .add ("Components", "x_ite/Components", Components_default_);
123612
123599
  /* harmony default export */ const x_ite_Components = ((/* unused pure expression or super */ null && (Components_default_)));
123613
123600
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/DOMIntegration.js
123614
- /* provided dependency */ var DOMIntegration_$ = __webpack_require__(749);
123601
+ /* provided dependency */ var DOMIntegration_$ = __webpack_require__(786);
123615
123602
  /*******************************************************************************
123616
123603
  * MIT License
123617
123604
  *
@@ -124879,7 +124866,7 @@ const FieldTypes_default_ = new Configuration_FieldTypesArray (Object .values (x
124879
124866
  x_ite_Namespace .add ("FieldTypes", "x_ite/Configuration/FieldTypes", FieldTypes_default_);
124880
124867
  /* harmony default export */ const FieldTypes = (FieldTypes_default_);
124881
124868
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/X3DBrowser.js
124882
- /* provided dependency */ var X3DBrowser_$ = __webpack_require__(749);
124869
+ /* provided dependency */ var X3DBrowser_$ = __webpack_require__(786);
124883
124870
  /*******************************************************************************
124884
124871
  *
124885
124872
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125981,7 +125968,7 @@ const X3DBrowser_default_ = X3DBrowser;
125981
125968
  x_ite_Namespace .add ("X3DBrowser", "x_ite/Browser/X3DBrowser", X3DBrowser_default_);
125982
125969
  /* harmony default export */ const Browser_X3DBrowser = (X3DBrowser_default_);
125983
125970
  ;// CONCATENATED MODULE: ./src/x_ite/X3DCanvasElement.js
125984
- /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(749);
125971
+ /* provided dependency */ var X3DCanvasElement_$ = __webpack_require__(786);
125985
125972
  /*******************************************************************************
125986
125973
  *
125987
125974
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126063,6 +126050,8 @@ class X3DCanvasElement extends HTMLElement
126063
126050
  "baseURL",
126064
126051
  "baseurl",
126065
126052
  "cache",
126053
+ "colorSpace",
126054
+ "colorspace",
126066
126055
  "contentScale",
126067
126056
  "contentscale",
126068
126057
  "contextMenu",
@@ -126123,8 +126112,8 @@ const X3DCanvasElement_default_ = X3DCanvasElement;
126123
126112
  x_ite_Namespace .add ("X3DCanvasElement", "x_ite/X3DCanvasElement", X3DCanvasElement_default_);
126124
126113
  /* harmony default export */ const x_ite_X3DCanvasElement = (X3DCanvasElement_default_);
126125
126114
  ;// CONCATENATED MODULE: ./src/lib/jquery.js
126126
- /* provided dependency */ var jquery_$ = __webpack_require__(749);
126127
- /* provided dependency */ var pako = __webpack_require__(481);
126115
+ /* provided dependency */ var jquery_$ = __webpack_require__(786);
126116
+ /* provided dependency */ var pako = __webpack_require__(826);
126128
126117
  Object .assign (jquery_$,
126129
126118
  {
126130
126119
  decodeText (input)
@@ -126201,14 +126190,14 @@ const jquery_default_ = jquery_$;
126201
126190
  x_ite_Namespace .add ("jquery", "lib/jquery", jquery_default_);
126202
126191
  /* harmony default export */ const jquery = ((/* unused pure expression or super */ null && (jquery_default_)));
126203
126192
  ;// CONCATENATED MODULE: ./src/lib/libtess.js
126204
- /* provided dependency */ var libtess_libtess = __webpack_require__(382);
126193
+ /* provided dependency */ var libtess_libtess = __webpack_require__(315);
126205
126194
  const libtess_default_ = libtess_libtess;
126206
126195
  ;
126207
126196
 
126208
126197
  x_ite_Namespace .add ("libtess", "lib/libtess", libtess_default_);
126209
126198
  /* harmony default export */ const lib_libtess = ((/* unused pure expression or super */ null && (libtess_default_)));
126210
126199
  ;// CONCATENATED MODULE: ./src/x_ite/X3D.js
126211
- /* provided dependency */ var X3D_$ = __webpack_require__(749);
126200
+ /* provided dependency */ var X3D_$ = __webpack_require__(786);
126212
126201
  /*******************************************************************************
126213
126202
  *
126214
126203
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126516,7 +126505,7 @@ Object .assign (X3D,
126516
126505
 
126517
126506
  // Assign X3D to global namespace.
126518
126507
 
126519
- window [Symbol .for ("X_ITE.X3D-10.0.0")] = x_ite_X3D;
126508
+ window [Symbol .for ("X_ITE.X3D-10.0.2")] = x_ite_X3D;
126520
126509
 
126521
126510
  customElements .define ("x3d-canvas", x_ite_X3DCanvasElement);
126522
126511