x_ite 8.6.8 → 8.6.9

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 (102) hide show
  1. package/.vscode/tasks.json +1 -1
  2. package/dist/assets/components/Annotation.js +13 -13
  3. package/dist/assets/components/Annotation.min.js +1 -1
  4. package/dist/assets/components/CADGeometry.js +13 -13
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +25 -25
  7. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  8. package/dist/assets/components/DIS.js +13 -13
  9. package/dist/assets/components/DIS.min.js +1 -1
  10. package/dist/assets/components/EventUtilities.js +9 -9
  11. package/dist/assets/components/EventUtilities.min.js +1 -1
  12. package/dist/assets/components/Geometry2D.js +19 -19
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +33 -33
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +18 -18
  17. package/dist/assets/components/HAnim.min.js +1 -1
  18. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  19. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  20. package/dist/assets/components/Layout.js +27 -27
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +24 -24
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +25 -27
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +19 -19
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +28 -28
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +24 -24
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/TextureProjector.js +14 -14
  35. package/dist/assets/components/TextureProjector.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +30 -30
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +19 -19
  39. package/dist/assets/components/VolumeRendering.min.js +1 -1
  40. package/dist/assets/components/X_ITE.js +9 -9
  41. package/dist/assets/components/X_ITE.min.js +1 -1
  42. package/dist/x_ite.css +1 -1
  43. package/dist/x_ite.js +897 -660
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +2 -2
  47. package/docs/laboratory/gltf-sample-viewer.html +4 -4
  48. package/package.json +1 -1
  49. package/src/assets/shaders/webgl1/Pointing.fs.js +1 -1
  50. package/src/assets/shaders/webgl1/include/Fragment.glsl.js +17 -1
  51. package/src/assets/shaders/webgl1/include/Point.glsl.js +10 -2
  52. package/src/assets/shaders/webgl1/include/Texture.glsl.js +31 -1
  53. package/src/assets/shaders/webgl1/include/Vertex.glsl.js +24 -0
  54. package/src/assets/shaders/webgl2/Pointing.fs.js +1 -1
  55. package/src/assets/shaders/webgl2/include/Fragment.glsl.js +18 -0
  56. package/src/assets/shaders/webgl2/include/Point.glsl.js +12 -4
  57. package/src/assets/shaders/webgl2/include/Texture.glsl.js +17 -20
  58. package/src/assets/shaders/webgl2/include/Vertex.glsl.js +24 -0
  59. package/src/bookmarks.js +1 -1
  60. package/src/tests.js +1 -0
  61. package/src/x_ite/Browser/Core/BrowserOptions.js +3 -0
  62. package/src/x_ite/Browser/Core/BrowserTimings.js +12 -11
  63. package/src/x_ite/Browser/Core/Context.js +64 -64
  64. package/src/x_ite/Browser/Core/ContextMenu.js +0 -9
  65. package/src/x_ite/Browser/Navigation/ExamineViewer.js +1 -1
  66. package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +8 -0
  67. package/src/x_ite/Browser/VERSION.js +1 -1
  68. package/src/x_ite/Browser/X3DBrowser.js +1 -1
  69. package/src/x_ite/Components/Core/X3DBindableNode.js +0 -2
  70. package/src/x_ite/Components/Core/X3DNode.js +3 -8
  71. package/src/x_ite/Components/Layering/X3DLayerNode.js +6 -2
  72. package/src/x_ite/Components/Navigation/NavigationInfo.js +1 -0
  73. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +34 -21
  74. package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +2 -4
  75. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +5 -19
  76. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +6 -12
  77. package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +4 -8
  78. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +28 -27
  79. package/src/x_ite/Components/Shape/Material.js +4 -0
  80. package/src/x_ite/Components/Shape/PhysicalMaterial.js +4 -0
  81. package/src/x_ite/Components/Shape/TwoSidedMaterial.js +1 -0
  82. package/src/x_ite/Components/Shape/X3DMaterialNode.js +21 -19
  83. package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +4 -0
  84. package/src/x_ite/Components/Texturing/ImageTexture.js +77 -48
  85. package/src/x_ite/Components/Texturing/MultiTexture.js +7 -4
  86. package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +19 -16
  87. package/src/x_ite/Components/Texturing/MultiTextureTransform.js +16 -32
  88. package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +1 -1
  89. package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +2 -8
  90. package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +2 -8
  91. package/src/x_ite/Execution/NamedNodesHandling.js +84 -0
  92. package/src/x_ite/Execution/X3DExecutionContext.js +7 -37
  93. package/src/x_ite/Execution/X3DScene.js +5 -0
  94. package/src/x_ite/InputOutput/FileLoader.js +1 -1
  95. package/src/x_ite/InputOutput/Generator.js +32 -81
  96. package/src/x_ite/Parser/GLTF2Parser.js +109 -43
  97. package/src/x_ite/Parser/OBJParser.js +42 -30
  98. package/src/x_ite/Parser/STLAParser.js +3 -0
  99. package/src/x_ite/Parser/SVGParser.js +4 -0
  100. package/src/x_ite/Rendering/X3DRenderObject.js +2 -0
  101. package/src/x_ite.html +52 -46
  102. package/x_ite.min.html +52 -46
@@ -192,70 +192,70 @@ const Context =
192
192
 
193
193
  // Async functions
194
194
 
195
- // Object .assign (gl, gl .getVersion () === 1
196
- // ? {
197
- // readPixelsAsync: gl .readPixels,
198
- // }
199
- // : {
200
- // clientWaitAsync: function (sync, flags, timeout)
201
- // {
202
- // return new Promise ((resolve, reject) =>
203
- // {
204
- // const check = () =>
205
- // {
206
- // const result = this .clientWaitSync (sync, flags, 0);
207
-
208
- // switch (result)
209
- // {
210
- // case this .WAIT_FAILED:
211
- // {
212
- // reject ();
213
- // return;
214
- // }
215
- // case this .TIMEOUT_EXPIRED:
216
- // {
217
- // setTimeout (check, timeout);
218
- // return;
219
- // }
220
- // default:
221
- // {
222
- // resolve ();
223
- // return;
224
- // }
225
- // }
226
- // };
227
-
228
- // check ();
229
- // });
230
- // },
231
- // getBufferSubDataAsync: async function (target, buffer, srcByteOffset, dstBuffer, /* optional */ dstOffset, /* optional */ length)
232
- // {
233
- // const sync = this .fenceSync (this .SYNC_GPU_COMMANDS_COMPLETE, 0);
234
-
235
- // this .flush ();
236
-
237
- // await this .clientWaitAsync (sync, 0, 10);
238
-
239
- // this .deleteSync (sync);
240
-
241
- // this .bindBuffer (target, buffer);
242
- // this .getBufferSubData (target, srcByteOffset, dstBuffer, dstOffset, length);
243
- // this .bindBuffer (target, null);
244
- // },
245
- // readPixelsAsync: async function (x, y, w, h, format, type, dest, dstOffset)
246
- // {
247
- // const buffer = this .createBuffer ();
248
-
249
- // this .bindBuffer (this .PIXEL_PACK_BUFFER, buffer);
250
- // this .bufferData (this .PIXEL_PACK_BUFFER, dest .byteLength, this .STREAM_READ);
251
- // this .readPixels (x, y, w, h, format, type, 0);
252
- // this .bindBuffer (this .PIXEL_PACK_BUFFER, null);
253
-
254
- // await this .getBufferSubDataAsync (this .PIXEL_PACK_BUFFER, buffer, 0, dest, dstOffset);
255
-
256
- // this .deleteBuffer (buffer);
257
- // },
258
- // });
195
+ Object .assign (gl, gl .getVersion () === 1
196
+ ? {
197
+ readPixelsAsync: gl .readPixels,
198
+ }
199
+ : {
200
+ clientWaitAsync: function (sync, flags, timeout)
201
+ {
202
+ return new Promise ((resolve, reject) =>
203
+ {
204
+ const check = () =>
205
+ {
206
+ const result = this .clientWaitSync (sync, flags, 0);
207
+
208
+ switch (result)
209
+ {
210
+ case this .WAIT_FAILED:
211
+ {
212
+ reject ();
213
+ return;
214
+ }
215
+ case this .TIMEOUT_EXPIRED:
216
+ {
217
+ setTimeout (check, timeout);
218
+ return;
219
+ }
220
+ default:
221
+ {
222
+ resolve ();
223
+ return;
224
+ }
225
+ }
226
+ };
227
+
228
+ check ();
229
+ });
230
+ },
231
+ getBufferSubDataAsync: async function (target, buffer, srcByteOffset, dstBuffer, /* optional */ dstOffset, /* optional */ length)
232
+ {
233
+ const sync = this .fenceSync (this .SYNC_GPU_COMMANDS_COMPLETE, 0);
234
+
235
+ this .flush ();
236
+
237
+ await this .clientWaitAsync (sync, 0, 10);
238
+
239
+ this .deleteSync (sync);
240
+
241
+ this .bindBuffer (target, buffer);
242
+ this .getBufferSubData (target, srcByteOffset, dstBuffer, dstOffset, length);
243
+ this .bindBuffer (target, null);
244
+ },
245
+ readPixelsAsync: async function (x, y, w, h, format, type, dest, dstOffset)
246
+ {
247
+ const buffer = this .createBuffer ();
248
+
249
+ this .bindBuffer (this .PIXEL_PACK_BUFFER, buffer);
250
+ this .bufferData (this .PIXEL_PACK_BUFFER, dest .byteLength, this .STREAM_READ);
251
+ this .readPixels (x, y, w, h, format, type, 0);
252
+ this .bindBuffer (this .PIXEL_PACK_BUFFER, null);
253
+
254
+ await this .getBufferSubDataAsync (this .PIXEL_PACK_BUFFER, buffer, 0, dest, dstOffset);
255
+
256
+ this .deleteBuffer (buffer);
257
+ },
258
+ });
259
259
 
260
260
  // Return context.
261
261
 
@@ -150,18 +150,9 @@ ContextMenu .prototype = Object .assign (Object .create (X3DBaseNode .prototype)
150
150
  browser .setBrowserOption ("StraightenHorizon", straightenHorizon);
151
151
 
152
152
  if (straightenHorizon)
153
- {
154
153
  browser .getNotification () ._string = _("Straighten Horizon") + ": " + _("on");
155
-
156
- const activeViewpoint = browser .getActiveViewpoint ();
157
-
158
- if (activeViewpoint)
159
- activeViewpoint .straighten (browser .getActiveLayer (), true);
160
- }
161
154
  else
162
- {
163
155
  browser .getNotification () ._string = _("Straighten Horizon") + ": " + _("off");
164
- }
165
156
  }
166
157
  .bind (this),
167
158
  },
@@ -789,7 +789,7 @@ ExamineViewer .prototype = Object .assign (Object .create (X3DViewer .prototype)
789
789
  .multRight (orientationOffsetBefore);
790
790
 
791
791
  if (straightenHorizon)
792
- viewpoint .straightenHorizon (userOrientation, viewpoint .getUpVector (true));
792
+ viewpoint .straightenHorizon (userOrientation);
793
793
 
794
794
  const orientationOffsetAfter = orientationOffset
795
795
  .assign (viewpoint .getOrientation ())
@@ -146,6 +146,14 @@ X3DTexturingContext .prototype =
146
146
  {
147
147
  return this [_maxTextures];
148
148
  },
149
+ getMaxTextureTransforms: function ()
150
+ {
151
+ return 4;
152
+ },
153
+ getMaxTexCoords: function ()
154
+ {
155
+ return 4;
156
+ },
149
157
  getMinTextureSize: function ()
150
158
  {
151
159
  return 16;
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.6.8";
48
+ export default "8.6.9";
@@ -656,7 +656,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
656
656
  if (!layerNode)
657
657
  return;
658
658
 
659
- layerNode .getViewpoint () ._viewAll = true;
659
+ layerNode .viewAll (1, this .getBrowserOption ("StraightenHorizon"));
660
660
  },
661
661
  firstViewpoint: function (layerNode)
662
662
  {
@@ -54,8 +54,6 @@ function X3DBindableNode (executionContext)
54
54
  X3DChildNode .call (this, executionContext);
55
55
 
56
56
  this .addType (X3DConstants .X3DBindableNode);
57
-
58
- this .addChildObjects ("transitionActive", new Fields .SFBool ());
59
57
  }
60
58
 
61
59
  X3DBindableNode .prototype = Object .assign (Object .create (X3DChildNode .prototype),
@@ -173,15 +173,10 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
173
173
  return copy;
174
174
  }
175
175
  },
176
- getDisplayName: (function ()
176
+ getDisplayName: function ()
177
177
  {
178
- const _TrailingNumber = /_\d+$/;
179
-
180
- return function ()
181
- {
182
- return this .getName () .replace (_TrailingNumber, "");
183
- };
184
- })(),
178
+ return this .getName () .replace (/_\d+$/, "");
179
+ },
185
180
  getNeedsName: function ()
186
181
  {
187
182
  if (this .getName () .length)
@@ -221,13 +221,17 @@ X3DLayerNode .prototype = Object .assign (Object .create (X3DNode .prototype),
221
221
  {
222
222
  return this .collisionTime;
223
223
  },
224
- lookAt: function (factor = 1, straighten = false)
224
+ viewAll: function (factor = 1, straighten = false)
225
225
  {
226
226
  const
227
227
  viewpointNode = this .getViewpoint (),
228
228
  bbox = this .getBBox (new Box3 ()) .multRight (Matrix4 .inverse (viewpointNode .getModelMatrix ()));
229
229
 
230
- viewpointNode .lookAt (this, bbox .center, viewpointNode .getLookAtDistance (bbox), factor, straighten);
230
+ viewpointNode .lookAt (this, bbox .center, viewpointNode .getLookAtDistance (bbox), factor, straighten);
231
+ },
232
+ straightenView: function ()
233
+ {
234
+ this .getViewpoint () .straightenView (this);
231
235
  },
232
236
  set_viewport__: function ()
233
237
  {
@@ -66,6 +66,7 @@ function NavigationInfo (executionContext)
66
66
  this .addType (X3DConstants .NavigationInfo);
67
67
 
68
68
  this .addChildObjects ("transitionStart", new Fields .SFBool (),
69
+ "transitionActive", new Fields .SFBool (),
69
70
  "availableViewers", new Fields .MFString (),
70
71
  "viewer", new Fields .SFString ("EXAMINE"));
71
72
 
@@ -118,7 +118,6 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
118
118
  this .scaleOrientationInterpolator .setup ();
119
119
  this .fieldOfViewScaleInterpolator .setup ();
120
120
 
121
- this .timeSensor ._isActive .addFieldInterest (this ._transitionActive);
122
121
  this .timeSensor ._fraction_changed .addFieldInterest (this .easeInEaseOut ._set_fraction);
123
122
 
124
123
  this .easeInEaseOut ._modifiedFraction_changed .addFieldInterest (this .positionInterpolator ._set_fraction);
@@ -186,10 +185,18 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
186
185
  },
187
186
  set_active__: function (navigationInfoNode, active)
188
187
  {
189
- if (this ._isBound .getValue () && ! active .getValue () && this .timeSensor ._fraction_changed .getValue () === 1)
190
- {
191
- navigationInfoNode ._transitionComplete = true;
192
- }
188
+ if (active .getValue ())
189
+ return;
190
+
191
+ this .timeSensor ._isActive .removeInterest ("set_active__", this);
192
+
193
+ if (!this ._isBound .getValue ())
194
+ return;
195
+
196
+ if (this .timeSensor ._fraction_changed .getValue () !== 1)
197
+ return;
198
+
199
+ navigationInfoNode ._transitionComplete = true;
193
200
  },
194
201
  setInterpolators: function () { },
195
202
  getPosition: function ()
@@ -272,6 +279,11 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
272
279
  if (this ._viewAll .getValue ())
273
280
  this .viewAll (layerNode .getBBox (new Box3 ()));
274
281
 
282
+ if (this .getBrowser () .getBrowserOption ("StraightenHorizon"))
283
+ {
284
+ this ._orientationOffset = this .straightenHorizon (this .getUserOrientation ()) .multLeft (this .getOrientation () .copy () .inverse ());
285
+ }
286
+
275
287
  // Handle NavigationInfo.
276
288
 
277
289
  const
@@ -320,7 +332,7 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
320
332
  }
321
333
  }
322
334
 
323
- layerNode .getNavigationInfo () ._transitionStart = true;
335
+ navigationInfoNode ._transitionStart = true;
324
336
 
325
337
  this .timeSensor ._cycleInterval = transitionTime;
326
338
  this .timeSensor ._stopTime = this .getBrowser () .getCurrentTime ();
@@ -339,11 +351,13 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
339
351
  this ._scaleOrientationOffset = relative .scaleOrientation;
340
352
 
341
353
  this .setInterpolators (fromViewpointNode, relative);
342
-
343
- this ._transitionActive = true;
344
354
  }
345
355
  else
346
356
  {
357
+ const navigationInfoNode = layerNode .getNavigationInfo ();
358
+
359
+ navigationInfoNode ._transitionComplete = true;
360
+
347
361
  const relative = this .getRelativeTransformation (fromViewpointNode);
348
362
 
349
363
  this ._positionOffset = relative .position;
@@ -368,6 +382,11 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
368
382
  this ._centerOfRotationOffset = Vector3 .Zero;
369
383
  this ._fieldOfViewScale = 1;
370
384
 
385
+ if (this .getBrowser () .getBrowserOption ("StraightenHorizon"))
386
+ {
387
+ this ._orientationOffset = this .straightenHorizon (this .getUserOrientation ()) .multLeft (this .getOrientation () .copy () .inverse ());
388
+ }
389
+
371
390
  this .set_nearDistance__ ();
372
391
  this .set_farDistance__ ();
373
392
  },
@@ -413,7 +432,7 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
413
432
  x .assign (up) .cross (z) .normalize ();
414
433
  y .assign (z) .cross (x) .normalize ();
415
434
 
416
- m .set (x.x, x.y, x.z, y.x, y.y, y.z, z.x, z.y, z.z);
435
+ m .set (... x, ... y, ... z);
417
436
  r .setMatrix (m);
418
437
 
419
438
  return r;
@@ -442,14 +461,10 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
442
461
  const
443
462
  offset = point .copy () .add (this .getUserOrientation () .multVecRot (new Vector3 (0, 0, distance))) .subtract (this .getPosition ());
444
463
 
445
- layerNode .getNavigationInfo () ._transitionStart = true;
446
-
447
- this .timeSensor ._cycleInterval = 0.2;
464
+ this .timeSensor ._cycleInterval = 1;
448
465
  this .timeSensor ._stopTime = this .getBrowser () .getCurrentTime ();
449
466
  this .timeSensor ._startTime = this .getBrowser () .getCurrentTime ();
450
467
 
451
- this .timeSensor ._isActive .addInterest ("set_active__", this, layerNode .getNavigationInfo ());
452
-
453
468
  this .easeInEaseOut ._easeInEaseOut = new Fields .MFVec2f (new Fields .SFVec2f (0, 1), new Fields .SFVec2f (1, 0));
454
469
 
455
470
  const
@@ -472,19 +487,17 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
472
487
 
473
488
  this ._fieldOfViewScale = 1;
474
489
  this ._centerOfRotationOffset = Vector3 .subtract (point, this .getCenterOfRotation ());
490
+ this .nearDistance = Math .min (distance / 2, 0.125);
491
+ this .farDistance = this .nearDistance * this .getMaxFarValue () / 0.125;
475
492
 
476
493
  this .setInterpolators (this, relative);
477
494
  },
478
- straighten: function (layerNode, horizon)
495
+ straightenView: function (layerNode)
479
496
  {
480
- layerNode .getNavigationInfo () ._transitionStart = true;
481
-
482
- this .timeSensor ._cycleInterval = 0.4;
497
+ this .timeSensor ._cycleInterval = 1;
483
498
  this .timeSensor ._stopTime = this .getBrowser () .getCurrentTime ();
484
499
  this .timeSensor ._startTime = this .getBrowser () .getCurrentTime ();
485
500
 
486
- this .timeSensor ._isActive .addInterest ("set_active__", this, layerNode .getNavigationInfo ());
487
-
488
501
  this .easeInEaseOut ._easeInEaseOut = new Fields .MFVec2f (new Fields .SFVec2f (0, 1), new Fields .SFVec2f (1, 0));
489
502
 
490
503
  const rotation = Rotation4 .multRight (Rotation4 .inverse (this .getOrientation ()), this .straightenHorizon (this .getUserOrientation ()));
@@ -507,7 +520,7 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
507
520
  localZAxis = new Vector3 (0, 0, 0),
508
521
  rotation = new Rotation4 (0, 0, 1, 0);
509
522
 
510
- return function (orientation, upVector = this .getUpVector ())
523
+ return function (orientation, upVector = this .getUpVector (true))
511
524
  {
512
525
  orientation .multVecRot (localXAxis .assign (Vector3 .xAxis) .negate ());
513
526
  orientation .multVecRot (localZAxis .assign (Vector3 .zAxis));
@@ -981,8 +981,7 @@ ParticleSystem .prototype = Object .assign (Object .create (X3DShapeNode .protot
981
981
 
982
982
  const blendModeNode = appearanceNode .getBlendMode ();
983
983
 
984
- if (blendModeNode)
985
- blendModeNode .enable (gl);
984
+ blendModeNode?.enable (gl);
986
985
 
987
986
  shaderNode .enable (gl);
988
987
  shaderNode .setUniforms (gl, this .geometryContext, renderContext);
@@ -1027,8 +1026,7 @@ ParticleSystem .prototype = Object .assign (Object .create (X3DShapeNode .protot
1027
1026
 
1028
1027
  gl .drawArraysInstanced (primitiveMode, 0, this .vertexCount, this .numParticles);
1029
1028
 
1030
- if (blendModeNode)
1031
- blendModeNode .disable (gl);
1029
+ blendModeNode?.disable (gl);
1032
1030
  }
1033
1031
 
1034
1032
  break;
@@ -178,7 +178,7 @@ X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype)
178
178
  this .backFace = new Map ([[gl .CCW, gl .CW], [gl .CW, gl .CCW]]);
179
179
  this .attribBuffers = [ ];
180
180
  this .textureCoordinateNode = browser .getDefaultTextureCoordinate ();
181
- this .texCoordBuffers = Array .from ({length: browser .getMaxTextures ()}, () => gl .createBuffer ());
181
+ this .texCoordBuffers = Array .from ({length: browser .getMaxTexCoords ()}, () => gl .createBuffer ());
182
182
  this .fogDepthBuffer = gl .createBuffer ();
183
183
  this .colorBuffer = gl .createBuffer ();
184
184
  this .normalBuffer = gl .createBuffer ();
@@ -830,16 +830,6 @@ X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype)
830
830
  if (this .multiTexCoords .length === 0)
831
831
  this .buildTexCoords ();
832
832
 
833
- if (this .multiTexCoords .length)
834
- {
835
- const maxTextures = this .getBrowser () .getMaxTextures ();
836
-
837
- for (let i = this .multiTexCoords .length; i < maxTextures; ++ i)
838
- this .multiTexCoords [i] = this .multiTexCoords .at (-1);
839
-
840
- this .multiTexCoords .length = maxTextures;
841
- }
842
-
843
833
  // Transfer arrays and update.
844
834
 
845
835
  this .transfer ();
@@ -1019,8 +1009,7 @@ X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype)
1019
1009
  attribBuffers = this .attribBuffers,
1020
1010
  primitiveMode = browser .getPrimitiveMode (this .primitiveMode);
1021
1011
 
1022
- if (blendModeNode)
1023
- blendModeNode .enable (gl);
1012
+ blendModeNode?.enable (gl);
1024
1013
 
1025
1014
  shaderNode .enable (gl);
1026
1015
  shaderNode .setUniforms (gl, this, renderContext, front);
@@ -1091,8 +1080,7 @@ X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype)
1091
1080
  }
1092
1081
  }
1093
1082
 
1094
- if (blendModeNode)
1095
- blendModeNode .disable (gl);
1083
+ blendModeNode?.disable (gl);
1096
1084
  },
1097
1085
  displaySimpleParticles: function (gl, shaderNode, particleSystem)
1098
1086
  {
@@ -1140,8 +1128,7 @@ X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype)
1140
1128
  attribBuffers = this .attribBuffers,
1141
1129
  primitiveMode = browser .getPrimitiveMode (this .primitiveMode);
1142
1130
 
1143
- if (blendModeNode)
1144
- blendModeNode .enable (gl);
1131
+ blendModeNode?.enable (gl);
1145
1132
 
1146
1133
  // Setup shader.
1147
1134
 
@@ -1211,8 +1198,7 @@ X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype)
1211
1198
  gl .drawArraysInstanced (primitiveMode, 0, this .vertexCount, particleSystem .numParticles);
1212
1199
  }
1213
1200
 
1214
- if (blendModeNode)
1215
- blendModeNode .disable (gl);
1201
+ blendModeNode?.disable (gl);
1216
1202
  },
1217
1203
  });
1218
1204
 
@@ -306,8 +306,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
306
306
 
307
307
  // Render triangles.
308
308
 
309
- if (blendModeNode)
310
- blendModeNode .enable (gl);
309
+ blendModeNode?.enable (gl);
311
310
 
312
311
  // Setup shader.
313
312
 
@@ -349,8 +348,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
349
348
  gl .enable (gl .CULL_FACE);
350
349
  gl .drawArrays (primitiveMode, 0, this .vertexCount * 3);
351
350
 
352
- if (blendModeNode)
353
- blendModeNode .disable (gl);
351
+ blendModeNode?.disable (gl);
354
352
 
355
353
  return;
356
354
  }
@@ -358,8 +356,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
358
356
 
359
357
  const primitiveMode = browser .getPrimitiveMode (this .getPrimitiveMode ());
360
358
 
361
- if (blendModeNode)
362
- blendModeNode .enable (gl);
359
+ blendModeNode?.enable (gl);
363
360
 
364
361
  // Setup shader.
365
362
 
@@ -389,8 +386,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
389
386
 
390
387
  gl .drawArrays (primitiveMode, 0, this .vertexCount);
391
388
 
392
- if (blendModeNode)
393
- blendModeNode .disable (gl);
389
+ blendModeNode?.disable (gl);
394
390
 
395
391
  gl .lineWidth (1);
396
392
  };
@@ -406,8 +402,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
406
402
  attribBuffers = this .getAttribBuffers (),
407
403
  primitiveMode = browser .getPrimitiveMode (this .getPrimitiveMode ());
408
404
 
409
- if (blendModeNode)
410
- blendModeNode .enable (gl);
405
+ blendModeNode?.enable (gl);
411
406
 
412
407
  // Setup shader.
413
408
 
@@ -446,8 +441,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
446
441
 
447
442
  gl .drawArraysInstanced (primitiveMode, 0, this .vertexCount, particleSystem .numParticles);
448
443
 
449
- if (blendModeNode)
450
- blendModeNode .disable (gl);
444
+ blendModeNode?.disable (gl);
451
445
 
452
446
  gl .lineWidth (1);
453
447
  },
@@ -81,8 +81,7 @@ X3DPointGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNod
81
81
  attribNodes = this .getAttrib (),
82
82
  attribBuffers = this .getAttribBuffers ();
83
83
 
84
- if (blendModeNode)
85
- blendModeNode .enable (gl);
84
+ blendModeNode?.enable (gl);
86
85
 
87
86
  // Setup shader.
88
87
 
@@ -110,8 +109,7 @@ X3DPointGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNod
110
109
 
111
110
  gl .drawArrays (this .primitiveMode, 0, this .vertexCount);
112
111
 
113
- if (blendModeNode)
114
- blendModeNode .disable (gl);
112
+ blendModeNode?.disable (gl);
115
113
  },
116
114
  displayParticles: function (gl, renderContext, particleSystem)
117
115
  {
@@ -122,8 +120,7 @@ X3DPointGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNod
122
120
  attribNodes = this .getAttrib (),
123
121
  attribBuffers = this .getAttribBuffers ();
124
122
 
125
- if (blendModeNode)
126
- blendModeNode .enable (gl);
123
+ blendModeNode?.enable (gl);
127
124
 
128
125
  // Setup shader.
129
126
 
@@ -162,8 +159,7 @@ X3DPointGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNod
162
159
 
163
160
  gl .drawArraysInstanced (this .primitiveMode, 0, this .vertexCount, particleSystem .numParticles);
164
161
 
165
- if (blendModeNode)
166
- blendModeNode .disable (gl);
162
+ blendModeNode?.disable (gl);
167
163
  },
168
164
  });
169
165