x_ite 4.7.5 → 4.7.6
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 +1 -3
- package/README.md +1 -1
- package/dist/example.html +2 -2
- package/dist/x_ite.css +2 -2
- package/dist/x_ite.js +66 -18
- package/dist/x_ite.min.js +13 -13
- package/dist/x_ite.zip +0 -0
- package/docs/Custom-Shaders.md +165 -174
- package/docs/What's-New.md +38 -6
- package/docs/_config.yml +1 -1
- package/docs/index.md +3 -3
- package/package.json +9 -4
- package/src/tests.js +1 -0
- package/src/x_ite/Browser/VERSION.js +1 -1
- 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/Rendering/X3DGeometryNode.js +25 -11
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
package/docs/index.md
CHANGED
|
@@ -8,7 +8,7 @@ X3D is an ISO-ratified, royalty-free open standards file format and run-time arc
|
|
|
8
8
|
|
|
9
9
|
X\_ITE supports custom shaders, clip planes, reflection mapping, script nodes, prototyping capabilities and event driven programming to provide you with an improved quality level of virtual effects and tools ready for the Internet.
|
|
10
10
|
|
|
11
|
-
**Developer note:** X\_ITE runs best in fresh installs of Google Chrome, Chromium, Firefox, Safari, Opera, and Microsoft Edge. X\_ITE uses the latest JavaScript standard, but is also compatible with older browser, and is
|
|
11
|
+
**Developer note:** X\_ITE runs best in fresh installs of Google Chrome, Chromium, Firefox, Safari, Opera, and Microsoft Edge. X\_ITE uses the latest JavaScript standard, but is also compatible with older browser, and is available both on your desktop computer and on your modern smart-phone.
|
|
12
12
|
{: .notice--info}
|
|
13
13
|
|
|
14
14
|
If you ever get in trouble, please [file a bug](https://github.com/create3000/x_ite/issues).
|
|
@@ -817,8 +817,8 @@ GitCDN serves raw files directly from GitHub with proper Content-Type headers an
|
|
|
817
817
|
If you are on production and everything works fine, then use a numbered version.
|
|
818
818
|
|
|
819
819
|
```html
|
|
820
|
-
<link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.
|
|
821
|
-
<script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.
|
|
820
|
+
<link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.6/dist/x_ite.css"/>
|
|
821
|
+
<script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.6/dist/x_ite.min.js"></script>
|
|
822
822
|
```
|
|
823
823
|
|
|
824
824
|
#### Latest Stable Version
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x_ite",
|
|
3
|
-
"version": "4.7.
|
|
4
|
-
"revision": "
|
|
3
|
+
"version": "4.7.6",
|
|
4
|
+
"revision": "1127",
|
|
5
5
|
"description": "X_ITE X3D Browser, a framework for integrating and manipulating X3D and VRML scenes in HTML.",
|
|
6
6
|
"main": "src/x_ite.js",
|
|
7
7
|
"repository": {
|
|
@@ -12,9 +12,14 @@
|
|
|
12
12
|
"X3D",
|
|
13
13
|
"VRML",
|
|
14
14
|
"WebGL",
|
|
15
|
-
"browser"
|
|
15
|
+
"browser",
|
|
16
|
+
"3D",
|
|
17
|
+
"wrl",
|
|
18
|
+
"JavaScript",
|
|
19
|
+
"JSON",
|
|
20
|
+
"xite"
|
|
16
21
|
],
|
|
17
|
-
"author": "Holger Seelig <holger.seelig@
|
|
22
|
+
"author": "Holger Seelig <holger.seelig@gmail.com>",
|
|
18
23
|
"license": "GPL-3.0",
|
|
19
24
|
"homepage": "https://create3000.github.io/x_ite/",
|
|
20
25
|
"contributors": [
|
package/src/tests.js
CHANGED
|
@@ -296,6 +296,7 @@ var X_ITE_TESTS = [
|
|
|
296
296
|
{ path: "Shape/LineProperties.x3dv" },
|
|
297
297
|
{ path: "Shape/BackMaterial.x3d" },
|
|
298
298
|
{ path: "Shape/UnlitMaterial.x3d" },
|
|
299
|
+
{ path: "Shape/Transparency.x3dv" },
|
|
299
300
|
{ path: "Shape/TwoSidedMaterial.x3d" },
|
|
300
301
|
{ component: "Sound" },
|
|
301
302
|
{ path: "Sound/04. Like A Virgin.mp3" },
|
|
@@ -72,7 +72,7 @@ function (Fields,
|
|
|
72
72
|
|
|
73
73
|
this .addType (X3DConstants .Switch);
|
|
74
74
|
|
|
75
|
-
if (executionContext .getSpecificationVersion ()
|
|
75
|
+
if (executionContext .getSpecificationVersion () === "2.0")
|
|
76
76
|
this .addAlias ("choice", this .children_);
|
|
77
77
|
|
|
78
78
|
this .childNode = null;
|
|
@@ -76,7 +76,7 @@ function (Fields,
|
|
|
76
76
|
|
|
77
77
|
this .addType (X3DConstants .LOD);
|
|
78
78
|
|
|
79
|
-
if (executionContext .getSpecificationVersion ()
|
|
79
|
+
if (executionContext .getSpecificationVersion () === "2.0")
|
|
80
80
|
this .addAlias ("level", this .children_); // VRML2
|
|
81
81
|
|
|
82
82
|
this .center_ .setUnit ("length");
|
|
@@ -912,7 +912,7 @@ function (Fields,
|
|
|
912
912
|
backMaterialNode = appearanceNode .backMaterialNode,
|
|
913
913
|
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
914
914
|
|
|
915
|
-
if (this .solid || !backMaterialNode ||
|
|
915
|
+
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
916
916
|
{
|
|
917
917
|
this .displayGeometry (gl, context, appearanceNode, frontShaderNode, true, true);
|
|
918
918
|
}
|
|
@@ -962,12 +962,19 @@ function (Fields,
|
|
|
962
962
|
|
|
963
963
|
// Draw depending on wireframe, solid and transparent.
|
|
964
964
|
|
|
965
|
-
if (
|
|
965
|
+
if (shaderNode .wireframe)
|
|
966
966
|
{
|
|
967
|
-
//
|
|
967
|
+
// Points and Wireframes.
|
|
968
968
|
|
|
969
|
-
|
|
970
|
-
|
|
969
|
+
if (shaderNode .primitiveMode === gl .POINTS)
|
|
970
|
+
{
|
|
971
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
972
|
+
}
|
|
973
|
+
else
|
|
974
|
+
{
|
|
975
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
976
|
+
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
977
|
+
}
|
|
971
978
|
}
|
|
972
979
|
else
|
|
973
980
|
{
|
|
@@ -983,7 +990,7 @@ function (Fields,
|
|
|
983
990
|
|
|
984
991
|
// Render back.
|
|
985
992
|
|
|
986
|
-
if (back)
|
|
993
|
+
if (back && !this .solid)
|
|
987
994
|
{
|
|
988
995
|
gl .cullFace (gl .FRONT);
|
|
989
996
|
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
@@ -1071,7 +1078,7 @@ function (Fields,
|
|
|
1071
1078
|
backMaterialNode = appearanceNode .backMaterialNode,
|
|
1072
1079
|
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
1073
1080
|
|
|
1074
|
-
if (this .solid || !backMaterialNode ||
|
|
1081
|
+
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
1075
1082
|
{
|
|
1076
1083
|
this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, true, true, particles, numParticles);
|
|
1077
1084
|
}
|
|
@@ -1131,7 +1138,7 @@ function (Fields,
|
|
|
1131
1138
|
|
|
1132
1139
|
if (shaderNode .wireframe)
|
|
1133
1140
|
{
|
|
1134
|
-
//
|
|
1141
|
+
// Points and Wireframes.
|
|
1135
1142
|
|
|
1136
1143
|
for (let p = 0; p < numParticles; ++ p)
|
|
1137
1144
|
{
|
|
@@ -1145,8 +1152,15 @@ function (Fields,
|
|
|
1145
1152
|
|
|
1146
1153
|
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1147
1154
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1155
|
+
if (shaderNode .primitiveMode === gl .POINTS)
|
|
1156
|
+
{
|
|
1157
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1158
|
+
}
|
|
1159
|
+
else
|
|
1160
|
+
{
|
|
1161
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
1162
|
+
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
1163
|
+
}
|
|
1150
1164
|
}
|
|
1151
1165
|
}
|
|
1152
1166
|
else
|
|
@@ -1173,7 +1187,7 @@ function (Fields,
|
|
|
1173
1187
|
|
|
1174
1188
|
gl .enable (gl .CULL_FACE);
|
|
1175
1189
|
|
|
1176
|
-
if (back)
|
|
1190
|
+
if (back && !this .solid)
|
|
1177
1191
|
{
|
|
1178
1192
|
gl .cullFace (gl .FRONT);
|
|
1179
1193
|
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
@@ -80,6 +80,35 @@ function (X3DGeometryNode,
|
|
|
80
80
|
{
|
|
81
81
|
return false;
|
|
82
82
|
},
|
|
83
|
+
transfer: function ()
|
|
84
|
+
{
|
|
85
|
+
// Line stipple support.
|
|
86
|
+
|
|
87
|
+
if (this .getGeometryType () === 1)
|
|
88
|
+
{
|
|
89
|
+
const
|
|
90
|
+
texCoords = this .getTexCoords (),
|
|
91
|
+
vertices = this .getVertices ();
|
|
92
|
+
|
|
93
|
+
this .getMultiTexCoords () .push (texCoords);
|
|
94
|
+
|
|
95
|
+
for (let i = 0, length = vertices .length; i < length; i += 8)
|
|
96
|
+
{
|
|
97
|
+
texCoords .push (vertices [i],
|
|
98
|
+
vertices [i + 1],
|
|
99
|
+
vertices [i + 2],
|
|
100
|
+
vertices [i + 3],
|
|
101
|
+
vertices [i],
|
|
102
|
+
vertices [i + 1],
|
|
103
|
+
vertices [i + 2],
|
|
104
|
+
vertices [i + 3]);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
texCoords .shrinkToFit ();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
X3DGeometryNode .prototype .transfer .call (this);
|
|
111
|
+
},
|
|
83
112
|
display: function (gl, context)
|
|
84
113
|
{
|
|
85
114
|
try
|
|
@@ -115,6 +144,9 @@ function (X3DGeometryNode,
|
|
|
115
144
|
if (this .colorMaterial)
|
|
116
145
|
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
117
146
|
|
|
147
|
+
if (this .getMultiTexCoords () .length)
|
|
148
|
+
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers, true);
|
|
149
|
+
|
|
118
150
|
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
119
151
|
|
|
120
152
|
// Wireframes are always solid so only one drawing call is needed.
|
|
@@ -130,7 +162,9 @@ function (X3DGeometryNode,
|
|
|
130
162
|
if (this .colorMaterial)
|
|
131
163
|
shaderNode .disableColorAttribute (gl);
|
|
132
164
|
|
|
133
|
-
|
|
165
|
+
if (this .getMultiTexCoords () .length)
|
|
166
|
+
shaderNode .disableTexCoordAttribute (gl);
|
|
167
|
+
|
|
134
168
|
shaderNode .disable (gl);
|
|
135
169
|
|
|
136
170
|
if (blendModeNode)
|