x_ite 10.0.5 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +26 -23
  2. package/dist/X3DUOM.xml +69 -11
  3. package/dist/assets/components/Annotation.js +13 -13
  4. package/dist/assets/components/Annotation.min.js +1 -1
  5. package/dist/assets/components/CADGeometry.js +16 -16
  6. package/dist/assets/components/CADGeometry.min.js +1 -1
  7. package/dist/assets/components/CubeMapTexturing.js +39 -27
  8. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  9. package/dist/assets/components/DIS.js +13 -13
  10. package/dist/assets/components/DIS.min.js +1 -1
  11. package/dist/assets/components/EventUtilities.js +9 -9
  12. package/dist/assets/components/EventUtilities.min.js +1 -1
  13. package/dist/assets/components/Geometry2D.js +51 -35
  14. package/dist/assets/components/Geometry2D.min.js +1 -1
  15. package/dist/assets/components/Geospatial.js +34 -34
  16. package/dist/assets/components/Geospatial.min.js +1 -1
  17. package/dist/assets/components/HAnim.js +23 -23
  18. package/dist/assets/components/HAnim.min.js +1 -1
  19. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  20. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  21. package/dist/assets/components/Layout.js +61 -46
  22. package/dist/assets/components/Layout.min.js +1 -1
  23. package/dist/assets/components/NURBS.js +25 -25
  24. package/dist/assets/components/NURBS.min.js +1 -1
  25. package/dist/assets/components/ParticleSystems.js +26 -26
  26. package/dist/assets/components/ParticleSystems.min.js +1 -1
  27. package/dist/assets/components/Picking.js +18 -18
  28. package/dist/assets/components/Picking.min.js +1 -1
  29. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  30. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  31. package/dist/assets/components/Scripting.js +38 -38
  32. package/dist/assets/components/Scripting.min.js +1 -1
  33. package/dist/assets/components/Text.js +287 -215
  34. package/dist/assets/components/Text.min.js +1 -1
  35. package/dist/assets/components/TextureProjection.js +15 -15
  36. package/dist/assets/components/TextureProjection.min.js +1 -1
  37. package/dist/assets/components/Texturing3D.js +28 -28
  38. package/dist/assets/components/Texturing3D.min.js +1 -1
  39. package/dist/assets/components/VolumeRendering.js +19 -19
  40. package/dist/assets/components/VolumeRendering.min.js +1 -1
  41. package/dist/assets/components/X_ITE.js +1254 -1053
  42. package/dist/assets/components/X_ITE.min.js +1 -1
  43. package/dist/assets/fonts/PT_Sans/OFL.txt +94 -0
  44. package/dist/assets/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
  45. package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
  46. package/dist/assets/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
  47. package/dist/assets/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
  48. package/dist/assets/lib/mikktspace_bg.wasm +0 -0
  49. package/dist/example.html +1 -1
  50. package/dist/x_ite.css +1 -1
  51. package/dist/x_ite.d.ts +60 -11
  52. package/dist/x_ite.js +1006 -683
  53. package/dist/x_ite.min.js +1 -1
  54. package/dist/x_ite.min.mjs +1 -1
  55. package/dist/x_ite.mjs +1006 -683
  56. package/dist/x_ite.zip +0 -0
  57. package/package.json +1 -1
  58. /package/dist/assets/fonts/{DroidSerif Apache License.txt → Droid/DroidSerif Apache License.txt} +0 -0
  59. /package/dist/assets/fonts/{DroidSerif-Bold.ttf → Droid/DroidSerif-Bold.ttf} +0 -0
  60. /package/dist/assets/fonts/{DroidSerif-BoldItalic.ttf → Droid/DroidSerif-BoldItalic.ttf} +0 -0
  61. /package/dist/assets/fonts/{DroidSerif-Italic.ttf → Droid/DroidSerif-Italic.ttf} +0 -0
  62. /package/dist/assets/fonts/{DroidSerif-Regular.ttf → Droid/DroidSerif-Regular.ttf} +0 -0
  63. /package/dist/assets/fonts/{Ubuntu LICENCE.txt → Ubuntu/Ubuntu LICENCE.txt} +0 -0
  64. /package/dist/assets/fonts/{Ubuntu-B.ttf → Ubuntu/Ubuntu-B.ttf} +0 -0
  65. /package/dist/assets/fonts/{Ubuntu-BI.ttf → Ubuntu/Ubuntu-BI.ttf} +0 -0
  66. /package/dist/assets/fonts/{Ubuntu-R.ttf → Ubuntu/Ubuntu-R.ttf} +0 -0
  67. /package/dist/assets/fonts/{Ubuntu-RI.ttf → Ubuntu/Ubuntu-RI.ttf} +0 -0
  68. /package/dist/assets/fonts/{UbuntuMono-B.ttf → Ubuntu/UbuntuMono-B.ttf} +0 -0
  69. /package/dist/assets/fonts/{UbuntuMono-BI.ttf → Ubuntu/UbuntuMono-BI.ttf} +0 -0
  70. /package/dist/assets/fonts/{UbuntuMono-R.ttf → Ubuntu/UbuntuMono-R.ttf} +0 -0
  71. /package/dist/assets/fonts/{UbuntuMono-RI.ttf → Ubuntu/UbuntuMono-RI.ttf} +0 -0
@@ -1,4 +1,4 @@
1
- /* X_ITE v10.0.5 */(() => { // webpackBootstrap
1
+ /* X_ITE v10.2.0 */(() => { // webpackBootstrap
2
2
  /******/ "use strict";
3
3
  /******/ // The require scope
4
4
  /******/ var __webpack_require__ = {};
@@ -38,27 +38,30 @@
38
38
  // UNUSED EXPORTS: default
39
39
 
40
40
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
41
- const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Components");
41
+ const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components");
42
42
  var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
43
43
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
44
- const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Fields");
44
+ const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Fields");
45
45
  var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
46
46
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
47
- const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Base/X3DFieldDefinition");
47
+ const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/X3DFieldDefinition");
48
48
  var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
49
49
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
50
- const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Base/FieldDefinitionArray");
50
+ const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/FieldDefinitionArray");
51
51
  var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
52
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DAppearanceChildNode\")"
53
- const X3DAppearanceChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Components/Shape/X3DAppearanceChildNode");
54
- var X3DAppearanceChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DAppearanceChildNode_namespaceObject);
52
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DNode\")"
53
+ const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components/Core/X3DNode");
54
+ var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
55
55
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
56
- const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Base/X3DConstants");
56
+ const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/X3DConstants");
57
57
  var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
58
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Utility/BitSet\")"
59
+ const BitSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Utility/BitSet");
60
+ var BitSet_default = /*#__PURE__*/__webpack_require__.n(BitSet_namespaceObject);
58
61
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
59
- const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Namespace");
62
+ const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Namespace");
60
63
  var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
61
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/BlendMode.js
64
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/X3DMaterialExtensionNode.js
62
65
  /*******************************************************************************
63
66
  *
64
67
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110,118 +113,35 @@ var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceOb
110
113
 
111
114
 
112
115
 
113
-
114
-
115
- /**
116
- * THIS NODE IS STILL EXPERIMENTAL.
117
- */
118
-
119
- function BlendMode (executionContext)
116
+ function X3DMaterialExtensionNode (executionContext)
120
117
  {
121
- X3DAppearanceChildNode_default().call (this, executionContext);
118
+ X3DNode_default().call (this, executionContext);
122
119
 
123
- this .addType ((X3DConstants_default()).BlendMode);
120
+ this .addType ((X3DConstants_default()).X3DMaterialExtensionNode);
124
121
 
125
- this .factorTypes = new Map ();
126
- this .equationTypes = new Map ();
122
+ this .textureBits = new (BitSet_default()) ();
127
123
  }
128
124
 
129
- Object .assign (Object .setPrototypeOf (BlendMode .prototype, (X3DAppearanceChildNode_default()).prototype),
125
+ Object .assign (Object .setPrototypeOf (X3DMaterialExtensionNode .prototype, (X3DNode_default()).prototype),
130
126
  {
131
- initialize ()
132
- {
133
- X3DAppearanceChildNode_default().prototype .initialize .call (this);
134
-
135
- const
136
- gl = this .getBrowser () .getContext (),
137
- ext = gl .getExtension ('EXT_blend_minmax');
138
-
139
- this .factorTypes .set ("ZERO", gl .ZERO);
140
- this .factorTypes .set ("ONE", gl .ONE);
141
- this .factorTypes .set ("SRC_COLOR", gl .SRC_COLOR);
142
- this .factorTypes .set ("ONE_MINUS_SRC_COLOR", gl .ONE_MINUS_SRC_COLOR);
143
- this .factorTypes .set ("DST_COLOR", gl .DST_COLOR);
144
- this .factorTypes .set ("ONE_MINUS_DST_COLOR", gl .ONE_MINUS_DST_COLOR);
145
- this .factorTypes .set ("SRC_ALPHA", gl .SRC_ALPHA);
146
- this .factorTypes .set ("ONE_MINUS_SRC_ALPHA", gl .ONE_MINUS_SRC_ALPHA);
147
- this .factorTypes .set ("DST_ALPHA", gl .DST_ALPHA);
148
- this .factorTypes .set ("ONE_MINUS_DST_ALPHA", gl .ONE_MINUS_DST_ALPHA);
149
- this .factorTypes .set ("SRC_ALPHA_SATURATE", gl .SRC_ALPHA_SATURATE);
150
- this .factorTypes .set ("CONSTANT_COLOR", gl .CONSTANT_COLOR);
151
- this .factorTypes .set ("ONE_MINUS_CONSTANT_COLOR", gl .ONE_MINUS_CONSTANT_COLOR);
152
- this .factorTypes .set ("CONSTANT_ALPHA", gl .CONSTANT_ALPHA);
153
- this .factorTypes .set ("ONE_MINUS_CONSTANT_ALPHA", gl .ONE_MINUS_CONSTANT_ALPHA);
154
-
155
- this .equationTypes .set ("FUNC_ADD", gl .FUNC_ADD);
156
- this .equationTypes .set ("FUNC_SUBTRACT", gl .FUNC_SUBTRACT);
157
- this .equationTypes .set ("FUNC_REVERSE_SUBTRACT", gl .FUNC_REVERSE_SUBTRACT);
158
- this .equationTypes .set ("MIN", gl .MIN || (ext && ext .MIN_EXT));
159
- this .equationTypes .set ("MAX", gl .MAX || (ext && ext .MAX_EXT));
160
-
161
- this ._sourceColorFactor .addInterest ("set_sourceColorFactor__", this);
162
- this ._sourceAlphaFactor .addInterest ("set_sourceAlphaFactor__", this);
163
- this ._destinationColorFactor .addInterest ("set_destinationColorFactor__", this);
164
- this ._destinationAlphaFactor .addInterest ("set_destinationAlphaFactor__", this);
165
- this ._colorEquation .addInterest ("set_colorEquation__", this);
166
- this ._alphaEquation .addInterest ("set_alphaEquation__", this);
167
-
168
- this .set_sourceColorFactor__ ();
169
- this .set_sourceAlphaFactor__ ();
170
- this .set_destinationColorFactor__ ();
171
- this .set_destinationAlphaFactor__ ();
172
- this .set_colorEquation__ ();
173
- this .set_alphaEquation__ ();
174
- },
175
- set_sourceColorFactor__ ()
176
- {
177
- this .sourceColorFactorType = this .factorTypes .get (this ._sourceColorFactor .getValue ())
178
- ?? this .factorTypes .get ("SRC_ALPHA");
179
- },
180
- set_sourceAlphaFactor__ ()
181
- {
182
- this .sourceAlphaFactorType = this .factorTypes .get (this ._sourceAlphaFactor .getValue ())
183
- ?? this .factorTypes .get ("ONE");
184
- },
185
- set_destinationColorFactor__ ()
186
- {
187
- this .destinationColorFactorType = this .factorTypes .get (this ._destinationColorFactor .getValue ())
188
- ?? this .factorTypes .get ("ONE_MINUS_SRC_ALPHA");
189
- },
190
- set_destinationAlphaFactor__ ()
191
- {
192
- this .destinationAlphaFactorType = this .factorTypes .get (this ._destinationAlphaFactor .getValue ())
193
- ?? this .factorTypes .get ("ONE_MINUS_SRC_ALPHA");
194
- },
195
- set_colorEquation__ ()
196
- {
197
- this .colorEquationType = this .equationTypes .get (this ._colorEquation .getValue ())
198
- ?? this .equationTypes .get ("FUNC_ADD");
199
- },
200
- set_alphaEquation__ ()
201
- {
202
- this .alphaEquationType = this .equationTypes .get (this ._alphaEquation .getValue ())
203
- ?? this .equationTypes .get ("FUNC_ADD");
204
- },
205
- enable (gl)
127
+ setTexture (index, textureNode)
206
128
  {
207
- const color = this ._blendColor .getValue ();
129
+ index *= 4;
208
130
 
209
- gl .blendColor (color .r, color .g, color .b, color .a);
210
- gl .blendFuncSeparate (this .sourceColorFactorType, this .destinationColorFactorType, this .sourceAlphaFactorType, this .destinationAlphaFactorType);
211
- gl .blendEquationSeparate (this .colorEquationType, this .alphaEquationType);
131
+ this .textureBits .remove (index, 0xf);
132
+ this .textureBits .add (index, textureNode ?.getTextureBits () ?? 0);
212
133
  },
213
- disable (gl)
134
+ getTextureBits ()
214
135
  {
215
- gl .blendFuncSeparate (gl .SRC_ALPHA, gl .ONE_MINUS_SRC_ALPHA, gl .ONE, gl .ONE_MINUS_SRC_ALPHA);
216
- gl .blendEquationSeparate (gl .FUNC_ADD, gl .FUNC_ADD);
136
+ return this .textureBits;
217
137
  },
218
138
  });
219
139
 
220
- Object .defineProperties (BlendMode,
140
+ Object .defineProperties (X3DMaterialExtensionNode,
221
141
  {
222
142
  typeName:
223
143
  {
224
- value: "BlendMode",
144
+ value: "X3DMaterialExtensionNode",
225
145
  enumerable: true,
226
146
  },
227
147
  componentInfo:
@@ -229,38 +149,88 @@ Object .defineProperties (BlendMode,
229
149
  value: Object .freeze ({ name: "X_ITE", level: 1 }),
230
150
  enumerable: true,
231
151
  },
232
- containerField:
233
- {
234
- value: "blendMode",
235
- enumerable: true,
236
- },
237
- specificationRange:
238
- {
239
- value: Object .freeze ({ from: "3.3", to: "Infinity" }),
240
- enumerable: true,
241
- },
242
- fieldDefinitions:
243
- {
244
- value: new (FieldDefinitionArray_default()) ([
245
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
246
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "blendColor", new (Fields_default()).SFColorRGBA ()),
247
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sourceColorFactor", new (Fields_default()).SFString ("SRC_ALPHA")),
248
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sourceAlphaFactor", new (Fields_default()).SFString ("ONE")),
249
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "destinationColorFactor", new (Fields_default()).SFString ("ONE_MINUS_SRC_ALPHA")),
250
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "destinationAlphaFactor", new (Fields_default()).SFString ("ONE_MINUS_SRC_ALPHA")),
251
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "colorEquation", new (Fields_default()).SFString ("FUNC_ADD")),
252
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "alphaEquation", new (Fields_default()).SFString ("FUNC_ADD")),
253
- ]),
254
- enumerable: true,
255
- },
256
152
  });
257
153
 
258
- const __default__ = BlendMode;
154
+ const __default__ = X3DMaterialExtensionNode;
259
155
  ;
260
156
 
261
- Namespace_default().add ("BlendMode", "x_ite/Components/X_ITE/BlendMode", __default__);
262
- /* harmony default export */ const X_ITE_BlendMode = (__default__);
263
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/DepthMode.js
157
+ Namespace_default().add ("X3DMaterialExtensionNode", "x_ite/Components/X_ITE/X3DMaterialExtensionNode", __default__);
158
+ /* harmony default export */ const X_ITE_X3DMaterialExtensionNode = (__default__);
159
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
160
+ const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/X3DCast");
161
+ var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
162
+ ;// CONCATENATED MODULE: ./src/x_ite/Browser/X_ITE/ExtensionKeys.js
163
+ /*******************************************************************************
164
+ *
165
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
166
+ *
167
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
168
+ *
169
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
170
+ *
171
+ * The copyright notice above does not evidence any actual of intended
172
+ * publication of such source code, and is an unpublished work by create3000.
173
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
174
+ * create3000.
175
+ *
176
+ * No permission is granted to copy, distribute, or create derivative works from
177
+ * the contents of this software, in whole or in part, without the prior written
178
+ * permission of create3000.
179
+ *
180
+ * NON-MILITARY USE ONLY
181
+ *
182
+ * All create3000 software are effectively free software with a non-military use
183
+ * restriction. It is free. Well commented source is provided. You may reuse the
184
+ * source in any way you please with the exception anything that uses it must be
185
+ * marked to indicate is contains 'non-military use only' components.
186
+ *
187
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
188
+ *
189
+ * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
190
+ *
191
+ * This file is part of the X_ITE Project.
192
+ *
193
+ * X_ITE is free software: you can redistribute it and/or modify it under the
194
+ * terms of the GNU General Public License version 3 only, as published by the
195
+ * Free Software Foundation.
196
+ *
197
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
198
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
199
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
200
+ * details (a copy is included in the LICENSE file that accompanied this code).
201
+ *
202
+ * You should have received a copy of the GNU General Public License version 3
203
+ * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
204
+ * copy of the GPLv3 License.
205
+ *
206
+ * For Silvio, Joy and Adi.
207
+ *
208
+ ******************************************************************************/
209
+
210
+ let i = 0;
211
+
212
+ const ExtensionKeys =
213
+ {
214
+ ANISOTROPY_MATERIAL_EXTENSION: i ++,
215
+ CLEARCOAT_MATERIAL_EXTENSION: i ++,
216
+ DIFFUSE_TRANSMISSION_EXTENSION: i ++,
217
+ DISPERSION_MATERIAL_EXTENSION: i ++,
218
+ EMISSIVE_STRENGTH_MATERIAL_EXTENSION: i ++,
219
+ IOR_MATERIAL_EXTENSION: i ++,
220
+ IRIDESCENCE_MATERIAL_EXTENSION: i ++,
221
+ SHEEN_MATERIAL_EXTENSION: i ++,
222
+ SPECULAR_MATERIAL_EXTENSION: i ++,
223
+ TRANSMISSION_MATERIAL_EXTENSION: i ++,
224
+ UNLIT_MATERIAL_EXTENSION: i ++,
225
+ VOLUME_MATERIAL_EXTENSION: i ++,
226
+ };
227
+
228
+ const ExtensionKeys_default_ = ExtensionKeys;
229
+ ;
230
+
231
+ Namespace_default().add ("ExtensionKeys", "x_ite/Browser/X_ITE/ExtensionKeys", ExtensionKeys_default_);
232
+ /* harmony default export */ const X_ITE_ExtensionKeys = (ExtensionKeys_default_);
233
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/AnisotropyMaterialExtension.js
264
234
  /*******************************************************************************
265
235
  *
266
236
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -314,86 +284,86 @@ Namespace_default().add ("BlendMode", "x_ite/Components/X_ITE/BlendMode", __defa
314
284
 
315
285
 
316
286
 
287
+
288
+
317
289
  /**
318
290
  * THIS NODE IS STILL EXPERIMENTAL.
319
291
  */
320
292
 
321
- function DepthMode (executionContext)
293
+ function AnisotropyMaterialExtension (executionContext)
322
294
  {
323
- X3DAppearanceChildNode_default().call (this, executionContext);
295
+ X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
324
296
 
325
- this .addType ((X3DConstants_default()).DepthMode);
297
+ this .addType ((X3DConstants_default()).AnisotropyMaterialExtension);
326
298
 
327
- this .addAlias ("depthFunc", this ._depthFunction);
299
+ this .anisotropyArray = new Float32Array (3);
328
300
  }
329
301
 
330
- Object .assign (Object .setPrototypeOf (DepthMode .prototype, (X3DAppearanceChildNode_default()).prototype),
302
+ Object .assign (Object .setPrototypeOf (AnisotropyMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
331
303
  {
332
304
  initialize ()
333
305
  {
334
- X3DAppearanceChildNode_default().prototype .initialize .call (this);
306
+ X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
335
307
 
336
- this ._depthFunction .addInterest ("set_depthFunction__", this);
308
+ this ._anisotropyStrength .addInterest ("set_anisotropyStrength__", this);
309
+ this ._anisotropyRotation .addInterest ("set_anisotropyRotation__", this);
310
+ this ._anisotropyTexture .addInterest ("set_anisotropyTexture__", this);
337
311
 
338
- this .set_depthFunction__ ();
312
+ this .set_anisotropyStrength__ ();
313
+ this .set_anisotropyRotation__ ();
314
+ this .set_anisotropyTexture__ ();
339
315
  },
340
- set_depthFunction__: (function ()
316
+ set_anisotropyStrength__ ()
341
317
  {
342
- const depthFunctions = new Map ([
343
- ["NEVER", "NEVER"],
344
- ["LESS", "LESS"],
345
- ["EQUAL", "EQUAL"],
346
- ["LESS_EQUAL", "LEQUAL"],
347
- ["GREATER", "GREATER"],
348
- ["NOT_EQUAL", "NOTEQUAL"],
349
- ["GREATER_EQUAL", "GEQUAL"],
350
- ["ALWAYS", "ALWAYS"],
351
- ]);
318
+ this .anisotropyArray [2] = Math .max (this ._anisotropyStrength .getValue (), 0);
319
+ },
320
+ set_anisotropyRotation__ ()
321
+ {
322
+ const anisotropyRotation = this ._anisotropyRotation .getValue ();
352
323
 
353
- return function ()
354
- {
355
- const gl = this .getBrowser () .getContext ();
324
+ this .anisotropyArray [0] = Math .cos (anisotropyRotation);
325
+ this .anisotropyArray [1] = Math .sin (anisotropyRotation);
326
+ },
327
+ set_anisotropyTexture__ ()
328
+ {
329
+ this .anisotropyTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._anisotropyTexture);
356
330
 
357
- this .depthFunction = gl [depthFunctions .get (this ._depthFunction .getValue ()) ?? "LEQUAL"];
358
- };
359
- })(),
360
- enable (gl)
331
+ this .setTexture (0, this .anisotropyTextureNode);
332
+ },
333
+ getExtensionKey ()
361
334
  {
362
- this .depthTest = gl .isEnabled (gl .DEPTH_TEST);
363
- this .depthWriteMask = gl .getParameter (gl .DEPTH_WRITEMASK);
335
+ return X_ITE_ExtensionKeys .ANISOTROPY_MATERIAL_EXTENSION;
336
+ },
337
+ getShaderOptions (options)
338
+ {
339
+ options .push ("X3D_ANISOTROPY_MATERIAL_EXT");
364
340
 
365
- gl .enable (gl .POLYGON_OFFSET_FILL);
366
- gl .polygonOffset (... this ._polygonOffset);
341
+ if (!+this .getTextureBits ())
342
+ return;
367
343
 
368
- if (this ._depthTest .getValue ())
369
- gl .enable (gl .DEPTH_TEST);
370
- else
371
- gl .disable (gl .DEPTH_TEST);
344
+ options .push ("X3D_MATERIAL_TEXTURES");
372
345
 
373
- gl .depthFunc (this .depthFunction);
374
- gl .depthRange (... this ._depthRange .getValue ());
375
- gl .depthMask (this ._depthMask .getValue ());
346
+ this .anisotropyTextureNode ?.getShaderOptions (options, "ANISOTROPY", true);
376
347
  },
377
- disable (gl)
348
+ setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
378
349
  {
379
- gl .disable (gl .POLYGON_OFFSET_FILL);
380
-
381
- if (this .depthTest)
382
- gl .enable (gl .DEPTH_TEST);
383
- else
384
- gl .disable (gl .DEPTH_TEST);
350
+ gl .uniform3fv (shaderObject .x3d_AnisotropyEXT, this .anisotropyArray);
385
351
 
386
- gl .depthFunc (gl .LEQUAL);
387
- gl .depthRange (0, 1);
388
- gl .depthMask (this .depthWriteMask);
352
+ this .anisotropyTextureNode ?.setNamedShaderUniforms (gl,
353
+ shaderObject,
354
+ renderObject,
355
+ shaderObject .x3d_AnisotropyTextureEXT,
356
+ this ._anisotropyTextureMapping .getValue (),
357
+ textureTransformMapping,
358
+ textureCoordinateMapping);
389
359
  },
390
360
  });
391
361
 
392
- Object .defineProperties (DepthMode,
362
+ Object .defineProperties (AnisotropyMaterialExtension,
393
363
  {
394
364
  typeName:
395
365
  {
396
- value: "DepthMode",
366
+ value: "AnisotropyMaterialExtension",
397
367
  enumerable: true,
398
368
  },
399
369
  componentInfo:
@@ -403,7 +373,7 @@ Object .defineProperties (DepthMode,
403
373
  },
404
374
  containerField:
405
375
  {
406
- value: "depthMode",
376
+ value: "extensions",
407
377
  enumerable: true,
408
378
  },
409
379
  specificationRange:
@@ -414,41 +384,25 @@ Object .defineProperties (DepthMode,
414
384
  fieldDefinitions:
415
385
  {
416
386
  value: new (FieldDefinitionArray_default()) ([
417
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
418
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "polygonOffset", new (Fields_default()).SFVec2f ()),
419
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthRange", new (Fields_default()).SFVec2f (0, 1)),
420
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthTest", new (Fields_default()).SFBool (true)),
421
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthFunction", new (Fields_default()).SFString ("LESS_EQUAL")),
422
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthMask", new (Fields_default()).SFBool (true)),
387
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
388
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyStrength", new (Fields_default()).SFFloat ()),
389
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyRotation", new (Fields_default()).SFFloat ()),
390
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyTextureMapping", new (Fields_default()).SFString ()),
391
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyTexture", new (Fields_default()).SFNode ()),
423
392
  ]),
424
393
  enumerable: true,
425
394
  },
426
395
  });
427
396
 
428
- const DepthMode_default_ = DepthMode;
397
+ const AnisotropyMaterialExtension_default_ = AnisotropyMaterialExtension;
429
398
  ;
430
399
 
431
- Namespace_default().add ("DepthMode", "x_ite/Components/X_ITE/DepthMode", DepthMode_default_);
432
- /* harmony default export */ const X_ITE_DepthMode = (DepthMode_default_);
433
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DShapeNode\")"
434
- const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Components/Shape/X3DShapeNode");
435
- var X3DShapeNode_default = /*#__PURE__*/__webpack_require__.n(X3DShapeNode_namespaceObject);
436
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
437
- const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Rendering/TraverseType");
438
- var TraverseType_default = /*#__PURE__*/__webpack_require__.n(TraverseType_namespaceObject);
439
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/VertexArray\")"
440
- const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Rendering/VertexArray");
441
- var VertexArray_default = /*#__PURE__*/__webpack_require__.n(VertexArray_namespaceObject);
442
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
443
- const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("standard/Math/Numbers/Vector3");
444
- var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
445
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
446
- const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("standard/Math/Numbers/Matrix4");
447
- var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
448
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Box3\")"
449
- const Box3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("standard/Math/Geometry/Box3");
450
- var Box3_default = /*#__PURE__*/__webpack_require__.n(Box3_namespaceObject);
451
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/InstancedShape.js
400
+ Namespace_default().add ("AnisotropyMaterialExtension", "x_ite/Components/X_ITE/AnisotropyMaterialExtension", AnisotropyMaterialExtension_default_);
401
+ /* harmony default export */ const X_ITE_AnisotropyMaterialExtension = (AnisotropyMaterialExtension_default_);
402
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DAppearanceChildNode\")"
403
+ const X3DAppearanceChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components/Shape/X3DAppearanceChildNode");
404
+ var X3DAppearanceChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DAppearanceChildNode_namespaceObject);
405
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/BlendMode.js
452
406
  /*******************************************************************************
453
407
  *
454
408
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -502,240 +456,116 @@ var Box3_default = /*#__PURE__*/__webpack_require__.n(Box3_namespaceObject);
502
456
 
503
457
 
504
458
 
505
-
506
-
507
-
508
-
509
-
510
459
  /**
511
460
  * THIS NODE IS STILL EXPERIMENTAL.
512
461
  */
513
462
 
514
- function InstancedShape (executionContext)
463
+ function BlendMode (executionContext)
515
464
  {
516
- X3DShapeNode_default().call (this, executionContext);
517
-
518
- this .addType ((X3DConstants_default()).InstancedShape);
519
-
520
- this .addChildObjects ((X3DConstants_default()).outputOnly, "matrices", new (Fields_default()).SFTime ());
465
+ X3DAppearanceChildNode_default().call (this, executionContext);
521
466
 
522
- this .min = new (Vector3_default()) ();
523
- this .max = new (Vector3_default()) ();
524
- this .scale = new (Vector3_default()) (1, 1, 1);
467
+ this .addType ((X3DConstants_default()).BlendMode);
525
468
 
526
- this .numInstances = 0;
527
- this .instancesStride = Float32Array .BYTES_PER_ELEMENT * (16 + 9); // mat4 + mat3
528
- this .matrixOffset = 0;
529
- this .normalMatrixOffset = Float32Array .BYTES_PER_ELEMENT * 16;
469
+ this .factorTypes = new Map ();
470
+ this .equationTypes = new Map ();
530
471
  }
531
472
 
532
- Object .assign (Object .setPrototypeOf (InstancedShape .prototype, (X3DShapeNode_default()).prototype),
473
+ Object .assign (Object .setPrototypeOf (BlendMode .prototype, (X3DAppearanceChildNode_default()).prototype),
533
474
  {
534
475
  initialize ()
535
476
  {
536
- X3DShapeNode_default().prototype .initialize .call (this);
477
+ X3DAppearanceChildNode_default().prototype .initialize .call (this);
537
478
 
538
479
  const
539
- browser = this .getBrowser (),
540
- gl = browser .getContext ();
541
-
542
- // Check version.
480
+ gl = this .getBrowser () .getContext (),
481
+ ext = gl .getExtension ('EXT_blend_minmax');
543
482
 
544
- if (browser .getContext () .getVersion () < 2)
545
- return;
483
+ this .factorTypes .set ("ZERO", gl .ZERO);
484
+ this .factorTypes .set ("ONE", gl .ONE);
485
+ this .factorTypes .set ("SRC_COLOR", gl .SRC_COLOR);
486
+ this .factorTypes .set ("ONE_MINUS_SRC_COLOR", gl .ONE_MINUS_SRC_COLOR);
487
+ this .factorTypes .set ("DST_COLOR", gl .DST_COLOR);
488
+ this .factorTypes .set ("ONE_MINUS_DST_COLOR", gl .ONE_MINUS_DST_COLOR);
489
+ this .factorTypes .set ("SRC_ALPHA", gl .SRC_ALPHA);
490
+ this .factorTypes .set ("ONE_MINUS_SRC_ALPHA", gl .ONE_MINUS_SRC_ALPHA);
491
+ this .factorTypes .set ("DST_ALPHA", gl .DST_ALPHA);
492
+ this .factorTypes .set ("ONE_MINUS_DST_ALPHA", gl .ONE_MINUS_DST_ALPHA);
493
+ this .factorTypes .set ("SRC_ALPHA_SATURATE", gl .SRC_ALPHA_SATURATE);
494
+ this .factorTypes .set ("CONSTANT_COLOR", gl .CONSTANT_COLOR);
495
+ this .factorTypes .set ("ONE_MINUS_CONSTANT_COLOR", gl .ONE_MINUS_CONSTANT_COLOR);
496
+ this .factorTypes .set ("CONSTANT_ALPHA", gl .CONSTANT_ALPHA);
497
+ this .factorTypes .set ("ONE_MINUS_CONSTANT_ALPHA", gl .ONE_MINUS_CONSTANT_ALPHA);
546
498
 
547
- this .instances = Object .assign (gl .createBuffer (),
548
- {
549
- vertexArrayObject: new (VertexArray_default()) (gl),
550
- thickLinesVertexArrayObject: new (VertexArray_default()) (gl),
551
- lineTrianglesBuffer: gl .createBuffer (),
552
- numLines: 0,
553
- });
499
+ this .equationTypes .set ("FUNC_ADD", gl .FUNC_ADD);
500
+ this .equationTypes .set ("FUNC_SUBTRACT", gl .FUNC_SUBTRACT);
501
+ this .equationTypes .set ("FUNC_REVERSE_SUBTRACT", gl .FUNC_REVERSE_SUBTRACT);
502
+ this .equationTypes .set ("MIN", gl .MIN || (ext && ext .MIN_EXT));
503
+ this .equationTypes .set ("MAX", gl .MAX || (ext && ext .MAX_EXT));
554
504
 
555
- this ._translations .addInterest ("set_transform__", this);
556
- this ._rotations .addInterest ("set_transform__", this);
557
- this ._scales .addInterest ("set_transform__", this);
558
- this ._matrices .addInterest ("set_matrices__", this);
505
+ this ._sourceColorFactor .addInterest ("set_sourceColorFactor__", this);
506
+ this ._sourceAlphaFactor .addInterest ("set_sourceAlphaFactor__", this);
507
+ this ._destinationColorFactor .addInterest ("set_destinationColorFactor__", this);
508
+ this ._destinationAlphaFactor .addInterest ("set_destinationAlphaFactor__", this);
509
+ this ._colorEquation .addInterest ("set_colorEquation__", this);
510
+ this ._alphaEquation .addInterest ("set_alphaEquation__", this);
559
511
 
560
- this .set_transform__ ();
512
+ this .set_sourceColorFactor__ ();
513
+ this .set_sourceAlphaFactor__ ();
514
+ this .set_destinationColorFactor__ ();
515
+ this .set_destinationAlphaFactor__ ();
516
+ this .set_colorEquation__ ();
517
+ this .set_alphaEquation__ ();
561
518
  },
562
- getShapeKey ()
519
+ set_sourceColorFactor__ ()
563
520
  {
564
- return 3;
521
+ this .sourceColorFactorType = this .factorTypes .get (this ._sourceColorFactor .getValue ())
522
+ ?? this .factorTypes .get ("SRC_ALPHA");
565
523
  },
566
- getNumInstances ()
524
+ set_sourceAlphaFactor__ ()
567
525
  {
568
- return this .numInstances;
526
+ this .sourceAlphaFactorType = this .factorTypes .get (this ._sourceAlphaFactor .getValue ())
527
+ ?? this .factorTypes .get ("ONE");
569
528
  },
570
- getInstances ()
529
+ set_destinationColorFactor__ ()
571
530
  {
572
- return this .instances;
531
+ this .destinationColorFactorType = this .factorTypes .get (this ._destinationColorFactor .getValue ())
532
+ ?? this .factorTypes .get ("ONE_MINUS_SRC_ALPHA");
573
533
  },
574
- set_bbox__: (function ()
534
+ set_destinationAlphaFactor__ ()
575
535
  {
576
- const
577
- min = new (Vector3_default()) (),
578
- max = new (Vector3_default()) (),
579
- bbox = new (Box3_default()) ();
580
-
581
- return function ()
582
- {
583
- if (this .numInstances)
584
- {
585
- if (this ._bboxSize .getValue () .equals (this .getDefaultBBoxSize ()))
586
- {
587
- if (this .getGeometry ())
588
- bbox .assign (this .getGeometry () .getBBox ());
589
- else
590
- bbox .set ();
591
-
592
- const
593
- size1_2 = bbox .size .multiply (this .scale .magnitude () / 2),
594
- center = bbox .center;
595
-
596
- min .assign (this .min) .add (center) .subtract (size1_2);
597
- max .assign (this .max) .add (center) .add (size1_2);
598
-
599
- this .bbox .setExtents (min, max);
600
- }
601
- else
602
- {
603
- this .bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
604
- }
605
- }
606
- else
607
- {
608
- this .bbox .set ();
609
- }
610
-
611
- this .getBBoxSize () .assign (this .bbox .size);
612
- this .getBBoxCenter () .assign (this .bbox .center);
613
- };
614
- })(),
615
- set_transform__ ()
536
+ this .destinationAlphaFactorType = this .factorTypes .get (this ._destinationAlphaFactor .getValue ())
537
+ ?? this .factorTypes .get ("ONE_MINUS_SRC_ALPHA");
538
+ },
539
+ set_colorEquation__ ()
616
540
  {
617
- this ._matrices = this .getBrowser () .getCurrentTime ();
541
+ this .colorEquationType = this .equationTypes .get (this ._colorEquation .getValue ())
542
+ ?? this .equationTypes .get ("FUNC_ADD");
618
543
  },
619
- set_matrices__ ()
544
+ set_alphaEquation__ ()
620
545
  {
621
- const
622
- browser = this .getBrowser (),
623
- gl = browser .getContext (),
624
- translations = this ._translations,
625
- rotations = this ._rotations,
626
- scales = this ._scales,
627
- numTranslations = translations .length,
628
- numRotations = rotations .length,
629
- numScales = scales .length,
630
- numInstances = Math .max (numTranslations, numRotations, numScales),
631
- stride = this .instancesStride / Float32Array .BYTES_PER_ELEMENT,
632
- length = this .instancesStride * numInstances,
633
- data = new Float32Array (length),
634
- matrix = new (Matrix4_default()) ();
635
-
636
- this .numInstances = numInstances;
637
-
638
- const
639
- min = this .min .set (Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY),
640
- max = this .max .set (Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY),
641
- scale = this .scale .assign (numScales ? max : (Vector3_default()).One);
642
-
643
- for (let i = 0, o = 0; i < numInstances; ++ i, o += stride)
644
- {
645
- matrix .set (numTranslations ? translations [Math .min (i, numTranslations - 1)] .getValue () : null,
646
- numRotations ? rotations [Math .min (i, numRotations - 1)] .getValue () : null,
647
- numScales ? scales [Math .min (i, numScales - 1)] .getValue () : null);
648
-
649
- if (numScales)
650
- scale .max (scales [Math .min (i, numScales - 1)] .getValue ());
651
-
652
- data .set (matrix, o);
653
- data .set (matrix .submatrix .transpose () .inverse (), o + 16);
654
-
655
- min .min (matrix .origin);
656
- max .max (matrix .origin);
657
- }
658
-
659
- gl .bindBuffer (gl .ARRAY_BUFFER, this .instances);
660
- gl .bufferData (gl .ARRAY_BUFFER, data, gl .DYNAMIC_DRAW);
661
-
662
- this .set_bbox__ ();
663
- },
664
- set_geometry__ ()
665
- {
666
- X3DShapeNode_default().prototype .set_geometry__ .call (this);
667
-
668
- if (this .getGeometry ())
669
- delete this .traverse;
670
- else
671
- this .traverse = Function .prototype;
672
-
673
- this .set_transform__ ();
546
+ this .alphaEquationType = this .equationTypes .get (this ._alphaEquation .getValue ())
547
+ ?? this .equationTypes .get ("FUNC_ADD");
674
548
  },
675
- intersectsBox (box, clipPlanes, modelViewMatrix)
676
- { },
677
- traverse (type, renderObject)
549
+ enable (gl)
678
550
  {
679
- if (!this .numInstances)
680
- return;
681
-
682
- // Always look at ParticleSystem if you do modify something here and there.
683
-
684
- switch (type)
685
- {
686
- case (TraverseType_default()).POINTER:
687
- {
688
- if (this ._pointerEvents .getValue ())
689
- renderObject .addPointingShape (this);
690
-
691
- break;
692
- }
693
- case (TraverseType_default()).PICKING:
694
- {
695
- break;
696
- }
697
- case (TraverseType_default()).COLLISION:
698
- {
699
- renderObject .addCollisionShape (this);
700
- break;
701
- }
702
- case (TraverseType_default()).SHADOW:
703
- {
704
- if (this ._castShadow .getValue ())
705
- renderObject .addShadowShape (this);
706
-
707
- break;
708
- }
709
- case (TraverseType_default()).DISPLAY:
710
- {
711
- if (renderObject .addDisplayShape (this))
712
- {
713
- // Currently used for GeneratedCubeMapTexture.
714
- this .getAppearance () .traverse (type, renderObject);
715
- }
716
-
717
- break;
718
- }
719
- }
551
+ const color = this ._blendColor .getValue ();
720
552
 
721
- // Currently used for ScreenText and Tools.
722
- this .getGeometry () .traverse (type, renderObject);
723
- },
724
- displaySimple (gl, renderContext, shaderNode)
725
- {
726
- this .getGeometry () .displaySimpleInstanced (gl, shaderNode, this);
553
+ gl .blendColor (color .r, color .g, color .b, color .a);
554
+ gl .blendFuncSeparate (this .sourceColorFactorType, this .destinationColorFactorType, this .sourceAlphaFactorType, this .destinationAlphaFactorType);
555
+ gl .blendEquationSeparate (this .colorEquationType, this .alphaEquationType);
727
556
  },
728
- display (gl, renderContext)
557
+ disable (gl)
729
558
  {
730
- this .getGeometry () .displayInstanced (gl, renderContext, this);
559
+ gl .blendFuncSeparate (gl .SRC_ALPHA, gl .ONE_MINUS_SRC_ALPHA, gl .ONE, gl .ONE_MINUS_SRC_ALPHA);
560
+ gl .blendEquationSeparate (gl .FUNC_ADD, gl .FUNC_ADD);
731
561
  },
732
562
  });
733
563
 
734
- Object .defineProperties (InstancedShape,
564
+ Object .defineProperties (BlendMode,
735
565
  {
736
566
  typeName:
737
567
  {
738
- value: "InstancedShape",
568
+ value: "BlendMode",
739
569
  enumerable: true,
740
570
  },
741
571
  componentInfo:
@@ -745,49 +575,39 @@ Object .defineProperties (InstancedShape,
745
575
  },
746
576
  containerField:
747
577
  {
748
- value: "children",
578
+ value: "blendMode",
749
579
  enumerable: true,
750
580
  },
751
581
  specificationRange:
752
582
  {
753
- value: Object .freeze ({ from: "2.0", to: "Infinity" }),
583
+ value: Object .freeze ({ from: "3.3", to: "Infinity" }),
754
584
  enumerable: true,
755
585
  },
756
586
  fieldDefinitions:
757
587
  {
758
588
  value: new (FieldDefinitionArray_default()) ([
759
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
760
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "translations", new (Fields_default()).MFVec3f ()),
761
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "rotations", new (Fields_default()).MFRotation ()),
762
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "scales", new (Fields_default()).MFVec3f ()),
763
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "pointerEvents", new (Fields_default()).SFBool (true)),
764
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "castShadow", new (Fields_default()).SFBool (true)),
765
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "visible", new (Fields_default()).SFBool (true)),
766
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "bboxDisplay", new (Fields_default()).SFBool ()),
767
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).initializeOnly, "bboxSize", new (Fields_default()).SFVec3f (-1, -1, -1)),
768
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).initializeOnly, "bboxCenter", new (Fields_default()).SFVec3f ()),
769
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "appearance", new (Fields_default()).SFNode ()),
770
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "geometry", new (Fields_default()).SFNode ()),
589
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
590
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "blendColor", new (Fields_default()).SFColorRGBA ()),
591
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sourceColorFactor", new (Fields_default()).SFString ("SRC_ALPHA")),
592
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sourceAlphaFactor", new (Fields_default()).SFString ("ONE")),
593
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "destinationColorFactor", new (Fields_default()).SFString ("ONE_MINUS_SRC_ALPHA")),
594
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "destinationAlphaFactor", new (Fields_default()).SFString ("ONE_MINUS_SRC_ALPHA")),
595
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "colorEquation", new (Fields_default()).SFString ("FUNC_ADD")),
596
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "alphaEquation", new (Fields_default()).SFString ("FUNC_ADD")),
771
597
  ]),
772
598
  enumerable: true,
773
599
  },
774
600
  });
775
601
 
776
- const InstancedShape_default_ = InstancedShape;
602
+ const BlendMode_default_ = BlendMode;
777
603
  ;
778
604
 
779
- Namespace_default().add ("InstancedShape", "x_ite/Components/X_ITE/InstancedShape", InstancedShape_default_);
780
- /* harmony default export */ const X_ITE_InstancedShape = (InstancedShape_default_);
781
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DOneSidedMaterialNode\")"
782
- const X3DOneSidedMaterialNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Components/Shape/X3DOneSidedMaterialNode");
783
- var X3DOneSidedMaterialNode_default = /*#__PURE__*/__webpack_require__.n(X3DOneSidedMaterialNode_namespaceObject);
784
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
785
- const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Base/X3DCast");
786
- var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
605
+ Namespace_default().add ("BlendMode", "x_ite/Components/X_ITE/BlendMode", BlendMode_default_);
606
+ /* harmony default export */ const X_ITE_BlendMode = (BlendMode_default_);
787
607
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
788
- const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("standard/Math/Algorithm");
608
+ const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Algorithm");
789
609
  var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
790
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SpecularGlossinessMaterial.js
610
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/ClearcoatMaterialExtension.js
791
611
  /*******************************************************************************
792
612
  *
793
613
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -843,252 +663,118 @@ var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceOb
843
663
 
844
664
 
845
665
 
666
+
846
667
  /**
847
- * THIS NODE IS DEPRECIATED.
668
+ * THIS NODE IS STILL EXPERIMENTAL.
848
669
  */
849
670
 
850
- function SpecularGlossinessMaterial (executionContext)
671
+ function ClearcoatMaterialExtension (executionContext)
851
672
  {
852
- console .warn ("SpecularGlossinessMaterial is depreciated, please use PhysicalMaterial instead.");
853
-
854
- X3DOneSidedMaterialNode_default().call (this, executionContext);
855
-
856
- this .addType ((X3DConstants_default()).SpecularGlossinessMaterial);
673
+ X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
857
674
 
858
- this .materialKey = "4/";
859
- this .diffuseColorArray = new Float32Array (3);
860
- this .specularColorArray = new Float32Array (3);
861
- this .extensionNodes = [ ];
675
+ this .addType ((X3DConstants_default()).ClearcoatMaterialExtension);
862
676
  }
863
677
 
864
- Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (X3DOneSidedMaterialNode_default()).prototype),
678
+ Object .assign (Object .setPrototypeOf (ClearcoatMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
865
679
  {
866
680
  initialize ()
867
681
  {
868
- X3DOneSidedMaterialNode_default().prototype .initialize .call (this);
869
-
870
- this ._diffuseColor .addInterest ("set_diffuseColor__", this);
871
- this ._diffuseTexture .addInterest ("set_diffuseTexture__", this);
872
- this ._diffuseTexture .addInterest ("set_transparent__", this);
873
- this ._specularColor .addInterest ("set_specularColor__", this);
874
- this ._glossiness .addInterest ("set_glossiness__", this);
875
- this ._specularGlossinessTexture .addInterest ("set_specularGlossinessTexture__", this);
876
- this ._occlusionStrength .addInterest ("set_occlusionStrength__", this);
877
- this ._occlusionTexture .addInterest ("set_occlusionTexture__", this);
878
- this ._extensions .addInterest ("set_extensions__", this);
879
-
880
- this .set_diffuseColor__ ();
881
- this .set_diffuseTexture__ ();
882
- this .set_specularColor__ ();
883
- this .set_glossiness__ ();
884
- this .set_specularGlossinessTexture__ ();
885
- this .set_occlusionStrength__ ();
886
- this .set_occlusionTexture__ ();
887
- this .set_extensions__ ();
888
- this .set_transparent__ ();
889
- },
890
- getMaterialKey ()
891
- {
892
- return this .materialKey;
893
- },
894
- getTextureIndices: (() =>
895
- {
896
- let i = 0;
897
-
898
- const textureIndices = {
899
- DIFFUSE_TEXTURE: i ++,
900
- SPECULAR_GLOSSINESS_TEXTURE: i ++,
901
- EMISSIVE_TEXTURE: i ++,
902
- OCCLUSION_TEXTURE: i ++,
903
- NORMAL_TEXTURE: i ++,
904
- };
905
-
906
- return function ()
907
- {
908
- return textureIndices;
909
- };
910
- })(),
911
- getBaseTexture ()
912
- {
913
- return this .diffuseTextureNode;
914
- },
915
- set_diffuseColor__ ()
916
- {
917
- //We cannot use this in Windows Edge:
918
- //this .diffuseColorArray .set (this ._diffuseColor .getValue ());
919
-
920
- const
921
- diffuseColorArray = this .diffuseColorArray,
922
- diffuseColor = this ._diffuseColor .getValue ();
923
-
924
- diffuseColorArray [0] = diffuseColor .r;
925
- diffuseColorArray [1] = diffuseColor .g;
926
- diffuseColorArray [2] = diffuseColor .b;
927
- },
928
- set_diffuseTexture__ ()
929
- {
930
- const index = this .getTextureIndices () .DIFFUSE_TEXTURE;
931
-
932
- if (this .diffuseTextureNode)
933
- {
934
- this .diffuseTextureNode ._transparent .removeInterest ("set_transparent__", this);
935
- this .diffuseTextureNode ._linear .removeInterest (`setTexture${index}`, this);
936
- }
937
-
938
- this .diffuseTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._diffuseTexture);
939
-
940
- if (this .diffuseTextureNode)
941
- {
942
- this .diffuseTextureNode ._transparent .addInterest ("set_transparent__", this);
943
- this .diffuseTextureNode ._linear .addInterest (`setTexture${index}`, this, index, this .diffuseTextureNode);
944
- }
945
-
946
- this .setTexture (index, this .diffuseTextureNode);
947
- },
948
- set_specularColor__ ()
949
- {
950
- //We cannot use this in Windows Edge:
951
- //this .specularColorArray .set (this ._specularColor .getValue ());
682
+ X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
952
683
 
953
- const
954
- specularColorArray = this .specularColorArray,
955
- specularColor = this ._specularColor .getValue ();
684
+ this ._clearcoat .addInterest ("set_clearcoat__", this);
685
+ this ._clearcoatTexture .addInterest ("set_clearcoatTexture__", this);
686
+ this ._clearcoatRoughness .addInterest ("set_clearcoatRoughness__", this);
687
+ this ._clearcoatRoughnessTexture .addInterest ("set_clearcoatRoughnessTexture__", this);
688
+ this ._clearcoatNormalTexture .addInterest ("set_clearcoatNormalTexture__", this);
956
689
 
957
- specularColorArray [0] = specularColor .r;
958
- specularColorArray [1] = specularColor .g;
959
- specularColorArray [2] = specularColor .b;
690
+ this .set_clearcoat__ ();
691
+ this .set_clearcoatTexture__ ();
692
+ this .set_clearcoatRoughness__ ();
693
+ this .set_clearcoatRoughnessTexture__ ();
694
+ this .set_clearcoatNormalTexture__ ();
960
695
  },
961
- set_glossiness__ ()
696
+ set_clearcoat__ ()
962
697
  {
963
- this .glossiness = Algorithm_default().clamp (this ._glossiness .getValue (), 0, 1);
698
+ this .clearcoat = Math .max (this ._clearcoat .getValue (), 0);
964
699
  },
965
- set_specularGlossinessTexture__ ()
700
+ set_clearcoatTexture__ ()
966
701
  {
967
- this .specularGlossinessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._specularGlossinessTexture);
702
+ this .clearcoatTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatTexture);
968
703
 
969
- this .setTexture (this .getTextureIndices () .SPECULAR_GLOSSINESS_TEXTURE, this .specularGlossinessTextureNode);
704
+ this .setTexture (0, this .clearcoatTextureNode);
970
705
  },
971
- set_occlusionStrength__ ()
706
+ set_clearcoatRoughness__ ()
972
707
  {
973
- this .occlusionStrength = Algorithm_default().clamp (this ._occlusionStrength .getValue (), 0, 1);
708
+ this .clearcoatRoughness = Algorithm_default().clamp (this ._clearcoatRoughness .getValue (), 0, 1);
974
709
  },
975
- set_occlusionTexture__ ()
710
+ set_clearcoatRoughnessTexture__ ()
976
711
  {
977
- this .occlusionTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._occlusionTexture);
712
+ this .clearcoatRoughnessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatRoughnessTexture);
978
713
 
979
- this .setTexture (this .getTextureIndices () .OCCLUSION_TEXTURE, this .occlusionTextureNode);
980
- },
981
- set_transparent__ ()
982
- {
983
- this .setTransparent (this .getTransparency () ||
984
- this .diffuseTextureNode ?.isTransparent ());
714
+ this .setTexture (1, this .clearcoatRoughnessTextureNode);
985
715
  },
986
- set_extensions__ ()
716
+ set_clearcoatNormalTexture__ ()
987
717
  {
988
- const extensionNodes = this .extensionNodes;
989
-
990
- for (const extensionNode of extensionNodes)
991
- extensionNode .removeInterest ("set_extensionsKey__", this);
992
-
993
- extensionNodes .length = 0;
994
-
995
- for (const node of this ._extensions)
996
- {
997
- const extensionNode = X3DCast_default() ((X3DConstants_default()).X3DMaterialExtensionNode, node);
998
-
999
- if (extensionNode)
1000
- extensionNodes .push (extensionNode);
1001
- }
1002
-
1003
- extensionNodes .sort ((a, b) => a .getExtensionKey () - b .getExtensionKey ());
1004
-
1005
- for (const extensionNode of extensionNodes)
1006
- extensionNode .addInterest ("set_extensionsKey__", this);
1007
-
1008
- this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes ((X3DConstants_default()).TransmissionMaterialExtension)));
718
+ this .clearcoatNormalTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatNormalTexture);
1009
719
 
1010
- this .set_extensionsKey__ ();
720
+ this .setTexture (2, this .clearcoatNormalTextureNode);
1011
721
  },
1012
- set_extensionsKey__ ()
722
+ getExtensionKey ()
1013
723
  {
1014
- const extensionsKey = this .extensionNodes
1015
- .map (extensionNode => `${extensionNode .getExtensionKey () .toString (16)}${extensionNode .getTextureBits () .toString (16)}`)
1016
- .join ("");
1017
-
1018
- this .materialKey = `[4.${extensionsKey}]`;
724
+ return X_ITE_ExtensionKeys .CLEARCOAT_MATERIAL_EXTENSION;
1019
725
  },
1020
- createShader (key, geometryContext, renderContext)
726
+ getShaderOptions (options)
1021
727
  {
1022
- const
1023
- browser = this .getBrowser (),
1024
- options = this .getShaderOptions (geometryContext, renderContext);
1025
-
1026
- for (const extensionNode of this .extensionNodes)
1027
- extensionNode .getShaderOptions (options);
1028
-
1029
- options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_SPECULAR_GLOSSINESS");
1030
-
1031
- if (+this .getTextureBits ())
1032
- {
1033
- this .diffuseTextureNode ?.getShaderOptions (options, "DIFFUSE");
1034
- this .specularGlossinessTextureNode ?.getShaderOptions (options, "SPECULAR_GLOSSINESS");
1035
- this .occlusionTextureNode ?.getShaderOptions (options, "OCCLUSION");
1036
- }
728
+ options .push ("X3D_CLEARCOAT_MATERIAL_EXT");
1037
729
 
1038
- const shaderNode = browser .createShader ("SpecularGlossiness", "Default", "Physical", options);
730
+ if (!+this .getTextureBits ())
731
+ return;
1039
732
 
1040
- browser .getShaders () .set (key, shaderNode);
733
+ options .push ("X3D_MATERIAL_TEXTURES");
1041
734
 
1042
- return shaderNode;
735
+ this .clearcoatTextureNode ?.getShaderOptions (options, "CLEARCOAT", true);
736
+ this .clearcoatRoughnessTextureNode ?.getShaderOptions (options, "CLEARCOAT_ROUGHNESS", true);
737
+ this .clearcoatNormalTextureNode ?.getShaderOptions (options, "CLEARCOAT_NORMAL", true);
1043
738
  },
1044
739
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1045
740
  {
1046
- X3DOneSidedMaterialNode_default().prototype .setShaderUniforms .call (this, gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
1047
-
1048
- for (const extensionNode of this .extensionNodes)
1049
- extensionNode .setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
1050
-
1051
- gl .uniform3fv (shaderObject .x3d_DiffuseColor, this .diffuseColorArray);
1052
- gl .uniform3fv (shaderObject .x3d_SpecularColor, this .specularColorArray);
1053
- gl .uniform1f (shaderObject .x3d_Glossiness, this .glossiness);
741
+ gl .uniform1f (shaderObject .x3d_ClearcoatEXT, this .clearcoat);
742
+ gl .uniform1f (shaderObject .x3d_ClearcoatRoughnessEXT, this .clearcoatRoughness);
1054
743
 
1055
744
  if (!+this .getTextureBits ())
1056
745
  return;
1057
746
 
1058
- this .diffuseTextureNode ?.setNamedShaderUniforms (gl,
747
+ this .clearcoatTextureNode ?.setNamedShaderUniforms (gl,
1059
748
  shaderObject,
1060
749
  renderObject,
1061
- shaderObject .x3d_DiffuseTexture,
1062
- this ._diffuseTextureMapping .getValue (),
750
+ shaderObject .x3d_ClearcoatTextureEXT,
751
+ this ._clearcoatTextureMapping .getValue (),
1063
752
  textureTransformMapping,
1064
753
  textureCoordinateMapping);
1065
754
 
1066
- this .specularGlossinessTextureNode ?.setNamedShaderUniforms (gl,
755
+ this .clearcoatRoughnessTextureNode ?.setNamedShaderUniforms (gl,
1067
756
  shaderObject,
1068
757
  renderObject,
1069
- shaderObject .x3d_SpecularGlossinessTexture,
1070
- this ._specularGlossinessTextureMapping .getValue (),
758
+ shaderObject .x3d_ClearcoatRoughnessTextureEXT,
759
+ this ._clearcoatRoughnessTextureMapping .getValue (),
1071
760
  textureTransformMapping,
1072
761
  textureCoordinateMapping);
1073
762
 
1074
- if (this .occlusionTextureNode)
1075
- gl .uniform1f (shaderObject .x3d_OcclusionStrength, this .occlusionStrength);
1076
-
1077
- this .occlusionTextureNode ?.setNamedShaderUniforms (gl,
763
+ this .clearcoatNormalTextureNode ?.setNamedShaderUniforms (gl,
1078
764
  shaderObject,
1079
765
  renderObject,
1080
- shaderObject .x3d_OcclusionTexture,
1081
- this ._occlusionTextureMapping .getValue (),
766
+ shaderObject .x3d_ClearcoatNormalTextureEXT,
767
+ this ._clearcoatNormalTextureMapping .getValue (),
1082
768
  textureTransformMapping,
1083
769
  textureCoordinateMapping);
1084
770
  },
1085
771
  });
1086
772
 
1087
- Object .defineProperties (SpecularGlossinessMaterial,
773
+ Object .defineProperties (ClearcoatMaterialExtension,
1088
774
  {
1089
775
  typeName:
1090
776
  {
1091
- value: "SpecularGlossinessMaterial",
777
+ value: "ClearcoatMaterialExtension",
1092
778
  enumerable: true,
1093
779
  },
1094
780
  componentInfo:
@@ -1098,7 +784,7 @@ Object .defineProperties (SpecularGlossinessMaterial,
1098
784
  },
1099
785
  containerField:
1100
786
  {
1101
- value: "material",
787
+ value: "extensions",
1102
788
  enumerable: true,
1103
789
  },
1104
790
  specificationRange:
@@ -1110,49 +796,25 @@ Object .defineProperties (SpecularGlossinessMaterial,
1110
796
  {
1111
797
  value: new (FieldDefinitionArray_default()) ([
1112
798
  new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1113
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseColor", new (Fields_default()).SFColor (1, 1, 1)),
1114
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTextureMapping", new (Fields_default()).SFString ()),
1115
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTexture", new (Fields_default()).SFNode ()),
1116
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularColor", new (Fields_default()).SFColor (1, 1, 1)),
1117
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "glossiness", new (Fields_default()).SFFloat (1)),
1118
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularGlossinessTextureMapping", new (Fields_default()).SFString ()),
1119
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularGlossinessTexture", new (Fields_default()).SFNode ()),
1120
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveColor", new (Fields_default()).SFColor ()),
1121
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveTextureMapping", new (Fields_default()).SFString ()),
1122
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveTexture", new (Fields_default()).SFNode ()),
1123
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionStrength", new (Fields_default()).SFFloat (1)),
1124
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionTextureMapping", new (Fields_default()).SFString ()),
1125
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionTexture", new (Fields_default()).SFNode ()),
1126
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalScale", new (Fields_default()).SFFloat (1)),
1127
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalTextureMapping", new (Fields_default()).SFString ()),
1128
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalTexture", new (Fields_default()).SFNode ()),
1129
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "transparency", new (Fields_default()).SFFloat ()),
1130
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "extensions", new (Fields_default()).MFNode ()), // experimental
799
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoat", new (Fields_default()).SFFloat ()),
800
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatTextureMapping", new (Fields_default()).SFString ()),
801
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatTexture", new (Fields_default()).SFNode ()),
802
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughness", new (Fields_default()).SFFloat ()),
803
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughnessTextureMapping", new (Fields_default()).SFString ()),
804
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughnessTexture", new (Fields_default()).SFNode ()),
805
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatNormalTextureMapping", new (Fields_default()).SFString ()),
806
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatNormalTexture", new (Fields_default()).SFNode ()),
1131
807
  ]),
1132
808
  enumerable: true,
1133
809
  },
1134
810
  });
1135
811
 
1136
- for (const index of Object .values (SpecularGlossinessMaterial .prototype .getTextureIndices ()))
1137
- {
1138
- SpecularGlossinessMaterial .prototype [`setTexture${index}`] = function (index, textureNode)
1139
- {
1140
- this .setTexture (index, textureNode);
1141
- };
1142
- }
1143
-
1144
- const SpecularGlossinessMaterial_default_ = SpecularGlossinessMaterial;
812
+ const ClearcoatMaterialExtension_default_ = ClearcoatMaterialExtension;
1145
813
  ;
1146
814
 
1147
- Namespace_default().add ("SpecularGlossinessMaterial", "x_ite/Components/X_ITE/SpecularGlossinessMaterial", SpecularGlossinessMaterial_default_);
1148
- /* harmony default export */ const X_ITE_SpecularGlossinessMaterial = (SpecularGlossinessMaterial_default_);
1149
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DNode\")"
1150
- const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("x_ite/Components/Core/X3DNode");
1151
- var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
1152
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Utility/BitSet\")"
1153
- const BitSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.5")] .require ("standard/Utility/BitSet");
1154
- var BitSet_default = /*#__PURE__*/__webpack_require__.n(BitSet_namespaceObject);
1155
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/X3DMaterialExtensionNode.js
815
+ Namespace_default().add ("ClearcoatMaterialExtension", "x_ite/Components/X_ITE/ClearcoatMaterialExtension", ClearcoatMaterialExtension_default_);
816
+ /* harmony default export */ const X_ITE_ClearcoatMaterialExtension = (ClearcoatMaterialExtension_default_);
817
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/DepthMode.js
1156
818
  /*******************************************************************************
1157
819
  *
1158
820
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1204,35 +866,88 @@ var BitSet_default = /*#__PURE__*/__webpack_require__.n(BitSet_namespaceObject);
1204
866
 
1205
867
 
1206
868
 
1207
- function X3DMaterialExtensionNode (executionContext)
869
+
870
+
871
+ /**
872
+ * THIS NODE IS STILL EXPERIMENTAL.
873
+ */
874
+
875
+ function DepthMode (executionContext)
1208
876
  {
1209
- X3DNode_default().call (this, executionContext);
877
+ X3DAppearanceChildNode_default().call (this, executionContext);
1210
878
 
1211
- this .addType ((X3DConstants_default()).X3DMaterialExtensionNode);
879
+ this .addType ((X3DConstants_default()).DepthMode);
1212
880
 
1213
- this .textureBits = new (BitSet_default()) ();
881
+ this .addAlias ("depthFunc", this ._depthFunction);
1214
882
  }
1215
883
 
1216
- Object .assign (Object .setPrototypeOf (X3DMaterialExtensionNode .prototype, (X3DNode_default()).prototype),
884
+ Object .assign (Object .setPrototypeOf (DepthMode .prototype, (X3DAppearanceChildNode_default()).prototype),
1217
885
  {
1218
- setTexture (index, textureNode)
886
+ initialize ()
1219
887
  {
1220
- index *= 4;
888
+ X3DAppearanceChildNode_default().prototype .initialize .call (this);
1221
889
 
1222
- this .textureBits .remove (index, 0xf);
1223
- this .textureBits .add (index, textureNode ?.getTextureBits () ?? 0);
890
+ this ._depthFunction .addInterest ("set_depthFunction__", this);
891
+
892
+ this .set_depthFunction__ ();
1224
893
  },
1225
- getTextureBits ()
894
+ set_depthFunction__: (function ()
1226
895
  {
1227
- return this .textureBits;
896
+ const depthFunctions = new Map ([
897
+ ["NEVER", "NEVER"],
898
+ ["LESS", "LESS"],
899
+ ["EQUAL", "EQUAL"],
900
+ ["LESS_EQUAL", "LEQUAL"],
901
+ ["GREATER", "GREATER"],
902
+ ["NOT_EQUAL", "NOTEQUAL"],
903
+ ["GREATER_EQUAL", "GEQUAL"],
904
+ ["ALWAYS", "ALWAYS"],
905
+ ]);
906
+
907
+ return function ()
908
+ {
909
+ const gl = this .getBrowser () .getContext ();
910
+
911
+ this .depthFunction = gl [depthFunctions .get (this ._depthFunction .getValue ()) ?? "LEQUAL"];
912
+ };
913
+ })(),
914
+ enable (gl)
915
+ {
916
+ this .depthTest = gl .isEnabled (gl .DEPTH_TEST);
917
+ this .depthWriteMask = gl .getParameter (gl .DEPTH_WRITEMASK);
918
+
919
+ gl .enable (gl .POLYGON_OFFSET_FILL);
920
+ gl .polygonOffset (... this ._polygonOffset);
921
+
922
+ if (this ._depthTest .getValue ())
923
+ gl .enable (gl .DEPTH_TEST);
924
+ else
925
+ gl .disable (gl .DEPTH_TEST);
926
+
927
+ gl .depthFunc (this .depthFunction);
928
+ gl .depthRange (... this ._depthRange .getValue ());
929
+ gl .depthMask (this ._depthMask .getValue ());
930
+ },
931
+ disable (gl)
932
+ {
933
+ gl .disable (gl .POLYGON_OFFSET_FILL);
934
+
935
+ if (this .depthTest)
936
+ gl .enable (gl .DEPTH_TEST);
937
+ else
938
+ gl .disable (gl .DEPTH_TEST);
939
+
940
+ gl .depthFunc (gl .LEQUAL);
941
+ gl .depthRange (0, 1);
942
+ gl .depthMask (this .depthWriteMask);
1228
943
  },
1229
944
  });
1230
945
 
1231
- Object .defineProperties (X3DMaterialExtensionNode,
946
+ Object .defineProperties (DepthMode,
1232
947
  {
1233
948
  typeName:
1234
949
  {
1235
- value: "X3DMaterialExtensionNode",
950
+ value: "DepthMode",
1236
951
  enumerable: true,
1237
952
  },
1238
953
  componentInfo:
@@ -1240,14 +955,36 @@ Object .defineProperties (X3DMaterialExtensionNode,
1240
955
  value: Object .freeze ({ name: "X_ITE", level: 1 }),
1241
956
  enumerable: true,
1242
957
  },
958
+ containerField:
959
+ {
960
+ value: "depthMode",
961
+ enumerable: true,
962
+ },
963
+ specificationRange:
964
+ {
965
+ value: Object .freeze ({ from: "4.0", to: "Infinity" }),
966
+ enumerable: true,
967
+ },
968
+ fieldDefinitions:
969
+ {
970
+ value: new (FieldDefinitionArray_default()) ([
971
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
972
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "polygonOffset", new (Fields_default()).SFVec2f ()),
973
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthRange", new (Fields_default()).SFVec2f (0, 1)),
974
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthTest", new (Fields_default()).SFBool (true)),
975
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthFunction", new (Fields_default()).SFString ("LESS_EQUAL")),
976
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "depthMask", new (Fields_default()).SFBool (true)),
977
+ ]),
978
+ enumerable: true,
979
+ },
1243
980
  });
1244
981
 
1245
- const X3DMaterialExtensionNode_default_ = X3DMaterialExtensionNode;
982
+ const DepthMode_default_ = DepthMode;
1246
983
  ;
1247
984
 
1248
- Namespace_default().add ("X3DMaterialExtensionNode", "x_ite/Components/X_ITE/X3DMaterialExtensionNode", X3DMaterialExtensionNode_default_);
1249
- /* harmony default export */ const X_ITE_X3DMaterialExtensionNode = (X3DMaterialExtensionNode_default_);
1250
- ;// CONCATENATED MODULE: ./src/x_ite/Browser/X_ITE/ExtensionKeys.js
985
+ Namespace_default().add ("DepthMode", "x_ite/Components/X_ITE/DepthMode", DepthMode_default_);
986
+ /* harmony default export */ const X_ITE_DepthMode = (DepthMode_default_);
987
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/DiffuseTransmissionMaterialExtension.js
1251
988
  /*******************************************************************************
1252
989
  *
1253
990
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1295,29 +1032,157 @@ Namespace_default().add ("X3DMaterialExtensionNode", "x_ite/Components/X_ITE/X3D
1295
1032
  *
1296
1033
  ******************************************************************************/
1297
1034
 
1298
- let i = 0;
1299
1035
 
1300
- const ExtensionKeys =
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+ /**
1044
+ * THIS NODE IS STILL EXPERIMENTAL.
1045
+ */
1046
+
1047
+ function DiffuseTransmissionMaterialExtension (executionContext)
1301
1048
  {
1302
- ANISOTROPY_MATERIAL_EXTENSION: i ++,
1303
- CLEARCOAT_MATERIAL_EXTENSION: i ++,
1304
- DISPERSION_MATERIAL_EXTENSION: i ++,
1305
- EMISSIVE_STRENGTH_MATERIAL_EXTENSION: i ++,
1306
- IOR_MATERIAL_EXTENSION: i ++,
1307
- IRIDESCENCE_MATERIAL_EXTENSION: i ++,
1308
- SHEEN_MATERIAL_EXTENSION: i ++,
1309
- SPECULAR_MATERIAL_EXTENSION: i ++,
1310
- TRANSMISSION_MATERIAL_EXTENSION: i ++,
1311
- UNLIT_MATERIAL_EXTENSION: i ++,
1312
- VOLUME_MATERIAL_EXTENSION: i ++,
1313
- };
1049
+ X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
1314
1050
 
1315
- const ExtensionKeys_default_ = ExtensionKeys;
1051
+ this .addType ((X3DConstants_default()).DiffuseTransmissionMaterialExtension);
1052
+
1053
+ this .diffuseTransmissionColorArray = new Float32Array (3);
1054
+ }
1055
+
1056
+ Object .assign (Object .setPrototypeOf (DiffuseTransmissionMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1057
+ {
1058
+ initialize ()
1059
+ {
1060
+ X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
1061
+
1062
+ this ._diffuseTransmission .addInterest ("set_diffuseTransmission__", this);
1063
+ this ._diffuseTransmissionTexture .addInterest ("set_diffuseTransmissionTexture__", this);
1064
+ this ._diffuseTransmissionColor .addInterest ("set_diffuseTransmissionColor__", this);
1065
+ this ._diffuseTransmissionColorTexture .addInterest ("set_diffuseTransmissionColorTexture__", this);
1066
+
1067
+ this .set_diffuseTransmission__ ();
1068
+ this .set_diffuseTransmissionTexture__ ();
1069
+ this .set_diffuseTransmissionColor__ ();
1070
+ this .set_diffuseTransmissionColorTexture__ ();
1071
+ },
1072
+ set_diffuseTransmission__ ()
1073
+ {
1074
+ this .diffuseTransmission = Math .max (this ._diffuseTransmission .getValue (), 0);
1075
+ },
1076
+ set_diffuseTransmissionTexture__ ()
1077
+ {
1078
+ this .diffuseTransmissionTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._diffuseTransmissionTexture);
1079
+
1080
+ this .setTexture (0, this .diffuseTransmissionTextureNode);
1081
+ },
1082
+ set_diffuseTransmissionColor__ ()
1083
+ {
1084
+ //We cannot use this in Windows Edge:
1085
+ //this .diffuseTransmissionColorArray .set (this ._diffuseTransmissionColor .getValue ());
1086
+
1087
+ const
1088
+ diffuseTransmissionColorArray = this .diffuseTransmissionColorArray,
1089
+ diffuseTransmissionColor = this ._diffuseTransmissionColor .getValue ();
1090
+
1091
+ diffuseTransmissionColorArray [0] = diffuseTransmissionColor .r;
1092
+ diffuseTransmissionColorArray [1] = diffuseTransmissionColor .g;
1093
+ diffuseTransmissionColorArray [2] = diffuseTransmissionColor .b;
1094
+ },
1095
+ set_diffuseTransmissionColorTexture__ ()
1096
+ {
1097
+ this .diffuseTransmissionColorTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._diffuseTransmissionColorTexture);
1098
+
1099
+ this .setTexture (1, this .diffuseTransmissionColorTextureNode);
1100
+ },
1101
+ getExtensionKey ()
1102
+ {
1103
+ return X_ITE_ExtensionKeys .DIFFUSE_TRANSMISSION_EXTENSION;
1104
+ },
1105
+ getShaderOptions (options)
1106
+ {
1107
+ options .push ("X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT");
1108
+
1109
+ if (!+this .getTextureBits ())
1110
+ return;
1111
+
1112
+ options .push ("X3D_MATERIAL_TEXTURES");
1113
+
1114
+ this .diffuseTransmissionTextureNode ?.getShaderOptions (options, "DIFFUSE_TRANSMISSION", true);
1115
+ this .diffuseTransmissionColorTextureNode ?.getShaderOptions (options, "DIFFUSE_TRANSMISSION_COLOR", true);
1116
+ },
1117
+ setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1118
+ {
1119
+ gl .uniform1f (shaderObject .x3d_DiffuseTransmissionEXT, this .diffuseTransmission);
1120
+ gl .uniform3fv (shaderObject .x3d_DiffuseTransmissionColorEXT, this .diffuseTransmissionColorArray);
1121
+
1122
+ if (!+this .getTextureBits ())
1123
+ return;
1124
+
1125
+ this .diffuseTransmissionTextureNode ?.setNamedShaderUniforms (gl,
1126
+ shaderObject,
1127
+ renderObject,
1128
+ shaderObject .x3d_DiffuseTransmissionTextureEXT,
1129
+ this ._diffuseTransmissionTextureMapping .getValue (),
1130
+ textureTransformMapping,
1131
+ textureCoordinateMapping);
1132
+
1133
+ this .diffuseTransmissionColorTextureNode ?.setNamedShaderUniforms (gl,
1134
+ shaderObject,
1135
+ renderObject,
1136
+ shaderObject .x3d_DiffuseTransmissionColorTextureEXT,
1137
+ this ._diffuseTransmissionColorTextureMapping .getValue (),
1138
+ textureTransformMapping,
1139
+ textureCoordinateMapping);
1140
+ },
1141
+ });
1142
+
1143
+ Object .defineProperties (DiffuseTransmissionMaterialExtension,
1144
+ {
1145
+ typeName:
1146
+ {
1147
+ value: "DiffuseTransmissionMaterialExtension",
1148
+ enumerable: true,
1149
+ },
1150
+ componentInfo:
1151
+ {
1152
+ value: Object .freeze ({ name: "X_ITE", level: 1 }),
1153
+ enumerable: true,
1154
+ },
1155
+ containerField:
1156
+ {
1157
+ value: "extensions",
1158
+ enumerable: true,
1159
+ },
1160
+ specificationRange:
1161
+ {
1162
+ value: Object .freeze ({ from: "4.0", to: "Infinity" }),
1163
+ enumerable: true,
1164
+ },
1165
+ fieldDefinitions:
1166
+ {
1167
+ value: new (FieldDefinitionArray_default()) ([
1168
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1169
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTransmission", new (Fields_default()).SFFloat ()),
1170
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTransmissionTextureMapping", new (Fields_default()).SFString ()),
1171
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTransmissionTexture", new (Fields_default()).SFNode ()),
1172
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTransmissionColor", new (Fields_default()).SFColor (1, 1, 1)),
1173
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTransmissionColorTextureMapping", new (Fields_default()).SFString ()),
1174
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTransmissionColorTexture", new (Fields_default()).SFNode ()),
1175
+ ]),
1176
+ enumerable: true,
1177
+ },
1178
+ });
1179
+
1180
+ const DiffuseTransmissionMaterialExtension_default_ = DiffuseTransmissionMaterialExtension;
1316
1181
  ;
1317
1182
 
1318
- Namespace_default().add ("ExtensionKeys", "x_ite/Browser/X_ITE/ExtensionKeys", ExtensionKeys_default_);
1319
- /* harmony default export */ const X_ITE_ExtensionKeys = (ExtensionKeys_default_);
1320
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/AnisotropyMaterialExtension.js
1183
+ Namespace_default().add ("DiffuseTransmissionMaterialExtension", "x_ite/Components/X_ITE/DiffuseTransmissionMaterialExtension", DiffuseTransmissionMaterialExtension_default_);
1184
+ /* harmony default export */ const X_ITE_DiffuseTransmissionMaterialExtension = (DiffuseTransmissionMaterialExtension_default_);
1185
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/DispersionMaterialExtension.js
1321
1186
  /*******************************************************************************
1322
1187
  *
1323
1188
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1372,85 +1237,50 @@ Namespace_default().add ("ExtensionKeys", "x_ite/Browser/X_ITE/ExtensionKeys", E
1372
1237
 
1373
1238
 
1374
1239
 
1375
-
1376
1240
  /**
1377
1241
  * THIS NODE IS STILL EXPERIMENTAL.
1378
1242
  */
1379
1243
 
1380
- function AnisotropyMaterialExtension (executionContext)
1244
+ function DispersionMaterialExtension (executionContext)
1381
1245
  {
1382
1246
  X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
1383
1247
 
1384
- this .addType ((X3DConstants_default()).AnisotropyMaterialExtension);
1385
-
1386
- this .anisotropyArray = new Float32Array (3);
1248
+ this .addType ((X3DConstants_default()).DispersionMaterialExtension);
1387
1249
  }
1388
1250
 
1389
- Object .assign (Object .setPrototypeOf (AnisotropyMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1251
+ Object .assign (Object .setPrototypeOf (DispersionMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1390
1252
  {
1391
1253
  initialize ()
1392
1254
  {
1393
1255
  X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
1394
1256
 
1395
- this ._anisotropyStrength .addInterest ("set_anisotropyStrength__", this);
1396
- this ._anisotropyRotation .addInterest ("set_anisotropyRotation__", this);
1397
- this ._anisotropyTexture .addInterest ("set_anisotropyTexture__", this);
1398
-
1399
- this .set_anisotropyStrength__ ();
1400
- this .set_anisotropyRotation__ ();
1401
- this .set_anisotropyTexture__ ();
1402
- },
1403
- set_anisotropyStrength__ ()
1404
- {
1405
- this .anisotropyArray [2] = Math .max (this ._anisotropyStrength .getValue (), 0);
1406
- },
1407
- set_anisotropyRotation__ ()
1408
- {
1409
- const anisotropyRotation = this ._anisotropyRotation .getValue ();
1257
+ this ._dispersion .addInterest ("set_dispersion__", this);
1410
1258
 
1411
- this .anisotropyArray [0] = Math .cos (anisotropyRotation);
1412
- this .anisotropyArray [1] = Math .sin (anisotropyRotation);
1259
+ this .set_dispersion__ ();
1413
1260
  },
1414
- set_anisotropyTexture__ ()
1261
+ set_dispersion__ ()
1415
1262
  {
1416
- this .anisotropyTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._anisotropyTexture);
1417
-
1418
- this .setTexture (0, this .anisotropyTextureNode);
1263
+ this .dispersion = Math .max (this ._dispersion .getValue (), 0);
1419
1264
  },
1420
1265
  getExtensionKey ()
1421
1266
  {
1422
- return X_ITE_ExtensionKeys .ANISOTROPY_MATERIAL_EXTENSION;
1267
+ return X_ITE_ExtensionKeys .DISPERSION_MATERIAL_EXTENSION;
1423
1268
  },
1424
1269
  getShaderOptions (options)
1425
1270
  {
1426
- options .push ("X3D_ANISOTROPY_MATERIAL_EXT");
1427
-
1428
- if (!+this .getTextureBits ())
1429
- return;
1430
-
1431
- options .push ("X3D_MATERIAL_TEXTURES");
1432
-
1433
- this .anisotropyTextureNode ?.getShaderOptions (options, "ANISOTROPY", true);
1271
+ options .push ("X3D_DISPERSION_MATERIAL_EXT");
1434
1272
  },
1435
1273
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1436
1274
  {
1437
- gl .uniform3fv (shaderObject .x3d_AnisotropyEXT, this .anisotropyArray);
1438
-
1439
- this .anisotropyTextureNode ?.setNamedShaderUniforms (gl,
1440
- shaderObject,
1441
- renderObject,
1442
- shaderObject .x3d_AnisotropyTextureEXT,
1443
- this ._anisotropyTextureMapping .getValue (),
1444
- textureTransformMapping,
1445
- textureCoordinateMapping);
1275
+ gl .uniform1f (shaderObject .x3d_DispersionEXT, this .dispersion);
1446
1276
  },
1447
1277
  });
1448
1278
 
1449
- Object .defineProperties (AnisotropyMaterialExtension,
1279
+ Object .defineProperties (DispersionMaterialExtension,
1450
1280
  {
1451
1281
  typeName:
1452
1282
  {
1453
- value: "AnisotropyMaterialExtension",
1283
+ value: "DispersionMaterialExtension",
1454
1284
  enumerable: true,
1455
1285
  },
1456
1286
  componentInfo:
@@ -1471,22 +1301,19 @@ Object .defineProperties (AnisotropyMaterialExtension,
1471
1301
  fieldDefinitions:
1472
1302
  {
1473
1303
  value: new (FieldDefinitionArray_default()) ([
1474
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1475
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyStrength", new (Fields_default()).SFFloat ()),
1476
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyRotation", new (Fields_default()).SFFloat ()),
1477
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyTextureMapping", new (Fields_default()).SFString ()),
1478
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyTexture", new (Fields_default()).SFNode ()),
1304
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1305
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "dispersion", new (Fields_default()).SFFloat ()),
1479
1306
  ]),
1480
1307
  enumerable: true,
1481
1308
  },
1482
1309
  });
1483
1310
 
1484
- const AnisotropyMaterialExtension_default_ = AnisotropyMaterialExtension;
1311
+ const DispersionMaterialExtension_default_ = DispersionMaterialExtension;
1485
1312
  ;
1486
1313
 
1487
- Namespace_default().add ("AnisotropyMaterialExtension", "x_ite/Components/X_ITE/AnisotropyMaterialExtension", AnisotropyMaterialExtension_default_);
1488
- /* harmony default export */ const X_ITE_AnisotropyMaterialExtension = (AnisotropyMaterialExtension_default_);
1489
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/ClearcoatMaterialExtension.js
1314
+ Namespace_default().add ("DispersionMaterialExtension", "x_ite/Components/X_ITE/DispersionMaterialExtension", DispersionMaterialExtension_default_);
1315
+ /* harmony default export */ const X_ITE_DispersionMaterialExtension = (DispersionMaterialExtension_default_);
1316
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/EmissiveStrengthMaterialExtension.js
1490
1317
  /*******************************************************************************
1491
1318
  *
1492
1319
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1541,119 +1368,50 @@ Namespace_default().add ("AnisotropyMaterialExtension", "x_ite/Components/X_ITE/
1541
1368
 
1542
1369
 
1543
1370
 
1544
-
1545
-
1546
1371
  /**
1547
1372
  * THIS NODE IS STILL EXPERIMENTAL.
1548
1373
  */
1549
1374
 
1550
- function ClearcoatMaterialExtension (executionContext)
1375
+ function EmissiveStrengthMaterialExtension (executionContext)
1551
1376
  {
1552
1377
  X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
1553
1378
 
1554
- this .addType ((X3DConstants_default()).ClearcoatMaterialExtension);
1379
+ this .addType ((X3DConstants_default()).EmissiveStrengthMaterialExtension);
1555
1380
  }
1556
1381
 
1557
- Object .assign (Object .setPrototypeOf (ClearcoatMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1382
+ Object .assign (Object .setPrototypeOf (EmissiveStrengthMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1558
1383
  {
1559
1384
  initialize ()
1560
1385
  {
1561
1386
  X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
1562
1387
 
1563
- this ._clearcoat .addInterest ("set_clearcoat__", this);
1564
- this ._clearcoatTexture .addInterest ("set_clearcoatTexture__", this);
1565
- this ._clearcoatRoughness .addInterest ("set_clearcoatRoughness__", this);
1566
- this ._clearcoatRoughnessTexture .addInterest ("set_clearcoatRoughnessTexture__", this);
1567
- this ._clearcoatNormalTexture .addInterest ("set_clearcoatNormalTexture__", this);
1568
-
1569
- this .set_clearcoat__ ();
1570
- this .set_clearcoatTexture__ ();
1571
- this .set_clearcoatRoughness__ ();
1572
- this .set_clearcoatRoughnessTexture__ ();
1573
- this .set_clearcoatNormalTexture__ ();
1574
- },
1575
- set_clearcoat__ ()
1576
- {
1577
- this .clearcoat = Math .max (this ._clearcoat .getValue (), 0);
1578
- },
1579
- set_clearcoatTexture__ ()
1580
- {
1581
- this .clearcoatTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatTexture);
1582
-
1583
- this .setTexture (0, this .clearcoatTextureNode);
1584
- },
1585
- set_clearcoatRoughness__ ()
1586
- {
1587
- this .clearcoatRoughness = Algorithm_default().clamp (this ._clearcoatRoughness .getValue (), 0, 1);
1588
- },
1589
- set_clearcoatRoughnessTexture__ ()
1590
- {
1591
- this .clearcoatRoughnessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatRoughnessTexture);
1388
+ this ._emissiveStrength .addInterest ("set_emissiveStrength__", this);
1592
1389
 
1593
- this .setTexture (1, this .clearcoatRoughnessTextureNode);
1390
+ this .set_emissiveStrength__ ();
1594
1391
  },
1595
- set_clearcoatNormalTexture__ ()
1392
+ set_emissiveStrength__ ()
1596
1393
  {
1597
- this .clearcoatNormalTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatNormalTexture);
1598
-
1599
- this .setTexture (2, this .clearcoatNormalTextureNode);
1394
+ this .emissiveStrength = Math .max (this ._emissiveStrength .getValue (), 0);
1600
1395
  },
1601
1396
  getExtensionKey ()
1602
1397
  {
1603
- return X_ITE_ExtensionKeys .CLEARCOAT_MATERIAL_EXTENSION;
1398
+ return X_ITE_ExtensionKeys .EMISSIVE_STRENGTH_MATERIAL_EXTENSION;
1604
1399
  },
1605
1400
  getShaderOptions (options)
1606
1401
  {
1607
- options .push ("X3D_CLEARCOAT_MATERIAL_EXT");
1608
-
1609
- if (!+this .getTextureBits ())
1610
- return;
1611
-
1612
- options .push ("X3D_MATERIAL_TEXTURES");
1613
-
1614
- this .clearcoatTextureNode ?.getShaderOptions (options, "CLEARCOAT", true);
1615
- this .clearcoatRoughnessTextureNode ?.getShaderOptions (options, "CLEARCOAT_ROUGHNESS", true);
1616
- this .clearcoatNormalTextureNode ?.getShaderOptions (options, "CLEARCOAT_NORMAL", true);
1402
+ options .push ("X3D_EMISSIVE_STRENGTH_MATERIAL_EXT");
1617
1403
  },
1618
1404
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1619
1405
  {
1620
- gl .uniform1f (shaderObject .x3d_ClearcoatEXT, this .clearcoat);
1621
- gl .uniform1f (shaderObject .x3d_ClearcoatRoughnessEXT, this .clearcoatRoughness);
1622
-
1623
- if (!+this .getTextureBits ())
1624
- return;
1625
-
1626
- this .clearcoatTextureNode ?.setNamedShaderUniforms (gl,
1627
- shaderObject,
1628
- renderObject,
1629
- shaderObject .x3d_ClearcoatTextureEXT,
1630
- this ._clearcoatTextureMapping .getValue (),
1631
- textureTransformMapping,
1632
- textureCoordinateMapping);
1633
-
1634
- this .clearcoatRoughnessTextureNode ?.setNamedShaderUniforms (gl,
1635
- shaderObject,
1636
- renderObject,
1637
- shaderObject .x3d_ClearcoatRoughnessTextureEXT,
1638
- this ._clearcoatRoughnessTextureMapping .getValue (),
1639
- textureTransformMapping,
1640
- textureCoordinateMapping);
1641
-
1642
- this .clearcoatNormalTextureNode ?.setNamedShaderUniforms (gl,
1643
- shaderObject,
1644
- renderObject,
1645
- shaderObject .x3d_ClearcoatNormalTextureEXT,
1646
- this ._clearcoatNormalTextureMapping .getValue (),
1647
- textureTransformMapping,
1648
- textureCoordinateMapping);
1406
+ gl .uniform1f (shaderObject .x3d_EmissiveStrengthEXT, this .emissiveStrength);
1649
1407
  },
1650
1408
  });
1651
1409
 
1652
- Object .defineProperties (ClearcoatMaterialExtension,
1410
+ Object .defineProperties (EmissiveStrengthMaterialExtension,
1653
1411
  {
1654
1412
  typeName:
1655
1413
  {
1656
- value: "ClearcoatMaterialExtension",
1414
+ value: "EmissiveStrengthMaterialExtension",
1657
1415
  enumerable: true,
1658
1416
  },
1659
1417
  componentInfo:
@@ -1674,26 +1432,37 @@ Object .defineProperties (ClearcoatMaterialExtension,
1674
1432
  fieldDefinitions:
1675
1433
  {
1676
1434
  value: new (FieldDefinitionArray_default()) ([
1677
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1678
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoat", new (Fields_default()).SFFloat ()),
1679
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatTextureMapping", new (Fields_default()).SFString ()),
1680
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatTexture", new (Fields_default()).SFNode ()),
1681
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughness", new (Fields_default()).SFFloat ()),
1682
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughnessTextureMapping", new (Fields_default()).SFString ()),
1683
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughnessTexture", new (Fields_default()).SFNode ()),
1684
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatNormalTextureMapping", new (Fields_default()).SFString ()),
1685
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatNormalTexture", new (Fields_default()).SFNode ()),
1435
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1436
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveStrength", new (Fields_default()).SFFloat (1)),
1686
1437
  ]),
1687
1438
  enumerable: true,
1688
1439
  },
1689
1440
  });
1690
1441
 
1691
- const ClearcoatMaterialExtension_default_ = ClearcoatMaterialExtension;
1442
+ const EmissiveStrengthMaterialExtension_default_ = EmissiveStrengthMaterialExtension;
1692
1443
  ;
1693
1444
 
1694
- Namespace_default().add ("ClearcoatMaterialExtension", "x_ite/Components/X_ITE/ClearcoatMaterialExtension", ClearcoatMaterialExtension_default_);
1695
- /* harmony default export */ const X_ITE_ClearcoatMaterialExtension = (ClearcoatMaterialExtension_default_);
1696
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/DispersionMaterialExtension.js
1445
+ Namespace_default().add ("EmissiveStrengthMaterialExtension", "x_ite/Components/X_ITE/EmissiveStrengthMaterialExtension", EmissiveStrengthMaterialExtension_default_);
1446
+ /* harmony default export */ const X_ITE_EmissiveStrengthMaterialExtension = (EmissiveStrengthMaterialExtension_default_);
1447
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DShapeNode\")"
1448
+ const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components/Shape/X3DShapeNode");
1449
+ var X3DShapeNode_default = /*#__PURE__*/__webpack_require__.n(X3DShapeNode_namespaceObject);
1450
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
1451
+ const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Rendering/TraverseType");
1452
+ var TraverseType_default = /*#__PURE__*/__webpack_require__.n(TraverseType_namespaceObject);
1453
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/VertexArray\")"
1454
+ const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Rendering/VertexArray");
1455
+ var VertexArray_default = /*#__PURE__*/__webpack_require__.n(VertexArray_namespaceObject);
1456
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
1457
+ const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Numbers/Vector3");
1458
+ var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
1459
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
1460
+ const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Numbers/Matrix4");
1461
+ var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
1462
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Box3\")"
1463
+ const Box3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Geometry/Box3");
1464
+ var Box3_default = /*#__PURE__*/__webpack_require__.n(Box3_namespaceObject);
1465
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/InstancedShape.js
1697
1466
  /*******************************************************************************
1698
1467
  *
1699
1468
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1748,50 +1517,239 @@ Namespace_default().add ("ClearcoatMaterialExtension", "x_ite/Components/X_ITE/C
1748
1517
 
1749
1518
 
1750
1519
 
1751
- /**
1752
- * THIS NODE IS STILL EXPERIMENTAL.
1753
- */
1754
1520
 
1755
- function DispersionMaterialExtension (executionContext)
1756
- {
1757
- X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
1758
1521
 
1759
- this .addType ((X3DConstants_default()).DispersionMaterialExtension);
1760
- }
1761
1522
 
1762
- Object .assign (Object .setPrototypeOf (DispersionMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1763
- {
1764
- initialize ()
1765
- {
1766
- X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
1767
1523
 
1768
- this ._dispersion .addInterest ("set_dispersion__", this);
1524
+ /**
1525
+ * THIS NODE IS STILL EXPERIMENTAL.
1526
+ */
1527
+
1528
+ function InstancedShape (executionContext)
1529
+ {
1530
+ X3DShapeNode_default().call (this, executionContext);
1531
+
1532
+ this .addType ((X3DConstants_default()).InstancedShape);
1533
+
1534
+ this .addChildObjects ((X3DConstants_default()).outputOnly, "matrices", new (Fields_default()).SFTime ());
1535
+
1536
+ this .min = new (Vector3_default()) ();
1537
+ this .max = new (Vector3_default()) ();
1538
+ this .scale = new (Vector3_default()) (1, 1, 1);
1539
+
1540
+ this .numInstances = 0;
1541
+ this .instancesStride = Float32Array .BYTES_PER_ELEMENT * (16 + 9); // mat4 + mat3
1542
+ this .matrixOffset = 0;
1543
+ this .normalMatrixOffset = Float32Array .BYTES_PER_ELEMENT * 16;
1544
+ }
1545
+
1546
+ Object .assign (Object .setPrototypeOf (InstancedShape .prototype, (X3DShapeNode_default()).prototype),
1547
+ {
1548
+ initialize ()
1549
+ {
1550
+ X3DShapeNode_default().prototype .initialize .call (this);
1551
+
1552
+ const
1553
+ browser = this .getBrowser (),
1554
+ gl = browser .getContext ();
1555
+
1556
+ // Check version.
1557
+
1558
+ if (browser .getContext () .getVersion () < 2)
1559
+ return;
1560
+
1561
+ this .instances = Object .assign (gl .createBuffer (),
1562
+ {
1563
+ vertexArrayObject: new (VertexArray_default()) (gl),
1564
+ thickLinesVertexArrayObject: new (VertexArray_default()) (gl),
1565
+ lineTrianglesBuffer: gl .createBuffer (),
1566
+ numLines: 0,
1567
+ });
1568
+
1569
+ this ._translations .addInterest ("set_transform__", this);
1570
+ this ._rotations .addInterest ("set_transform__", this);
1571
+ this ._scales .addInterest ("set_transform__", this);
1572
+ this ._matrices .addInterest ("set_matrices__", this);
1573
+
1574
+ this .set_transform__ ();
1575
+ },
1576
+ getShapeKey ()
1577
+ {
1578
+ return 3;
1579
+ },
1580
+ getNumInstances ()
1581
+ {
1582
+ return this .numInstances;
1583
+ },
1584
+ getInstances ()
1585
+ {
1586
+ return this .instances;
1587
+ },
1588
+ set_bbox__: (function ()
1589
+ {
1590
+ const
1591
+ min = new (Vector3_default()) (),
1592
+ max = new (Vector3_default()) (),
1593
+ bbox = new (Box3_default()) ();
1594
+
1595
+ return function ()
1596
+ {
1597
+ if (this .numInstances)
1598
+ {
1599
+ if (this ._bboxSize .getValue () .equals (this .getDefaultBBoxSize ()))
1600
+ {
1601
+ if (this .getGeometry ())
1602
+ bbox .assign (this .getGeometry () .getBBox ());
1603
+ else
1604
+ bbox .set ();
1605
+
1606
+ const
1607
+ size1_2 = bbox .size .multiply (this .scale .magnitude () / 2),
1608
+ center = bbox .center;
1609
+
1610
+ min .assign (this .min) .add (center) .subtract (size1_2);
1611
+ max .assign (this .max) .add (center) .add (size1_2);
1612
+
1613
+ this .bbox .setExtents (min, max);
1614
+ }
1615
+ else
1616
+ {
1617
+ this .bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
1618
+ }
1619
+ }
1620
+ else
1621
+ {
1622
+ this .bbox .set ();
1623
+ }
1624
+
1625
+ this .getBBoxSize () .assign (this .bbox .size);
1626
+ this .getBBoxCenter () .assign (this .bbox .center);
1627
+ };
1628
+ })(),
1629
+ set_transform__ ()
1630
+ {
1631
+ this ._matrices = this .getBrowser () .getCurrentTime ();
1632
+ },
1633
+ set_matrices__ ()
1634
+ {
1635
+ const
1636
+ browser = this .getBrowser (),
1637
+ gl = browser .getContext (),
1638
+ translations = this ._translations,
1639
+ rotations = this ._rotations,
1640
+ scales = this ._scales,
1641
+ numTranslations = translations .length,
1642
+ numRotations = rotations .length,
1643
+ numScales = scales .length,
1644
+ numInstances = Math .max (numTranslations, numRotations, numScales),
1645
+ stride = this .instancesStride / Float32Array .BYTES_PER_ELEMENT,
1646
+ length = this .instancesStride * numInstances,
1647
+ data = new Float32Array (length),
1648
+ matrix = new (Matrix4_default()) ();
1649
+
1650
+ this .numInstances = numInstances;
1651
+
1652
+ const
1653
+ min = this .min .set (Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY),
1654
+ max = this .max .set (Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY),
1655
+ scale = this .scale .assign (numScales ? max : (Vector3_default()).One);
1656
+
1657
+ for (let i = 0, o = 0; i < numInstances; ++ i, o += stride)
1658
+ {
1659
+ matrix .set (numTranslations ? translations [Math .min (i, numTranslations - 1)] .getValue () : null,
1660
+ numRotations ? rotations [Math .min (i, numRotations - 1)] .getValue () : null,
1661
+ numScales ? scales [Math .min (i, numScales - 1)] .getValue () : null);
1662
+
1663
+ if (numScales)
1664
+ scale .max (scales [Math .min (i, numScales - 1)] .getValue ());
1665
+
1666
+ data .set (matrix, o);
1667
+ data .set (matrix .submatrix .transpose () .inverse (), o + 16);
1668
+
1669
+ min .min (matrix .origin);
1670
+ max .max (matrix .origin);
1671
+ }
1672
+
1673
+ gl .bindBuffer (gl .ARRAY_BUFFER, this .instances);
1674
+ gl .bufferData (gl .ARRAY_BUFFER, data, gl .DYNAMIC_DRAW);
1769
1675
 
1770
- this .set_dispersion__ ();
1676
+ this .set_bbox__ ();
1771
1677
  },
1772
- set_dispersion__ ()
1678
+ set_geometry__ ()
1773
1679
  {
1774
- this .dispersion = Math .max (this ._dispersion .getValue (), 0);
1680
+ X3DShapeNode_default().prototype .set_geometry__ .call (this);
1681
+
1682
+ if (this .getGeometry ())
1683
+ delete this .traverse;
1684
+ else
1685
+ this .traverse = Function .prototype;
1686
+
1687
+ this .set_transform__ ();
1775
1688
  },
1776
- getExtensionKey ()
1689
+ intersectsBox (box, clipPlanes, modelViewMatrix)
1690
+ { },
1691
+ traverse (type, renderObject)
1777
1692
  {
1778
- return X_ITE_ExtensionKeys .DISPERSION_MATERIAL_EXTENSION;
1693
+ if (!this .numInstances)
1694
+ return;
1695
+
1696
+ // Always look at ParticleSystem if you do modify something here and there.
1697
+
1698
+ switch (type)
1699
+ {
1700
+ case (TraverseType_default()).POINTER:
1701
+ {
1702
+ if (this ._pointerEvents .getValue ())
1703
+ renderObject .addPointingShape (this);
1704
+
1705
+ break;
1706
+ }
1707
+ case (TraverseType_default()).PICKING:
1708
+ {
1709
+ break;
1710
+ }
1711
+ case (TraverseType_default()).COLLISION:
1712
+ {
1713
+ renderObject .addCollisionShape (this);
1714
+ break;
1715
+ }
1716
+ case (TraverseType_default()).SHADOW:
1717
+ {
1718
+ if (this ._castShadow .getValue ())
1719
+ renderObject .addShadowShape (this);
1720
+
1721
+ break;
1722
+ }
1723
+ case (TraverseType_default()).DISPLAY:
1724
+ {
1725
+ if (renderObject .addDisplayShape (this))
1726
+ {
1727
+ // Currently used for GeneratedCubeMapTexture.
1728
+ this .getAppearance () .traverse (type, renderObject);
1729
+ }
1730
+
1731
+ break;
1732
+ }
1733
+ }
1734
+
1735
+ // Currently used for ScreenText and Tools.
1736
+ this .getGeometry () .traverse (type, renderObject);
1779
1737
  },
1780
- getShaderOptions (options)
1738
+ displaySimple (gl, renderContext, shaderNode)
1781
1739
  {
1782
- options .push ("X3D_DISPERSION_MATERIAL_EXT");
1740
+ this .getGeometry () .displaySimpleInstanced (gl, shaderNode, this);
1783
1741
  },
1784
- setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1742
+ display (gl, renderContext)
1785
1743
  {
1786
- gl .uniform1f (shaderObject .x3d_DispersionEXT, this .dispersion);
1744
+ this .getGeometry () .displayInstanced (gl, renderContext, this);
1787
1745
  },
1788
1746
  });
1789
1747
 
1790
- Object .defineProperties (DispersionMaterialExtension,
1748
+ Object .defineProperties (InstancedShape,
1791
1749
  {
1792
1750
  typeName:
1793
1751
  {
1794
- value: "DispersionMaterialExtension",
1752
+ value: "InstancedShape",
1795
1753
  enumerable: true,
1796
1754
  },
1797
1755
  componentInfo:
@@ -1801,30 +1759,40 @@ Object .defineProperties (DispersionMaterialExtension,
1801
1759
  },
1802
1760
  containerField:
1803
1761
  {
1804
- value: "extensions",
1762
+ value: "children",
1805
1763
  enumerable: true,
1806
1764
  },
1807
1765
  specificationRange:
1808
1766
  {
1809
- value: Object .freeze ({ from: "4.0", to: "Infinity" }),
1767
+ value: Object .freeze ({ from: "2.0", to: "Infinity" }),
1810
1768
  enumerable: true,
1811
1769
  },
1812
1770
  fieldDefinitions:
1813
1771
  {
1814
1772
  value: new (FieldDefinitionArray_default()) ([
1815
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1816
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "dispersion", new (Fields_default()).SFFloat ()),
1773
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1774
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "translations", new (Fields_default()).MFVec3f ()),
1775
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "rotations", new (Fields_default()).MFRotation ()),
1776
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "scales", new (Fields_default()).MFVec3f ()),
1777
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "pointerEvents", new (Fields_default()).SFBool (true)),
1778
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "castShadow", new (Fields_default()).SFBool (true)),
1779
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "visible", new (Fields_default()).SFBool (true)),
1780
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "bboxDisplay", new (Fields_default()).SFBool ()),
1781
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).initializeOnly, "bboxSize", new (Fields_default()).SFVec3f (-1, -1, -1)),
1782
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).initializeOnly, "bboxCenter", new (Fields_default()).SFVec3f ()),
1783
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "appearance", new (Fields_default()).SFNode ()),
1784
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "geometry", new (Fields_default()).SFNode ()),
1817
1785
  ]),
1818
1786
  enumerable: true,
1819
1787
  },
1820
1788
  });
1821
1789
 
1822
- const DispersionMaterialExtension_default_ = DispersionMaterialExtension;
1790
+ const InstancedShape_default_ = InstancedShape;
1823
1791
  ;
1824
1792
 
1825
- Namespace_default().add ("DispersionMaterialExtension", "x_ite/Components/X_ITE/DispersionMaterialExtension", DispersionMaterialExtension_default_);
1826
- /* harmony default export */ const X_ITE_DispersionMaterialExtension = (DispersionMaterialExtension_default_);
1827
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/EmissiveStrengthMaterialExtension.js
1793
+ Namespace_default().add ("InstancedShape", "x_ite/Components/X_ITE/InstancedShape", InstancedShape_default_);
1794
+ /* harmony default export */ const X_ITE_InstancedShape = (InstancedShape_default_);
1795
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/IORMaterialExtension.js
1828
1796
  /*******************************************************************************
1829
1797
  *
1830
1798
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1883,46 +1851,46 @@ Namespace_default().add ("DispersionMaterialExtension", "x_ite/Components/X_ITE/
1883
1851
  * THIS NODE IS STILL EXPERIMENTAL.
1884
1852
  */
1885
1853
 
1886
- function EmissiveStrengthMaterialExtension (executionContext)
1854
+ function IORMaterialExtension (executionContext)
1887
1855
  {
1888
1856
  X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
1889
1857
 
1890
- this .addType ((X3DConstants_default()).EmissiveStrengthMaterialExtension);
1858
+ this .addType ((X3DConstants_default()).IORMaterialExtension);
1891
1859
  }
1892
1860
 
1893
- Object .assign (Object .setPrototypeOf (EmissiveStrengthMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1861
+ Object .assign (Object .setPrototypeOf (IORMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1894
1862
  {
1895
1863
  initialize ()
1896
1864
  {
1897
1865
  X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
1898
1866
 
1899
- this ._emissiveStrength .addInterest ("set_emissiveStrength__", this);
1867
+ this ._indexOfRefraction .addInterest ("set_indexOfRefraction__", this);
1900
1868
 
1901
- this .set_emissiveStrength__ ();
1869
+ this .set_indexOfRefraction__ ();
1902
1870
  },
1903
- set_emissiveStrength__ ()
1871
+ set_indexOfRefraction__ ()
1904
1872
  {
1905
- this .emissiveStrength = Math .max (this ._emissiveStrength .getValue (), 0);
1873
+ this .indexOfRefraction = Math .max (this ._indexOfRefraction .getValue (), 1);
1906
1874
  },
1907
1875
  getExtensionKey ()
1908
1876
  {
1909
- return X_ITE_ExtensionKeys .EMISSIVE_STRENGTH_MATERIAL_EXTENSION;
1877
+ return X_ITE_ExtensionKeys .IOR_MATERIAL_EXTENSION;
1910
1878
  },
1911
1879
  getShaderOptions (options)
1912
1880
  {
1913
- options .push ("X3D_EMISSIVE_STRENGTH_MATERIAL_EXT");
1881
+ options .push ("X3D_IOR_MATERIAL_EXT");
1914
1882
  },
1915
1883
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
1916
1884
  {
1917
- gl .uniform1f (shaderObject .x3d_EmissiveStrengthEXT, this .emissiveStrength);
1885
+ gl .uniform1f (shaderObject .x3d_IorEXT, this .indexOfRefraction);
1918
1886
  },
1919
1887
  });
1920
1888
 
1921
- Object .defineProperties (EmissiveStrengthMaterialExtension,
1889
+ Object .defineProperties (IORMaterialExtension,
1922
1890
  {
1923
1891
  typeName:
1924
1892
  {
1925
- value: "EmissiveStrengthMaterialExtension",
1893
+ value: "IORMaterialExtension",
1926
1894
  enumerable: true,
1927
1895
  },
1928
1896
  componentInfo:
@@ -1943,19 +1911,19 @@ Object .defineProperties (EmissiveStrengthMaterialExtension,
1943
1911
  fieldDefinitions:
1944
1912
  {
1945
1913
  value: new (FieldDefinitionArray_default()) ([
1946
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1947
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveStrength", new (Fields_default()).SFFloat (1)),
1914
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
1915
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "indexOfRefraction", new (Fields_default()).SFFloat (1.5)),
1948
1916
  ]),
1949
1917
  enumerable: true,
1950
1918
  },
1951
1919
  });
1952
1920
 
1953
- const EmissiveStrengthMaterialExtension_default_ = EmissiveStrengthMaterialExtension;
1921
+ const IORMaterialExtension_default_ = IORMaterialExtension;
1954
1922
  ;
1955
1923
 
1956
- Namespace_default().add ("EmissiveStrengthMaterialExtension", "x_ite/Components/X_ITE/EmissiveStrengthMaterialExtension", EmissiveStrengthMaterialExtension_default_);
1957
- /* harmony default export */ const X_ITE_EmissiveStrengthMaterialExtension = (EmissiveStrengthMaterialExtension_default_);
1958
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/IORMaterialExtension.js
1924
+ Namespace_default().add ("IORMaterialExtension", "x_ite/Components/X_ITE/IORMaterialExtension", IORMaterialExtension_default_);
1925
+ /* harmony default export */ const X_ITE_IORMaterialExtension = (IORMaterialExtension_default_);
1926
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/IridescenceMaterialExtension.js
1959
1927
  /*******************************************************************************
1960
1928
  *
1961
1929
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2010,50 +1978,115 @@ Namespace_default().add ("EmissiveStrengthMaterialExtension", "x_ite/Components/
2010
1978
 
2011
1979
 
2012
1980
 
1981
+
2013
1982
  /**
2014
1983
  * THIS NODE IS STILL EXPERIMENTAL.
2015
1984
  */
2016
1985
 
2017
- function IORMaterialExtension (executionContext)
1986
+ function IridescenceMaterialExtension (executionContext)
2018
1987
  {
2019
1988
  X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
2020
1989
 
2021
- this .addType ((X3DConstants_default()).IORMaterialExtension);
1990
+ this .addType ((X3DConstants_default()).IridescenceMaterialExtension);
2022
1991
  }
2023
1992
 
2024
- Object .assign (Object .setPrototypeOf (IORMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
1993
+ Object .assign (Object .setPrototypeOf (IridescenceMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
2025
1994
  {
2026
1995
  initialize ()
2027
1996
  {
2028
- X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
2029
-
2030
- this ._indexOfRefraction .addInterest ("set_indexOfRefraction__", this);
2031
-
2032
- this .set_indexOfRefraction__ ();
1997
+ X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
1998
+
1999
+ this ._iridescence .addInterest ("set_iridescence__", this);
2000
+ this ._iridescenceTexture .addInterest ("set_iridescenceTexture__", this);
2001
+ this ._iridescenceIndexOfRefraction .addInterest ("set_iridescenceIndexOfRefraction__", this);
2002
+ this ._iridescenceThicknessMinimum .addInterest ("set_iridescenceThicknessMinimum__", this);
2003
+ this ._iridescenceThicknessMaximum .addInterest ("set_iridescenceThicknessMaximum__", this);
2004
+ this ._iridescenceThicknessTexture .addInterest ("set_iridescenceThicknessTexture__", this);
2005
+
2006
+ this .set_iridescence__ ();
2007
+ this .set_iridescenceTexture__ ();
2008
+ this .set_iridescenceIndexOfRefraction__ ();
2009
+ this .set_iridescenceThicknessMinimum__ ();
2010
+ this .set_iridescenceThicknessMaximum__ ();
2011
+ this .set_iridescenceThicknessTexture__ ();
2012
+ },
2013
+ set_iridescence__ ()
2014
+ {
2015
+ this .iridescence = Math .max (this ._iridescence .getValue (), 0);
2016
+ },
2017
+ set_iridescenceTexture__ ()
2018
+ {
2019
+ this .iridescenceTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._iridescenceTexture);
2020
+
2021
+ this .setTexture (0, this .iridescenceTextureNode);
2022
+ },
2023
+ set_iridescenceIndexOfRefraction__ ()
2024
+ {
2025
+ this .iridescenceIndexOfRefraction = Math .max (this ._iridescenceIndexOfRefraction .getValue (), 1);
2026
+ },
2027
+ set_iridescenceThicknessMinimum__ ()
2028
+ {
2029
+ this .iridescenceThicknessMinimum = Math .max (this ._iridescenceThicknessMinimum .getValue (), 0);
2030
+ },
2031
+ set_iridescenceThicknessMaximum__ ()
2032
+ {
2033
+ this .iridescenceThicknessMaximum = Math .max (this ._iridescenceThicknessMaximum .getValue (), 0);
2033
2034
  },
2034
- set_indexOfRefraction__ ()
2035
+ set_iridescenceThicknessTexture__ ()
2035
2036
  {
2036
- this .indexOfRefraction = Math .max (this ._indexOfRefraction .getValue (), 1);
2037
+ this .iridescenceThicknessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._iridescenceThicknessTexture);
2038
+
2039
+ this .setTexture (1, this .iridescenceThicknessTextureNode);
2037
2040
  },
2038
2041
  getExtensionKey ()
2039
2042
  {
2040
- return X_ITE_ExtensionKeys .IOR_MATERIAL_EXTENSION;
2043
+ return X_ITE_ExtensionKeys .IRIDESCENCE_MATERIAL_EXTENSION;
2041
2044
  },
2042
2045
  getShaderOptions (options)
2043
2046
  {
2044
- options .push ("X3D_IOR_MATERIAL_EXT");
2047
+ options .push ("X3D_IRIDESCENCE_MATERIAL_EXT");
2048
+
2049
+ if (!+this .getTextureBits ())
2050
+ return;
2051
+
2052
+ options .push ("X3D_MATERIAL_TEXTURES");
2053
+
2054
+ this .iridescenceTextureNode ?.getShaderOptions (options, "IRIDESCENCE", true);
2055
+ this .iridescenceThicknessTextureNode ?.getShaderOptions (options, "IRIDESCENCE_THICKNESS", true);
2045
2056
  },
2046
2057
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
2047
2058
  {
2048
- gl .uniform1f (shaderObject .x3d_IorEXT, this .indexOfRefraction);
2059
+ gl .uniform1f (shaderObject .x3d_IridescenceEXT, this .iridescence);
2060
+ gl .uniform1f (shaderObject .x3d_IridescenceIndexOfRefractionEXT, this .iridescenceIndexOfRefraction);
2061
+ gl .uniform1f (shaderObject .x3d_IridescenceThicknessMinimumEXT, this .iridescenceThicknessMinimum);
2062
+ gl .uniform1f (shaderObject .x3d_IridescenceThicknessMaximumEXT, this .iridescenceThicknessMaximum);
2063
+
2064
+ if (!+this .getTextureBits ())
2065
+ return;
2066
+
2067
+ this .iridescenceTextureNode ?.setNamedShaderUniforms (gl,
2068
+ shaderObject,
2069
+ renderObject,
2070
+ shaderObject .x3d_IridescenceTextureEXT,
2071
+ this ._iridescenceTextureMapping .getValue (),
2072
+ textureTransformMapping,
2073
+ textureCoordinateMapping);
2074
+
2075
+ this .iridescenceThicknessTextureNode ?.setNamedShaderUniforms (gl,
2076
+ shaderObject,
2077
+ renderObject,
2078
+ shaderObject .x3d_IridescenceThicknessTextureEXT,
2079
+ this ._iridescenceThicknessTextureMapping .getValue (),
2080
+ textureTransformMapping,
2081
+ textureCoordinateMapping);
2049
2082
  },
2050
2083
  });
2051
2084
 
2052
- Object .defineProperties (IORMaterialExtension,
2085
+ Object .defineProperties (IridescenceMaterialExtension,
2053
2086
  {
2054
2087
  typeName:
2055
2088
  {
2056
- value: "IORMaterialExtension",
2089
+ value: "IridescenceMaterialExtension",
2057
2090
  enumerable: true,
2058
2091
  },
2059
2092
  componentInfo:
@@ -2074,19 +2107,26 @@ Object .defineProperties (IORMaterialExtension,
2074
2107
  fieldDefinitions:
2075
2108
  {
2076
2109
  value: new (FieldDefinitionArray_default()) ([
2077
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
2078
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "indexOfRefraction", new (Fields_default()).SFFloat (1.5)),
2110
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
2111
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescence", new (Fields_default()).SFFloat ()),
2112
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceTextureMapping", new (Fields_default()).SFString ()),
2113
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceTexture", new (Fields_default()).SFNode ()),
2114
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceIndexOfRefraction", new (Fields_default()).SFFloat (1.3)),
2115
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessMinimum", new (Fields_default()).SFFloat (100)),
2116
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessMaximum", new (Fields_default()).SFFloat (400)),
2117
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessTextureMapping", new (Fields_default()).SFString ()),
2118
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessTexture", new (Fields_default()).SFNode ()),
2079
2119
  ]),
2080
2120
  enumerable: true,
2081
2121
  },
2082
2122
  });
2083
2123
 
2084
- const IORMaterialExtension_default_ = IORMaterialExtension;
2124
+ const IridescenceMaterialExtension_default_ = IridescenceMaterialExtension;
2085
2125
  ;
2086
2126
 
2087
- Namespace_default().add ("IORMaterialExtension", "x_ite/Components/X_ITE/IORMaterialExtension", IORMaterialExtension_default_);
2088
- /* harmony default export */ const X_ITE_IORMaterialExtension = (IORMaterialExtension_default_);
2089
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/IridescenceMaterialExtension.js
2127
+ Namespace_default().add ("IridescenceMaterialExtension", "x_ite/Components/X_ITE/IridescenceMaterialExtension", IridescenceMaterialExtension_default_);
2128
+ /* harmony default export */ const X_ITE_IridescenceMaterialExtension = (IridescenceMaterialExtension_default_);
2129
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SheenMaterialExtension.js
2090
2130
  /*******************************************************************************
2091
2131
  *
2092
2132
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2142,114 +2182,121 @@ Namespace_default().add ("IORMaterialExtension", "x_ite/Components/X_ITE/IORMate
2142
2182
 
2143
2183
 
2144
2184
 
2185
+
2145
2186
  /**
2146
2187
  * THIS NODE IS STILL EXPERIMENTAL.
2147
2188
  */
2148
2189
 
2149
- function IridescenceMaterialExtension (executionContext)
2190
+ function SheenMaterialExtension (executionContext)
2150
2191
  {
2151
2192
  X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
2152
2193
 
2153
- this .addType ((X3DConstants_default()).IridescenceMaterialExtension);
2194
+ this .addType ((X3DConstants_default()).SheenMaterialExtension);
2195
+
2196
+ this .sheenColorArray = new Float32Array (3);
2154
2197
  }
2155
2198
 
2156
- Object .assign (Object .setPrototypeOf (IridescenceMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
2199
+ Object .assign (Object .setPrototypeOf (SheenMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
2157
2200
  {
2158
2201
  initialize ()
2159
2202
  {
2160
2203
  X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
2161
2204
 
2162
- this ._iridescence .addInterest ("set_iridescence__", this);
2163
- this ._iridescenceTexture .addInterest ("set_iridescenceTexture__", this);
2164
- this ._iridescenceIndexOfRefraction .addInterest ("set_iridescenceIndexOfRefraction__", this);
2165
- this ._iridescenceThicknessMinimum .addInterest ("set_iridescenceThicknessMinimum__", this);
2166
- this ._iridescenceThicknessMaximum .addInterest ("set_iridescenceThicknessMaximum__", this);
2167
- this ._iridescenceThicknessTexture .addInterest ("set_iridescenceThicknessTexture__", this);
2205
+ this ._sheenColor .addInterest ("set_sheenColor__", this);
2206
+ this ._sheenColorTexture .addInterest ("set_sheenColorTexture__", this);
2207
+ this ._sheenRoughness .addInterest ("set_sheenRoughness__", this);
2208
+ this ._sheenRoughnessTexture .addInterest ("set_sheenRoughnessTexture__", this);
2168
2209
 
2169
- this .set_iridescence__ ();
2170
- this .set_iridescenceTexture__ ();
2171
- this .set_iridescenceIndexOfRefraction__ ();
2172
- this .set_iridescenceThicknessMinimum__ ();
2173
- this .set_iridescenceThicknessMaximum__ ();
2174
- this .set_iridescenceThicknessTexture__ ();
2175
- },
2176
- set_iridescence__ ()
2177
- {
2178
- this .iridescence = Math .max (this ._iridescence .getValue (), 0);
2210
+ this .set_sheenColor__ ();
2211
+ this .set_sheenColorTexture__ ();
2212
+ this .set_sheenRoughness__ ();
2213
+ this .set_sheenRoughnessTexture__ ();
2179
2214
  },
2180
- set_iridescenceTexture__ ()
2215
+ set_sheenColor__ ()
2181
2216
  {
2182
- this .iridescenceTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._iridescenceTexture);
2217
+ //We cannot use this in Windows Edge:
2218
+ //this .sheenColorArray .set (this ._sheenColor .getValue ());
2183
2219
 
2184
- this .setTexture (0, this .iridescenceTextureNode);
2185
- },
2186
- set_iridescenceIndexOfRefraction__ ()
2187
- {
2188
- this .iridescenceIndexOfRefraction = Math .max (this ._iridescenceIndexOfRefraction .getValue (), 1);
2220
+ const
2221
+ sheenColorArray = this .sheenColorArray,
2222
+ sheenColor = this ._sheenColor .getValue ();
2223
+
2224
+ sheenColorArray [0] = sheenColor .r;
2225
+ sheenColorArray [1] = sheenColor .g;
2226
+ sheenColorArray [2] = sheenColor .b;
2189
2227
  },
2190
- set_iridescenceThicknessMinimum__ ()
2228
+ set_sheenColorTexture__ ()
2191
2229
  {
2192
- this .iridescenceThicknessMinimum = Math .max (this ._iridescenceThicknessMinimum .getValue (), 0);
2230
+ this .sheenColorTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._sheenColorTexture);
2231
+
2232
+ this .setTexture (0, this .sheenColorTextureNode);
2193
2233
  },
2194
- set_iridescenceThicknessMaximum__ ()
2234
+ set_sheenRoughness__ ()
2195
2235
  {
2196
- this .iridescenceThicknessMaximum = Math .max (this ._iridescenceThicknessMaximum .getValue (), 0);
2236
+ this .sheenRoughness = Algorithm_default().clamp (this ._sheenRoughness .getValue (), 0, 1);
2197
2237
  },
2198
- set_iridescenceThicknessTexture__ ()
2238
+ set_sheenRoughnessTexture__ ()
2199
2239
  {
2200
- this .iridescenceThicknessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._iridescenceThicknessTexture);
2240
+ this .sheenRoughnessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._sheenRoughnessTexture);
2201
2241
 
2202
- this .setTexture (1, this .iridescenceThicknessTextureNode);
2242
+ this .setTexture (1, this .sheenRoughnessTextureNode);
2203
2243
  },
2204
2244
  getExtensionKey ()
2205
2245
  {
2206
- return X_ITE_ExtensionKeys .IRIDESCENCE_MATERIAL_EXTENSION;
2246
+ return X_ITE_ExtensionKeys .SHEEN_MATERIAL_EXTENSION;
2207
2247
  },
2208
2248
  getShaderOptions (options)
2209
2249
  {
2210
- options .push ("X3D_IRIDESCENCE_MATERIAL_EXT");
2250
+ options .push ("X3D_SHEEN_MATERIAL_EXT");
2211
2251
 
2212
2252
  if (!+this .getTextureBits ())
2213
2253
  return;
2214
2254
 
2215
2255
  options .push ("X3D_MATERIAL_TEXTURES");
2216
2256
 
2217
- this .iridescenceTextureNode ?.getShaderOptions (options, "IRIDESCENCE", true);
2218
- this .iridescenceThicknessTextureNode ?.getShaderOptions (options, "IRIDESCENCE_THICKNESS", true);
2257
+ this .sheenColorTextureNode ?.getShaderOptions (options, "SHEEN_COLOR", true);
2258
+ this .sheenRoughnessTextureNode ?.getShaderOptions (options, "SHEEN_ROUGHNESS", true);
2219
2259
  },
2220
2260
  setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
2221
2261
  {
2222
- gl .uniform1f (shaderObject .x3d_IridescenceEXT, this .iridescence);
2223
- gl .uniform1f (shaderObject .x3d_IridescenceIndexOfRefractionEXT, this .iridescenceIndexOfRefraction);
2224
- gl .uniform1f (shaderObject .x3d_IridescenceThicknessMinimumEXT, this .iridescenceThicknessMinimum);
2225
- gl .uniform1f (shaderObject .x3d_IridescenceThicknessMaximumEXT, this .iridescenceThicknessMaximum);
2262
+ gl .uniform3fv (shaderObject .x3d_SheenColorEXT, this .sheenColorArray);
2263
+ gl .uniform1f (shaderObject .x3d_SheenRoughnessEXT, this .sheenRoughness);
2264
+
2265
+ const
2266
+ browser = this .getBrowser (),
2267
+ SheenELUTTexture = browser .getLibraryTexture ("lut_sheen_E.png"),
2268
+ SheenELUTTextureUnit = browser .getTexture2DUnit ();
2269
+
2270
+ gl .activeTexture (gl .TEXTURE0 + SheenELUTTextureUnit);
2271
+ gl .bindTexture (gl .TEXTURE_2D, SheenELUTTexture .getTexture ());
2272
+ gl .uniform1i (shaderObject .x3d_SheenELUTTextureEXT, SheenELUTTextureUnit);
2226
2273
 
2227
2274
  if (!+this .getTextureBits ())
2228
2275
  return;
2229
2276
 
2230
- this .iridescenceTextureNode ?.setNamedShaderUniforms (gl,
2277
+ this .sheenColorTextureNode ?.setNamedShaderUniforms (gl,
2231
2278
  shaderObject,
2232
2279
  renderObject,
2233
- shaderObject .x3d_IridescenceTextureEXT,
2234
- this ._iridescenceTextureMapping .getValue (),
2280
+ shaderObject .x3d_SheenColorTextureEXT,
2281
+ this ._sheenColorTextureMapping .getValue (),
2235
2282
  textureTransformMapping,
2236
2283
  textureCoordinateMapping);
2237
2284
 
2238
- this .iridescenceThicknessTextureNode ?.setNamedShaderUniforms (gl,
2285
+ this .sheenRoughnessTextureNode ?.setNamedShaderUniforms (gl,
2239
2286
  shaderObject,
2240
2287
  renderObject,
2241
- shaderObject .x3d_IridescenceThicknessTextureEXT,
2242
- this ._iridescenceThicknessTextureMapping .getValue (),
2288
+ shaderObject .x3d_SheenRoughnessTextureEXT,
2289
+ this ._sheenRoughnessTextureMapping .getValue (),
2243
2290
  textureTransformMapping,
2244
2291
  textureCoordinateMapping);
2245
2292
  },
2246
2293
  });
2247
2294
 
2248
- Object .defineProperties (IridescenceMaterialExtension,
2295
+ Object .defineProperties (SheenMaterialExtension,
2249
2296
  {
2250
2297
  typeName:
2251
2298
  {
2252
- value: "IridescenceMaterialExtension",
2299
+ value: "SheenMaterialExtension",
2253
2300
  enumerable: true,
2254
2301
  },
2255
2302
  componentInfo:
@@ -2270,26 +2317,27 @@ Object .defineProperties (IridescenceMaterialExtension,
2270
2317
  fieldDefinitions:
2271
2318
  {
2272
2319
  value: new (FieldDefinitionArray_default()) ([
2273
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
2274
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescence", new (Fields_default()).SFFloat ()),
2275
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceTextureMapping", new (Fields_default()).SFString ()),
2276
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceTexture", new (Fields_default()).SFNode ()),
2277
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceIndexOfRefraction", new (Fields_default()).SFFloat (1.3)),
2278
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessMinimum", new (Fields_default()).SFFloat (100)),
2279
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessMaximum", new (Fields_default()).SFFloat (400)),
2280
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessTextureMapping", new (Fields_default()).SFString ()),
2281
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessTexture", new (Fields_default()).SFNode ()),
2320
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
2321
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColor", new (Fields_default()).SFColor ()),
2322
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColorTextureMapping", new (Fields_default()).SFString ()),
2323
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColorTexture", new (Fields_default()).SFNode ()),
2324
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughness", new (Fields_default()).SFFloat ()),
2325
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughnessTextureMapping", new (Fields_default()).SFString ()),
2326
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughnessTexture", new (Fields_default()).SFNode ()),
2282
2327
  ]),
2283
2328
  enumerable: true,
2284
2329
  },
2285
2330
  });
2286
2331
 
2287
- const IridescenceMaterialExtension_default_ = IridescenceMaterialExtension;
2332
+ const SheenMaterialExtension_default_ = SheenMaterialExtension;
2288
2333
  ;
2289
2334
 
2290
- Namespace_default().add ("IridescenceMaterialExtension", "x_ite/Components/X_ITE/IridescenceMaterialExtension", IridescenceMaterialExtension_default_);
2291
- /* harmony default export */ const X_ITE_IridescenceMaterialExtension = (IridescenceMaterialExtension_default_);
2292
- ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SheenMaterialExtension.js
2335
+ Namespace_default().add ("SheenMaterialExtension", "x_ite/Components/X_ITE/SheenMaterialExtension", SheenMaterialExtension_default_);
2336
+ /* harmony default export */ const X_ITE_SheenMaterialExtension = (SheenMaterialExtension_default_);
2337
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DOneSidedMaterialNode\")"
2338
+ const X3DOneSidedMaterialNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components/Shape/X3DOneSidedMaterialNode");
2339
+ var X3DOneSidedMaterialNode_default = /*#__PURE__*/__webpack_require__.n(X3DOneSidedMaterialNode_namespaceObject);
2340
+ ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SpecularGlossinessMaterial.js
2293
2341
  /*******************************************************************************
2294
2342
  *
2295
2343
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2345,121 +2393,252 @@ Namespace_default().add ("IridescenceMaterialExtension", "x_ite/Components/X_ITE
2345
2393
 
2346
2394
 
2347
2395
 
2396
+ /**
2397
+ * THIS NODE IS DEPRECIATED.
2398
+ */
2399
+
2400
+ function SpecularGlossinessMaterial (executionContext)
2401
+ {
2402
+ console .warn ("SpecularGlossinessMaterial is depreciated, please use PhysicalMaterial instead.");
2403
+
2404
+ X3DOneSidedMaterialNode_default().call (this, executionContext);
2405
+
2406
+ this .addType ((X3DConstants_default()).SpecularGlossinessMaterial);
2407
+
2408
+ this .materialKey = "4/";
2409
+ this .diffuseColorArray = new Float32Array (3);
2410
+ this .specularColorArray = new Float32Array (3);
2411
+ this .extensionNodes = [ ];
2412
+ }
2413
+
2414
+ Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (X3DOneSidedMaterialNode_default()).prototype),
2415
+ {
2416
+ initialize ()
2417
+ {
2418
+ X3DOneSidedMaterialNode_default().prototype .initialize .call (this);
2419
+
2420
+ this ._diffuseColor .addInterest ("set_diffuseColor__", this);
2421
+ this ._diffuseTexture .addInterest ("set_diffuseTexture__", this);
2422
+ this ._diffuseTexture .addInterest ("set_transparent__", this);
2423
+ this ._specularColor .addInterest ("set_specularColor__", this);
2424
+ this ._glossiness .addInterest ("set_glossiness__", this);
2425
+ this ._specularGlossinessTexture .addInterest ("set_specularGlossinessTexture__", this);
2426
+ this ._occlusionStrength .addInterest ("set_occlusionStrength__", this);
2427
+ this ._occlusionTexture .addInterest ("set_occlusionTexture__", this);
2428
+ this ._extensions .addInterest ("set_extensions__", this);
2429
+
2430
+ this .set_diffuseColor__ ();
2431
+ this .set_diffuseTexture__ ();
2432
+ this .set_specularColor__ ();
2433
+ this .set_glossiness__ ();
2434
+ this .set_specularGlossinessTexture__ ();
2435
+ this .set_occlusionStrength__ ();
2436
+ this .set_occlusionTexture__ ();
2437
+ this .set_extensions__ ();
2438
+ this .set_transparent__ ();
2439
+ },
2440
+ getMaterialKey ()
2441
+ {
2442
+ return this .materialKey;
2443
+ },
2444
+ getTextureIndices: (() =>
2445
+ {
2446
+ let i = 0;
2447
+
2448
+ const textureIndices = {
2449
+ DIFFUSE_TEXTURE: i ++,
2450
+ SPECULAR_GLOSSINESS_TEXTURE: i ++,
2451
+ EMISSIVE_TEXTURE: i ++,
2452
+ OCCLUSION_TEXTURE: i ++,
2453
+ NORMAL_TEXTURE: i ++,
2454
+ };
2348
2455
 
2349
- /**
2350
- * THIS NODE IS STILL EXPERIMENTAL.
2351
- */
2456
+ return function ()
2457
+ {
2458
+ return textureIndices;
2459
+ };
2460
+ })(),
2461
+ getBaseTexture ()
2462
+ {
2463
+ return this .diffuseTextureNode;
2464
+ },
2465
+ set_diffuseColor__ ()
2466
+ {
2467
+ //We cannot use this in Windows Edge:
2468
+ //this .diffuseColorArray .set (this ._diffuseColor .getValue ());
2352
2469
 
2353
- function SheenMaterialExtension (executionContext)
2354
- {
2355
- X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
2470
+ const
2471
+ diffuseColorArray = this .diffuseColorArray,
2472
+ diffuseColor = this ._diffuseColor .getValue ();
2356
2473
 
2357
- this .addType ((X3DConstants_default()).SheenMaterialExtension);
2474
+ diffuseColorArray [0] = diffuseColor .r;
2475
+ diffuseColorArray [1] = diffuseColor .g;
2476
+ diffuseColorArray [2] = diffuseColor .b;
2477
+ },
2478
+ set_diffuseTexture__ ()
2479
+ {
2480
+ const index = this .getTextureIndices () .DIFFUSE_TEXTURE;
2358
2481
 
2359
- this .sheenColorArray = new Float32Array (3);
2360
- }
2482
+ if (this .diffuseTextureNode)
2483
+ {
2484
+ this .diffuseTextureNode ._transparent .removeInterest ("set_transparent__", this);
2485
+ this .diffuseTextureNode ._linear .removeInterest (`setTexture${index}`, this);
2486
+ }
2361
2487
 
2362
- Object .assign (Object .setPrototypeOf (SheenMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
2363
- {
2364
- initialize ()
2365
- {
2366
- X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
2488
+ this .diffuseTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._diffuseTexture);
2367
2489
 
2368
- this ._sheenColor .addInterest ("set_sheenColor__", this);
2369
- this ._sheenColorTexture .addInterest ("set_sheenColorTexture__", this);
2370
- this ._sheenRoughness .addInterest ("set_sheenRoughness__", this);
2371
- this ._sheenRoughnessTexture .addInterest ("set_sheenRoughnessTexture__", this);
2490
+ if (this .diffuseTextureNode)
2491
+ {
2492
+ this .diffuseTextureNode ._transparent .addInterest ("set_transparent__", this);
2493
+ this .diffuseTextureNode ._linear .addInterest (`setTexture${index}`, this, index, this .diffuseTextureNode);
2494
+ }
2372
2495
 
2373
- this .set_sheenColor__ ();
2374
- this .set_sheenColorTexture__ ();
2375
- this .set_sheenRoughness__ ();
2376
- this .set_sheenRoughnessTexture__ ();
2496
+ this .setTexture (index, this .diffuseTextureNode);
2377
2497
  },
2378
- set_sheenColor__ ()
2498
+ set_specularColor__ ()
2379
2499
  {
2380
2500
  //We cannot use this in Windows Edge:
2381
- //this .sheenColorArray .set (this ._sheenColor .getValue ());
2501
+ //this .specularColorArray .set (this ._specularColor .getValue ());
2382
2502
 
2383
2503
  const
2384
- sheenColorArray = this .sheenColorArray,
2385
- sheenColor = this ._sheenColor .getValue ();
2504
+ specularColorArray = this .specularColorArray,
2505
+ specularColor = this ._specularColor .getValue ();
2386
2506
 
2387
- sheenColorArray [0] = sheenColor .r;
2388
- sheenColorArray [1] = sheenColor .g;
2389
- sheenColorArray [2] = sheenColor .b;
2507
+ specularColorArray [0] = specularColor .r;
2508
+ specularColorArray [1] = specularColor .g;
2509
+ specularColorArray [2] = specularColor .b;
2390
2510
  },
2391
- set_sheenColorTexture__ ()
2511
+ set_glossiness__ ()
2392
2512
  {
2393
- this .sheenColorTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._sheenColorTexture);
2513
+ this .glossiness = Algorithm_default().clamp (this ._glossiness .getValue (), 0, 1);
2514
+ },
2515
+ set_specularGlossinessTexture__ ()
2516
+ {
2517
+ this .specularGlossinessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._specularGlossinessTexture);
2394
2518
 
2395
- this .setTexture (0, this .sheenColorTextureNode);
2519
+ this .setTexture (this .getTextureIndices () .SPECULAR_GLOSSINESS_TEXTURE, this .specularGlossinessTextureNode);
2396
2520
  },
2397
- set_sheenRoughness__ ()
2521
+ set_occlusionStrength__ ()
2398
2522
  {
2399
- this .sheenRoughness = Algorithm_default().clamp (this ._sheenRoughness .getValue (), 0, 1);
2523
+ this .occlusionStrength = Algorithm_default().clamp (this ._occlusionStrength .getValue (), 0, 1);
2400
2524
  },
2401
- set_sheenRoughnessTexture__ ()
2525
+ set_occlusionTexture__ ()
2402
2526
  {
2403
- this .sheenRoughnessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._sheenRoughnessTexture);
2527
+ this .occlusionTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._occlusionTexture);
2404
2528
 
2405
- this .setTexture (1, this .sheenRoughnessTextureNode);
2529
+ this .setTexture (this .getTextureIndices () .OCCLUSION_TEXTURE, this .occlusionTextureNode);
2406
2530
  },
2407
- getExtensionKey ()
2531
+ set_transparent__ ()
2408
2532
  {
2409
- return X_ITE_ExtensionKeys .SHEEN_MATERIAL_EXTENSION;
2533
+ this .setTransparent (this .getTransparency () ||
2534
+ this .diffuseTextureNode ?.isTransparent ());
2410
2535
  },
2411
- getShaderOptions (options)
2536
+ set_extensions__ ()
2412
2537
  {
2413
- options .push ("X3D_SHEEN_MATERIAL_EXT");
2538
+ const extensionNodes = this .extensionNodes;
2414
2539
 
2415
- if (!+this .getTextureBits ())
2416
- return;
2540
+ for (const extensionNode of extensionNodes)
2541
+ extensionNode .removeInterest ("set_extensionsKey__", this);
2417
2542
 
2418
- options .push ("X3D_MATERIAL_TEXTURES");
2543
+ extensionNodes .length = 0;
2419
2544
 
2420
- this .sheenColorTextureNode ?.getShaderOptions (options, "SHEEN_COLOR", true);
2421
- this .sheenRoughnessTextureNode ?.getShaderOptions (options, "SHEEN_ROUGHNESS", true);
2545
+ for (const node of this ._extensions)
2546
+ {
2547
+ const extensionNode = X3DCast_default() ((X3DConstants_default()).X3DMaterialExtensionNode, node);
2548
+
2549
+ if (extensionNode)
2550
+ extensionNodes .push (extensionNode);
2551
+ }
2552
+
2553
+ extensionNodes .sort ((a, b) => a .getExtensionKey () - b .getExtensionKey ());
2554
+
2555
+ for (const extensionNode of extensionNodes)
2556
+ extensionNode .addInterest ("set_extensionsKey__", this);
2557
+
2558
+ this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes ((X3DConstants_default()).TransmissionMaterialExtension)));
2559
+
2560
+ this .set_extensionsKey__ ();
2422
2561
  },
2423
- setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
2562
+ set_extensionsKey__ ()
2424
2563
  {
2425
- gl .uniform3fv (shaderObject .x3d_SheenColorEXT, this .sheenColorArray);
2426
- gl .uniform1f (shaderObject .x3d_SheenRoughnessEXT, this .sheenRoughness);
2564
+ const extensionsKey = this .extensionNodes
2565
+ .map (extensionNode => `${extensionNode .getExtensionKey () .toString (16)}${extensionNode .getTextureBits () .toString (16)}`)
2566
+ .join ("");
2427
2567
 
2568
+ this .materialKey = `[4.${extensionsKey}]`;
2569
+ },
2570
+ createShader (key, geometryContext, renderContext)
2571
+ {
2428
2572
  const
2429
- browser = this .getBrowser (),
2430
- SheenELUTTexture = browser .getLibraryTexture ("lut_sheen_E.png"),
2431
- SheenELUTTextureUnit = browser .getTexture2DUnit ();
2573
+ browser = this .getBrowser (),
2574
+ options = this .getShaderOptions (geometryContext, renderContext);
2432
2575
 
2433
- gl .activeTexture (gl .TEXTURE0 + SheenELUTTextureUnit);
2434
- gl .bindTexture (gl .TEXTURE_2D, SheenELUTTexture .getTexture ());
2435
- gl .uniform1i (shaderObject .x3d_SheenELUTTextureEXT, SheenELUTTextureUnit);
2576
+ for (const extensionNode of this .extensionNodes)
2577
+ extensionNode .getShaderOptions (options);
2578
+
2579
+ options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_SPECULAR_GLOSSINESS");
2580
+
2581
+ if (+this .getTextureBits ())
2582
+ {
2583
+ this .diffuseTextureNode ?.getShaderOptions (options, "DIFFUSE");
2584
+ this .specularGlossinessTextureNode ?.getShaderOptions (options, "SPECULAR_GLOSSINESS");
2585
+ this .occlusionTextureNode ?.getShaderOptions (options, "OCCLUSION");
2586
+ }
2587
+
2588
+ const shaderNode = browser .createShader ("SpecularGlossiness", "Default", "Physical", options);
2589
+
2590
+ browser .getShaders () .set (key, shaderNode);
2591
+
2592
+ return shaderNode;
2593
+ },
2594
+ setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
2595
+ {
2596
+ X3DOneSidedMaterialNode_default().prototype .setShaderUniforms .call (this, gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
2597
+
2598
+ for (const extensionNode of this .extensionNodes)
2599
+ extensionNode .setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
2600
+
2601
+ gl .uniform3fv (shaderObject .x3d_DiffuseColor, this .diffuseColorArray);
2602
+ gl .uniform3fv (shaderObject .x3d_SpecularColor, this .specularColorArray);
2603
+ gl .uniform1f (shaderObject .x3d_Glossiness, this .glossiness);
2436
2604
 
2437
2605
  if (!+this .getTextureBits ())
2438
2606
  return;
2439
2607
 
2440
- this .sheenColorTextureNode ?.setNamedShaderUniforms (gl,
2608
+ this .diffuseTextureNode ?.setNamedShaderUniforms (gl,
2441
2609
  shaderObject,
2442
2610
  renderObject,
2443
- shaderObject .x3d_SheenColorTextureEXT,
2444
- this ._sheenColorTextureMapping .getValue (),
2611
+ shaderObject .x3d_DiffuseTexture,
2612
+ this ._diffuseTextureMapping .getValue (),
2445
2613
  textureTransformMapping,
2446
2614
  textureCoordinateMapping);
2447
2615
 
2448
- this .sheenRoughnessTextureNode ?.setNamedShaderUniforms (gl,
2616
+ this .specularGlossinessTextureNode ?.setNamedShaderUniforms (gl,
2449
2617
  shaderObject,
2450
2618
  renderObject,
2451
- shaderObject .x3d_SheenRoughnessTextureEXT,
2452
- this ._sheenRoughnessTextureMapping .getValue (),
2619
+ shaderObject .x3d_SpecularGlossinessTexture,
2620
+ this ._specularGlossinessTextureMapping .getValue (),
2621
+ textureTransformMapping,
2622
+ textureCoordinateMapping);
2623
+
2624
+ if (this .occlusionTextureNode)
2625
+ gl .uniform1f (shaderObject .x3d_OcclusionStrength, this .occlusionStrength);
2626
+
2627
+ this .occlusionTextureNode ?.setNamedShaderUniforms (gl,
2628
+ shaderObject,
2629
+ renderObject,
2630
+ shaderObject .x3d_OcclusionTexture,
2631
+ this ._occlusionTextureMapping .getValue (),
2453
2632
  textureTransformMapping,
2454
2633
  textureCoordinateMapping);
2455
2634
  },
2456
2635
  });
2457
2636
 
2458
- Object .defineProperties (SheenMaterialExtension,
2637
+ Object .defineProperties (SpecularGlossinessMaterial,
2459
2638
  {
2460
2639
  typeName:
2461
2640
  {
2462
- value: "SheenMaterialExtension",
2641
+ value: "SpecularGlossinessMaterial",
2463
2642
  enumerable: true,
2464
2643
  },
2465
2644
  componentInfo:
@@ -2469,7 +2648,7 @@ Object .defineProperties (SheenMaterialExtension,
2469
2648
  },
2470
2649
  containerField:
2471
2650
  {
2472
- value: "extensions",
2651
+ value: "material",
2473
2652
  enumerable: true,
2474
2653
  },
2475
2654
  specificationRange:
@@ -2480,23 +2659,43 @@ Object .defineProperties (SheenMaterialExtension,
2480
2659
  fieldDefinitions:
2481
2660
  {
2482
2661
  value: new (FieldDefinitionArray_default()) ([
2483
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
2484
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColor", new (Fields_default()).SFColor ()),
2485
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColorTextureMapping", new (Fields_default()).SFString ()),
2486
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColorTexture", new (Fields_default()).SFNode ()),
2487
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughness", new (Fields_default()).SFFloat ()),
2488
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughnessTextureMapping", new (Fields_default()).SFString ()),
2489
- new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughnessTexture", new (Fields_default()).SFNode ()),
2662
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
2663
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseColor", new (Fields_default()).SFColor (1, 1, 1)),
2664
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTextureMapping", new (Fields_default()).SFString ()),
2665
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTexture", new (Fields_default()).SFNode ()),
2666
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularColor", new (Fields_default()).SFColor (1, 1, 1)),
2667
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "glossiness", new (Fields_default()).SFFloat (1)),
2668
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularGlossinessTextureMapping", new (Fields_default()).SFString ()),
2669
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularGlossinessTexture", new (Fields_default()).SFNode ()),
2670
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveColor", new (Fields_default()).SFColor ()),
2671
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveTextureMapping", new (Fields_default()).SFString ()),
2672
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveTexture", new (Fields_default()).SFNode ()),
2673
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionStrength", new (Fields_default()).SFFloat (1)),
2674
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionTextureMapping", new (Fields_default()).SFString ()),
2675
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionTexture", new (Fields_default()).SFNode ()),
2676
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalScale", new (Fields_default()).SFFloat (1)),
2677
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalTextureMapping", new (Fields_default()).SFString ()),
2678
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalTexture", new (Fields_default()).SFNode ()),
2679
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "transparency", new (Fields_default()).SFFloat ()),
2680
+ new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "extensions", new (Fields_default()).MFNode ()), // experimental
2490
2681
  ]),
2491
2682
  enumerable: true,
2492
2683
  },
2493
2684
  });
2494
2685
 
2495
- const SheenMaterialExtension_default_ = SheenMaterialExtension;
2686
+ for (const index of Object .values (SpecularGlossinessMaterial .prototype .getTextureIndices ()))
2687
+ {
2688
+ SpecularGlossinessMaterial .prototype [`setTexture${index}`] = function (index, textureNode)
2689
+ {
2690
+ this .setTexture (index, textureNode);
2691
+ };
2692
+ }
2693
+
2694
+ const SpecularGlossinessMaterial_default_ = SpecularGlossinessMaterial;
2496
2695
  ;
2497
2696
 
2498
- Namespace_default().add ("SheenMaterialExtension", "x_ite/Components/X_ITE/SheenMaterialExtension", SheenMaterialExtension_default_);
2499
- /* harmony default export */ const X_ITE_SheenMaterialExtension = (SheenMaterialExtension_default_);
2697
+ Namespace_default().add ("SpecularGlossinessMaterial", "x_ite/Components/X_ITE/SpecularGlossinessMaterial", SpecularGlossinessMaterial_default_);
2698
+ /* harmony default export */ const X_ITE_SpecularGlossinessMaterial = (SpecularGlossinessMaterial_default_);
2500
2699
  ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SpecularMaterialExtension.js
2501
2700
  /*******************************************************************************
2502
2701
  *
@@ -3117,21 +3316,23 @@ Namespace_default().add ("VolumeMaterialExtension", "x_ite/Components/X_ITE/Volu
3117
3316
 
3118
3317
 
3119
3318
 
3319
+
3120
3320
  Components_default().add ({
3121
3321
  name: "X_ITE",
3122
3322
  concreteNodes:
3123
3323
  [
3124
- X_ITE_BlendMode,
3125
- X_ITE_DepthMode,
3126
- X_ITE_InstancedShape,
3127
- X_ITE_SpecularGlossinessMaterial,
3128
3324
  X_ITE_AnisotropyMaterialExtension,
3325
+ X_ITE_BlendMode,
3129
3326
  X_ITE_ClearcoatMaterialExtension,
3327
+ X_ITE_DepthMode,
3328
+ X_ITE_DiffuseTransmissionMaterialExtension,
3130
3329
  X_ITE_DispersionMaterialExtension,
3131
3330
  X_ITE_EmissiveStrengthMaterialExtension,
3331
+ X_ITE_InstancedShape,
3132
3332
  X_ITE_IORMaterialExtension,
3133
3333
  X_ITE_IridescenceMaterialExtension,
3134
3334
  X_ITE_SheenMaterialExtension,
3335
+ X_ITE_SpecularGlossinessMaterial,
3135
3336
  X_ITE_SpecularMaterialExtension,
3136
3337
  X_ITE_TransmissionMaterialExtension,
3137
3338
  X_ITE_VolumeMaterialExtension,