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.
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +2 -5
- package/Makefile +1 -0
- package/README.md +1 -1
- package/build/components/annotation.build.js +2 -2
- package/build/components/cad-geometry.build.js +2 -2
- package/build/components/cube-map-texturing.build.js +2 -2
- package/build/components/dis.build.js +2 -2
- package/build/components/event-utilities.build.js +2 -2
- package/build/components/geometry2d.build.js +2 -2
- package/build/components/geospatial.build.js +2 -2
- package/build/components/h-anim.build.js +2 -2
- package/build/components/key-device-sensor.build.js +2 -2
- package/build/components/layout.build.js +2 -2
- package/build/components/nurbs.build.js +2 -2
- package/build/components/particle-systems.build.js +2 -2
- package/build/components/picking.build.js +2 -2
- package/build/components/projective-texture-mapping.build.js +2 -2
- package/build/components/rigid-body-physics.build.js +2 -2
- package/build/components/scripting.build.js +2 -2
- package/build/components/texturing-3d.build.js +2 -2
- package/build/components/volume-rendering.build.js +2 -2
- package/build/components/x_ite.build.js +2 -2
- package/build/parts/default.end.frag.js +2 -0
- package/build/parts/default.start.frag.js +8 -0
- package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +2 -2
- package/dist/assets/components/annotation.js +9 -7
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +9 -7
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +9 -7
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +9 -7
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +9 -7
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +9 -7
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +9 -7
- package/dist/assets/components/geospatial.min.js +2 -2
- package/dist/assets/components/h-anim.js +9 -7
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +9 -7
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +9 -7
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +9 -7
- package/dist/assets/components/nurbs.min.js +2 -2
- package/dist/assets/components/particle-systems.js +9 -7
- package/dist/assets/components/particle-systems.min.js +2 -2
- package/dist/assets/components/picking.js +13 -11
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +9 -7
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +9 -7
- package/dist/assets/components/rigid-body-physics.min.js +17 -17
- package/dist/assets/components/scripting.js +16 -9
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +9 -7
- package/dist/assets/components/texturing-3d.min.js +3 -3
- package/dist/assets/components/volume-rendering.js +11 -9
- package/dist/assets/components/volume-rendering.min.js +3 -3
- package/dist/assets/components/x_ite.js +9 -7
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl1/Phong.fs +0 -1
- package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
- package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl2/Phong.fs +0 -1
- package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +4 -3
- package/dist/x_ite.js +28281 -27706
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Accessing-the-External-Browser.md +32 -3
- package/docs/Custom-Shaders.md +165 -174
- package/docs/What's-New.md +61 -6
- package/docs/_config.yml +1 -1
- package/docs/index.md +21 -14
- package/docs/reference/Browser-Services.md +36 -8
- package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
- package/package.json +13 -6
- package/src/assets/components/picking.js +2 -2
- package/src/assets/components/volume-rendering.js +2 -2
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl1/Phong.fs +0 -1
- package/src/assets/shaders/webgl1/Unlit.fs +0 -3
- package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl2/Phong.fs +0 -1
- package/src/assets/shaders/webgl2/Unlit.fs +0 -3
- package/src/bookmarks.js +8 -11
- package/src/examples.js +1 -1
- package/src/locale/de.po +19 -75
- package/src/locale/fr.po +18 -75
- package/src/standard/Time/MicroTime.js +3 -1
- package/src/standard/Utility/DataStorage.js +7 -10
- package/src/tests.js +2 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
- package/src/x_ite/Browser/Core/BrowserTimings.js +13 -24
- package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
- package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +1 -3
- package/src/x_ite/Browser/Networking/urls.js +25 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
- package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +70 -50
- package/src/x_ite/Components/Grouping/Switch.js +1 -1
- package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
- package/src/x_ite/Components/Navigation/Collision.js +1 -1
- package/src/x_ite/Components/Navigation/LOD.js +1 -1
- package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +25 -11
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
- package/src/x_ite/Components/Scripting/Script.js +7 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
- package/src/x_ite/Components/Shaders.js +9 -9
- package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
- package/src/x_ite/Fields/SFColor.js +20 -7
- package/src/x_ite/Fields/SFColorRGBA.js +6 -6
- package/src/x_ite/Fields/SFDouble.js +2 -2
- package/src/x_ite/Fields/SFFloat.js +2 -2
- package/src/x_ite/Fields/SFImage.js +13 -13
- package/src/x_ite/Fields/SFMatrix3.js +5 -5
- package/src/x_ite/Fields/SFMatrix4.js +6 -6
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +14 -3
- package/src/x_ite/Fields/SFNode.js +23 -19
- package/src/x_ite/Fields/SFNodeCache.js +14 -10
- package/src/x_ite/Fields/SFRotation.js +10 -10
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/Fields/SFTime.js +1 -1
- package/src/x_ite/Fields/SFVec2.js +6 -6
- package/src/x_ite/Fields/SFVec3.js +7 -7
- package/src/x_ite/Fields/SFVec4.js +8 -8
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +7 -6
- package/src/x_ite/InputOutput/Generator.js +85 -65
- package/src/x_ite/Parser/X3DParser.js +6 -0
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/X3D.js +8 -2
- package/src/x_ite.config.js +0 -5
- package/src/x_ite.css +2 -1
- package/src/x_ite.html +3 -3
- package/src/x_ite.js +21 -12
- package/x_ite.min.html +3 -3
- package/build/parts/default.end.frag +0 -2
- package/build/parts/default.start.frag +0 -6
- 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
|
|
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>
|
package/docs/Custom-Shaders.md
CHANGED
|
@@ -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
|
-
```
|
|
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
|
|
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] *
|
|
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
|
-
```
|
|
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
|
|
131
|
-
<th
|
|
132
|
-
<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
|
|
361
|
-
<th
|
|
362
|
-
<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
|
|
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
|
|
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>
|
|
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,
|
|
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 |
|
|
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
|
|
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"
|
|
643
|
+
<table class=" table">
|
|
654
644
|
<thead>
|
|
655
645
|
<tr>
|
|
656
|
-
<th
|
|
657
|
-
<th
|
|
658
|
-
<th
|
|
659
|
-
<th
|
|
660
|
-
<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
|
|
666
|
-
<td
|
|
667
|
-
<td
|
|
668
|
-
<td
|
|
669
|
-
<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"
|
|
662
|
+
<td colspan="5"><hr/>
|
|
673
663
|
</td>
|
|
674
664
|
</tr>
|
|
675
665
|
<tr>
|
|
676
|
-
<td
|
|
677
|
-
<td
|
|
678
|
-
<td
|
|
679
|
-
<td
|
|
680
|
-
<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"
|
|
673
|
+
<td colspan="5"><hr/>
|
|
684
674
|
</td>
|
|
685
675
|
</tr>
|
|
686
676
|
<tr>
|
|
687
|
-
<td
|
|
688
|
-
<td
|
|
689
|
-
<td
|
|
690
|
-
<td
|
|
691
|
-
<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
|
|
695
|
-
<td
|
|
696
|
-
<td
|
|
697
|
-
<td
|
|
698
|
-
<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
|
|
702
|
-
<td
|
|
703
|
-
<td
|
|
704
|
-
<td
|
|
705
|
-
<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
|
|
709
|
-
<td
|
|
710
|
-
<td
|
|
711
|
-
<td
|
|
712
|
-
<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"
|
|
705
|
+
<td colspan="5"><hr/>
|
|
716
706
|
</td>
|
|
717
707
|
</tr>
|
|
718
708
|
<tr>
|
|
719
|
-
<td
|
|
720
|
-
<td
|
|
721
|
-
<td
|
|
722
|
-
<td
|
|
723
|
-
<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"
|
|
716
|
+
<td colspan="5"><hr/>
|
|
727
717
|
</td>
|
|
728
718
|
</tr>
|
|
729
719
|
<tr>
|
|
730
|
-
<td
|
|
731
|
-
<td
|
|
732
|
-
<td
|
|
733
|
-
<td
|
|
734
|
-
<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
|
|
738
|
-
<td
|
|
739
|
-
<td
|
|
740
|
-
<td
|
|
741
|
-
<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
|
|
745
|
-
<td
|
|
746
|
-
<td
|
|
747
|
-
<td
|
|
748
|
-
<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"
|
|
741
|
+
<td colspan="5"><hr/>
|
|
752
742
|
</td>
|
|
753
743
|
</tr>
|
|
754
744
|
<tr>
|
|
755
|
-
<td
|
|
756
|
-
<td
|
|
757
|
-
<td
|
|
758
|
-
<td
|
|
759
|
-
<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
|
|
763
|
-
<td
|
|
764
|
-
<td
|
|
765
|
-
<td
|
|
766
|
-
<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
|
|
770
|
-
<td
|
|
771
|
-
<td
|
|
772
|
-
<td
|
|
773
|
-
<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
|
|
777
|
-
<td
|
|
778
|
-
<td
|
|
779
|
-
<td
|
|
780
|
-
<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"
|
|
773
|
+
<td colspan="5"><hr/>
|
|
784
774
|
</td>
|
|
785
775
|
</tr>
|
|
786
776
|
<tr>
|
|
787
|
-
<td
|
|
788
|
-
<td
|
|
789
|
-
<td
|
|
790
|
-
<td
|
|
791
|
-
<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
|
|
795
|
-
<td
|
|
796
|
-
<td
|
|
797
|
-
<td
|
|
798
|
-
<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
|
|
802
|
-
<td
|
|
803
|
-
<td
|
|
804
|
-
<td
|
|
805
|
-
<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
|
|
809
|
-
<td
|
|
810
|
-
<td
|
|
811
|
-
<td
|
|
812
|
-
<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"
|
|
805
|
+
<td colspan="5"><hr/>
|
|
816
806
|
</td>
|
|
817
807
|
</tr>
|
|
818
808
|
<tr>
|
|
819
|
-
<td
|
|
820
|
-
<td
|
|
821
|
-
<td
|
|
822
|
-
<td
|
|
823
|
-
<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
|
|
827
|
-
<td
|
|
828
|
-
<td
|
|
829
|
-
<td
|
|
830
|
-
<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
|
|
834
|
-
<td
|
|
835
|
-
<td
|
|
836
|
-
<td
|
|
837
|
-
<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
|
-
```
|
|
850
|
+
```glsl
|
|
851
|
+
#version 300 es
|
|
852
|
+
|
|
861
853
|
#ifdef X3D_LOGARITHMIC_DEPTH_BUFFER
|
|
862
|
-
|
|
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
|
-
```
|
|
879
|
-
#
|
|
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
|
-
|
|
876
|
+
in float depth;
|
|
886
877
|
#endif
|
|
887
878
|
|
|
888
879
|
void
|