x_ite 4.7.5 → 4.7.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 (157) hide show
  1. package/.vscode/launch.json +15 -0
  2. package/.vscode/settings.json +2 -5
  3. package/Makefile +1 -0
  4. package/README.md +1 -1
  5. package/build/components/annotation.build.js +2 -2
  6. package/build/components/cad-geometry.build.js +2 -2
  7. package/build/components/cube-map-texturing.build.js +2 -2
  8. package/build/components/dis.build.js +2 -2
  9. package/build/components/event-utilities.build.js +2 -2
  10. package/build/components/geometry2d.build.js +2 -2
  11. package/build/components/geospatial.build.js +2 -2
  12. package/build/components/h-anim.build.js +2 -2
  13. package/build/components/key-device-sensor.build.js +2 -2
  14. package/build/components/layout.build.js +2 -2
  15. package/build/components/nurbs.build.js +2 -2
  16. package/build/components/particle-systems.build.js +2 -2
  17. package/build/components/picking.build.js +2 -2
  18. package/build/components/projective-texture-mapping.build.js +2 -2
  19. package/build/components/rigid-body-physics.build.js +2 -2
  20. package/build/components/scripting.build.js +2 -2
  21. package/build/components/texturing-3d.build.js +2 -2
  22. package/build/components/volume-rendering.build.js +2 -2
  23. package/build/components/x_ite.build.js +2 -2
  24. package/build/parts/default.end.frag.js +2 -0
  25. package/build/parts/default.start.frag.js +8 -0
  26. package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
  27. package/build/parts/x_ite.start.frag.js +16 -0
  28. package/build/x_ite.build.js +2 -2
  29. package/dist/assets/components/annotation.js +9 -7
  30. package/dist/assets/components/annotation.min.js +1 -1
  31. package/dist/assets/components/cad-geometry.js +9 -7
  32. package/dist/assets/components/cad-geometry.min.js +1 -1
  33. package/dist/assets/components/cube-map-texturing.js +9 -7
  34. package/dist/assets/components/cube-map-texturing.min.js +1 -1
  35. package/dist/assets/components/dis.js +9 -7
  36. package/dist/assets/components/dis.min.js +1 -1
  37. package/dist/assets/components/event-utilities.js +9 -7
  38. package/dist/assets/components/event-utilities.min.js +1 -1
  39. package/dist/assets/components/geometry2d.js +9 -7
  40. package/dist/assets/components/geometry2d.min.js +1 -1
  41. package/dist/assets/components/geospatial.js +9 -7
  42. package/dist/assets/components/geospatial.min.js +2 -2
  43. package/dist/assets/components/h-anim.js +9 -7
  44. package/dist/assets/components/h-anim.min.js +1 -1
  45. package/dist/assets/components/key-device-sensor.js +9 -7
  46. package/dist/assets/components/key-device-sensor.min.js +1 -1
  47. package/dist/assets/components/layout.js +9 -7
  48. package/dist/assets/components/layout.min.js +1 -1
  49. package/dist/assets/components/nurbs.js +9 -7
  50. package/dist/assets/components/nurbs.min.js +2 -2
  51. package/dist/assets/components/particle-systems.js +9 -7
  52. package/dist/assets/components/particle-systems.min.js +2 -2
  53. package/dist/assets/components/picking.js +13 -11
  54. package/dist/assets/components/picking.min.js +1 -1
  55. package/dist/assets/components/projective-texture-mapping.js +9 -7
  56. package/dist/assets/components/projective-texture-mapping.min.js +1 -1
  57. package/dist/assets/components/rigid-body-physics.js +9 -7
  58. package/dist/assets/components/rigid-body-physics.min.js +17 -17
  59. package/dist/assets/components/scripting.js +16 -9
  60. package/dist/assets/components/scripting.min.js +1 -1
  61. package/dist/assets/components/texturing-3d.js +9 -7
  62. package/dist/assets/components/texturing-3d.min.js +3 -3
  63. package/dist/assets/components/volume-rendering.js +11 -9
  64. package/dist/assets/components/volume-rendering.min.js +3 -3
  65. package/dist/assets/components/x_ite.js +9 -7
  66. package/dist/assets/components/x_ite.min.js +1 -1
  67. package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
  68. package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
  69. package/dist/assets/shaders/webgl1/Phong.fs +0 -1
  70. package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
  71. package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
  72. package/dist/assets/shaders/webgl2/Phong.fs +0 -1
  73. package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
  74. package/dist/example.html +2 -2
  75. package/dist/x_ite.css +4 -3
  76. package/dist/x_ite.js +28281 -27706
  77. package/dist/x_ite.min.js +41 -41
  78. package/dist/x_ite.zip +0 -0
  79. package/docs/Accessing-the-External-Browser.md +32 -3
  80. package/docs/Custom-Shaders.md +165 -174
  81. package/docs/What's-New.md +61 -6
  82. package/docs/_config.yml +1 -1
  83. package/docs/index.md +21 -14
  84. package/docs/reference/Browser-Services.md +36 -8
  85. package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
  86. package/package.json +13 -6
  87. package/src/assets/components/picking.js +2 -2
  88. package/src/assets/components/volume-rendering.js +2 -2
  89. package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
  90. package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
  91. package/src/assets/shaders/webgl1/Phong.fs +0 -1
  92. package/src/assets/shaders/webgl1/Unlit.fs +0 -3
  93. package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
  94. package/src/assets/shaders/webgl2/Phong.fs +0 -1
  95. package/src/assets/shaders/webgl2/Unlit.fs +0 -3
  96. package/src/bookmarks.js +8 -11
  97. package/src/examples.js +1 -1
  98. package/src/locale/de.po +19 -75
  99. package/src/locale/fr.po +18 -75
  100. package/src/standard/Time/MicroTime.js +3 -1
  101. package/src/standard/Utility/DataStorage.js +7 -10
  102. package/src/tests.js +2 -1
  103. package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
  104. package/src/x_ite/Browser/Core/BrowserTimings.js +13 -24
  105. package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
  106. package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
  107. package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
  108. package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
  109. package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
  110. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
  111. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +1 -3
  112. package/src/x_ite/Browser/Networking/urls.js +25 -0
  113. package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
  114. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
  115. package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
  116. package/src/x_ite/Browser/VERSION.js +1 -1
  117. package/src/x_ite/Browser/X3DBrowser.js +70 -50
  118. package/src/x_ite/Components/Grouping/Switch.js +1 -1
  119. package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
  120. package/src/x_ite/Components/Navigation/Collision.js +1 -1
  121. package/src/x_ite/Components/Navigation/LOD.js +1 -1
  122. package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
  123. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +25 -11
  124. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
  125. package/src/x_ite/Components/Scripting/Script.js +7 -2
  126. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
  127. package/src/x_ite/Components/Shaders.js +9 -9
  128. package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
  129. package/src/x_ite/Fields/SFColor.js +20 -7
  130. package/src/x_ite/Fields/SFColorRGBA.js +6 -6
  131. package/src/x_ite/Fields/SFDouble.js +2 -2
  132. package/src/x_ite/Fields/SFFloat.js +2 -2
  133. package/src/x_ite/Fields/SFImage.js +13 -13
  134. package/src/x_ite/Fields/SFMatrix3.js +5 -5
  135. package/src/x_ite/Fields/SFMatrix4.js +6 -6
  136. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +14 -3
  137. package/src/x_ite/Fields/SFNode.js +23 -19
  138. package/src/x_ite/Fields/SFNodeCache.js +14 -10
  139. package/src/x_ite/Fields/SFRotation.js +10 -10
  140. package/src/x_ite/Fields/SFString.js +1 -1
  141. package/src/x_ite/Fields/SFTime.js +1 -1
  142. package/src/x_ite/Fields/SFVec2.js +6 -6
  143. package/src/x_ite/Fields/SFVec3.js +7 -7
  144. package/src/x_ite/Fields/SFVec4.js +8 -8
  145. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +7 -6
  146. package/src/x_ite/InputOutput/Generator.js +85 -65
  147. package/src/x_ite/Parser/X3DParser.js +6 -0
  148. package/src/x_ite/Parser/XMLParser.js +1 -1
  149. package/src/x_ite/X3D.js +8 -2
  150. package/src/x_ite.config.js +0 -5
  151. package/src/x_ite.css +2 -1
  152. package/src/x_ite.html +3 -3
  153. package/src/x_ite.js +21 -12
  154. package/x_ite.min.html +3 -3
  155. package/build/parts/default.end.frag +0 -2
  156. package/build/parts/default.start.frag +0 -6
  157. package/build/parts/x_ite.start.frag +0 -8
package/dist/x_ite.zip CHANGED
Binary file
@@ -8,10 +8,10 @@ If you want combine DOM access with X3D access in your JavaScript functions then
8
8
 
9
9
  ## Introduction
10
10
 
11
- There is the X3D object which is always available, it expects at least one function handler that is called when the browsers (<X3DCanvas> elements) are ready, or the second function handler is called if an error occurred.
11
+ There is the X3D object which is always available, it expects one function handler that is called when the browsers (<X3DCanvas> elements) are ready, and a second function handler, that is called if an error occurred. These two arguments are optional. The return value of the X3D function is a Promise, which can be used instead of the arguments.
12
12
 
13
13
  ```js
14
- X3D (callback[, errorCallback]);
14
+ Promise X3D ([callback[, errorCallback]]);
15
15
  ```
16
16
 
17
17
  The callback function is called when the browser is available. The callback function takes no arguments. The error callback is called if an error occurred, it has one argument *error.*
@@ -65,6 +65,35 @@ function (error)
65
65
  </script>
66
66
  ```
67
67
 
68
+ ### Using the Promise return value
69
+
70
+ ```js
71
+ X3D () .then (function ()
72
+ {
73
+ const Browser = X3D .getBrowser ();
74
+ })
75
+ .catch (function (error)
76
+ {
77
+ // ooops an error.
78
+ console .error (error);
79
+ });
80
+ ```
81
+
82
+ ### Async use of X3D object
83
+
84
+ ```js
85
+ async function foo (url)
86
+ {
87
+ await X3D ();
88
+
89
+ const Browser = X3D .getBrowser ();
90
+
91
+ await Browser .loadURL (new MFString (url));
92
+
93
+ console .log (`Done loading scene '${Browser .currentScene .worldURL}'.`);
94
+ }
95
+ ```
96
+
68
97
  ## X3D Object
69
98
 
70
99
  ### Functions
@@ -265,7 +294,7 @@ function spin ()
265
294
  ### The HTML
266
295
 
267
296
  ```html
268
- <X3DCanvas src="external-browser.x3d" onload="init ()"/>
297
+ <X3DCanvas src="external-browser.x3d" onload="init ()"></X3DCanvas>
269
298
 
270
299
  <div class="buttons">
271
300
  <button id="center" class="button" onclick="center ()">Center</button>
@@ -64,7 +64,7 @@ Once the X3D is defined we can now write the vertex and the fragment shader sour
64
64
 
65
65
  ### Vertex Shader
66
66
 
67
- ```c
67
+ ```glsl
68
68
  #version 300 es
69
69
 
70
70
  precision mediump float;
@@ -73,7 +73,7 @@ uniform mat4 x3d_TextureMatrix [x3d_MaxTextures];
73
73
  uniform mat4 x3d_ModelViewMatrix;
74
74
  uniform mat4 x3d_ProjectionMatrix;
75
75
 
76
- in vec4 x3d_TexCoord;
76
+ in vec4 x3d_TexCoord0;
77
77
  in vec4 x3d_Vertex;
78
78
 
79
79
  out vec4 texCoord;
@@ -81,7 +81,7 @@ out vec4 texCoord;
81
81
  void
82
82
  main ()
83
83
  {
84
- texCoord = x3d_TextureMatrix [0] * x3d_TexCoord;
84
+ texCoord = x3d_TextureMatrix [0] * x3d_TexCoord0;
85
85
 
86
86
  gl_Position = x3d_ProjectionMatrix * x3d_ModelViewMatrix * x3d_Vertex;
87
87
  }
@@ -89,7 +89,7 @@ main ()
89
89
 
90
90
  ### Fragment Shader
91
91
 
92
- ```c
92
+ ```glsl
93
93
  #version 300 es
94
94
 
95
95
  precision mediump float;
@@ -127,9 +127,9 @@ A ComposedShader node provides the capability to define custom fields like the S
127
127
  <table class=" table">
128
128
  <thead>
129
129
  <tr>
130
- <th scope="col">X3D field type</th>
131
- <th scope="col">GLSL variable type</th>
132
- <th scope="col"></th>
130
+ <th>X3D field type</th>
131
+ <th>GLSL variable type</th>
132
+ <th></th>
133
133
  </tr>
134
134
  </thead>
135
135
  <tbody>
@@ -357,9 +357,9 @@ A ComposedShader defines a number of special variables for the various shader st
357
357
  <table class=" table">
358
358
  <thead>
359
359
  <tr>
360
- <th scope="col">Type</th>
361
- <th scope="col">Name</th>
362
- <th scope="col">Comment</th>
360
+ <th>Type</th>
361
+ <th>Name</th>
362
+ <th>Comment</th>
363
363
  </tr>
364
364
  </thead>
365
365
  <tbody>
@@ -374,8 +374,7 @@ A ComposedShader defines a number of special variables for the various shader st
374
374
  <td>x3d_Points, x3d_Lines, x3d_Geometry2D, x3d_Geometry3D</td>
375
375
  </tr>
376
376
  <tr>
377
- <td colspan="3"><hr/>
378
- </td>
377
+ <td colspan="3"><hr/></td>
379
378
  </tr>
380
379
  <tr>
381
380
  <td>uniform int</td>
@@ -392,6 +391,22 @@ A ComposedShader defines a number of special variables for the various shader st
392
391
  <td>x3d_Fog</td>
393
392
  <td>see table »Uniform Struct x3d_FogParameters«</td>
394
393
  </tr>
394
+ <tr>
395
+ <td colspan="3"><hr/></td>
396
+ </tr>
397
+ <tr>
398
+ <td>uniform int</td>
399
+ <td>x3d_NumLights</td>
400
+ <td>number of lights in x3d_LightSource</td>
401
+ </tr>
402
+ <tr>
403
+ <td>uniform x3d_LightSourceParameters</td>
404
+ <td>x3d_LightSource [x3d_MaxLights]</td>
405
+ <td>see table »Uniform Struct x3d_LightSourceParameters«</td>
406
+ </tr>
407
+ <tr>
408
+ <td colspan="3"><hr/></td>
409
+ </tr>
395
410
  <tr>
396
411
  <td>uniform float</td>
397
412
  <td>x3d_AlphaCutoff</td>
@@ -413,9 +428,7 @@ A ComposedShader defines a number of special variables for the various shader st
413
428
  <td>see table »Uniform Struct x3d_FillPropertiesParameters«</td>
414
429
  </tr>
415
430
  <tr>
416
- <td></td>
417
- <td></td>
418
- <td></td>
431
+ <td colspan="3"><hr/></td>
419
432
  </tr>
420
433
  <tr>
421
434
  <td>uniform bool</td>
@@ -423,36 +436,15 @@ A ComposedShader defines a number of special variables for the various shader st
423
436
  <td>true if X3DColorNode attached</td>
424
437
  </tr>
425
438
  <tr>
426
- <td>uniform int</td>
427
- <td>x3d_NumLights</td>
428
- <td>Number of lights in x3d_LightSource</td>
429
- </tr>
430
- <tr>
431
- <td>uniform x3d_LightSourceParameters</td>
432
- <td>x3d_LightSource [x3d_MaxLights]</td>
433
- <td>see table »Uniform Struct x3d_LightSourceParameters«</td>
434
- </tr>
435
- <tr>
436
- <td colspan="3"><hr/>
437
- </td>
438
- </tr>
439
- <tr>
440
- <td>uniform float</td>
441
- <td>x3d_AlphaCutoff</td>
442
- <td>alphaCutoff value from Appearance</td>
443
- </tr>
444
- <tr>
445
- <td colspan="3"><hr/>
446
- </td>
439
+ <td colspan="3"><hr/></td>
447
440
  </tr>
448
441
  <tr>
449
442
  <td>uniform x3d_MaterialParameters</td>
450
- <td>x3d_tMaterial</td>
443
+ <td>x3d_Material</td>
451
444
  <td>see table »Uniform Struct x3d_MaterialParameters«</td>
452
445
  </tr>
453
446
  <tr>
454
- <td colspan="3"><hr/>
455
- </td>
447
+ <td colspan="3"><hr/></td>
456
448
  </tr>
457
449
  <tr>
458
450
  <td>uniform int</td>
@@ -480,8 +472,7 @@ A ComposedShader defines a number of special variables for the various shader st
480
472
  <td>see table »Uniform Struct x3d_TextureCoordinateGeneratorParameters«</td>
481
473
  </tr>
482
474
  <tr>
483
- <td colspan="3"><hr/>
484
- </td>
475
+ <td colspan="3"><hr/></td>
485
476
  </tr>
486
477
  <tr>
487
478
  <td>uniform ivec4</td>
@@ -514,8 +505,7 @@ A ComposedShader defines a number of special variables for the various shader st
514
505
  <td>transformation matrix of the camera</td>
515
506
  </tr>
516
507
  <tr>
517
- <td colspan="3"><hr/>
518
- </td>
508
+ <td colspan="3"><hr/></td>
519
509
  </tr>
520
510
  <tr>
521
511
  <td>attribute float</td>
@@ -545,7 +535,7 @@ A ComposedShader defines a number of special variables for the various shader st
545
535
  <tr>
546
536
  <td>attribute vec4</td>
547
537
  <td>x3d_Vertex</td>
548
- <td>vertex coordinate, **required**</td>
538
+ <td>vertex coordinate, <b>required</b></td>
549
539
  </tr>
550
540
  </tbody>
551
541
  </table>
@@ -628,7 +618,7 @@ If the shader node is part of a ParticleSystem node the following attributes are
628
618
  | Type | Name | Comment |
629
619
  |-----------------|--------------------------|-----------------------------------------------------------|
630
620
  | attribute float | x3d\_ParticleId | integer id of the particle |
631
- | attribute float | x3d\_ParticleLife | integer number of current life |
621
+ | attribute float | x3d\_ParticleLife | integer number of current life cycle |
632
622
  | attribute float | x3d\_ParticleElapsedTime | elapsed time normalized in the range \[0, 1\] |
633
623
  | attribute vec4 | x3d\_ParticlePosition | center coordinate of particle, in relation to x3d\_Vertex |
634
624
 
@@ -636,205 +626,205 @@ If the ParticleSystem.*geometryType* is GEOMETRY the following uniforms are avai
636
626
 
637
627
  | Type | Name | Comment |
638
628
  |---------------------------------|---------------|----------------------------------------------------|
639
- | uniform x3d\_ParticleParameters | x3d\_Particle | See table »Uniform Struct x3d\_ParticleParameters« |
629
+ | uniform x3d\_ParticleParameters | x3d\_Particle | see table »Uniform Struct x3d\_ParticleParameters« |
640
630
 
641
631
  #### Uniform Struct x3d\_ParticleParameters
642
632
 
643
633
  | Type | Name | Comment |
644
634
  |-------|-------------|-----------------------------------------------|
645
635
  | int | id | integer id of the particle |
646
- | int | life | integer number of current life |
636
+ | int | life | integer number of current life cycle |
647
637
  | float | elapsedTime | elapsed time normalized in the range \[0, 1\] |
648
638
 
649
639
  ## Built-in Constants
650
640
 
651
- Some built-in variables are enumerated and have special values and meanings. The following table list all of them and their corresponding values. Note: as of version 1.27 these constant are buit-in.
641
+ Some built-in variables are enumerated and have special values and meanings. The following table list all of them and their corresponding values. Note: as of version 1.27 these constant are built-in.
652
642
 
653
- <table class=" table" style="width: 1046px;">
643
+ <table class=" table">
654
644
  <thead>
655
645
  <tr>
656
- <th style="width: 297.767px;">Variable</th>
657
- <th style="width: 41.7667px;">Type</th>
658
- <th scope="col" style="width: 252.767px;">Name</th>
659
- <th scope="col" style="width: 49.7667px;">Value</th>
660
- <th style="width: 369.933px;">Comment</th>
646
+ <th>Variable</th>
647
+ <th>Type</th>
648
+ <th>Name</th>
649
+ <th>Value</th>
650
+ <th>Comment</th>
661
651
  </tr>
662
652
  </thead>
663
653
  <tbody>
664
654
  <tr>
665
- <td style="width: 297.767px;">X_ITE</td>
666
- <td style="width: 41.7667px;"></td>
667
- <td style="width: 252.767px;"></td>
668
- <td style="width: 49.7667px;"></td>
669
- <td style="width: 369.933px;">defined</td>
655
+ <td>X_ITE</td>
656
+ <td></td>
657
+ <td></td>
658
+ <td></td>
659
+ <td>defined</td>
670
660
  </tr>
671
661
  <tr>
672
- <td colspan="5" style="width: 1036px;"><hr/>
662
+ <td colspan="5"><hr/>
673
663
  </td>
674
664
  </tr>
675
665
  <tr>
676
- <td style="width: 297.767px;">X3D_LOGARITHMIC_DEPTH_BUFFER</td>
677
- <td style="width: 41.7667px;"></td>
678
- <td style="width: 252.767px;"></td>
679
- <td style="width: 49.7667px;"></td>
680
- <td style="width: 369.933px;">defined if logarithmic depth buffer is enabled in [browser options](http://create3000.de/users-guide/ecmascript-object-and-function-definitions/browser-services/#browser-object).</td>
666
+ <td>X3D_LOGARITHMIC_DEPTH_BUFFER</td>
667
+ <td></td>
668
+ <td></td>
669
+ <td></td>
670
+ <td>defined if logarithmic depth buffer is enabled in <a href="https://create3000.github.io/x_ite/reference/Browser-Services.html#string-getbrowseroption-string-name">browser options</a>.</td>
681
671
  </tr>
682
672
  <tr>
683
- <td colspan="5" style="width: 1036px;"><hr/>
673
+ <td colspan="5"><hr/>
684
674
  </td>
685
675
  </tr>
686
676
  <tr>
687
- <td style="width: 297.767px;">x3d_GeometryType</td>
688
- <td style="width: 41.7667px;">int</td>
689
- <td style="width: 252.767px;">x3d_Points</td>
690
- <td style="width: 49.7667px;">0</td>
691
- <td style="width: 369.933px;">appears on PointSet and Polypoint2D</td>
677
+ <td>x3d_GeometryType</td>
678
+ <td>int</td>
679
+ <td>x3d_Points</td>
680
+ <td>0</td>
681
+ <td>appears on PointSet and Polypoint2D</td>
692
682
  </tr>
693
683
  <tr>
694
- <td style="width: 297.767px;"></td>
695
- <td style="width: 41.7667px;">int</td>
696
- <td style="width: 252.767px;">x3d_Lines</td>
697
- <td style="width: 49.7667px;">1</td>
698
- <td style="width: 369.933px;">appears on IndexedLineSet, LineSet and Polyline2D</td>
684
+ <td></td>
685
+ <td>int</td>
686
+ <td>x3d_Lines</td>
687
+ <td>1</td>
688
+ <td>appears on IndexedLineSet, LineSet and Polyline2D</td>
699
689
  </tr>
700
690
  <tr>
701
- <td style="width: 297.767px;"></td>
702
- <td style="width: 41.7667px;">int</td>
703
- <td style="width: 252.767px;">x3d_Geometry2D</td>
704
- <td style="width: 49.7667px;">2</td>
705
- <td style="width: 369.933px;">appears on Geometry2D nodes</td>
691
+ <td></td>
692
+ <td>int</td>
693
+ <td>x3d_Geometry2D</td>
694
+ <td>2</td>
695
+ <td>appears on Geometry2D nodes</td>
706
696
  </tr>
707
697
  <tr>
708
- <td style="width: 297.767px;"></td>
709
- <td style="width: 41.7667px;">int</td>
710
- <td style="width: 252.767px;">x3d_Geometry3D</td>
711
- <td style="width: 49.7667px;">3</td>
712
- <td style="width: 369.933px;">appears on Geometry3D nodes and other 3D nodes</td>
698
+ <td></td>
699
+ <td>int</td>
700
+ <td>x3d_Geometry3D</td>
701
+ <td>3</td>
702
+ <td>appears on Geometry3D nodes and other 3D nodes</td>
713
703
  </tr>
714
704
  <tr>
715
- <td colspan="5" style="width: 1036px;"><hr/>
705
+ <td colspan="5"><hr/>
716
706
  </td>
717
707
  </tr>
718
708
  <tr>
719
- <td style="width: 297.767px;">x3d_ClipPlane</td>
720
- <td style="width: 41.7667px;">int</td>
721
- <td style="width: 252.767px;">x3d_MaxClipPlanes</td>
722
- <td style="width: 49.7667px;">6</td>
723
- <td style="width: 369.933px;"></td>
709
+ <td>x3d_ClipPlane</td>
710
+ <td>int</td>
711
+ <td>x3d_MaxClipPlanes</td>
712
+ <td>6</td>
713
+ <td></td>
724
714
  </tr>
725
715
  <tr>
726
- <td colspan="5" style="width: 1036px;"><hr/>
716
+ <td colspan="5"><hr/>
727
717
  </td>
728
718
  </tr>
729
719
  <tr>
730
- <td style="width: 297.767px;">x3d_FogType</td>
731
- <td style="width: 41.7667px;">int</td>
732
- <td style="width: 252.767px;">x3d_None</td>
733
- <td style="width: 49.7667px;">0</td>
734
- <td style="width: 369.933px;"></td>
720
+ <td>x3d_FogType</td>
721
+ <td>int</td>
722
+ <td>x3d_None</td>
723
+ <td>0</td>
724
+ <td></td>
735
725
  </tr>
736
726
  <tr>
737
- <td style="width: 297.767px;"></td>
738
- <td style="width: 41.7667px;">int</td>
739
- <td style="width: 252.767px;">x3d_LinearFog</td>
740
- <td style="width: 49.7667px;">1</td>
741
- <td style="width: 369.933px;"></td>
727
+ <td></td>
728
+ <td>int</td>
729
+ <td>x3d_LinearFog</td>
730
+ <td>1</td>
731
+ <td></td>
742
732
  </tr>
743
733
  <tr>
744
- <td style="width: 297.767px;"></td>
745
- <td style="width: 41.7667px;">int</td>
746
- <td style="width: 252.767px;">x3d_ExponentialFog</td>
747
- <td style="width: 49.7667px;">2</td>
748
- <td style="width: 369.933px;"></td>
734
+ <td></td>
735
+ <td>int</td>
736
+ <td>x3d_ExponentialFog</td>
737
+ <td>2</td>
738
+ <td></td>
749
739
  </tr>
750
740
  <tr>
751
- <td colspan="5" style="width: 1036px;"><hr/>
741
+ <td colspan="5"><hr/>
752
742
  </td>
753
743
  </tr>
754
744
  <tr>
755
- <td style="width: 297.767px;"></td>
756
- <td style="width: 41.7667px;">int</td>
757
- <td style="width: 252.767px;">x3d_MaxLights</td>
758
- <td style="width: 49.7667px;">8</td>
759
- <td style="width: 369.933px;"></td>
745
+ <td></td>
746
+ <td>int</td>
747
+ <td>x3d_MaxLights</td>
748
+ <td>8</td>
749
+ <td></td>
760
750
  </tr>
761
751
  <tr>
762
- <td style="width: 297.767px;">x3d_LightType</td>
763
- <td style="width: 41.7667px;">int</td>
764
- <td style="width: 252.767px;">x3d_DirectionalLight</td>
765
- <td style="width: 49.7667px;">1</td>
766
- <td style="width: 369.933px;"></td>
752
+ <td>x3d_LightType</td>
753
+ <td>int</td>
754
+ <td>x3d_DirectionalLight</td>
755
+ <td>1</td>
756
+ <td></td>
767
757
  </tr>
768
758
  <tr>
769
- <td style="width: 297.767px;"></td>
770
- <td style="width: 41.7667px;">int</td>
771
- <td style="width: 252.767px;">x3d_PointLight</td>
772
- <td style="width: 49.7667px;">2</td>
773
- <td style="width: 369.933px;"></td>
759
+ <td></td>
760
+ <td>int</td>
761
+ <td>x3d_PointLight</td>
762
+ <td>2</td>
763
+ <td></td>
774
764
  </tr>
775
765
  <tr>
776
- <td style="width: 297.767px;"></td>
777
- <td style="width: 41.7667px;">int</td>
778
- <td style="width: 252.767px;">x3d_SpotLight</td>
779
- <td style="width: 49.7667px;">3</td>
780
- <td style="width: 369.933px;"></td>
766
+ <td></td>
767
+ <td>int</td>
768
+ <td>x3d_SpotLight</td>
769
+ <td>3</td>
770
+ <td></td>
781
771
  </tr>
782
772
  <tr>
783
- <td colspan="5" style="width: 1036px;"><hr/>
773
+ <td colspan="5"><hr/>
784
774
  </td>
785
775
  </tr>
786
776
  <tr>
787
- <td style="width: 297.767px;"></td>
788
- <td style="width: 41.7667px;">int</td>
789
- <td style="width: 252.767px;">x3d_MaxTextures</td>
790
- <td style="width: 49.7667px;">2</td>
791
- <td style="width: 369.933px;"></td>
777
+ <td></td>
778
+ <td>int</td>
779
+ <td>x3d_MaxTextures</td>
780
+ <td>2</td>
781
+ <td></td>
792
782
  </tr>
793
783
  <tr>
794
- <td style="width: 297.767px;">x3d_TextureType</td>
795
- <td style="width: 41.7667px;">int</td>
796
- <td style="width: 252.767px;">x3d_TextureType2D</td>
797
- <td style="width: 49.7667px;">2</td>
798
- <td style="width: 369.933px;"></td>
784
+ <td>x3d_TextureType</td>
785
+ <td>int</td>
786
+ <td>x3d_TextureType2D</td>
787
+ <td>2</td>
788
+ <td></td>
799
789
  </tr>
800
790
  <tr>
801
- <td style="width: 297.767px;"></td>
802
- <td style="width: 41.7667px;">int</td>
803
- <td style="width: 252.767px;">x3d_TextureType3D</td>
804
- <td style="width: 49.7667px;">3</td>
805
- <td style="width: 369.933px;"></td>
791
+ <td></td>
792
+ <td>int</td>
793
+ <td>x3d_TextureType3D</td>
794
+ <td>3</td>
795
+ <td></td>
806
796
  </tr>
807
797
  <tr>
808
- <td style="width: 297.767px;"></td>
809
- <td style="width: 41.7667px;">int</td>
810
- <td style="width: 252.767px;">x3d_TextureTypeCubeMapTexture</td>
811
- <td style="width: 49.7667px;">4</td>
812
- <td style="width: 369.933px;"></td>
798
+ <td></td>
799
+ <td>int</td>
800
+ <td>x3d_TextureTypeCubeMapTexture</td>
801
+ <td>4</td>
802
+ <td></td>
813
803
  </tr>
814
804
  <tr>
815
- <td colspan="5" style="width: 1036px;"><hr/>
805
+ <td colspan="5"><hr/>
816
806
  </td>
817
807
  </tr>
818
808
  <tr>
819
- <td style="width: 297.767px;">x3d_ColorMode</td>
820
- <td style="width: 41.7667px;">int</td>
821
- <td style="width: 252.767px;">x3d_PointColor</td>
822
- <td style="width: 49.7667px;">0</td>
823
- <td style="width: 369.933px;">PointProperties colorMode constants</td>
809
+ <td>x3d_ColorMode</td>
810
+ <td>int</td>
811
+ <td>x3d_PointColor</td>
812
+ <td>0</td>
813
+ <td>PointProperties colorMode constants</td>
824
814
  </tr>
825
815
  <tr>
826
- <td style="width: 297.767px;"></td>
827
- <td style="width: 41.7667px;">int</td>
828
- <td style="width: 252.767px;">x3d_TextureColor</td>
829
- <td style="width: 49.7667px;">1</td>
830
- <td style="width: 369.933px;"></td>
816
+ <td></td>
817
+ <td>int</td>
818
+ <td>x3d_TextureColor</td>
819
+ <td>1</td>
820
+ <td></td>
831
821
  </tr>
832
822
  <tr>
833
- <td style="width: 297.767px;"></td>
834
- <td style="width: 41.7667px;">int</td>
835
- <td style="width: 252.767px;">x3d_TextureAndPointColor</td>
836
- <td style="width: 49.7667px;">2</td>
837
- <td style="width: 369.933px;"></td>
823
+ <td></td>
824
+ <td>int</td>
825
+ <td>x3d_TextureAndPointColor</td>
826
+ <td>2</td>
827
+ <td></td>
838
828
  </tr>
839
829
  </tbody>
840
830
  </table>
@@ -857,9 +847,11 @@ function initialize ()
857
847
 
858
848
  To address the issue of the depth not being interpolated in perspectively-correct way, output the following interpolant to the vertex shader:
859
849
 
860
- ```c
850
+ ```glsl
851
+ #version 300 es
852
+
861
853
  #ifdef X3D_LOGARITHMIC_DEPTH_BUFFER
862
- varying float depth;
854
+ out float depth;
863
855
  #endif
864
856
 
865
857
  void
@@ -867,7 +859,7 @@ main ()
867
859
  {
868
860
  ...
869
861
  #ifdef X3D_LOGARITHMIC_DEPTH_BUFFER
870
- // Assuming gl_Position was already computed
862
+ // Assuming gl_Position was already computed.
871
863
  depth = 1.0 + gl_Position .w;
872
864
  #endif
873
865
  }
@@ -875,14 +867,13 @@ main ()
875
867
 
876
868
  and then in the fragment shader add:
877
869
 
878
- ```c
879
- #ifdef X3D_LOGARITHMIC_DEPTH_BUFFER
880
- #extension GL_EXT_frag_depth : enable
881
- #endif
870
+ ```glsl
871
+ #version 300 es
882
872
 
883
873
  #ifdef X3D_LOGARITHMIC_DEPTH_BUFFER
874
+ #extension GL_EXT_frag_depth : enable
884
875
  uniform float x3d_LogarithmicFarValue1_2;
885
- varying float depth;
876
+ in float depth;
886
877
  #endif
887
878
 
888
879
  void