@woosh/meep-engine 2.43.47 → 2.43.49
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/core/model/node-graph/DataType.js +10 -0
- package/core/model/node-graph/NodeGraph.js +1 -1
- package/core/model/node-graph/NodeGraph.spec.js +16 -0
- package/core/model/node-graph/node/NodeDescription.js +11 -0
- package/engine/asset/loaders/image/png/prototypePNG.js +1 -1
- package/engine/graphics/render/forward_plus/materials/FP_SHADER_CHUNK_ACCUMULATION.js +3 -41
- package/package.json +1 -1
|
@@ -55,6 +55,9 @@ export class DataType {
|
|
|
55
55
|
* @returns {DataType}
|
|
56
56
|
*/
|
|
57
57
|
static from(id, name) {
|
|
58
|
+
assert.isNonNegativeInteger(id, 'id');
|
|
59
|
+
assert.isString(name, 'name');
|
|
60
|
+
|
|
58
61
|
const r = new DataType();
|
|
59
62
|
|
|
60
63
|
r.id = id;
|
|
@@ -63,3 +66,10 @@ export class DataType {
|
|
|
63
66
|
return r;
|
|
64
67
|
}
|
|
65
68
|
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @readonly
|
|
73
|
+
* @type {boolean}
|
|
74
|
+
*/
|
|
75
|
+
DataType.prototype.isDataType = true;
|
|
@@ -31,3 +31,19 @@ test("createConnection returns a number", () => {
|
|
|
31
31
|
|
|
32
32
|
expect(typeof g.createConnection(i0, pOut, i1, pInt)).toBe('number');
|
|
33
33
|
});
|
|
34
|
+
|
|
35
|
+
test('getNode produces correct result', () => {
|
|
36
|
+
const graph = new NodeGraph();
|
|
37
|
+
|
|
38
|
+
//
|
|
39
|
+
expect(graph.getNode(0)).toBe(undefined);
|
|
40
|
+
|
|
41
|
+
const d = new NodeDescription();
|
|
42
|
+
|
|
43
|
+
const node_id = graph.createNode(d);
|
|
44
|
+
|
|
45
|
+
const node_instance = graph.getNode(node_id);
|
|
46
|
+
|
|
47
|
+
expect(node_instance).toBeDefined();
|
|
48
|
+
expect(node_instance.id).toBe(node_id);
|
|
49
|
+
});
|
|
@@ -110,6 +110,7 @@ export class NodeDescription {
|
|
|
110
110
|
* @returns {NodeParameterDescription}
|
|
111
111
|
*/
|
|
112
112
|
getParameter(id) {
|
|
113
|
+
assert.isNonNegativeInteger(id, 'id');
|
|
113
114
|
|
|
114
115
|
const paramDescriptors = this.parameters;
|
|
115
116
|
|
|
@@ -133,6 +134,13 @@ export class NodeDescription {
|
|
|
133
134
|
* @param {PortDirection} direction
|
|
134
135
|
*/
|
|
135
136
|
createPort(type, name, direction) {
|
|
137
|
+
assert.defined(type, 'type');
|
|
138
|
+
assert.notNull(type, 'type');
|
|
139
|
+
assert.equal(type.isDataType, true, 'type.isDataType !== true');
|
|
140
|
+
|
|
141
|
+
assert.defined(direction, 'direction');
|
|
142
|
+
assert.isString(name, 'name');
|
|
143
|
+
|
|
136
144
|
const port = new Port();
|
|
137
145
|
|
|
138
146
|
const id = pickNewSetId(this.ports);
|
|
@@ -154,6 +162,8 @@ export class NodeDescription {
|
|
|
154
162
|
* @returns {Port|null}
|
|
155
163
|
*/
|
|
156
164
|
getPortById(id) {
|
|
165
|
+
assert.isNonNegativeInteger(id, 'id');
|
|
166
|
+
|
|
157
167
|
for (const port of this.ports) {
|
|
158
168
|
if (port.id === id) {
|
|
159
169
|
return port;
|
|
@@ -170,6 +180,7 @@ export class NodeDescription {
|
|
|
170
180
|
* @return {Port|undefined}
|
|
171
181
|
*/
|
|
172
182
|
getPortByName(name) {
|
|
183
|
+
assert.isString(name, 'name');
|
|
173
184
|
|
|
174
185
|
for (const port of this.ports) {
|
|
175
186
|
if (port.name === name) {
|
|
@@ -7,7 +7,7 @@ const array_loader = new ArrayBufferLoader();
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
array_loader.load('moicon/
|
|
10
|
+
array_loader.load('moicon/ISO 7010 - Safety Signs (3)/ISO 7010 - Safety Signs/Emergency/400px/E001 – Emergency exit (left hand).png',(asset)=>{
|
|
11
11
|
|
|
12
12
|
const array = asset.create();
|
|
13
13
|
|
|
@@ -61,53 +61,15 @@ export const FP_SHADER_CHUNK_ACCUMULATION = `
|
|
|
61
61
|
vec4 light_data_4 = texelFetch(fp_t_light_data, address_to_data_texture_coordinates(light_address+4u), 0);
|
|
62
62
|
|
|
63
63
|
// compute normal of the decal, we get this by extracting rotation matrix and transforming (0,1,0) vector using that
|
|
64
|
-
|
|
65
|
-
mat4 decal_view_transform = viewMatrix*decal_transform_matrix;
|
|
66
|
-
// mat3 decal_view_transform = mat3(transpose(inverse(viewMatrix*decal_transform_matrix)));
|
|
67
|
-
// mat3 decal_view_transform = mat3(transpose(inverse( decal_transform_matrix )));
|
|
68
|
-
|
|
69
|
-
// vec3 decal_normal = normalize(vec3(
|
|
70
|
-
// decal_view_transform[1][0], decal_view_transform[1][1], decal_view_transform[1][2]
|
|
71
|
-
// ));
|
|
72
|
-
|
|
73
|
-
// vec3 decal_normal = normalize(vec3(
|
|
74
|
-
// decal_view_transform[0][2], decal_view_transform[1][2], decal_view_transform[2][2]
|
|
75
|
-
// ));
|
|
76
|
-
vec3 decal_normal = normalize(vec3(
|
|
64
|
+
vec3 decal_normal = normalize(vec3(
|
|
77
65
|
decal_transform_matrix[0][2], decal_transform_matrix[1][2], decal_transform_matrix[2][2]
|
|
78
66
|
));
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// vec3 decal_normal = normalize( ( decal_view_transform * vec3( 0.0, 1.0, 0.0 ) ).xyz );
|
|
83
|
-
// vec3 decal_normal = normalize( ( transpose(inverse( decal_view_transform )) * vec4( 0.0, 1.0, 0.0, 0.0 ) ).xyz );
|
|
84
67
|
|
|
85
68
|
// Get geometry normal in world-space
|
|
86
69
|
vec3 g_normal = normalize( ( transpose(viewMatrix) * vec4( geometry.normal, 0.0 ) ).xyz );
|
|
87
|
-
|
|
88
|
-
// material.diffuseColor = geometry.normal*0.5 + 0.5;
|
|
89
|
-
// material.diffuseColor = normalize( ( viewMatrix * vec4( geometry.normal, 0.0 ) ).xyz )*0.5 + 0.5;
|
|
90
|
-
// material.diffuseColor = decal_normal*0.5 + 0.5;
|
|
91
|
-
|
|
92
|
-
// material.diffuseColor = mix(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), decal_normal.y*0.5 + 0.5);
|
|
93
|
-
// material.diffuseColor = mix(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), g_normal.y*0.5 + 0.5);
|
|
94
|
-
// material.diffuseColor = g_normal*0.5 + 0.5;
|
|
95
|
-
// continue;
|
|
96
|
-
|
|
97
|
-
// if(length(local_position.xyz) < 0.3){
|
|
98
|
-
// // circle in the center
|
|
99
|
-
// material.diffuseColor = g_normal*0.5 + 0.5;
|
|
100
|
-
// }else{
|
|
101
|
-
// material.diffuseColor = decal_normal*0.5 + 0.5;
|
|
102
|
-
// }
|
|
103
|
-
//
|
|
104
|
-
// continue;
|
|
105
|
-
|
|
70
|
+
|
|
106
71
|
float decal_surface_dot = dot(decal_normal, g_normal);
|
|
107
|
-
|
|
108
|
-
// material.diffuseColor = mix(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), decal_surface_dot);
|
|
109
|
-
// continue;
|
|
110
|
-
|
|
72
|
+
|
|
111
73
|
// we fade out decals when the projection angle to the surface gets too steep
|
|
112
74
|
// 0.7 is cos(45deg) and 0.5 is cos(60deg), dot returns cos of angle between two normals
|
|
113
75
|
float decal_surface_angle_fade = smoothstep(-0.5,-0.7,decal_surface_dot);
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"productName": "Meep",
|
|
6
6
|
"description": "production-ready JavaScript game engine based on Entity Component System Architecture",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.43.
|
|
8
|
+
"version": "2.43.49",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|