x_ite 8.6.7 → 8.6.8
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/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +26 -26
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +18 -18
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +19 -19
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +18 -18
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +33 -33
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +144 -163
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/package.json +1 -1
- package/src/assets/shaders/webgl1/include/Vertex.glsl.js +2 -3
- package/src/assets/shaders/webgl2/include/Particle.glsl.js +9 -23
- package/src/standard/Math/Numbers/Color3.js +2 -2
- package/src/standard/Math/Numbers/Color4.js +1 -1
- package/src/x_ite/Browser/Shaders/Shaders.js +0 -2
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +1 -1
- package/src/x_ite/Components/Shape/Material.js +24 -23
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +1 -0
- package/src/x_ite/Components/Shape/UnlitMaterial.js +1 -0
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +12 -10
- package/src/x_ite/Components/Texturing/ImageTexture.js +17 -4
- package/src/x_ite/Components/Texturing/MovieTexture.js +5 -4
- package/src/x_ite/Parser/GLTF2Parser.js +3 -9
- package/src/x_ite/Parser/OBJParser.js +6 -9
- package/src/assets/shaders/webgl1/include/Particle.glsl.js +0 -7
package/dist/x_ite.zip
CHANGED
|
Binary file
|
package/docs/_config.yml
CHANGED
package/package.json
CHANGED
|
@@ -72,7 +72,6 @@ varying vec3 vertex;
|
|
|
72
72
|
|
|
73
73
|
// Main
|
|
74
74
|
|
|
75
|
-
#pragma X3D include "Particle.glsl"
|
|
76
75
|
#pragma X3D include "PointSize.glsl"
|
|
77
76
|
|
|
78
77
|
void
|
|
@@ -101,11 +100,11 @@ vertex_main ()
|
|
|
101
100
|
#if ! defined (X3D_GEOMETRY_0D) && ! defined (X3D_GEOMETRY_1D)
|
|
102
101
|
#if defined (X3D_TEXTURE) || defined (X3D_MATERIAL_TEXTURES)
|
|
103
102
|
#if X3D_NUM_TEXTURE_COORDINATES > 0
|
|
104
|
-
texCoord0 =
|
|
103
|
+
texCoord0 = x3d_TexCoord0;
|
|
105
104
|
#endif
|
|
106
105
|
|
|
107
106
|
#if X3D_NUM_TEXTURE_COORDINATES > 1
|
|
108
|
-
texCoord1 =
|
|
107
|
+
texCoord1 = x3d_TexCoord1;
|
|
109
108
|
#endif
|
|
110
109
|
#endif
|
|
111
110
|
#endif
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export default /* glsl */ `
|
|
2
2
|
#if defined (X3D_PARTICLE_SYSTEM)
|
|
3
|
+
#if defined (X3D_TEX_COORD_RAMP)
|
|
4
|
+
|
|
5
|
+
uniform sampler2D x3d_TexCoordRamp;
|
|
3
6
|
|
|
4
7
|
in vec4 x3d_Particle;
|
|
5
|
-
in mat4 x3d_ParticleMatrix;
|
|
6
8
|
|
|
7
9
|
vec4
|
|
8
10
|
texelFetch (const in sampler2D sampler, const in int index, const in int lod)
|
|
@@ -14,12 +16,8 @@ texelFetch (const in sampler2D sampler, const in int index, const in int lod)
|
|
|
14
16
|
return t;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
#if defined (X3D_TEX_COORD_RAMP)
|
|
18
|
-
|
|
19
|
-
uniform sampler2D x3d_TexCoordRamp;
|
|
20
|
-
|
|
21
19
|
vec4
|
|
22
|
-
|
|
20
|
+
getTexCoord (const in vec4 texCoord)
|
|
23
21
|
{
|
|
24
22
|
const int map [6] = int [6] (0, 1, 2, 0, 2, 3);
|
|
25
23
|
|
|
@@ -28,9 +26,11 @@ getParticleTexCoord (const in vec4 texCoord)
|
|
|
28
26
|
return texelFetch (x3d_TexCoordRamp, index0 + map [gl_VertexID % 6], 0);
|
|
29
27
|
}
|
|
30
28
|
#else
|
|
31
|
-
#define
|
|
29
|
+
#define getTexCoord(texCoord) (texCoord)
|
|
32
30
|
#endif
|
|
33
31
|
|
|
32
|
+
in mat4 x3d_ParticleMatrix;
|
|
33
|
+
|
|
34
34
|
vec4
|
|
35
35
|
getVertex (const in vec4 vertex)
|
|
36
36
|
{
|
|
@@ -38,21 +38,7 @@ getVertex (const in vec4 vertex)
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
#else
|
|
41
|
-
|
|
42
|
-
#define
|
|
43
|
-
#define getParticleTexCoord(texCoord) (texCoord)
|
|
44
|
-
|
|
45
|
-
#endif
|
|
46
|
-
|
|
47
|
-
#if defined (X3D_PHYSICAL_MATERIAL)
|
|
48
|
-
vec4
|
|
49
|
-
getTexCoord (const in vec4 texCoord)
|
|
50
|
-
{
|
|
51
|
-
vec4 t = getParticleTexCoord (texCoord);
|
|
52
|
-
|
|
53
|
-
return vec4 (t .x, 1.0 - t .y, t .z, t .w);
|
|
54
|
-
}
|
|
55
|
-
#else
|
|
56
|
-
#define getTexCoord(texCoord) getParticleTexCoord(texCoord)
|
|
41
|
+
#define getVertex(vertex) (vertex)
|
|
42
|
+
#define getTexCoord(texCoord) (texCoord)
|
|
57
43
|
#endif
|
|
58
44
|
`;
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
import Algorithm from "../Algorithm.js";
|
|
49
49
|
|
|
50
|
-
const clamp = Algorithm
|
|
50
|
+
const { clamp, interval, degrees } = Algorithm;
|
|
51
51
|
|
|
52
52
|
const
|
|
53
53
|
_r = Symbol .for ("X_ITE.Color3.r"),
|
|
@@ -157,7 +157,7 @@ Color3 .prototype =
|
|
|
157
157
|
}
|
|
158
158
|
else
|
|
159
159
|
{
|
|
160
|
-
const w =
|
|
160
|
+
const w = degrees (interval (h, 0, Math .PI * 2)) / 60; // sector 0 to 5
|
|
161
161
|
|
|
162
162
|
const i = Math .floor (w);
|
|
163
163
|
const f = w - i; // factorial part of h
|
|
@@ -53,7 +53,6 @@ import Fragment1 from "../../../assets/shaders/webgl1/include/Fragm
|
|
|
53
53
|
import Hatch1 from "../../../assets/shaders/webgl1/include/Hatch.glsl.js";
|
|
54
54
|
import Material1 from "../../../assets/shaders/webgl1/include/Material.glsl.js";
|
|
55
55
|
import Normal1 from "../../../assets/shaders/webgl1/include/Normal.glsl.js";
|
|
56
|
-
import Particle1 from "../../../assets/shaders/webgl1/include/Particle.glsl.js";
|
|
57
56
|
import Perlin1 from "../../../assets/shaders/webgl1/include/Perlin.glsl.js";
|
|
58
57
|
import Point1 from "../../../assets/shaders/webgl1/include/Point.glsl.js";
|
|
59
58
|
import PointSize1 from "../../../assets/shaders/webgl1/include/PointSize.glsl.js";
|
|
@@ -117,7 +116,6 @@ const Shaders = {
|
|
|
117
116
|
Hatch: Hatch1,
|
|
118
117
|
Material: Material1,
|
|
119
118
|
Normal: Normal1,
|
|
120
|
-
Particle: Particle1,
|
|
121
119
|
Perlin: Perlin1,
|
|
122
120
|
Point: Point1,
|
|
123
121
|
PointSize: PointSize1,
|
|
@@ -203,7 +203,7 @@ ComposedCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironme
|
|
|
203
203
|
case X3DConstants .MovieTexture:
|
|
204
204
|
{
|
|
205
205
|
gl .bindTexture (this .getTarget (), this .getTexture ());
|
|
206
|
-
gl .pixelStorei (gl .UNPACK_FLIP_Y_WEBGL,
|
|
206
|
+
gl .pixelStorei (gl .UNPACK_FLIP_Y_WEBGL, textureNode ._flipVertically .getValue ());
|
|
207
207
|
gl .texImage2D (this .getTargets () [i], 0, gl .RGBA, width, height, 0, gl .RGBA, gl .UNSIGNED_BYTE, textureNode .getElement ());
|
|
208
208
|
break;
|
|
209
209
|
}
|
|
@@ -71,29 +71,30 @@ Material .prototype = Object .assign (Object .create (X3DOneSidedMaterialNode .p
|
|
|
71
71
|
{
|
|
72
72
|
constructor: Material,
|
|
73
73
|
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
74
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata",
|
|
75
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "ambientIntensity",
|
|
76
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "ambientTextureMapping",
|
|
77
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "ambientTexture",
|
|
78
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "diffuseColor",
|
|
79
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "diffuseTextureMapping",
|
|
80
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "diffuseTexture",
|
|
81
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "specularColor",
|
|
82
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "specularTextureMapping",
|
|
83
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "specularTexture",
|
|
84
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveColor",
|
|
85
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
86
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
87
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
88
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
89
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
90
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
91
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
92
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
93
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
94
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
95
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
96
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "
|
|
74
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
75
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "ambientIntensity", new Fields .SFFloat (0.2)),
|
|
76
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "ambientTextureMapping", new Fields .SFString ()),
|
|
77
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "ambientTexture", new Fields .SFNode ()),
|
|
78
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "diffuseColor", new Fields .SFColor (0.8, 0.8, 0.8)),
|
|
79
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "diffuseTextureMapping", new Fields .SFString ()),
|
|
80
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "diffuseTexture", new Fields .SFNode ()),
|
|
81
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "specularColor", new Fields .SFColor ()),
|
|
82
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "specularTextureMapping", new Fields .SFString ()),
|
|
83
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "specularTexture", new Fields .SFNode ()),
|
|
84
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveColor", new Fields .SFColor ()),
|
|
85
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveStrength", new Fields .SFFloat (1)),
|
|
86
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveTextureMapping", new Fields .SFString ()),
|
|
87
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveTexture", new Fields .SFNode ()),
|
|
88
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "shininess", new Fields .SFFloat (0.2)),
|
|
89
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "shininessTextureMapping", new Fields .SFString ()),
|
|
90
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "shininessTexture", new Fields .SFNode ()),
|
|
91
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "occlusionStrength", new Fields .SFFloat (1)),
|
|
92
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "occlusionTextureMapping", new Fields .SFString ()),
|
|
93
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "occlusionTexture", new Fields .SFNode ()),
|
|
94
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "normalScale", new Fields .SFFloat (1)),
|
|
95
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "normalTextureMapping", new Fields .SFString ()),
|
|
96
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "normalTexture", new Fields .SFNode ()),
|
|
97
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "transparency", new Fields .SFFloat ()),
|
|
97
98
|
]),
|
|
98
99
|
getTypeName: function ()
|
|
99
100
|
{
|
|
@@ -71,6 +71,7 @@ PhysicalMaterial .prototype = Object .assign (Object .create (X3DOneSidedMateria
|
|
|
71
71
|
new X3DFieldDefinition (X3DConstants .inputOutput, "baseTextureMapping", new Fields .SFString ()),
|
|
72
72
|
new X3DFieldDefinition (X3DConstants .inputOutput, "baseTexture", new Fields .SFNode ()),
|
|
73
73
|
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveColor", new Fields .SFColor (0, 0, 0)),
|
|
74
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveStrength", new Fields .SFFloat (1)),
|
|
74
75
|
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveTextureMapping", new Fields .SFString ()),
|
|
75
76
|
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveTexture", new Fields .SFNode ()),
|
|
76
77
|
new X3DFieldDefinition (X3DConstants .inputOutput, "metallic", new Fields .SFFloat (1)),
|
|
@@ -64,6 +64,7 @@ UnlitMaterial .prototype = Object .assign (Object .create (X3DOneSidedMaterialNo
|
|
|
64
64
|
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
65
65
|
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
66
66
|
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveColor", new Fields .SFColor (1, 1, 1)),
|
|
67
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveStrength", new Fields .SFFloat (1)),
|
|
67
68
|
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveTextureMapping", new Fields .SFString ()),
|
|
68
69
|
new X3DFieldDefinition (X3DConstants .inputOutput, "emissiveTexture", new Fields .SFNode ()),
|
|
69
70
|
new X3DFieldDefinition (X3DConstants .inputOutput, "normalScale", new Fields .SFFloat (1)),
|
|
@@ -69,11 +69,12 @@ X3DOneSidedMaterialNode .prototype = Object .assign (Object .create (X3DMaterial
|
|
|
69
69
|
{
|
|
70
70
|
X3DMaterialNode .prototype .initialize .call (this);
|
|
71
71
|
|
|
72
|
-
this ._emissiveColor
|
|
73
|
-
this .
|
|
74
|
-
this .
|
|
75
|
-
this .
|
|
76
|
-
this ._transparency
|
|
72
|
+
this ._emissiveColor .addInterest ("set_emissiveColor__", this);
|
|
73
|
+
this ._emissiveStrength .addInterest ("set_emissiveColor__", this);
|
|
74
|
+
this ._emissiveTexture .addInterest ("set_emissiveTexture__", this);
|
|
75
|
+
this ._normalTexture .addInterest ("set_normalTexture__", this);
|
|
76
|
+
this ._transparency .addInterest ("set_transparency__", this);
|
|
77
|
+
this ._transparency .addInterest ("set_transparent__", this);
|
|
77
78
|
|
|
78
79
|
this .set_emissiveColor__ ();
|
|
79
80
|
this .set_emissiveTexture__ ();
|
|
@@ -86,12 +87,13 @@ X3DOneSidedMaterialNode .prototype = Object .assign (Object .create (X3DMaterial
|
|
|
86
87
|
//this .emissiveColor .set (this ._emissiveColor .getValue ());
|
|
87
88
|
|
|
88
89
|
const
|
|
89
|
-
emissiveColor
|
|
90
|
-
emissiveColor_
|
|
90
|
+
emissiveColor = this .emissiveColor,
|
|
91
|
+
emissiveColor_ = this ._emissiveColor .getValue (),
|
|
92
|
+
emissiveStrength = this ._emissiveStrength .getValue ();
|
|
91
93
|
|
|
92
|
-
emissiveColor [0] = emissiveColor_ .r;
|
|
93
|
-
emissiveColor [1] = emissiveColor_ .g;
|
|
94
|
-
emissiveColor [2] = emissiveColor_ .b;
|
|
94
|
+
emissiveColor [0] = emissiveColor_ .r * emissiveStrength;
|
|
95
|
+
emissiveColor [1] = emissiveColor_ .g * emissiveStrength;
|
|
96
|
+
emissiveColor [2] = emissiveColor_ .b * emissiveStrength;
|
|
95
97
|
},
|
|
96
98
|
set_emissiveTexture__: function ()
|
|
97
99
|
{
|
|
@@ -77,6 +77,7 @@ ImageTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
77
77
|
new X3DFieldDefinition (X3DConstants .inputOutput, "url", new Fields .MFString ()),
|
|
78
78
|
new X3DFieldDefinition (X3DConstants .inputOutput, "autoRefresh", new Fields .SFTime ()),
|
|
79
79
|
new X3DFieldDefinition (X3DConstants .inputOutput, "autoRefreshTimeLimit", new Fields .SFTime (3600)),
|
|
80
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "flipVertically", new Fields .SFBool ()),
|
|
80
81
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "repeatS", new Fields .SFBool (true)),
|
|
81
82
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "repeatT", new Fields .SFBool (true)),
|
|
82
83
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "textureProperties", new Fields .SFNode ()),
|
|
@@ -98,6 +99,8 @@ ImageTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
98
99
|
X3DTexture2DNode .prototype .initialize .call (this);
|
|
99
100
|
X3DUrlObject .prototype .initialize .call (this);
|
|
100
101
|
|
|
102
|
+
this ._flipVertically .addInterest ("set_url__", this);
|
|
103
|
+
|
|
101
104
|
this .image .on ("load", this .setImage .bind (this));
|
|
102
105
|
this .image .on ("abort error", this .setError .bind (this));
|
|
103
106
|
this .image .prop ("crossOrigin", "Anonymous");
|
|
@@ -179,8 +182,13 @@ ImageTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
179
182
|
|
|
180
183
|
cx .clearRect (0, 0, width, height);
|
|
181
184
|
cx .save ();
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
|
|
186
|
+
if (!this ._flipVertically .getValue ())
|
|
187
|
+
{
|
|
188
|
+
cx .translate (0, height);
|
|
189
|
+
cx .scale (1, -1);
|
|
190
|
+
}
|
|
191
|
+
|
|
184
192
|
cx .drawImage (image, 0, 0);
|
|
185
193
|
cx .restore ();
|
|
186
194
|
}
|
|
@@ -196,8 +204,13 @@ ImageTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
196
204
|
|
|
197
205
|
cx .clearRect (0, 0, width, height);
|
|
198
206
|
cx .save ();
|
|
199
|
-
|
|
200
|
-
|
|
207
|
+
|
|
208
|
+
if (!this ._flipVertically .getValue ())
|
|
209
|
+
{
|
|
210
|
+
cx .translate (0, height);
|
|
211
|
+
cx .scale (1, -1);
|
|
212
|
+
}
|
|
213
|
+
|
|
201
214
|
cx .drawImage (image, 0, 0, image .width, image .height, 0, 0, width, height);
|
|
202
215
|
cx .restore ();
|
|
203
216
|
}
|
|
@@ -93,6 +93,7 @@ MovieTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
93
93
|
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
94
94
|
new X3DFieldDefinition (X3DConstants .outputOnly, "elapsedTime", new Fields .SFTime ()),
|
|
95
95
|
new X3DFieldDefinition (X3DConstants .outputOnly, "duration_changed", new Fields .SFTime (-1)),
|
|
96
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "flipVertically", new Fields .SFBool ()),
|
|
96
97
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "repeatS", new Fields .SFBool (true)),
|
|
97
98
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "repeatT", new Fields .SFBool (true)),
|
|
98
99
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "textureProperties", new Fields .SFNode ()),
|
|
@@ -219,7 +220,7 @@ MovieTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
219
220
|
throw new Error ("The movie texture is a non power-of-two texture.");
|
|
220
221
|
|
|
221
222
|
this .setMedia (this .video [0]);
|
|
222
|
-
this .setTexture (width, height, false, video,
|
|
223
|
+
this .setTexture (width, height, false, video, !this ._flipVertically .getValue ());
|
|
223
224
|
this .setLoadState (X3DConstants .COMPLETE_STATE);
|
|
224
225
|
}
|
|
225
226
|
catch (error)
|
|
@@ -239,7 +240,7 @@ MovieTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
239
240
|
gif .pause ();
|
|
240
241
|
|
|
241
242
|
this .setMedia (gif);
|
|
242
|
-
this .setTexture (gif .get_canvas () .width, gif .get_canvas () .height, false, gif .get_frames () [0] .data,
|
|
243
|
+
this .setTexture (gif .get_canvas () .width, gif .get_canvas () .height, false, gif .get_frames () [0] .data, !this ._flipVertically .getValue ());
|
|
243
244
|
this .setLoadState (X3DConstants .COMPLETE_STATE);
|
|
244
245
|
}
|
|
245
246
|
catch (error)
|
|
@@ -256,9 +257,9 @@ MovieTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
|
|
|
256
257
|
return;
|
|
257
258
|
|
|
258
259
|
if (this .gif)
|
|
259
|
-
this .updateTexture (this .gif .currentFrame .data,
|
|
260
|
+
this .updateTexture (this .gif .currentFrame .data, !this ._flipVertically .getValue ());
|
|
260
261
|
else
|
|
261
|
-
this .updateTexture (this .video [0],
|
|
262
|
+
this .updateTexture (this .video [0], !this ._flipVertically .getValue ());
|
|
262
263
|
},
|
|
263
264
|
traverse: X3DTexture2DNode .prototype .traverse,
|
|
264
265
|
dispose: function ()
|
|
@@ -696,7 +696,8 @@ GLTF2Parser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
696
696
|
if (name)
|
|
697
697
|
scene .addNamedNode (scene .getUniqueName (name), textureNode);
|
|
698
698
|
|
|
699
|
-
textureNode ._url
|
|
699
|
+
textureNode ._url = [image .uri];
|
|
700
|
+
textureNode ._flipVertically = true;
|
|
700
701
|
|
|
701
702
|
const sampler = this .samplers [texture .sampler];
|
|
702
703
|
|
|
@@ -926,14 +927,7 @@ GLTF2Parser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
926
927
|
if (!(KHR_materials_emissive_strength instanceof Object))
|
|
927
928
|
return;
|
|
928
929
|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
// Will not always get the desired result, because colors are clamped values,
|
|
932
|
-
// especially if there is an emissiveTexture.
|
|
933
|
-
|
|
934
|
-
materialNode ._emissiveColor .r *= emissiveStrength;
|
|
935
|
-
materialNode ._emissiveColor .g *= emissiveStrength;
|
|
936
|
-
materialNode ._emissiveColor .b *= emissiveStrength;
|
|
930
|
+
materialNode ._emissiveStrength = this .numberValue (KHR_materials_emissive_strength .emissiveStrength, 1);
|
|
937
931
|
},
|
|
938
932
|
textureTransformObject: function (KHR_texture_transform, mapping)
|
|
939
933
|
{
|
|
@@ -275,15 +275,12 @@ OBJParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
275
275
|
try
|
|
276
276
|
{
|
|
277
277
|
const
|
|
278
|
-
scene
|
|
279
|
-
url
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
.catch (Function .prototype);
|
|
285
|
-
|
|
286
|
-
const parser = new MaterialParser (scene, input);
|
|
278
|
+
scene = this .getExecutionContext (),
|
|
279
|
+
url = new URL (path, scene .getWorldURL ()),
|
|
280
|
+
response = await fetch (url),
|
|
281
|
+
arrayBuffer = await response .arrayBuffer (),
|
|
282
|
+
input = $.decodeText ($.ungzip (arrayBuffer)),
|
|
283
|
+
parser = new MaterialParser (scene, input);
|
|
287
284
|
|
|
288
285
|
parser .parse ();
|
|
289
286
|
|