@zephyr3d/scene 0.9.4 → 0.9.5
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/animation/animationmask.js +224 -0
- package/dist/animation/animationmask.js.map +1 -0
- package/dist/animation/animationset.js +268 -67
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/animationtrack.js.map +1 -1
- package/dist/animation/eulerrotationtrack.js +3 -0
- package/dist/animation/eulerrotationtrack.js.map +1 -1
- package/dist/animation/fixed_geometry_cache_track.js +7 -0
- package/dist/animation/fixed_geometry_cache_track.js.map +1 -1
- package/dist/animation/ik_modifier.js.map +1 -1
- package/dist/animation/joint_dynamics/collision.js +6 -4
- package/dist/animation/joint_dynamics/collision.js.map +1 -1
- package/dist/animation/joint_dynamics/controller.js +390 -43
- package/dist/animation/joint_dynamics/controller.js.map +1 -1
- package/dist/animation/joint_dynamics/joint_dynamics_system.js +62 -3
- package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
- package/dist/animation/joint_dynamics/solver.js +4 -3
- package/dist/animation/joint_dynamics/solver.js.map +1 -1
- package/dist/animation/joint_dynamics/types.js.map +1 -1
- package/dist/animation/joint_dynamics_modifier.js +2 -0
- package/dist/animation/joint_dynamics_modifier.js.map +1 -1
- package/dist/animation/morphtarget.js +3 -72
- package/dist/animation/morphtarget.js.map +1 -1
- package/dist/animation/morphtrack.js +3 -0
- package/dist/animation/morphtrack.js.map +1 -1
- package/dist/animation/pca_geometry_cache_track.js +3 -0
- package/dist/animation/pca_geometry_cache_track.js.map +1 -1
- package/dist/animation/proptrack.js +3 -0
- package/dist/animation/proptrack.js.map +1 -1
- package/dist/animation/rotationtrack.js +3 -0
- package/dist/animation/rotationtrack.js.map +1 -1
- package/dist/animation/scaletrack.js +3 -0
- package/dist/animation/scaletrack.js.map +1 -1
- package/dist/animation/skeleton.js +254 -79
- package/dist/animation/skeleton.js.map +1 -1
- package/dist/animation/skeleton_modifier.js.map +1 -1
- package/dist/animation/spring_modifier.js.map +1 -1
- package/dist/animation/translationtrack.js +3 -0
- package/dist/animation/translationtrack.js.map +1 -1
- package/dist/app/engine.js +171 -107
- package/dist/app/engine.js.map +1 -1
- package/dist/app/scriptregistry.js +251 -80
- package/dist/app/scriptregistry.js.map +1 -1
- package/dist/asset/assetmanager.js +344 -365
- package/dist/asset/assetmanager.js.map +1 -1
- package/dist/asset/loaders/gltf/gltf_loader.js +17 -14
- package/dist/asset/loaders/gltf/gltf_loader.js.map +1 -1
- package/dist/asset/loaders/loader.js +1 -6
- package/dist/asset/loaders/loader.js.map +1 -1
- package/dist/asset/loaders/zabc/zabc_loader.js.map +1 -1
- package/dist/asset/model.js +1000 -131
- package/dist/asset/model.js.map +1 -1
- package/dist/avatar/wardrobe.js +474 -0
- package/dist/avatar/wardrobe.js.map +1 -0
- package/dist/index.d.ts +1125 -199
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +6 -3
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
- package/dist/material/mixins/pbr/common.js +72 -15
- package/dist/material/mixins/pbr/common.js.map +1 -1
- package/dist/material/msdf_text_sprite.js +4 -4
- package/dist/material/msdf_text_sprite.js.map +1 -1
- package/dist/material/pbrblueprint.js +102 -102
- package/dist/material/pbrblueprint.js.map +1 -1
- package/dist/render/envlight.js +54 -1
- package/dist/render/envlight.js.map +1 -1
- package/dist/render/sky.js +9 -0
- package/dist/render/sky.js.map +1 -1
- package/dist/scene/batchgroup.js +11 -13
- package/dist/scene/batchgroup.js.map +1 -1
- package/dist/scene/environment.js +15 -2
- package/dist/scene/environment.js.map +1 -1
- package/dist/scene/mesh.js +79 -16
- package/dist/scene/mesh.js.map +1 -1
- package/dist/scene/scene.js +1 -0
- package/dist/scene/scene.js.map +1 -1
- package/dist/scene/scene_node.js +203 -2
- package/dist/scene/scene_node.js.map +1 -1
- package/dist/text/font/font_asset.js.map +1 -1
- package/dist/text/msdf/generator.js.map +1 -1
- package/dist/text/msdf/shape.js +4 -1
- package/dist/text/msdf/shape.js.map +1 -1
- package/dist/text/runtime/msdf_text_atlas_manager.js +4 -1
- package/dist/text/runtime/msdf_text_atlas_manager.js.map +1 -1
- package/dist/utility/blueprint/material/inputs.js +1157 -1154
- package/dist/utility/blueprint/material/inputs.js.map +1 -1
- package/dist/utility/bounding_volume.js.map +1 -1
- package/dist/utility/pmrem.js +34 -8
- package/dist/utility/pmrem.js.map +1 -1
- package/dist/utility/serialization/manager.js +22 -9
- package/dist/utility/serialization/manager.js.map +1 -1
- package/dist/utility/serialization/scene/animation.js +700 -7
- package/dist/utility/serialization/scene/animation.js.map +1 -1
- package/dist/utility/serialization/scene/mesh.js +64 -4
- package/dist/utility/serialization/scene/mesh.js.map +1 -1
- package/dist/utility/serialization/scene/node.js +187 -8
- package/dist/utility/serialization/scene/node.js.map +1 -1
- package/dist/utility/serialization/types.js.map +1 -1
- package/dist/utility/textures/sheenlut.js +138 -0
- package/dist/utility/textures/sheenlut.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseGraphNode } from '../node.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Vertex output node
|
|
3
|
+
/**
|
|
4
|
+
* Vertex output node
|
|
5
|
+
* @public
|
|
5
6
|
*/ class VertexOutputNode extends BaseGraphNode {
|
|
6
7
|
_index;
|
|
7
8
|
constructor(index){
|
|
@@ -54,37 +55,38 @@ import { BaseGraphNode } from '../node.js';
|
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Generates a string representation of this node
|
|
59
|
-
*
|
|
60
|
-
* @returns 'vertex index'
|
|
58
|
+
/**
|
|
59
|
+
* Generates a string representation of this node
|
|
60
|
+
*
|
|
61
|
+
* @returns 'vertex index'
|
|
61
62
|
*/ toString() {
|
|
62
63
|
return `Vertex Output${this._index}`;
|
|
63
64
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Validates the node state
|
|
66
|
-
*
|
|
67
|
-
* @returns Empty string (always valid)
|
|
68
|
-
*
|
|
69
|
-
* @remarks
|
|
70
|
-
* Vertex index nodes are always valid as they have no inputs.
|
|
65
|
+
/**
|
|
66
|
+
* Validates the node state
|
|
67
|
+
*
|
|
68
|
+
* @returns Empty string (always valid)
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* Vertex index nodes are always valid as they have no inputs.
|
|
71
72
|
*/ validate() {
|
|
72
73
|
return '';
|
|
73
74
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Gets the output type for a specific output slot
|
|
76
|
-
*
|
|
77
|
-
* @param id - The output slot ID
|
|
78
|
-
* @returns 'float' for individual channel outputs (id \> 1), 'vec4' for full color
|
|
75
|
+
/**
|
|
76
|
+
* Gets the output type for a specific output slot
|
|
77
|
+
*
|
|
78
|
+
* @param id - The output slot ID
|
|
79
|
+
* @returns 'float' for individual channel outputs (id \> 1), 'vec4' for full color
|
|
79
80
|
*/ getType(id) {
|
|
80
81
|
return id > 1 ? 'float' : 'vec4';
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
/**
|
|
84
|
-
* Vertex index input node
|
|
84
|
+
/**
|
|
85
|
+
* Vertex index input node
|
|
86
|
+
* @public
|
|
85
87
|
*/ class VertexIndexNode extends BaseGraphNode {
|
|
86
|
-
/**
|
|
87
|
-
* Creates a new vertex index node
|
|
88
|
+
/**
|
|
89
|
+
* Creates a new vertex index node
|
|
88
90
|
*/ constructor(){
|
|
89
91
|
super();
|
|
90
92
|
this._outputs = [
|
|
@@ -94,10 +96,10 @@ import { BaseGraphNode } from '../node.js';
|
|
|
94
96
|
}
|
|
95
97
|
];
|
|
96
98
|
}
|
|
97
|
-
/**
|
|
98
|
-
* Gets the serialization descriptor for this node type
|
|
99
|
-
*
|
|
100
|
-
* @returns Serialization class descriptor
|
|
99
|
+
/**
|
|
100
|
+
* Gets the serialization descriptor for this node type
|
|
101
|
+
*
|
|
102
|
+
* @returns Serialization class descriptor
|
|
101
103
|
*/ static getSerializationCls() {
|
|
102
104
|
return {
|
|
103
105
|
ctor: VertexIndexNode,
|
|
@@ -107,36 +109,37 @@ import { BaseGraphNode } from '../node.js';
|
|
|
107
109
|
}
|
|
108
110
|
};
|
|
109
111
|
}
|
|
110
|
-
/**
|
|
111
|
-
* Generates a string representation of this node
|
|
112
|
-
*
|
|
113
|
-
* @returns 'vertex index'
|
|
112
|
+
/**
|
|
113
|
+
* Generates a string representation of this node
|
|
114
|
+
*
|
|
115
|
+
* @returns 'vertex index'
|
|
114
116
|
*/ toString() {
|
|
115
117
|
return 'vertex index';
|
|
116
118
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Validates the node state
|
|
119
|
-
*
|
|
120
|
-
* @returns Empty string (always valid)
|
|
121
|
-
*
|
|
122
|
-
* @remarks
|
|
123
|
-
* Vertex index nodes are always valid as they have no inputs.
|
|
119
|
+
/**
|
|
120
|
+
* Validates the node state
|
|
121
|
+
*
|
|
122
|
+
* @returns Empty string (always valid)
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* Vertex index nodes are always valid as they have no inputs.
|
|
124
126
|
*/ validate() {
|
|
125
127
|
return '';
|
|
126
128
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Gets the output type for a specific output slot
|
|
129
|
-
*
|
|
130
|
-
* @returns 'float'
|
|
129
|
+
/**
|
|
130
|
+
* Gets the output type for a specific output slot
|
|
131
|
+
*
|
|
132
|
+
* @returns 'float'
|
|
131
133
|
*/ getType() {
|
|
132
134
|
return 'float';
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Instance index input node
|
|
137
|
+
/**
|
|
138
|
+
* Instance index input node
|
|
139
|
+
* @public
|
|
137
140
|
*/ class InstanceIndexNode extends BaseGraphNode {
|
|
138
|
-
/**
|
|
139
|
-
* Creates a new instance index node
|
|
141
|
+
/**
|
|
142
|
+
* Creates a new instance index node
|
|
140
143
|
*/ constructor(){
|
|
141
144
|
super();
|
|
142
145
|
this._outputs = [
|
|
@@ -146,10 +149,10 @@ import { BaseGraphNode } from '../node.js';
|
|
|
146
149
|
}
|
|
147
150
|
];
|
|
148
151
|
}
|
|
149
|
-
/**
|
|
150
|
-
* Gets the serialization descriptor for this node type
|
|
151
|
-
*
|
|
152
|
-
* @returns Serialization class descriptor
|
|
152
|
+
/**
|
|
153
|
+
* Gets the serialization descriptor for this node type
|
|
154
|
+
*
|
|
155
|
+
* @returns Serialization class descriptor
|
|
153
156
|
*/ static getSerializationCls() {
|
|
154
157
|
return {
|
|
155
158
|
ctor: InstanceIndexNode,
|
|
@@ -159,68 +162,68 @@ import { BaseGraphNode } from '../node.js';
|
|
|
159
162
|
}
|
|
160
163
|
};
|
|
161
164
|
}
|
|
162
|
-
/**
|
|
163
|
-
* Generates a string representation of this node
|
|
164
|
-
*
|
|
165
|
-
* @returns 'instance index'
|
|
165
|
+
/**
|
|
166
|
+
* Generates a string representation of this node
|
|
167
|
+
*
|
|
168
|
+
* @returns 'instance index'
|
|
166
169
|
*/ toString() {
|
|
167
170
|
return 'instance index';
|
|
168
171
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Validates the node state
|
|
171
|
-
*
|
|
172
|
-
* @returns Empty string (always valid)
|
|
173
|
-
*
|
|
174
|
-
* @remarks
|
|
175
|
-
* Instance index nodes are always valid as they have no inputs.
|
|
172
|
+
/**
|
|
173
|
+
* Validates the node state
|
|
174
|
+
*
|
|
175
|
+
* @returns Empty string (always valid)
|
|
176
|
+
*
|
|
177
|
+
* @remarks
|
|
178
|
+
* Instance index nodes are always valid as they have no inputs.
|
|
176
179
|
*/ validate() {
|
|
177
180
|
return '';
|
|
178
181
|
}
|
|
179
|
-
/**
|
|
180
|
-
* Gets the output type for a specific output slot
|
|
181
|
-
*
|
|
182
|
-
* @returns 'float'
|
|
182
|
+
/**
|
|
183
|
+
* Gets the output type for a specific output slot
|
|
184
|
+
*
|
|
185
|
+
* @returns 'float'
|
|
183
186
|
*/ getType() {
|
|
184
187
|
return 'float';
|
|
185
188
|
}
|
|
186
189
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Vertex color input node
|
|
189
|
-
*
|
|
190
|
-
* @remarks
|
|
191
|
-
* Provides access to per-vertex color data from the mesh.
|
|
192
|
-
* Vertex colors are stored as RGBA values (vec4) and can be used for:
|
|
193
|
-
* - Hand-painted color variations
|
|
194
|
-
* - Ambient occlusion baking
|
|
195
|
-
* - Blend weights for texture mixing
|
|
196
|
-
* - Custom data encoded in color channels
|
|
197
|
-
*
|
|
198
|
-
* Outputs:
|
|
199
|
-
* - Output 1: Full RGBA color (vec4)
|
|
200
|
-
* - Output 2: Red channel (float)
|
|
201
|
-
* - Output 3: Green channel (float)
|
|
202
|
-
* - Output 4: Blue channel (float)
|
|
203
|
-
* - Output 5: Alpha channel (float)
|
|
204
|
-
*
|
|
205
|
-
* @example
|
|
206
|
-
* ```typescript
|
|
207
|
-
* const vertexColor = new VertexColorNode();
|
|
208
|
-
*
|
|
209
|
-
* // Use full color
|
|
210
|
-
* baseColorNode.connectInput(1, vertexColor, 1);
|
|
211
|
-
*
|
|
212
|
-
* // Use individual channels
|
|
213
|
-
* roughnessNode.connectInput(1, vertexColor, 2); // Red as roughness
|
|
214
|
-
* metallicNode.connectInput(1, vertexColor, 3); // Green as metallic
|
|
215
|
-
* ```
|
|
216
|
-
*
|
|
217
|
-
* @public
|
|
190
|
+
/**
|
|
191
|
+
* Vertex color input node
|
|
192
|
+
*
|
|
193
|
+
* @remarks
|
|
194
|
+
* Provides access to per-vertex color data from the mesh.
|
|
195
|
+
* Vertex colors are stored as RGBA values (vec4) and can be used for:
|
|
196
|
+
* - Hand-painted color variations
|
|
197
|
+
* - Ambient occlusion baking
|
|
198
|
+
* - Blend weights for texture mixing
|
|
199
|
+
* - Custom data encoded in color channels
|
|
200
|
+
*
|
|
201
|
+
* Outputs:
|
|
202
|
+
* - Output 1: Full RGBA color (vec4)
|
|
203
|
+
* - Output 2: Red channel (float)
|
|
204
|
+
* - Output 3: Green channel (float)
|
|
205
|
+
* - Output 4: Blue channel (float)
|
|
206
|
+
* - Output 5: Alpha channel (float)
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* const vertexColor = new VertexColorNode();
|
|
211
|
+
*
|
|
212
|
+
* // Use full color
|
|
213
|
+
* baseColorNode.connectInput(1, vertexColor, 1);
|
|
214
|
+
*
|
|
215
|
+
* // Use individual channels
|
|
216
|
+
* roughnessNode.connectInput(1, vertexColor, 2); // Red as roughness
|
|
217
|
+
* metallicNode.connectInput(1, vertexColor, 3); // Green as metallic
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* @public
|
|
218
221
|
*/ class VertexColorNode extends BaseGraphNode {
|
|
219
|
-
/**
|
|
220
|
-
* Creates a new vertex color node
|
|
221
|
-
*
|
|
222
|
-
* @remarks
|
|
223
|
-
* Initializes with 5 output slots: full RGBA and individual R, G, B, A channels.
|
|
222
|
+
/**
|
|
223
|
+
* Creates a new vertex color node
|
|
224
|
+
*
|
|
225
|
+
* @remarks
|
|
226
|
+
* Initializes with 5 output slots: full RGBA and individual R, G, B, A channels.
|
|
224
227
|
*/ constructor(){
|
|
225
228
|
super();
|
|
226
229
|
this._outputs = [
|
|
@@ -250,10 +253,10 @@ import { BaseGraphNode } from '../node.js';
|
|
|
250
253
|
}
|
|
251
254
|
];
|
|
252
255
|
}
|
|
253
|
-
/**
|
|
254
|
-
* Gets the serialization descriptor for this node type
|
|
255
|
-
*
|
|
256
|
-
* @returns Serialization class descriptor
|
|
256
|
+
/**
|
|
257
|
+
* Gets the serialization descriptor for this node type
|
|
258
|
+
*
|
|
259
|
+
* @returns Serialization class descriptor
|
|
257
260
|
*/ static getSerializationCls() {
|
|
258
261
|
return {
|
|
259
262
|
ctor: VertexColorNode,
|
|
@@ -263,68 +266,68 @@ import { BaseGraphNode } from '../node.js';
|
|
|
263
266
|
}
|
|
264
267
|
};
|
|
265
268
|
}
|
|
266
|
-
/**
|
|
267
|
-
* Generates a string representation of this node
|
|
268
|
-
*
|
|
269
|
-
* @returns 'vertex color'
|
|
269
|
+
/**
|
|
270
|
+
* Generates a string representation of this node
|
|
271
|
+
*
|
|
272
|
+
* @returns 'vertex color'
|
|
270
273
|
*/ toString() {
|
|
271
274
|
return 'vertex color';
|
|
272
275
|
}
|
|
273
|
-
/**
|
|
274
|
-
* Validates the node state
|
|
275
|
-
*
|
|
276
|
-
* @returns Empty string (always valid)
|
|
277
|
-
*
|
|
278
|
-
* @remarks
|
|
279
|
-
* Vertex color nodes are always valid as they have no inputs.
|
|
276
|
+
/**
|
|
277
|
+
* Validates the node state
|
|
278
|
+
*
|
|
279
|
+
* @returns Empty string (always valid)
|
|
280
|
+
*
|
|
281
|
+
* @remarks
|
|
282
|
+
* Vertex color nodes are always valid as they have no inputs.
|
|
280
283
|
*/ validate() {
|
|
281
284
|
return '';
|
|
282
285
|
}
|
|
283
|
-
/**
|
|
284
|
-
* Gets the output type for a specific output slot
|
|
285
|
-
*
|
|
286
|
-
* @param id - The output slot ID
|
|
287
|
-
* @returns 'float' for individual channel outputs (id \> 1), 'vec4' for full color
|
|
286
|
+
/**
|
|
287
|
+
* Gets the output type for a specific output slot
|
|
288
|
+
*
|
|
289
|
+
* @param id - The output slot ID
|
|
290
|
+
* @returns 'float' for individual channel outputs (id \> 1), 'vec4' for full color
|
|
288
291
|
*/ getType(id) {
|
|
289
292
|
return id > 1 ? 'float' : 'vec4';
|
|
290
293
|
}
|
|
291
294
|
}
|
|
292
|
-
/**
|
|
293
|
-
* Vertex UV coordinate input node
|
|
294
|
-
*
|
|
295
|
-
* @remarks
|
|
296
|
-
* Provides access to per-vertex texture coordinates (UV coordinates) from the mesh.
|
|
297
|
-
* UV coordinates map 3D mesh vertices to 2D texture space, typically in the range [0, 1].
|
|
298
|
-
*
|
|
299
|
-
* Used for:
|
|
300
|
-
* - Texture sampling (most common use)
|
|
301
|
-
* - Procedural pattern generation
|
|
302
|
-
* - Gradient effects based on position in UV space
|
|
303
|
-
* - Decal placement
|
|
304
|
-
*
|
|
305
|
-
* Outputs:
|
|
306
|
-
* - Output 1: Full UV coordinates (vec2)
|
|
307
|
-
* - Output 2: U coordinate (horizontal, float)
|
|
308
|
-
* - Output 3: V coordinate (vertical, float)
|
|
309
|
-
*
|
|
310
|
-
* @example
|
|
311
|
-
* ```typescript
|
|
312
|
-
* const uv = new VertexUVNode();
|
|
313
|
-
*
|
|
314
|
-
* // Sample texture using UV coordinates
|
|
315
|
-
* textureSample.connectInput(1, uv, 1);
|
|
316
|
-
*
|
|
317
|
-
* // Use U coordinate for horizontal gradient
|
|
318
|
-
* mixNode.connectInput(3, uv, 2);
|
|
319
|
-
* ```
|
|
320
|
-
*
|
|
321
|
-
* @public
|
|
295
|
+
/**
|
|
296
|
+
* Vertex UV coordinate input node
|
|
297
|
+
*
|
|
298
|
+
* @remarks
|
|
299
|
+
* Provides access to per-vertex texture coordinates (UV coordinates) from the mesh.
|
|
300
|
+
* UV coordinates map 3D mesh vertices to 2D texture space, typically in the range [0, 1].
|
|
301
|
+
*
|
|
302
|
+
* Used for:
|
|
303
|
+
* - Texture sampling (most common use)
|
|
304
|
+
* - Procedural pattern generation
|
|
305
|
+
* - Gradient effects based on position in UV space
|
|
306
|
+
* - Decal placement
|
|
307
|
+
*
|
|
308
|
+
* Outputs:
|
|
309
|
+
* - Output 1: Full UV coordinates (vec2)
|
|
310
|
+
* - Output 2: U coordinate (horizontal, float)
|
|
311
|
+
* - Output 3: V coordinate (vertical, float)
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```typescript
|
|
315
|
+
* const uv = new VertexUVNode();
|
|
316
|
+
*
|
|
317
|
+
* // Sample texture using UV coordinates
|
|
318
|
+
* textureSample.connectInput(1, uv, 1);
|
|
319
|
+
*
|
|
320
|
+
* // Use U coordinate for horizontal gradient
|
|
321
|
+
* mixNode.connectInput(3, uv, 2);
|
|
322
|
+
* ```
|
|
323
|
+
*
|
|
324
|
+
* @public
|
|
322
325
|
*/ class VertexUVNode extends BaseGraphNode {
|
|
323
|
-
/**
|
|
324
|
-
* Creates a new vertex UV node
|
|
325
|
-
*
|
|
326
|
-
* @remarks
|
|
327
|
-
* Initializes with 3 output slots: full UV and individual U, V components.
|
|
326
|
+
/**
|
|
327
|
+
* Creates a new vertex UV node
|
|
328
|
+
*
|
|
329
|
+
* @remarks
|
|
330
|
+
* Initializes with 3 output slots: full UV and individual U, V components.
|
|
328
331
|
*/ constructor(){
|
|
329
332
|
super();
|
|
330
333
|
this._outputs = [
|
|
@@ -344,10 +347,10 @@ import { BaseGraphNode } from '../node.js';
|
|
|
344
347
|
}
|
|
345
348
|
];
|
|
346
349
|
}
|
|
347
|
-
/**
|
|
348
|
-
* Gets the serialization descriptor for this node type
|
|
349
|
-
*
|
|
350
|
-
* @returns Serialization class descriptor
|
|
350
|
+
/**
|
|
351
|
+
* Gets the serialization descriptor for this node type
|
|
352
|
+
*
|
|
353
|
+
* @returns Serialization class descriptor
|
|
351
354
|
*/ static getSerializationCls() {
|
|
352
355
|
return {
|
|
353
356
|
ctor: VertexUVNode,
|
|
@@ -357,74 +360,74 @@ import { BaseGraphNode } from '../node.js';
|
|
|
357
360
|
}
|
|
358
361
|
};
|
|
359
362
|
}
|
|
360
|
-
/**
|
|
361
|
-
* Generates a string representation of this node
|
|
362
|
-
*
|
|
363
|
-
* @returns 'vertex UV'
|
|
363
|
+
/**
|
|
364
|
+
* Generates a string representation of this node
|
|
365
|
+
*
|
|
366
|
+
* @returns 'vertex UV'
|
|
364
367
|
*/ toString() {
|
|
365
368
|
return 'vertex UV';
|
|
366
369
|
}
|
|
367
|
-
/**
|
|
368
|
-
* Validates the node state
|
|
369
|
-
*
|
|
370
|
-
* @returns Empty string (always valid)
|
|
371
|
-
*
|
|
372
|
-
* @remarks
|
|
373
|
-
* Vertex UV nodes are always valid as they have no inputs.
|
|
370
|
+
/**
|
|
371
|
+
* Validates the node state
|
|
372
|
+
*
|
|
373
|
+
* @returns Empty string (always valid)
|
|
374
|
+
*
|
|
375
|
+
* @remarks
|
|
376
|
+
* Vertex UV nodes are always valid as they have no inputs.
|
|
374
377
|
*/ validate() {
|
|
375
378
|
return '';
|
|
376
379
|
}
|
|
377
|
-
/**
|
|
378
|
-
* Gets the output type for a specific output slot
|
|
379
|
-
*
|
|
380
|
-
* @param id - The output slot ID
|
|
381
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec2' for full UV
|
|
380
|
+
/**
|
|
381
|
+
* Gets the output type for a specific output slot
|
|
382
|
+
*
|
|
383
|
+
* @param id - The output slot ID
|
|
384
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec2' for full UV
|
|
382
385
|
*/ getType(id) {
|
|
383
386
|
return id > 1 ? 'float' : 'vec2';
|
|
384
387
|
}
|
|
385
388
|
}
|
|
386
|
-
/**
|
|
387
|
-
* Vertex world position input node
|
|
388
|
-
*
|
|
389
|
-
* @remarks
|
|
390
|
-
* Provides access to the vertex position in world space coordinates.
|
|
391
|
-
* World position is the absolute 3D location of the vertex in the scene,
|
|
392
|
-
* after applying all model transformations but before view/projection.
|
|
393
|
-
*
|
|
394
|
-
* Used for:
|
|
395
|
-
* - Distance-based effects (fog, fade)
|
|
396
|
-
* - World-space texturing (triplanar mapping)
|
|
397
|
-
* - Position-based color gradients
|
|
398
|
-
* - Vertex animation based on world location
|
|
399
|
-
* - Custom lighting calculations
|
|
400
|
-
*
|
|
401
|
-
* Outputs:
|
|
402
|
-
* - Output 1: Full position (vec3)
|
|
403
|
-
* - Output 2: X coordinate (float)
|
|
404
|
-
* - Output 3: Y coordinate (float)
|
|
405
|
-
* - Output 4: Z coordinate (float)
|
|
406
|
-
*
|
|
407
|
-
* @example
|
|
408
|
-
* ```typescript
|
|
409
|
-
* const worldPos = new VertexPositionNode();
|
|
410
|
-
*
|
|
411
|
-
* // Calculate distance from origin
|
|
412
|
-
* const origin = new ConstantVec3Node();
|
|
413
|
-
* const distance = new DistanceNode();
|
|
414
|
-
* distance.connectInput(1, worldPos, 1);
|
|
415
|
-
* distance.connectInput(2, origin, 1);
|
|
416
|
-
*
|
|
417
|
-
* // Height-based color gradient
|
|
418
|
-
* colorMix.connectInput(3, worldPos, 3); // Use Y (height)
|
|
419
|
-
* ```
|
|
420
|
-
*
|
|
421
|
-
* @public
|
|
389
|
+
/**
|
|
390
|
+
* Vertex world position input node
|
|
391
|
+
*
|
|
392
|
+
* @remarks
|
|
393
|
+
* Provides access to the vertex position in world space coordinates.
|
|
394
|
+
* World position is the absolute 3D location of the vertex in the scene,
|
|
395
|
+
* after applying all model transformations but before view/projection.
|
|
396
|
+
*
|
|
397
|
+
* Used for:
|
|
398
|
+
* - Distance-based effects (fog, fade)
|
|
399
|
+
* - World-space texturing (triplanar mapping)
|
|
400
|
+
* - Position-based color gradients
|
|
401
|
+
* - Vertex animation based on world location
|
|
402
|
+
* - Custom lighting calculations
|
|
403
|
+
*
|
|
404
|
+
* Outputs:
|
|
405
|
+
* - Output 1: Full position (vec3)
|
|
406
|
+
* - Output 2: X coordinate (float)
|
|
407
|
+
* - Output 3: Y coordinate (float)
|
|
408
|
+
* - Output 4: Z coordinate (float)
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* ```typescript
|
|
412
|
+
* const worldPos = new VertexPositionNode();
|
|
413
|
+
*
|
|
414
|
+
* // Calculate distance from origin
|
|
415
|
+
* const origin = new ConstantVec3Node();
|
|
416
|
+
* const distance = new DistanceNode();
|
|
417
|
+
* distance.connectInput(1, worldPos, 1);
|
|
418
|
+
* distance.connectInput(2, origin, 1);
|
|
419
|
+
*
|
|
420
|
+
* // Height-based color gradient
|
|
421
|
+
* colorMix.connectInput(3, worldPos, 3); // Use Y (height)
|
|
422
|
+
* ```
|
|
423
|
+
*
|
|
424
|
+
* @public
|
|
422
425
|
*/ class VertexPositionNode extends BaseGraphNode {
|
|
423
|
-
/**
|
|
424
|
-
* Creates a new vertex position node
|
|
425
|
-
*
|
|
426
|
-
* @remarks
|
|
427
|
-
* Initializes with 4 output slots: full position and individual X, Y, Z components.
|
|
426
|
+
/**
|
|
427
|
+
* Creates a new vertex position node
|
|
428
|
+
*
|
|
429
|
+
* @remarks
|
|
430
|
+
* Initializes with 4 output slots: full position and individual X, Y, Z components.
|
|
428
431
|
*/ constructor(){
|
|
429
432
|
super();
|
|
430
433
|
this._outputs = [
|
|
@@ -449,17 +452,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
449
452
|
}
|
|
450
453
|
];
|
|
451
454
|
}
|
|
452
|
-
/**
|
|
453
|
-
* Generates a string representation of this node
|
|
454
|
-
*
|
|
455
|
-
* @returns 'world position'
|
|
455
|
+
/**
|
|
456
|
+
* Generates a string representation of this node
|
|
457
|
+
*
|
|
458
|
+
* @returns 'world position'
|
|
456
459
|
*/ toString() {
|
|
457
460
|
return 'world position';
|
|
458
461
|
}
|
|
459
|
-
/**
|
|
460
|
-
* Gets the serialization descriptor for this node type
|
|
461
|
-
*
|
|
462
|
-
* @returns Serialization class descriptor
|
|
462
|
+
/**
|
|
463
|
+
* Gets the serialization descriptor for this node type
|
|
464
|
+
*
|
|
465
|
+
* @returns Serialization class descriptor
|
|
463
466
|
*/ static getSerializationCls() {
|
|
464
467
|
return {
|
|
465
468
|
ctor: VertexPositionNode,
|
|
@@ -469,41 +472,41 @@ import { BaseGraphNode } from '../node.js';
|
|
|
469
472
|
}
|
|
470
473
|
};
|
|
471
474
|
}
|
|
472
|
-
/**
|
|
473
|
-
* Validates the node state
|
|
474
|
-
*
|
|
475
|
-
* @returns Empty string (always valid)
|
|
476
|
-
*
|
|
477
|
-
* @remarks
|
|
478
|
-
* Vertex position nodes are always valid as they have no inputs.
|
|
475
|
+
/**
|
|
476
|
+
* Validates the node state
|
|
477
|
+
*
|
|
478
|
+
* @returns Empty string (always valid)
|
|
479
|
+
*
|
|
480
|
+
* @remarks
|
|
481
|
+
* Vertex position nodes are always valid as they have no inputs.
|
|
479
482
|
*/ validate() {
|
|
480
483
|
return '';
|
|
481
484
|
}
|
|
482
|
-
/**
|
|
483
|
-
* Gets the output type for a specific output slot
|
|
484
|
-
*
|
|
485
|
-
* @param id - The output slot ID
|
|
486
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full position
|
|
485
|
+
/**
|
|
486
|
+
* Gets the output type for a specific output slot
|
|
487
|
+
*
|
|
488
|
+
* @param id - The output slot ID
|
|
489
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full position
|
|
487
490
|
*/ getType(id) {
|
|
488
491
|
return id > 1 ? 'float' : 'vec3';
|
|
489
492
|
}
|
|
490
493
|
}
|
|
491
|
-
/**
|
|
492
|
-
* Pixel world position input node
|
|
493
|
-
*
|
|
494
|
-
* @remarks
|
|
495
|
-
* Provides access to current pixel world-space position.
|
|
496
|
-
*
|
|
497
|
-
* Outputs:
|
|
498
|
-
* - Output 1: Full position (vec3)
|
|
499
|
-
* - Output 2: X coordinate (float)
|
|
500
|
-
* - Output 3: Y coordinate (float)
|
|
501
|
-
* - Output 4: Z coordinate (float)
|
|
502
|
-
*
|
|
503
|
-
* @public
|
|
494
|
+
/**
|
|
495
|
+
* Pixel world position input node
|
|
496
|
+
*
|
|
497
|
+
* @remarks
|
|
498
|
+
* Provides access to current pixel world-space position.
|
|
499
|
+
*
|
|
500
|
+
* Outputs:
|
|
501
|
+
* - Output 1: Full position (vec3)
|
|
502
|
+
* - Output 2: X coordinate (float)
|
|
503
|
+
* - Output 3: Y coordinate (float)
|
|
504
|
+
* - Output 4: Z coordinate (float)
|
|
505
|
+
*
|
|
506
|
+
* @public
|
|
504
507
|
*/ class PixelWorldPositionNode extends BaseGraphNode {
|
|
505
|
-
/**
|
|
506
|
-
* Creates a new pixel world position node
|
|
508
|
+
/**
|
|
509
|
+
* Creates a new pixel world position node
|
|
507
510
|
*/ constructor(){
|
|
508
511
|
super();
|
|
509
512
|
this._outputs = [
|
|
@@ -528,17 +531,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
528
531
|
}
|
|
529
532
|
];
|
|
530
533
|
}
|
|
531
|
-
/**
|
|
532
|
-
* Generates a string representation of this node
|
|
533
|
-
*
|
|
534
|
-
* @returns 'pixel world position'
|
|
534
|
+
/**
|
|
535
|
+
* Generates a string representation of this node
|
|
536
|
+
*
|
|
537
|
+
* @returns 'pixel world position'
|
|
535
538
|
*/ toString() {
|
|
536
539
|
return 'pixel world position';
|
|
537
540
|
}
|
|
538
|
-
/**
|
|
539
|
-
* Gets the serialization descriptor for this node type
|
|
540
|
-
*
|
|
541
|
-
* @returns Serialization class descriptor
|
|
541
|
+
/**
|
|
542
|
+
* Gets the serialization descriptor for this node type
|
|
543
|
+
*
|
|
544
|
+
* @returns Serialization class descriptor
|
|
542
545
|
*/ static getSerializationCls() {
|
|
543
546
|
return {
|
|
544
547
|
ctor: PixelWorldPositionNode,
|
|
@@ -548,64 +551,64 @@ import { BaseGraphNode } from '../node.js';
|
|
|
548
551
|
}
|
|
549
552
|
};
|
|
550
553
|
}
|
|
551
|
-
/**
|
|
552
|
-
* Validates the node state
|
|
553
|
-
*
|
|
554
|
-
* @returns Empty string (always valid)
|
|
554
|
+
/**
|
|
555
|
+
* Validates the node state
|
|
556
|
+
*
|
|
557
|
+
* @returns Empty string (always valid)
|
|
555
558
|
*/ validate() {
|
|
556
559
|
return '';
|
|
557
560
|
}
|
|
558
|
-
/**
|
|
559
|
-
* Gets the output type for a specific output slot
|
|
560
|
-
*
|
|
561
|
-
* @param id - The output slot ID
|
|
562
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full position
|
|
561
|
+
/**
|
|
562
|
+
* Gets the output type for a specific output slot
|
|
563
|
+
*
|
|
564
|
+
* @param id - The output slot ID
|
|
565
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full position
|
|
563
566
|
*/ getType(id) {
|
|
564
567
|
return id > 1 ? 'float' : 'vec3';
|
|
565
568
|
}
|
|
566
569
|
}
|
|
567
|
-
/**
|
|
568
|
-
* Vertex normal input node
|
|
569
|
-
*
|
|
570
|
-
* @remarks
|
|
571
|
-
* Provides access to per-vertex normal vectors in world space.
|
|
572
|
-
* Normals are unit vectors perpendicular to the surface, used extensively
|
|
573
|
-
* in lighting calculations and surface orientation effects.
|
|
574
|
-
*
|
|
575
|
-
* Used for:
|
|
576
|
-
* - Custom lighting calculations
|
|
577
|
-
* - Fresnel effects (view-dependent shading)
|
|
578
|
-
* - Rim lighting
|
|
579
|
-
* - Normal-based masking
|
|
580
|
-
* - Environment mapping
|
|
581
|
-
*
|
|
582
|
-
* Outputs:
|
|
583
|
-
* - Output 1: Full normal vector (vec3, normalized)
|
|
584
|
-
* - Output 2: X component (float)
|
|
585
|
-
* - Output 3: Y component (float)
|
|
586
|
-
* - Output 4: Z component (float)
|
|
587
|
-
*
|
|
588
|
-
* @example
|
|
589
|
-
* ```typescript
|
|
590
|
-
* const normal = new VertexNormalNode();
|
|
591
|
-
* const viewDir = new ViewDirectionNode();
|
|
592
|
-
*
|
|
593
|
-
* // Calculate Fresnel effect
|
|
594
|
-
* const dot = new DotProductNode();
|
|
595
|
-
* dot.connectInput(1, normal, 1);
|
|
596
|
-
* dot.connectInput(2, viewDir, 1);
|
|
597
|
-
*
|
|
598
|
-
* // Rim lighting using Y component
|
|
599
|
-
* rimMask.connectInput(1, normal, 3);
|
|
600
|
-
* ```
|
|
601
|
-
*
|
|
602
|
-
* @public
|
|
570
|
+
/**
|
|
571
|
+
* Vertex normal input node
|
|
572
|
+
*
|
|
573
|
+
* @remarks
|
|
574
|
+
* Provides access to per-vertex normal vectors in world space.
|
|
575
|
+
* Normals are unit vectors perpendicular to the surface, used extensively
|
|
576
|
+
* in lighting calculations and surface orientation effects.
|
|
577
|
+
*
|
|
578
|
+
* Used for:
|
|
579
|
+
* - Custom lighting calculations
|
|
580
|
+
* - Fresnel effects (view-dependent shading)
|
|
581
|
+
* - Rim lighting
|
|
582
|
+
* - Normal-based masking
|
|
583
|
+
* - Environment mapping
|
|
584
|
+
*
|
|
585
|
+
* Outputs:
|
|
586
|
+
* - Output 1: Full normal vector (vec3, normalized)
|
|
587
|
+
* - Output 2: X component (float)
|
|
588
|
+
* - Output 3: Y component (float)
|
|
589
|
+
* - Output 4: Z component (float)
|
|
590
|
+
*
|
|
591
|
+
* @example
|
|
592
|
+
* ```typescript
|
|
593
|
+
* const normal = new VertexNormalNode();
|
|
594
|
+
* const viewDir = new ViewDirectionNode();
|
|
595
|
+
*
|
|
596
|
+
* // Calculate Fresnel effect
|
|
597
|
+
* const dot = new DotProductNode();
|
|
598
|
+
* dot.connectInput(1, normal, 1);
|
|
599
|
+
* dot.connectInput(2, viewDir, 1);
|
|
600
|
+
*
|
|
601
|
+
* // Rim lighting using Y component
|
|
602
|
+
* rimMask.connectInput(1, normal, 3);
|
|
603
|
+
* ```
|
|
604
|
+
*
|
|
605
|
+
* @public
|
|
603
606
|
*/ class VertexNormalNode extends BaseGraphNode {
|
|
604
|
-
/**
|
|
605
|
-
* Creates a new vertex normal node
|
|
606
|
-
*
|
|
607
|
-
* @remarks
|
|
608
|
-
* Initializes with 4 output slots: full normal and individual X, Y, Z components.
|
|
607
|
+
/**
|
|
608
|
+
* Creates a new vertex normal node
|
|
609
|
+
*
|
|
610
|
+
* @remarks
|
|
611
|
+
* Initializes with 4 output slots: full normal and individual X, Y, Z components.
|
|
609
612
|
*/ constructor(){
|
|
610
613
|
super();
|
|
611
614
|
this._outputs = [
|
|
@@ -630,17 +633,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
630
633
|
}
|
|
631
634
|
];
|
|
632
635
|
}
|
|
633
|
-
/**
|
|
634
|
-
* Generates a string representation of this node
|
|
635
|
-
*
|
|
636
|
-
* @returns 'vertex normal'
|
|
636
|
+
/**
|
|
637
|
+
* Generates a string representation of this node
|
|
638
|
+
*
|
|
639
|
+
* @returns 'vertex normal'
|
|
637
640
|
*/ toString() {
|
|
638
641
|
return 'vertex normal';
|
|
639
642
|
}
|
|
640
|
-
/**
|
|
641
|
-
* Gets the serialization descriptor for this node type
|
|
642
|
-
*
|
|
643
|
-
* @returns Serialization class descriptor
|
|
643
|
+
/**
|
|
644
|
+
* Gets the serialization descriptor for this node type
|
|
645
|
+
*
|
|
646
|
+
* @returns Serialization class descriptor
|
|
644
647
|
*/ static getSerializationCls() {
|
|
645
648
|
return {
|
|
646
649
|
ctor: VertexNormalNode,
|
|
@@ -650,44 +653,44 @@ import { BaseGraphNode } from '../node.js';
|
|
|
650
653
|
}
|
|
651
654
|
};
|
|
652
655
|
}
|
|
653
|
-
/**
|
|
654
|
-
* Validates the node state
|
|
655
|
-
*
|
|
656
|
-
* @returns Empty string (always valid)
|
|
657
|
-
*
|
|
658
|
-
* @remarks
|
|
659
|
-
* Vertex normal nodes are always valid as they have no inputs.
|
|
656
|
+
/**
|
|
657
|
+
* Validates the node state
|
|
658
|
+
*
|
|
659
|
+
* @returns Empty string (always valid)
|
|
660
|
+
*
|
|
661
|
+
* @remarks
|
|
662
|
+
* Vertex normal nodes are always valid as they have no inputs.
|
|
660
663
|
*/ validate() {
|
|
661
664
|
return '';
|
|
662
665
|
}
|
|
663
|
-
/**
|
|
664
|
-
* Gets the output type for a specific output slot
|
|
665
|
-
*
|
|
666
|
-
* @param id - The output slot ID
|
|
667
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full normal
|
|
666
|
+
/**
|
|
667
|
+
* Gets the output type for a specific output slot
|
|
668
|
+
*
|
|
669
|
+
* @param id - The output slot ID
|
|
670
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full normal
|
|
668
671
|
*/ getType(id) {
|
|
669
672
|
return id > 1 ? 'float' : 'vec3';
|
|
670
673
|
}
|
|
671
674
|
}
|
|
672
|
-
/**
|
|
673
|
-
* Pixel normal input node
|
|
674
|
-
*
|
|
675
|
-
* @remarks
|
|
676
|
-
* Provides access to the world-space surface normal used in fragment shading.
|
|
677
|
-
*
|
|
678
|
-
* Outputs:
|
|
679
|
-
* - Output 1: Full normal vector (vec3, normalized)
|
|
680
|
-
* - Output 2: X component (float)
|
|
681
|
-
* - Output 3: Y component (float)
|
|
682
|
-
* - Output 4: Z component (float)
|
|
683
|
-
*
|
|
684
|
-
* @public
|
|
675
|
+
/**
|
|
676
|
+
* Pixel normal input node
|
|
677
|
+
*
|
|
678
|
+
* @remarks
|
|
679
|
+
* Provides access to the world-space surface normal used in fragment shading.
|
|
680
|
+
*
|
|
681
|
+
* Outputs:
|
|
682
|
+
* - Output 1: Full normal vector (vec3, normalized)
|
|
683
|
+
* - Output 2: X component (float)
|
|
684
|
+
* - Output 3: Y component (float)
|
|
685
|
+
* - Output 4: Z component (float)
|
|
686
|
+
*
|
|
687
|
+
* @public
|
|
685
688
|
*/ class PixelNormalNode extends BaseGraphNode {
|
|
686
|
-
/**
|
|
687
|
-
* Creates a new pixel normal node
|
|
688
|
-
*
|
|
689
|
-
* @remarks
|
|
690
|
-
* Initializes with 4 output slots: full normal and individual X, Y, Z components.
|
|
689
|
+
/**
|
|
690
|
+
* Creates a new pixel normal node
|
|
691
|
+
*
|
|
692
|
+
* @remarks
|
|
693
|
+
* Initializes with 4 output slots: full normal and individual X, Y, Z components.
|
|
691
694
|
*/ constructor(){
|
|
692
695
|
super();
|
|
693
696
|
this._outputs = [
|
|
@@ -712,17 +715,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
712
715
|
}
|
|
713
716
|
];
|
|
714
717
|
}
|
|
715
|
-
/**
|
|
716
|
-
* Generates a string representation of this node
|
|
717
|
-
*
|
|
718
|
-
* @returns 'pixel normal'
|
|
718
|
+
/**
|
|
719
|
+
* Generates a string representation of this node
|
|
720
|
+
*
|
|
721
|
+
* @returns 'pixel normal'
|
|
719
722
|
*/ toString() {
|
|
720
723
|
return 'pixel normal';
|
|
721
724
|
}
|
|
722
|
-
/**
|
|
723
|
-
* Gets the serialization descriptor for this node type
|
|
724
|
-
*
|
|
725
|
-
* @returns Serialization class descriptor
|
|
725
|
+
/**
|
|
726
|
+
* Gets the serialization descriptor for this node type
|
|
727
|
+
*
|
|
728
|
+
* @returns Serialization class descriptor
|
|
726
729
|
*/ static getSerializationCls() {
|
|
727
730
|
return {
|
|
728
731
|
ctor: PixelNormalNode,
|
|
@@ -732,62 +735,62 @@ import { BaseGraphNode } from '../node.js';
|
|
|
732
735
|
}
|
|
733
736
|
};
|
|
734
737
|
}
|
|
735
|
-
/**
|
|
736
|
-
* Validates the node state
|
|
737
|
-
*
|
|
738
|
-
* @returns Empty string (always valid)
|
|
738
|
+
/**
|
|
739
|
+
* Validates the node state
|
|
740
|
+
*
|
|
741
|
+
* @returns Empty string (always valid)
|
|
739
742
|
*/ validate() {
|
|
740
743
|
return '';
|
|
741
744
|
}
|
|
742
|
-
/**
|
|
743
|
-
* Gets the output type for a specific output slot
|
|
744
|
-
*
|
|
745
|
-
* @param id - The output slot ID
|
|
746
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full normal
|
|
745
|
+
/**
|
|
746
|
+
* Gets the output type for a specific output slot
|
|
747
|
+
*
|
|
748
|
+
* @param id - The output slot ID
|
|
749
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full normal
|
|
747
750
|
*/ getType(id) {
|
|
748
751
|
return id > 1 ? 'float' : 'vec3';
|
|
749
752
|
}
|
|
750
753
|
}
|
|
751
|
-
/**
|
|
752
|
-
* Vertex tangent input node
|
|
753
|
-
*
|
|
754
|
-
* @remarks
|
|
755
|
-
* Provides access to per-vertex tangent vectors in world space.
|
|
756
|
-
* Tangents are unit vectors parallel to the surface, aligned with the U texture coordinate direction.
|
|
757
|
-
* Together with normals and binormals, they form the tangent-space basis (TBN matrix).
|
|
758
|
-
*
|
|
759
|
-
* Used for:
|
|
760
|
-
* - Normal mapping (constructing TBN matrix)
|
|
761
|
-
* - Anisotropic reflections (hair, brushed metal)
|
|
762
|
-
* - Tangent-space calculations
|
|
763
|
-
* - Flow map effects
|
|
764
|
-
*
|
|
765
|
-
* Outputs:
|
|
766
|
-
* - Output 1: Full tangent vector (vec3, normalized)
|
|
767
|
-
* - Output 2: X component (float)
|
|
768
|
-
* - Output 3: Y component (float)
|
|
769
|
-
* - Output 4: Z component (float)
|
|
770
|
-
*
|
|
771
|
-
* @example
|
|
772
|
-
* ```typescript
|
|
773
|
-
* const tangent = new VertexTangentNode();
|
|
774
|
-
* const normal = new VertexNormalNode();
|
|
775
|
-
* const binormal = new VertexBinormalNode();
|
|
776
|
-
*
|
|
777
|
-
* // Construct TBN matrix for normal mapping
|
|
778
|
-
* const tbnMatrix = new MakeMatrixNode();
|
|
779
|
-
* tbnMatrix.connectInput(1, tangent, 1);
|
|
780
|
-
* tbnMatrix.connectInput(2, binormal, 1);
|
|
781
|
-
* tbnMatrix.connectInput(3, normal, 1);
|
|
782
|
-
* ```
|
|
783
|
-
*
|
|
784
|
-
* @public
|
|
754
|
+
/**
|
|
755
|
+
* Vertex tangent input node
|
|
756
|
+
*
|
|
757
|
+
* @remarks
|
|
758
|
+
* Provides access to per-vertex tangent vectors in world space.
|
|
759
|
+
* Tangents are unit vectors parallel to the surface, aligned with the U texture coordinate direction.
|
|
760
|
+
* Together with normals and binormals, they form the tangent-space basis (TBN matrix).
|
|
761
|
+
*
|
|
762
|
+
* Used for:
|
|
763
|
+
* - Normal mapping (constructing TBN matrix)
|
|
764
|
+
* - Anisotropic reflections (hair, brushed metal)
|
|
765
|
+
* - Tangent-space calculations
|
|
766
|
+
* - Flow map effects
|
|
767
|
+
*
|
|
768
|
+
* Outputs:
|
|
769
|
+
* - Output 1: Full tangent vector (vec3, normalized)
|
|
770
|
+
* - Output 2: X component (float)
|
|
771
|
+
* - Output 3: Y component (float)
|
|
772
|
+
* - Output 4: Z component (float)
|
|
773
|
+
*
|
|
774
|
+
* @example
|
|
775
|
+
* ```typescript
|
|
776
|
+
* const tangent = new VertexTangentNode();
|
|
777
|
+
* const normal = new VertexNormalNode();
|
|
778
|
+
* const binormal = new VertexBinormalNode();
|
|
779
|
+
*
|
|
780
|
+
* // Construct TBN matrix for normal mapping
|
|
781
|
+
* const tbnMatrix = new MakeMatrixNode();
|
|
782
|
+
* tbnMatrix.connectInput(1, tangent, 1);
|
|
783
|
+
* tbnMatrix.connectInput(2, binormal, 1);
|
|
784
|
+
* tbnMatrix.connectInput(3, normal, 1);
|
|
785
|
+
* ```
|
|
786
|
+
*
|
|
787
|
+
* @public
|
|
785
788
|
*/ class VertexTangentNode extends BaseGraphNode {
|
|
786
|
-
/**
|
|
787
|
-
* Creates a new vertex tangent node
|
|
788
|
-
*
|
|
789
|
-
* @remarks
|
|
790
|
-
* Initializes with 4 output slots: full tangent and individual X, Y, Z components.
|
|
789
|
+
/**
|
|
790
|
+
* Creates a new vertex tangent node
|
|
791
|
+
*
|
|
792
|
+
* @remarks
|
|
793
|
+
* Initializes with 4 output slots: full tangent and individual X, Y, Z components.
|
|
791
794
|
*/ constructor(){
|
|
792
795
|
super();
|
|
793
796
|
this._outputs = [
|
|
@@ -812,17 +815,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
812
815
|
}
|
|
813
816
|
];
|
|
814
817
|
}
|
|
815
|
-
/**
|
|
816
|
-
* Generates a string representation of this node
|
|
817
|
-
*
|
|
818
|
-
* @returns 'vertex tangent'
|
|
818
|
+
/**
|
|
819
|
+
* Generates a string representation of this node
|
|
820
|
+
*
|
|
821
|
+
* @returns 'vertex tangent'
|
|
819
822
|
*/ toString() {
|
|
820
823
|
return 'vertex tangent';
|
|
821
824
|
}
|
|
822
|
-
/**
|
|
823
|
-
* Gets the serialization descriptor for this node type
|
|
824
|
-
*
|
|
825
|
-
* @returns Serialization class descriptor
|
|
825
|
+
/**
|
|
826
|
+
* Gets the serialization descriptor for this node type
|
|
827
|
+
*
|
|
828
|
+
* @returns Serialization class descriptor
|
|
826
829
|
*/ static getSerializationCls() {
|
|
827
830
|
return {
|
|
828
831
|
ctor: VertexTangentNode,
|
|
@@ -832,68 +835,68 @@ import { BaseGraphNode } from '../node.js';
|
|
|
832
835
|
}
|
|
833
836
|
};
|
|
834
837
|
}
|
|
835
|
-
/**
|
|
836
|
-
* Validates the node state
|
|
837
|
-
*
|
|
838
|
-
* @returns Empty string (always valid)
|
|
839
|
-
*
|
|
840
|
-
* @remarks
|
|
841
|
-
* Vertex tangent nodes are always valid as they have no inputs.
|
|
838
|
+
/**
|
|
839
|
+
* Validates the node state
|
|
840
|
+
*
|
|
841
|
+
* @returns Empty string (always valid)
|
|
842
|
+
*
|
|
843
|
+
* @remarks
|
|
844
|
+
* Vertex tangent nodes are always valid as they have no inputs.
|
|
842
845
|
*/ validate() {
|
|
843
846
|
return '';
|
|
844
847
|
}
|
|
845
|
-
/**
|
|
846
|
-
* Gets the output type for a specific output slot
|
|
847
|
-
*
|
|
848
|
-
* @param id - The output slot ID
|
|
849
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full tangent
|
|
848
|
+
/**
|
|
849
|
+
* Gets the output type for a specific output slot
|
|
850
|
+
*
|
|
851
|
+
* @param id - The output slot ID
|
|
852
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full tangent
|
|
850
853
|
*/ getType(id) {
|
|
851
854
|
return id > 1 ? 'float' : 'vec3';
|
|
852
855
|
}
|
|
853
856
|
}
|
|
854
|
-
/**
|
|
855
|
-
* Vertex binormal (bitangent) input node
|
|
856
|
-
*
|
|
857
|
-
* @remarks
|
|
858
|
-
* Provides access to per-vertex binormal (also called bitangent) vectors in world space.
|
|
859
|
-
* Binormals are unit vectors perpendicular to both the normal and tangent,
|
|
860
|
-
* aligned with the V texture coordinate direction.
|
|
861
|
-
* Together with normals and tangents, they form the tangent-space basis (TBN matrix).
|
|
862
|
-
*
|
|
863
|
-
* The binormal is typically computed as: binormal = cross(normal, tangent) * handedness
|
|
864
|
-
*
|
|
865
|
-
* Used for:
|
|
866
|
-
* - Normal mapping (constructing TBN matrix)
|
|
867
|
-
* - Tangent-space calculations
|
|
868
|
-
* - Surface flow effects
|
|
869
|
-
* - Oriented texture mapping
|
|
870
|
-
*
|
|
871
|
-
* Outputs:
|
|
872
|
-
* - Output 1: Full binormal vector (vec3, normalized)
|
|
873
|
-
* - Output 2: X component (float)
|
|
874
|
-
* - Output 3: Y component (float)
|
|
875
|
-
* - Output 4: Z component (float)
|
|
876
|
-
*
|
|
877
|
-
* @example
|
|
878
|
-
* ```typescript
|
|
879
|
-
* const tangent = new VertexTangentNode();
|
|
880
|
-
* const normal = new VertexNormalNode();
|
|
881
|
-
* const binormal = new VertexBinormalNode();
|
|
882
|
-
*
|
|
883
|
-
* // Use for normal mapping transformation
|
|
884
|
-
* const normalMap = new TextureSampleNode();
|
|
885
|
-
* const tbnTransform = new TransformNode();
|
|
886
|
-
* tbnTransform.connectInput(1, normalMap, 1);
|
|
887
|
-
* tbnTransform.connectInput(2, tbnMatrixNode, 1);
|
|
888
|
-
* ```
|
|
889
|
-
*
|
|
890
|
-
* @public
|
|
857
|
+
/**
|
|
858
|
+
* Vertex binormal (bitangent) input node
|
|
859
|
+
*
|
|
860
|
+
* @remarks
|
|
861
|
+
* Provides access to per-vertex binormal (also called bitangent) vectors in world space.
|
|
862
|
+
* Binormals are unit vectors perpendicular to both the normal and tangent,
|
|
863
|
+
* aligned with the V texture coordinate direction.
|
|
864
|
+
* Together with normals and tangents, they form the tangent-space basis (TBN matrix).
|
|
865
|
+
*
|
|
866
|
+
* The binormal is typically computed as: binormal = cross(normal, tangent) * handedness
|
|
867
|
+
*
|
|
868
|
+
* Used for:
|
|
869
|
+
* - Normal mapping (constructing TBN matrix)
|
|
870
|
+
* - Tangent-space calculations
|
|
871
|
+
* - Surface flow effects
|
|
872
|
+
* - Oriented texture mapping
|
|
873
|
+
*
|
|
874
|
+
* Outputs:
|
|
875
|
+
* - Output 1: Full binormal vector (vec3, normalized)
|
|
876
|
+
* - Output 2: X component (float)
|
|
877
|
+
* - Output 3: Y component (float)
|
|
878
|
+
* - Output 4: Z component (float)
|
|
879
|
+
*
|
|
880
|
+
* @example
|
|
881
|
+
* ```typescript
|
|
882
|
+
* const tangent = new VertexTangentNode();
|
|
883
|
+
* const normal = new VertexNormalNode();
|
|
884
|
+
* const binormal = new VertexBinormalNode();
|
|
885
|
+
*
|
|
886
|
+
* // Use for normal mapping transformation
|
|
887
|
+
* const normalMap = new TextureSampleNode();
|
|
888
|
+
* const tbnTransform = new TransformNode();
|
|
889
|
+
* tbnTransform.connectInput(1, normalMap, 1);
|
|
890
|
+
* tbnTransform.connectInput(2, tbnMatrixNode, 1);
|
|
891
|
+
* ```
|
|
892
|
+
*
|
|
893
|
+
* @public
|
|
891
894
|
*/ class VertexBinormalNode extends BaseGraphNode {
|
|
892
|
-
/**
|
|
893
|
-
* Creates a new vertex binormal node
|
|
894
|
-
*
|
|
895
|
-
* @remarks
|
|
896
|
-
* Initializes with 4 output slots: full binormal and individual X, Y, Z components.
|
|
895
|
+
/**
|
|
896
|
+
* Creates a new vertex binormal node
|
|
897
|
+
*
|
|
898
|
+
* @remarks
|
|
899
|
+
* Initializes with 4 output slots: full binormal and individual X, Y, Z components.
|
|
897
900
|
*/ constructor(){
|
|
898
901
|
super();
|
|
899
902
|
this._outputs = [
|
|
@@ -918,17 +921,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
918
921
|
}
|
|
919
922
|
];
|
|
920
923
|
}
|
|
921
|
-
/**
|
|
922
|
-
* Generates a string representation of this node
|
|
923
|
-
*
|
|
924
|
-
* @returns 'vertex binormal'
|
|
924
|
+
/**
|
|
925
|
+
* Generates a string representation of this node
|
|
926
|
+
*
|
|
927
|
+
* @returns 'vertex binormal'
|
|
925
928
|
*/ toString() {
|
|
926
929
|
return 'vertex binormal';
|
|
927
930
|
}
|
|
928
|
-
/**
|
|
929
|
-
* Gets the serialization descriptor for this node type
|
|
930
|
-
*
|
|
931
|
-
* @returns Serialization class descriptor
|
|
931
|
+
/**
|
|
932
|
+
* Gets the serialization descriptor for this node type
|
|
933
|
+
*
|
|
934
|
+
* @returns Serialization class descriptor
|
|
932
935
|
*/ static getSerializationCls() {
|
|
933
936
|
return {
|
|
934
937
|
ctor: VertexBinormalNode,
|
|
@@ -938,62 +941,62 @@ import { BaseGraphNode } from '../node.js';
|
|
|
938
941
|
}
|
|
939
942
|
};
|
|
940
943
|
}
|
|
941
|
-
/**
|
|
942
|
-
* Validates the node state
|
|
943
|
-
*
|
|
944
|
-
* @returns Empty string (always valid)
|
|
945
|
-
*
|
|
946
|
-
* @remarks
|
|
947
|
-
* Vertex binormal nodes are always valid as they have no inputs.
|
|
944
|
+
/**
|
|
945
|
+
* Validates the node state
|
|
946
|
+
*
|
|
947
|
+
* @returns Empty string (always valid)
|
|
948
|
+
*
|
|
949
|
+
* @remarks
|
|
950
|
+
* Vertex binormal nodes are always valid as they have no inputs.
|
|
948
951
|
*/ validate() {
|
|
949
952
|
return '';
|
|
950
953
|
}
|
|
951
|
-
/**
|
|
952
|
-
* Gets the output type for a specific output slot
|
|
953
|
-
*
|
|
954
|
-
* @param id - The output slot ID
|
|
955
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full binormal
|
|
954
|
+
/**
|
|
955
|
+
* Gets the output type for a specific output slot
|
|
956
|
+
*
|
|
957
|
+
* @param id - The output slot ID
|
|
958
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full binormal
|
|
956
959
|
*/ getType(id) {
|
|
957
960
|
return id > 1 ? 'float' : 'vec3';
|
|
958
961
|
}
|
|
959
962
|
}
|
|
960
|
-
/**
|
|
961
|
-
* Projection matrix input node
|
|
962
|
-
*
|
|
963
|
-
* @remarks
|
|
964
|
-
* Provides the camera's projection matrix (view space to clip space transformation).
|
|
965
|
-
* This matrix transforms coordinates from camera/view space to normalized device coordinates (NDC).
|
|
966
|
-
*
|
|
967
|
-
* For perspective projection: converts frustum to cube, applies perspective divide
|
|
968
|
-
* For orthographic projection: applies parallel projection scaling
|
|
969
|
-
*
|
|
970
|
-
* Used for:
|
|
971
|
-
* - Custom vertex transformations
|
|
972
|
-
* - Screen-space effects
|
|
973
|
-
* - Depth calculations
|
|
974
|
-
* - Custom projection modifications
|
|
975
|
-
*
|
|
976
|
-
* Output:
|
|
977
|
-
* - Output 1: 4x4 projection matrix (mat4)
|
|
978
|
-
*
|
|
979
|
-
* @example
|
|
980
|
-
* ```typescript
|
|
981
|
-
* const projMatrix = new ProjectionMatrixNode();
|
|
982
|
-
* const viewSpacePos = new ViewSpacePositionNode();
|
|
983
|
-
*
|
|
984
|
-
* // Transform to clip space
|
|
985
|
-
* const transform = new TransformNode();
|
|
986
|
-
* transform.connectInput(1, viewSpacePos, 1);
|
|
987
|
-
* transform.connectInput(2, projMatrix, 1);
|
|
988
|
-
* ```
|
|
989
|
-
*
|
|
990
|
-
* @public
|
|
963
|
+
/**
|
|
964
|
+
* Projection matrix input node
|
|
965
|
+
*
|
|
966
|
+
* @remarks
|
|
967
|
+
* Provides the camera's projection matrix (view space to clip space transformation).
|
|
968
|
+
* This matrix transforms coordinates from camera/view space to normalized device coordinates (NDC).
|
|
969
|
+
*
|
|
970
|
+
* For perspective projection: converts frustum to cube, applies perspective divide
|
|
971
|
+
* For orthographic projection: applies parallel projection scaling
|
|
972
|
+
*
|
|
973
|
+
* Used for:
|
|
974
|
+
* - Custom vertex transformations
|
|
975
|
+
* - Screen-space effects
|
|
976
|
+
* - Depth calculations
|
|
977
|
+
* - Custom projection modifications
|
|
978
|
+
*
|
|
979
|
+
* Output:
|
|
980
|
+
* - Output 1: 4x4 projection matrix (mat4)
|
|
981
|
+
*
|
|
982
|
+
* @example
|
|
983
|
+
* ```typescript
|
|
984
|
+
* const projMatrix = new ProjectionMatrixNode();
|
|
985
|
+
* const viewSpacePos = new ViewSpacePositionNode();
|
|
986
|
+
*
|
|
987
|
+
* // Transform to clip space
|
|
988
|
+
* const transform = new TransformNode();
|
|
989
|
+
* transform.connectInput(1, viewSpacePos, 1);
|
|
990
|
+
* transform.connectInput(2, projMatrix, 1);
|
|
991
|
+
* ```
|
|
992
|
+
*
|
|
993
|
+
* @public
|
|
991
994
|
*/ class ProjectionMatrixNode extends BaseGraphNode {
|
|
992
|
-
/**
|
|
993
|
-
* Creates a new projection matrix node
|
|
994
|
-
*
|
|
995
|
-
* @remarks
|
|
996
|
-
* Initializes with one output slot for the mat4 matrix.
|
|
995
|
+
/**
|
|
996
|
+
* Creates a new projection matrix node
|
|
997
|
+
*
|
|
998
|
+
* @remarks
|
|
999
|
+
* Initializes with one output slot for the mat4 matrix.
|
|
997
1000
|
*/ constructor(){
|
|
998
1001
|
super();
|
|
999
1002
|
this._outputs = [
|
|
@@ -1003,17 +1006,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1003
1006
|
}
|
|
1004
1007
|
];
|
|
1005
1008
|
}
|
|
1006
|
-
/**
|
|
1007
|
-
* Generates a string representation of this node
|
|
1008
|
-
*
|
|
1009
|
-
* @returns 'ViewToClipMatrix'
|
|
1009
|
+
/**
|
|
1010
|
+
* Generates a string representation of this node
|
|
1011
|
+
*
|
|
1012
|
+
* @returns 'ViewToClipMatrix'
|
|
1010
1013
|
*/ toString() {
|
|
1011
1014
|
return 'ViewToClipMatrix';
|
|
1012
1015
|
}
|
|
1013
|
-
/**
|
|
1014
|
-
* Gets the serialization descriptor for this node type
|
|
1015
|
-
*
|
|
1016
|
-
* @returns Serialization class descriptor
|
|
1016
|
+
/**
|
|
1017
|
+
* Gets the serialization descriptor for this node type
|
|
1018
|
+
*
|
|
1019
|
+
* @returns Serialization class descriptor
|
|
1017
1020
|
*/ static getSerializationCls() {
|
|
1018
1021
|
return {
|
|
1019
1022
|
ctor: ProjectionMatrixNode,
|
|
@@ -1023,61 +1026,61 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1023
1026
|
}
|
|
1024
1027
|
};
|
|
1025
1028
|
}
|
|
1026
|
-
/**
|
|
1027
|
-
* Validates the node state
|
|
1028
|
-
*
|
|
1029
|
-
* @returns Empty string (always valid)
|
|
1030
|
-
*
|
|
1031
|
-
* @remarks
|
|
1032
|
-
* Matrix nodes are always valid as they have no inputs.
|
|
1029
|
+
/**
|
|
1030
|
+
* Validates the node state
|
|
1031
|
+
*
|
|
1032
|
+
* @returns Empty string (always valid)
|
|
1033
|
+
*
|
|
1034
|
+
* @remarks
|
|
1035
|
+
* Matrix nodes are always valid as they have no inputs.
|
|
1033
1036
|
*/ validate() {
|
|
1034
1037
|
return '';
|
|
1035
1038
|
}
|
|
1036
|
-
/**
|
|
1037
|
-
* Gets the output type
|
|
1038
|
-
*
|
|
1039
|
-
* @returns 'mat4'
|
|
1039
|
+
/**
|
|
1040
|
+
* Gets the output type
|
|
1041
|
+
*
|
|
1042
|
+
* @returns 'mat4'
|
|
1040
1043
|
*/ getType() {
|
|
1041
1044
|
return 'mat4';
|
|
1042
1045
|
}
|
|
1043
1046
|
}
|
|
1044
|
-
/**
|
|
1045
|
-
* View matrix input node
|
|
1046
|
-
*
|
|
1047
|
-
* @remarks
|
|
1048
|
-
* Provides the camera's view matrix (world space to view space transformation).
|
|
1049
|
-
* This matrix transforms coordinates from world space to camera/view space,
|
|
1050
|
-
* where the camera is at the origin looking down the negative Z axis.
|
|
1051
|
-
*
|
|
1052
|
-
* The view matrix is the inverse of the camera's world transformation matrix.
|
|
1053
|
-
*
|
|
1054
|
-
* Used for:
|
|
1055
|
-
* - Custom lighting in view space
|
|
1056
|
-
* - View-space normal calculations
|
|
1057
|
-
* - Billboard effects
|
|
1058
|
-
* - Custom camera-relative transformations
|
|
1059
|
-
*
|
|
1060
|
-
* Output:
|
|
1061
|
-
* - Output 1: 4x4 view matrix (mat4)
|
|
1062
|
-
*
|
|
1063
|
-
* @example
|
|
1064
|
-
* ```typescript
|
|
1065
|
-
* const viewMatrix = new ViewMatrixNode();
|
|
1066
|
-
* const worldPos = new VertexPositionNode();
|
|
1067
|
-
*
|
|
1068
|
-
* // Transform to view space
|
|
1069
|
-
* const transform = new TransformNode();
|
|
1070
|
-
* transform.connectInput(1, worldPos, 1);
|
|
1071
|
-
* transform.connectInput(2, viewMatrix, 1);
|
|
1072
|
-
* ```
|
|
1073
|
-
*
|
|
1074
|
-
* @public
|
|
1047
|
+
/**
|
|
1048
|
+
* View matrix input node
|
|
1049
|
+
*
|
|
1050
|
+
* @remarks
|
|
1051
|
+
* Provides the camera's view matrix (world space to view space transformation).
|
|
1052
|
+
* This matrix transforms coordinates from world space to camera/view space,
|
|
1053
|
+
* where the camera is at the origin looking down the negative Z axis.
|
|
1054
|
+
*
|
|
1055
|
+
* The view matrix is the inverse of the camera's world transformation matrix.
|
|
1056
|
+
*
|
|
1057
|
+
* Used for:
|
|
1058
|
+
* - Custom lighting in view space
|
|
1059
|
+
* - View-space normal calculations
|
|
1060
|
+
* - Billboard effects
|
|
1061
|
+
* - Custom camera-relative transformations
|
|
1062
|
+
*
|
|
1063
|
+
* Output:
|
|
1064
|
+
* - Output 1: 4x4 view matrix (mat4)
|
|
1065
|
+
*
|
|
1066
|
+
* @example
|
|
1067
|
+
* ```typescript
|
|
1068
|
+
* const viewMatrix = new ViewMatrixNode();
|
|
1069
|
+
* const worldPos = new VertexPositionNode();
|
|
1070
|
+
*
|
|
1071
|
+
* // Transform to view space
|
|
1072
|
+
* const transform = new TransformNode();
|
|
1073
|
+
* transform.connectInput(1, worldPos, 1);
|
|
1074
|
+
* transform.connectInput(2, viewMatrix, 1);
|
|
1075
|
+
* ```
|
|
1076
|
+
*
|
|
1077
|
+
* @public
|
|
1075
1078
|
*/ class ViewMatrixNode extends BaseGraphNode {
|
|
1076
|
-
/**
|
|
1077
|
-
* Creates a new view matrix node
|
|
1078
|
-
*
|
|
1079
|
-
* @remarks
|
|
1080
|
-
* Initializes with one output slot for the mat4 matrix.
|
|
1079
|
+
/**
|
|
1080
|
+
* Creates a new view matrix node
|
|
1081
|
+
*
|
|
1082
|
+
* @remarks
|
|
1083
|
+
* Initializes with one output slot for the mat4 matrix.
|
|
1081
1084
|
*/ constructor(){
|
|
1082
1085
|
super();
|
|
1083
1086
|
this._outputs = [
|
|
@@ -1087,17 +1090,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1087
1090
|
}
|
|
1088
1091
|
];
|
|
1089
1092
|
}
|
|
1090
|
-
/**
|
|
1091
|
-
* Generates a string representation of this node
|
|
1092
|
-
*
|
|
1093
|
-
* @returns 'WorldToViewMatrix'
|
|
1093
|
+
/**
|
|
1094
|
+
* Generates a string representation of this node
|
|
1095
|
+
*
|
|
1096
|
+
* @returns 'WorldToViewMatrix'
|
|
1094
1097
|
*/ toString() {
|
|
1095
1098
|
return 'WorldToViewMatrix';
|
|
1096
1099
|
}
|
|
1097
|
-
/**
|
|
1098
|
-
* Gets the serialization descriptor for this node type
|
|
1099
|
-
*
|
|
1100
|
-
* @returns Serialization class descriptor
|
|
1100
|
+
/**
|
|
1101
|
+
* Gets the serialization descriptor for this node type
|
|
1102
|
+
*
|
|
1103
|
+
* @returns Serialization class descriptor
|
|
1101
1104
|
*/ static getSerializationCls() {
|
|
1102
1105
|
return {
|
|
1103
1106
|
ctor: ViewMatrixNode,
|
|
@@ -1107,61 +1110,61 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1107
1110
|
}
|
|
1108
1111
|
};
|
|
1109
1112
|
}
|
|
1110
|
-
/**
|
|
1111
|
-
* Validates the node state
|
|
1112
|
-
*
|
|
1113
|
-
* @returns Empty string (always valid)
|
|
1114
|
-
*
|
|
1115
|
-
* @remarks
|
|
1116
|
-
* Matrix nodes are always valid as they have no inputs.
|
|
1113
|
+
/**
|
|
1114
|
+
* Validates the node state
|
|
1115
|
+
*
|
|
1116
|
+
* @returns Empty string (always valid)
|
|
1117
|
+
*
|
|
1118
|
+
* @remarks
|
|
1119
|
+
* Matrix nodes are always valid as they have no inputs.
|
|
1117
1120
|
*/ validate() {
|
|
1118
1121
|
return '';
|
|
1119
1122
|
}
|
|
1120
|
-
/**
|
|
1121
|
-
* Gets the output type
|
|
1122
|
-
*
|
|
1123
|
-
* @returns 'mat4'
|
|
1123
|
+
/**
|
|
1124
|
+
* Gets the output type
|
|
1125
|
+
*
|
|
1126
|
+
* @returns 'mat4'
|
|
1124
1127
|
*/ getType() {
|
|
1125
1128
|
return 'mat4';
|
|
1126
1129
|
}
|
|
1127
1130
|
}
|
|
1128
|
-
/**
|
|
1129
|
-
* View-projection matrix input node
|
|
1130
|
-
*
|
|
1131
|
-
* @remarks
|
|
1132
|
-
* Provides the combined view-projection matrix (world space to clip space transformation).
|
|
1133
|
-
* This is the product of the view matrix and projection matrix, commonly used for
|
|
1134
|
-
* transforming vertices from world space directly to clip space in one step.
|
|
1135
|
-
*
|
|
1136
|
-
* Equivalent to: projectionMatrix * viewMatrix
|
|
1137
|
-
*
|
|
1138
|
-
* Used for:
|
|
1139
|
-
* - Vertex position transformation (most common use)
|
|
1140
|
-
* - Custom vertex shaders
|
|
1141
|
-
* - Screen-space position calculations
|
|
1142
|
-
* - Shadow mapping
|
|
1143
|
-
*
|
|
1144
|
-
* Output:
|
|
1145
|
-
* - Output 1: 4x4 view-projection matrix (mat4)
|
|
1146
|
-
*
|
|
1147
|
-
* @example
|
|
1148
|
-
* ```typescript
|
|
1149
|
-
* const viewProjMatrix = new ViewProjMatrixNode();
|
|
1150
|
-
* const worldPos = new VertexPositionNode();
|
|
1151
|
-
*
|
|
1152
|
-
* // Transform directly to clip space
|
|
1153
|
-
* const transform = new TransformNode();
|
|
1154
|
-
* transform.connectInput(1, worldPos, 1);
|
|
1155
|
-
* transform.connectInput(2, viewProjMatrix, 1);
|
|
1156
|
-
* ```
|
|
1157
|
-
*
|
|
1158
|
-
* @public
|
|
1131
|
+
/**
|
|
1132
|
+
* View-projection matrix input node
|
|
1133
|
+
*
|
|
1134
|
+
* @remarks
|
|
1135
|
+
* Provides the combined view-projection matrix (world space to clip space transformation).
|
|
1136
|
+
* This is the product of the view matrix and projection matrix, commonly used for
|
|
1137
|
+
* transforming vertices from world space directly to clip space in one step.
|
|
1138
|
+
*
|
|
1139
|
+
* Equivalent to: projectionMatrix * viewMatrix
|
|
1140
|
+
*
|
|
1141
|
+
* Used for:
|
|
1142
|
+
* - Vertex position transformation (most common use)
|
|
1143
|
+
* - Custom vertex shaders
|
|
1144
|
+
* - Screen-space position calculations
|
|
1145
|
+
* - Shadow mapping
|
|
1146
|
+
*
|
|
1147
|
+
* Output:
|
|
1148
|
+
* - Output 1: 4x4 view-projection matrix (mat4)
|
|
1149
|
+
*
|
|
1150
|
+
* @example
|
|
1151
|
+
* ```typescript
|
|
1152
|
+
* const viewProjMatrix = new ViewProjMatrixNode();
|
|
1153
|
+
* const worldPos = new VertexPositionNode();
|
|
1154
|
+
*
|
|
1155
|
+
* // Transform directly to clip space
|
|
1156
|
+
* const transform = new TransformNode();
|
|
1157
|
+
* transform.connectInput(1, worldPos, 1);
|
|
1158
|
+
* transform.connectInput(2, viewProjMatrix, 1);
|
|
1159
|
+
* ```
|
|
1160
|
+
*
|
|
1161
|
+
* @public
|
|
1159
1162
|
*/ class ViewProjMatrixNode extends BaseGraphNode {
|
|
1160
|
-
/**
|
|
1161
|
-
* Creates a new view-projection matrix node
|
|
1162
|
-
*
|
|
1163
|
-
* @remarks
|
|
1164
|
-
* Initializes with one output slot for the mat4 matrix.
|
|
1163
|
+
/**
|
|
1164
|
+
* Creates a new view-projection matrix node
|
|
1165
|
+
*
|
|
1166
|
+
* @remarks
|
|
1167
|
+
* Initializes with one output slot for the mat4 matrix.
|
|
1165
1168
|
*/ constructor(){
|
|
1166
1169
|
super();
|
|
1167
1170
|
this._outputs = [
|
|
@@ -1171,17 +1174,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1171
1174
|
}
|
|
1172
1175
|
];
|
|
1173
1176
|
}
|
|
1174
|
-
/**
|
|
1175
|
-
* Generates a string representation of this node
|
|
1176
|
-
*
|
|
1177
|
-
* @returns 'WorldToClipMatrix'
|
|
1177
|
+
/**
|
|
1178
|
+
* Generates a string representation of this node
|
|
1179
|
+
*
|
|
1180
|
+
* @returns 'WorldToClipMatrix'
|
|
1178
1181
|
*/ toString() {
|
|
1179
1182
|
return 'WorldToClipMatrix';
|
|
1180
1183
|
}
|
|
1181
|
-
/**
|
|
1182
|
-
* Gets the serialization descriptor for this node type
|
|
1183
|
-
*
|
|
1184
|
-
* @returns Serialization class descriptor
|
|
1184
|
+
/**
|
|
1185
|
+
* Gets the serialization descriptor for this node type
|
|
1186
|
+
*
|
|
1187
|
+
* @returns Serialization class descriptor
|
|
1185
1188
|
*/ static getSerializationCls() {
|
|
1186
1189
|
return {
|
|
1187
1190
|
ctor: ViewProjMatrixNode,
|
|
@@ -1191,58 +1194,58 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1191
1194
|
}
|
|
1192
1195
|
};
|
|
1193
1196
|
}
|
|
1194
|
-
/**
|
|
1195
|
-
* Validates the node state
|
|
1196
|
-
*
|
|
1197
|
-
* @returns Empty string (always valid)
|
|
1198
|
-
*
|
|
1199
|
-
* @remarks
|
|
1200
|
-
* Matrix nodes are always valid as they have no inputs.
|
|
1197
|
+
/**
|
|
1198
|
+
* Validates the node state
|
|
1199
|
+
*
|
|
1200
|
+
* @returns Empty string (always valid)
|
|
1201
|
+
*
|
|
1202
|
+
* @remarks
|
|
1203
|
+
* Matrix nodes are always valid as they have no inputs.
|
|
1201
1204
|
*/ validate() {
|
|
1202
1205
|
return '';
|
|
1203
1206
|
}
|
|
1204
|
-
/**
|
|
1205
|
-
* Gets the output type
|
|
1206
|
-
*
|
|
1207
|
-
* @returns 'mat4'
|
|
1207
|
+
/**
|
|
1208
|
+
* Gets the output type
|
|
1209
|
+
*
|
|
1210
|
+
* @returns 'mat4'
|
|
1208
1211
|
*/ getType() {
|
|
1209
1212
|
return 'mat4';
|
|
1210
1213
|
}
|
|
1211
1214
|
}
|
|
1212
|
-
/**
|
|
1213
|
-
* Inverse projection matrix input node
|
|
1214
|
-
*
|
|
1215
|
-
* @remarks
|
|
1216
|
-
* Provides the inverse of the projection matrix (clip space to view space transformation).
|
|
1217
|
-
* This matrix transforms coordinates from normalized device coordinates (NDC) back to camera/view space.
|
|
1218
|
-
*
|
|
1219
|
-
* Used for:
|
|
1220
|
-
* - Screen-space to view-space reconstruction
|
|
1221
|
-
* - Depth buffer unprojection
|
|
1222
|
-
* - Deferred rendering position reconstruction
|
|
1223
|
-
* - Ray marching from screen space
|
|
1224
|
-
*
|
|
1225
|
-
* Output:
|
|
1226
|
-
* - Output 1: 4x4 inverse projection matrix (mat4)
|
|
1227
|
-
*
|
|
1228
|
-
* @example
|
|
1229
|
-
* ```typescript
|
|
1230
|
-
* const invProjMatrix = new InvProjMatrixNode();
|
|
1231
|
-
* const clipPos = new ClipSpacePositionNode();
|
|
1232
|
-
*
|
|
1233
|
-
* // Reconstruct view space position
|
|
1234
|
-
* const transform = new TransformNode();
|
|
1235
|
-
* transform.connectInput(1, clipPos, 1);
|
|
1236
|
-
* transform.connectInput(2, invProjMatrix, 1);
|
|
1237
|
-
* ```
|
|
1238
|
-
*
|
|
1239
|
-
* @public
|
|
1215
|
+
/**
|
|
1216
|
+
* Inverse projection matrix input node
|
|
1217
|
+
*
|
|
1218
|
+
* @remarks
|
|
1219
|
+
* Provides the inverse of the projection matrix (clip space to view space transformation).
|
|
1220
|
+
* This matrix transforms coordinates from normalized device coordinates (NDC) back to camera/view space.
|
|
1221
|
+
*
|
|
1222
|
+
* Used for:
|
|
1223
|
+
* - Screen-space to view-space reconstruction
|
|
1224
|
+
* - Depth buffer unprojection
|
|
1225
|
+
* - Deferred rendering position reconstruction
|
|
1226
|
+
* - Ray marching from screen space
|
|
1227
|
+
*
|
|
1228
|
+
* Output:
|
|
1229
|
+
* - Output 1: 4x4 inverse projection matrix (mat4)
|
|
1230
|
+
*
|
|
1231
|
+
* @example
|
|
1232
|
+
* ```typescript
|
|
1233
|
+
* const invProjMatrix = new InvProjMatrixNode();
|
|
1234
|
+
* const clipPos = new ClipSpacePositionNode();
|
|
1235
|
+
*
|
|
1236
|
+
* // Reconstruct view space position
|
|
1237
|
+
* const transform = new TransformNode();
|
|
1238
|
+
* transform.connectInput(1, clipPos, 1);
|
|
1239
|
+
* transform.connectInput(2, invProjMatrix, 1);
|
|
1240
|
+
* ```
|
|
1241
|
+
*
|
|
1242
|
+
* @public
|
|
1240
1243
|
*/ class InvProjMatrixNode extends BaseGraphNode {
|
|
1241
|
-
/**
|
|
1242
|
-
* Creates a new inverse projection matrix node
|
|
1243
|
-
*
|
|
1244
|
-
* @remarks
|
|
1245
|
-
* Initializes with one output slot for the mat4 matrix.
|
|
1244
|
+
/**
|
|
1245
|
+
* Creates a new inverse projection matrix node
|
|
1246
|
+
*
|
|
1247
|
+
* @remarks
|
|
1248
|
+
* Initializes with one output slot for the mat4 matrix.
|
|
1246
1249
|
*/ constructor(){
|
|
1247
1250
|
super();
|
|
1248
1251
|
this._outputs = [
|
|
@@ -1252,17 +1255,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1252
1255
|
}
|
|
1253
1256
|
];
|
|
1254
1257
|
}
|
|
1255
|
-
/**
|
|
1256
|
-
* Generates a string representation of this node
|
|
1257
|
-
*
|
|
1258
|
-
* @returns 'ClipToViewMatrix'
|
|
1258
|
+
/**
|
|
1259
|
+
* Generates a string representation of this node
|
|
1260
|
+
*
|
|
1261
|
+
* @returns 'ClipToViewMatrix'
|
|
1259
1262
|
*/ toString() {
|
|
1260
1263
|
return 'ClipToViewMatrix';
|
|
1261
1264
|
}
|
|
1262
|
-
/**
|
|
1263
|
-
* Gets the serialization descriptor for this node type
|
|
1264
|
-
*
|
|
1265
|
-
* @returns Serialization class descriptor
|
|
1265
|
+
/**
|
|
1266
|
+
* Gets the serialization descriptor for this node type
|
|
1267
|
+
*
|
|
1268
|
+
* @returns Serialization class descriptor
|
|
1266
1269
|
*/ static getSerializationCls() {
|
|
1267
1270
|
return {
|
|
1268
1271
|
ctor: InvProjMatrixNode,
|
|
@@ -1272,60 +1275,60 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1272
1275
|
}
|
|
1273
1276
|
};
|
|
1274
1277
|
}
|
|
1275
|
-
/**
|
|
1276
|
-
* Validates the node state
|
|
1277
|
-
*
|
|
1278
|
-
* @returns Empty string (always valid)
|
|
1279
|
-
*
|
|
1280
|
-
* @remarks
|
|
1281
|
-
* Matrix nodes are always valid as they have no inputs.
|
|
1278
|
+
/**
|
|
1279
|
+
* Validates the node state
|
|
1280
|
+
*
|
|
1281
|
+
* @returns Empty string (always valid)
|
|
1282
|
+
*
|
|
1283
|
+
* @remarks
|
|
1284
|
+
* Matrix nodes are always valid as they have no inputs.
|
|
1282
1285
|
*/ validate() {
|
|
1283
1286
|
return '';
|
|
1284
1287
|
}
|
|
1285
|
-
/**
|
|
1286
|
-
* Gets the output type
|
|
1287
|
-
*
|
|
1288
|
-
* @returns 'mat4'
|
|
1288
|
+
/**
|
|
1289
|
+
* Gets the output type
|
|
1290
|
+
*
|
|
1291
|
+
* @returns 'mat4'
|
|
1289
1292
|
*/ getType() {
|
|
1290
1293
|
return 'mat4';
|
|
1291
1294
|
}
|
|
1292
1295
|
}
|
|
1293
|
-
/**
|
|
1294
|
-
* Inverse view-projection matrix input node
|
|
1295
|
-
*
|
|
1296
|
-
* @remarks
|
|
1297
|
-
* Provides the inverse of the view-projection matrix (clip space to world space transformation).
|
|
1298
|
-
* This matrix transforms coordinates from normalized device coordinates (NDC) back to world space.
|
|
1299
|
-
*
|
|
1300
|
-
* Equivalent to: inverse(projectionMatrix * viewMatrix)
|
|
1301
|
-
*
|
|
1302
|
-
* Used for:
|
|
1303
|
-
* - Screen-space to world-space reconstruction
|
|
1304
|
-
* - Deferred rendering world position reconstruction
|
|
1305
|
-
* - Picking and ray casting from screen coordinates
|
|
1306
|
-
* - Screen-space effects needing world position
|
|
1307
|
-
*
|
|
1308
|
-
* Output:
|
|
1309
|
-
* - Output 1: 4x4 inverse view-projection matrix (mat4)
|
|
1310
|
-
*
|
|
1311
|
-
* @example
|
|
1312
|
-
* ```typescript
|
|
1313
|
-
* const invViewProjMatrix = new InvViewProjMatrixNode();
|
|
1314
|
-
* const screenPos = new ScreenPositionNode();
|
|
1315
|
-
*
|
|
1316
|
-
* // Reconstruct world position from screen coordinates
|
|
1317
|
-
* const transform = new TransformNode();
|
|
1318
|
-
* transform.connectInput(1, screenPos, 1);
|
|
1319
|
-
* transform.connectInput(2, invViewProjMatrix, 1);
|
|
1320
|
-
* ```
|
|
1321
|
-
*
|
|
1322
|
-
* @public
|
|
1296
|
+
/**
|
|
1297
|
+
* Inverse view-projection matrix input node
|
|
1298
|
+
*
|
|
1299
|
+
* @remarks
|
|
1300
|
+
* Provides the inverse of the view-projection matrix (clip space to world space transformation).
|
|
1301
|
+
* This matrix transforms coordinates from normalized device coordinates (NDC) back to world space.
|
|
1302
|
+
*
|
|
1303
|
+
* Equivalent to: inverse(projectionMatrix * viewMatrix)
|
|
1304
|
+
*
|
|
1305
|
+
* Used for:
|
|
1306
|
+
* - Screen-space to world-space reconstruction
|
|
1307
|
+
* - Deferred rendering world position reconstruction
|
|
1308
|
+
* - Picking and ray casting from screen coordinates
|
|
1309
|
+
* - Screen-space effects needing world position
|
|
1310
|
+
*
|
|
1311
|
+
* Output:
|
|
1312
|
+
* - Output 1: 4x4 inverse view-projection matrix (mat4)
|
|
1313
|
+
*
|
|
1314
|
+
* @example
|
|
1315
|
+
* ```typescript
|
|
1316
|
+
* const invViewProjMatrix = new InvViewProjMatrixNode();
|
|
1317
|
+
* const screenPos = new ScreenPositionNode();
|
|
1318
|
+
*
|
|
1319
|
+
* // Reconstruct world position from screen coordinates
|
|
1320
|
+
* const transform = new TransformNode();
|
|
1321
|
+
* transform.connectInput(1, screenPos, 1);
|
|
1322
|
+
* transform.connectInput(2, invViewProjMatrix, 1);
|
|
1323
|
+
* ```
|
|
1324
|
+
*
|
|
1325
|
+
* @public
|
|
1323
1326
|
*/ class InvViewProjMatrixNode extends BaseGraphNode {
|
|
1324
|
-
/**
|
|
1325
|
-
* Creates a new inverse view-projection matrix node
|
|
1326
|
-
*
|
|
1327
|
-
* @remarks
|
|
1328
|
-
* Initializes with one output slot for the mat4 matrix.
|
|
1327
|
+
/**
|
|
1328
|
+
* Creates a new inverse view-projection matrix node
|
|
1329
|
+
*
|
|
1330
|
+
* @remarks
|
|
1331
|
+
* Initializes with one output slot for the mat4 matrix.
|
|
1329
1332
|
*/ constructor(){
|
|
1330
1333
|
super();
|
|
1331
1334
|
this._outputs = [
|
|
@@ -1335,17 +1338,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1335
1338
|
}
|
|
1336
1339
|
];
|
|
1337
1340
|
}
|
|
1338
|
-
/**
|
|
1339
|
-
* Generates a string representation of this node
|
|
1340
|
-
*
|
|
1341
|
-
* @returns 'ClipToWorldMatrix'
|
|
1341
|
+
/**
|
|
1342
|
+
* Generates a string representation of this node
|
|
1343
|
+
*
|
|
1344
|
+
* @returns 'ClipToWorldMatrix'
|
|
1342
1345
|
*/ toString() {
|
|
1343
1346
|
return 'ClipToWorldMatrix';
|
|
1344
1347
|
}
|
|
1345
|
-
/**
|
|
1346
|
-
* Gets the serialization descriptor for this node type
|
|
1347
|
-
*
|
|
1348
|
-
* @returns Serialization class descriptor
|
|
1348
|
+
/**
|
|
1349
|
+
* Gets the serialization descriptor for this node type
|
|
1350
|
+
*
|
|
1351
|
+
* @returns Serialization class descriptor
|
|
1349
1352
|
*/ static getSerializationCls() {
|
|
1350
1353
|
return {
|
|
1351
1354
|
ctor: InvViewProjMatrixNode,
|
|
@@ -1355,34 +1358,34 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1355
1358
|
}
|
|
1356
1359
|
};
|
|
1357
1360
|
}
|
|
1358
|
-
/**
|
|
1359
|
-
* Validates the node state
|
|
1360
|
-
*
|
|
1361
|
-
* @returns Empty string (always valid)
|
|
1362
|
-
*
|
|
1363
|
-
* @remarks
|
|
1364
|
-
* Matrix nodes are always valid as they have no inputs.
|
|
1361
|
+
/**
|
|
1362
|
+
* Validates the node state
|
|
1363
|
+
*
|
|
1364
|
+
* @returns Empty string (always valid)
|
|
1365
|
+
*
|
|
1366
|
+
* @remarks
|
|
1367
|
+
* Matrix nodes are always valid as they have no inputs.
|
|
1365
1368
|
*/ validate() {
|
|
1366
1369
|
return '';
|
|
1367
1370
|
}
|
|
1368
|
-
/**
|
|
1369
|
-
* Gets the output type
|
|
1370
|
-
*
|
|
1371
|
-
* @returns 'mat4'
|
|
1371
|
+
/**
|
|
1372
|
+
* Gets the output type
|
|
1373
|
+
*
|
|
1374
|
+
* @returns 'mat4'
|
|
1372
1375
|
*/ getType() {
|
|
1373
1376
|
return 'mat4';
|
|
1374
1377
|
}
|
|
1375
1378
|
}
|
|
1376
|
-
/**
|
|
1377
|
-
* Billboard matrix input node
|
|
1378
|
-
*
|
|
1379
|
-
* @public
|
|
1379
|
+
/**
|
|
1380
|
+
* Billboard matrix input node
|
|
1381
|
+
*
|
|
1382
|
+
* @public
|
|
1380
1383
|
*/ class BillboardMatrixNode extends BaseGraphNode {
|
|
1381
|
-
/**
|
|
1382
|
-
* Creates a new billboard matrix node
|
|
1383
|
-
*
|
|
1384
|
-
* @remarks
|
|
1385
|
-
* Initializes with one output slot for the mat3 matrix.
|
|
1384
|
+
/**
|
|
1385
|
+
* Creates a new billboard matrix node
|
|
1386
|
+
*
|
|
1387
|
+
* @remarks
|
|
1388
|
+
* Initializes with one output slot for the mat3 matrix.
|
|
1386
1389
|
*/ constructor(){
|
|
1387
1390
|
super();
|
|
1388
1391
|
this._outputs = [
|
|
@@ -1392,17 +1395,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1392
1395
|
}
|
|
1393
1396
|
];
|
|
1394
1397
|
}
|
|
1395
|
-
/**
|
|
1396
|
-
* Generates a string representation of this node
|
|
1397
|
-
*
|
|
1398
|
-
* @returns 'BillboardMatrix'
|
|
1398
|
+
/**
|
|
1399
|
+
* Generates a string representation of this node
|
|
1400
|
+
*
|
|
1401
|
+
* @returns 'BillboardMatrix'
|
|
1399
1402
|
*/ toString() {
|
|
1400
1403
|
return 'BillboardMatrix';
|
|
1401
1404
|
}
|
|
1402
|
-
/**
|
|
1403
|
-
* Gets the serialization descriptor for this node type
|
|
1404
|
-
*
|
|
1405
|
-
* @returns Serialization class descriptor
|
|
1405
|
+
/**
|
|
1406
|
+
* Gets the serialization descriptor for this node type
|
|
1407
|
+
*
|
|
1408
|
+
* @returns Serialization class descriptor
|
|
1406
1409
|
*/ static getSerializationCls() {
|
|
1407
1410
|
return {
|
|
1408
1411
|
ctor: BillboardMatrixNode,
|
|
@@ -1412,69 +1415,69 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1412
1415
|
}
|
|
1413
1416
|
};
|
|
1414
1417
|
}
|
|
1415
|
-
/**
|
|
1416
|
-
* Validates the node state
|
|
1417
|
-
*
|
|
1418
|
-
* @returns Empty string (always valid)
|
|
1419
|
-
*
|
|
1420
|
-
* @remarks
|
|
1421
|
-
* Matrix nodes are always valid as they have no inputs.
|
|
1418
|
+
/**
|
|
1419
|
+
* Validates the node state
|
|
1420
|
+
*
|
|
1421
|
+
* @returns Empty string (always valid)
|
|
1422
|
+
*
|
|
1423
|
+
* @remarks
|
|
1424
|
+
* Matrix nodes are always valid as they have no inputs.
|
|
1422
1425
|
*/ validate() {
|
|
1423
1426
|
return '';
|
|
1424
1427
|
}
|
|
1425
|
-
/**
|
|
1426
|
-
* Gets the output type
|
|
1427
|
-
*
|
|
1428
|
-
* @returns 'mat4'
|
|
1428
|
+
/**
|
|
1429
|
+
* Gets the output type
|
|
1430
|
+
*
|
|
1431
|
+
* @returns 'mat4'
|
|
1429
1432
|
*/ getType() {
|
|
1430
1433
|
return 'mat3';
|
|
1431
1434
|
}
|
|
1432
1435
|
}
|
|
1433
|
-
/**
|
|
1434
|
-
* Elapsed time input node
|
|
1435
|
-
*
|
|
1436
|
-
* @remarks
|
|
1437
|
-
* Provides the total elapsed time since the application started, in seconds.
|
|
1438
|
-
* This value continuously increases and is useful for creating time-based animations
|
|
1439
|
-
* and effects directly in the material shader.
|
|
1440
|
-
*
|
|
1441
|
-
* Used for:
|
|
1442
|
-
* - Animated textures (scrolling, rotating)
|
|
1443
|
-
* - Pulsating effects
|
|
1444
|
-
* - Wave animations
|
|
1445
|
-
* - Oscillating values (using sin/cos)
|
|
1446
|
-
* - Time-based procedural patterns
|
|
1447
|
-
*
|
|
1448
|
-
* Output:
|
|
1449
|
-
* - Output 1: Elapsed time in seconds (float)
|
|
1450
|
-
*
|
|
1451
|
-
* @example
|
|
1452
|
-
* ```typescript
|
|
1453
|
-
* const time = new ElapsedTimeNode();
|
|
1454
|
-
* const speed = new ConstantScalarNode();
|
|
1455
|
-
* speed.x = 0.5;
|
|
1456
|
-
*
|
|
1457
|
-
* // Animate UV scrolling
|
|
1458
|
-
* const mul = new CompMulNode();
|
|
1459
|
-
* mul.connectInput(1, time, 1);
|
|
1460
|
-
* mul.connectInput(2, speed, 1);
|
|
1461
|
-
*
|
|
1462
|
-
* const add = new CompAddNode();
|
|
1463
|
-
* add.connectInput(1, uvNode, 1);
|
|
1464
|
-
* add.connectInput(2, mul, 1);
|
|
1465
|
-
*
|
|
1466
|
-
* // Pulsating effect with sine wave
|
|
1467
|
-
* const sin = new SinNode();
|
|
1468
|
-
* sin.connectInput(1, time, 1);
|
|
1469
|
-
* ```
|
|
1470
|
-
*
|
|
1471
|
-
* @public
|
|
1436
|
+
/**
|
|
1437
|
+
* Elapsed time input node
|
|
1438
|
+
*
|
|
1439
|
+
* @remarks
|
|
1440
|
+
* Provides the total elapsed time since the application started, in seconds.
|
|
1441
|
+
* This value continuously increases and is useful for creating time-based animations
|
|
1442
|
+
* and effects directly in the material shader.
|
|
1443
|
+
*
|
|
1444
|
+
* Used for:
|
|
1445
|
+
* - Animated textures (scrolling, rotating)
|
|
1446
|
+
* - Pulsating effects
|
|
1447
|
+
* - Wave animations
|
|
1448
|
+
* - Oscillating values (using sin/cos)
|
|
1449
|
+
* - Time-based procedural patterns
|
|
1450
|
+
*
|
|
1451
|
+
* Output:
|
|
1452
|
+
* - Output 1: Elapsed time in seconds (float)
|
|
1453
|
+
*
|
|
1454
|
+
* @example
|
|
1455
|
+
* ```typescript
|
|
1456
|
+
* const time = new ElapsedTimeNode();
|
|
1457
|
+
* const speed = new ConstantScalarNode();
|
|
1458
|
+
* speed.x = 0.5;
|
|
1459
|
+
*
|
|
1460
|
+
* // Animate UV scrolling
|
|
1461
|
+
* const mul = new CompMulNode();
|
|
1462
|
+
* mul.connectInput(1, time, 1);
|
|
1463
|
+
* mul.connectInput(2, speed, 1);
|
|
1464
|
+
*
|
|
1465
|
+
* const add = new CompAddNode();
|
|
1466
|
+
* add.connectInput(1, uvNode, 1);
|
|
1467
|
+
* add.connectInput(2, mul, 1);
|
|
1468
|
+
*
|
|
1469
|
+
* // Pulsating effect with sine wave
|
|
1470
|
+
* const sin = new SinNode();
|
|
1471
|
+
* sin.connectInput(1, time, 1);
|
|
1472
|
+
* ```
|
|
1473
|
+
*
|
|
1474
|
+
* @public
|
|
1472
1475
|
*/ class ElapsedTimeNode extends BaseGraphNode {
|
|
1473
|
-
/**
|
|
1474
|
-
* Creates a new elapsed time node
|
|
1475
|
-
*
|
|
1476
|
-
* @remarks
|
|
1477
|
-
* Initializes with one output slot for the time value.
|
|
1476
|
+
/**
|
|
1477
|
+
* Creates a new elapsed time node
|
|
1478
|
+
*
|
|
1479
|
+
* @remarks
|
|
1480
|
+
* Initializes with one output slot for the time value.
|
|
1478
1481
|
*/ constructor(){
|
|
1479
1482
|
super();
|
|
1480
1483
|
this._outputs = [
|
|
@@ -1484,17 +1487,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1484
1487
|
}
|
|
1485
1488
|
];
|
|
1486
1489
|
}
|
|
1487
|
-
/**
|
|
1488
|
-
* Generates a string representation of this node
|
|
1489
|
-
*
|
|
1490
|
-
* @returns 'Elapsed time'
|
|
1490
|
+
/**
|
|
1491
|
+
* Generates a string representation of this node
|
|
1492
|
+
*
|
|
1493
|
+
* @returns 'Elapsed time'
|
|
1491
1494
|
*/ toString() {
|
|
1492
1495
|
return 'Elapsed time';
|
|
1493
1496
|
}
|
|
1494
|
-
/**
|
|
1495
|
-
* Gets the serialization descriptor for this node type
|
|
1496
|
-
*
|
|
1497
|
-
* @returns Serialization class descriptor
|
|
1497
|
+
/**
|
|
1498
|
+
* Gets the serialization descriptor for this node type
|
|
1499
|
+
*
|
|
1500
|
+
* @returns Serialization class descriptor
|
|
1498
1501
|
*/ static getSerializationCls() {
|
|
1499
1502
|
return {
|
|
1500
1503
|
ctor: ElapsedTimeNode,
|
|
@@ -1504,71 +1507,71 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1504
1507
|
}
|
|
1505
1508
|
};
|
|
1506
1509
|
}
|
|
1507
|
-
/**
|
|
1508
|
-
* Validates the node state
|
|
1509
|
-
*
|
|
1510
|
-
* @returns Empty string (always valid)
|
|
1511
|
-
*
|
|
1512
|
-
* @remarks
|
|
1513
|
-
* Time nodes are always valid as they have no inputs.
|
|
1510
|
+
/**
|
|
1511
|
+
* Validates the node state
|
|
1512
|
+
*
|
|
1513
|
+
* @returns Empty string (always valid)
|
|
1514
|
+
*
|
|
1515
|
+
* @remarks
|
|
1516
|
+
* Time nodes are always valid as they have no inputs.
|
|
1514
1517
|
*/ validate() {
|
|
1515
1518
|
return '';
|
|
1516
1519
|
}
|
|
1517
|
-
/**
|
|
1518
|
-
* Gets the output type
|
|
1519
|
-
*
|
|
1520
|
-
* @returns 'float'
|
|
1520
|
+
/**
|
|
1521
|
+
* Gets the output type
|
|
1522
|
+
*
|
|
1523
|
+
* @returns 'float'
|
|
1521
1524
|
*/ getType() {
|
|
1522
1525
|
return 'float';
|
|
1523
1526
|
}
|
|
1524
1527
|
}
|
|
1525
|
-
/**
|
|
1526
|
-
* Camera position input node
|
|
1527
|
-
*
|
|
1528
|
-
* @remarks
|
|
1529
|
-
* Provides the world-space position of the camera/viewer.
|
|
1530
|
-
* This is the location of the camera in the 3D scene coordinate system.
|
|
1531
|
-
*
|
|
1532
|
-
* Used for:
|
|
1533
|
-
* - View direction calculations
|
|
1534
|
-
* - Distance-based effects (distance fog, LOD)
|
|
1535
|
-
* - Reflections and refractions
|
|
1536
|
-
* - Fresnel effects
|
|
1537
|
-
* - Environment mapping
|
|
1538
|
-
* - Specular highlights
|
|
1539
|
-
*
|
|
1540
|
-
* Outputs:
|
|
1541
|
-
* - Output 1: Full camera position (vec3)
|
|
1542
|
-
* - Output 2: X coordinate (float)
|
|
1543
|
-
* - Output 3: Y coordinate (float)
|
|
1544
|
-
* - Output 4: Z coordinate (float)
|
|
1545
|
-
*
|
|
1546
|
-
* @example
|
|
1547
|
-
* ```typescript
|
|
1548
|
-
* const cameraPos = new CameraPositionNode();
|
|
1549
|
-
* const worldPos = new VertexPositionNode();
|
|
1550
|
-
*
|
|
1551
|
-
* // Calculate view direction
|
|
1552
|
-
* const viewDir = new CompSubNode();
|
|
1553
|
-
* viewDir.connectInput(1, cameraPos, 1);
|
|
1554
|
-
* viewDir.connectInput(2, worldPos, 1);
|
|
1555
|
-
*
|
|
1556
|
-
* const normalizedViewDir = new NormalizeNode();
|
|
1557
|
-
* normalizedViewDir.connectInput(1, viewDir, 1);
|
|
1558
|
-
*
|
|
1559
|
-
* // Calculate distance to camera
|
|
1560
|
-
* const distance = new DistanceNode();
|
|
1561
|
-
* distance.connectInput(1, cameraPos, 1);
|
|
1562
|
-
* distance.connectInput(2, worldPos, 1);
|
|
1563
|
-
* ```
|
|
1564
|
-
*
|
|
1565
|
-
* @public
|
|
1528
|
+
/**
|
|
1529
|
+
* Camera position input node
|
|
1530
|
+
*
|
|
1531
|
+
* @remarks
|
|
1532
|
+
* Provides the world-space position of the camera/viewer.
|
|
1533
|
+
* This is the location of the camera in the 3D scene coordinate system.
|
|
1534
|
+
*
|
|
1535
|
+
* Used for:
|
|
1536
|
+
* - View direction calculations
|
|
1537
|
+
* - Distance-based effects (distance fog, LOD)
|
|
1538
|
+
* - Reflections and refractions
|
|
1539
|
+
* - Fresnel effects
|
|
1540
|
+
* - Environment mapping
|
|
1541
|
+
* - Specular highlights
|
|
1542
|
+
*
|
|
1543
|
+
* Outputs:
|
|
1544
|
+
* - Output 1: Full camera position (vec3)
|
|
1545
|
+
* - Output 2: X coordinate (float)
|
|
1546
|
+
* - Output 3: Y coordinate (float)
|
|
1547
|
+
* - Output 4: Z coordinate (float)
|
|
1548
|
+
*
|
|
1549
|
+
* @example
|
|
1550
|
+
* ```typescript
|
|
1551
|
+
* const cameraPos = new CameraPositionNode();
|
|
1552
|
+
* const worldPos = new VertexPositionNode();
|
|
1553
|
+
*
|
|
1554
|
+
* // Calculate view direction
|
|
1555
|
+
* const viewDir = new CompSubNode();
|
|
1556
|
+
* viewDir.connectInput(1, cameraPos, 1);
|
|
1557
|
+
* viewDir.connectInput(2, worldPos, 1);
|
|
1558
|
+
*
|
|
1559
|
+
* const normalizedViewDir = new NormalizeNode();
|
|
1560
|
+
* normalizedViewDir.connectInput(1, viewDir, 1);
|
|
1561
|
+
*
|
|
1562
|
+
* // Calculate distance to camera
|
|
1563
|
+
* const distance = new DistanceNode();
|
|
1564
|
+
* distance.connectInput(1, cameraPos, 1);
|
|
1565
|
+
* distance.connectInput(2, worldPos, 1);
|
|
1566
|
+
* ```
|
|
1567
|
+
*
|
|
1568
|
+
* @public
|
|
1566
1569
|
*/ class CameraPositionNode extends BaseGraphNode {
|
|
1567
|
-
/**
|
|
1568
|
-
* Creates a new camera position node
|
|
1569
|
-
*
|
|
1570
|
-
* @remarks
|
|
1571
|
-
* Initializes with 4 output slots: full position and individual X, Y, Z components.
|
|
1570
|
+
/**
|
|
1571
|
+
* Creates a new camera position node
|
|
1572
|
+
*
|
|
1573
|
+
* @remarks
|
|
1574
|
+
* Initializes with 4 output slots: full position and individual X, Y, Z components.
|
|
1572
1575
|
*/ constructor(){
|
|
1573
1576
|
super();
|
|
1574
1577
|
this._outputs = [
|
|
@@ -1593,17 +1596,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1593
1596
|
}
|
|
1594
1597
|
];
|
|
1595
1598
|
}
|
|
1596
|
-
/**
|
|
1597
|
-
* Generates a string representation of this node
|
|
1598
|
-
*
|
|
1599
|
-
* @returns 'camera position'
|
|
1599
|
+
/**
|
|
1600
|
+
* Generates a string representation of this node
|
|
1601
|
+
*
|
|
1602
|
+
* @returns 'camera position'
|
|
1600
1603
|
*/ toString() {
|
|
1601
1604
|
return 'camera position';
|
|
1602
1605
|
}
|
|
1603
|
-
/**
|
|
1604
|
-
* Gets the serialization descriptor for this node type
|
|
1605
|
-
*
|
|
1606
|
-
* @returns Serialization class descriptor
|
|
1606
|
+
/**
|
|
1607
|
+
* Gets the serialization descriptor for this node type
|
|
1608
|
+
*
|
|
1609
|
+
* @returns Serialization class descriptor
|
|
1607
1610
|
*/ static getSerializationCls() {
|
|
1608
1611
|
return {
|
|
1609
1612
|
ctor: CameraPositionNode,
|
|
@@ -1613,44 +1616,44 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1613
1616
|
}
|
|
1614
1617
|
};
|
|
1615
1618
|
}
|
|
1616
|
-
/**
|
|
1617
|
-
* Validates the node state
|
|
1618
|
-
*
|
|
1619
|
-
* @returns Empty string (always valid)
|
|
1620
|
-
*
|
|
1621
|
-
* @remarks
|
|
1622
|
-
* Camera position nodes are always valid as they have no inputs.
|
|
1619
|
+
/**
|
|
1620
|
+
* Validates the node state
|
|
1621
|
+
*
|
|
1622
|
+
* @returns Empty string (always valid)
|
|
1623
|
+
*
|
|
1624
|
+
* @remarks
|
|
1625
|
+
* Camera position nodes are always valid as they have no inputs.
|
|
1623
1626
|
*/ validate() {
|
|
1624
1627
|
return '';
|
|
1625
1628
|
}
|
|
1626
|
-
/**
|
|
1627
|
-
* Gets the output type for a specific output slot
|
|
1628
|
-
*
|
|
1629
|
-
* @param id - The output slot ID
|
|
1630
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full position
|
|
1629
|
+
/**
|
|
1630
|
+
* Gets the output type for a specific output slot
|
|
1631
|
+
*
|
|
1632
|
+
* @param id - The output slot ID
|
|
1633
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full position
|
|
1631
1634
|
*/ getType(id) {
|
|
1632
1635
|
return id > 1 ? 'float' : 'vec3';
|
|
1633
1636
|
}
|
|
1634
1637
|
}
|
|
1635
|
-
/**
|
|
1636
|
-
* Camera vector input node
|
|
1637
|
-
*
|
|
1638
|
-
* @remarks
|
|
1639
|
-
* Provides the world-space direction from current surface point to camera.
|
|
1640
|
-
*
|
|
1641
|
-
* Outputs:
|
|
1642
|
-
* - Output 1: Full vector (vec3, normalized)
|
|
1643
|
-
* - Output 2: X component (float)
|
|
1644
|
-
* - Output 3: Y component (float)
|
|
1645
|
-
* - Output 4: Z component (float)
|
|
1646
|
-
*
|
|
1647
|
-
* @public
|
|
1638
|
+
/**
|
|
1639
|
+
* Camera vector input node
|
|
1640
|
+
*
|
|
1641
|
+
* @remarks
|
|
1642
|
+
* Provides the world-space direction from current surface point to camera.
|
|
1643
|
+
*
|
|
1644
|
+
* Outputs:
|
|
1645
|
+
* - Output 1: Full vector (vec3, normalized)
|
|
1646
|
+
* - Output 2: X component (float)
|
|
1647
|
+
* - Output 3: Y component (float)
|
|
1648
|
+
* - Output 4: Z component (float)
|
|
1649
|
+
*
|
|
1650
|
+
* @public
|
|
1648
1651
|
*/ class CameraVectorNode extends BaseGraphNode {
|
|
1649
|
-
/**
|
|
1650
|
-
* Creates a new camera vector node
|
|
1651
|
-
*
|
|
1652
|
-
* @remarks
|
|
1653
|
-
* Initializes with 4 output slots: full vector and individual X, Y, Z components.
|
|
1652
|
+
/**
|
|
1653
|
+
* Creates a new camera vector node
|
|
1654
|
+
*
|
|
1655
|
+
* @remarks
|
|
1656
|
+
* Initializes with 4 output slots: full vector and individual X, Y, Z components.
|
|
1654
1657
|
*/ constructor(){
|
|
1655
1658
|
super();
|
|
1656
1659
|
this._outputs = [
|
|
@@ -1675,17 +1678,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1675
1678
|
}
|
|
1676
1679
|
];
|
|
1677
1680
|
}
|
|
1678
|
-
/**
|
|
1679
|
-
* Generates a string representation of this node
|
|
1680
|
-
*
|
|
1681
|
-
* @returns 'camera vector'
|
|
1681
|
+
/**
|
|
1682
|
+
* Generates a string representation of this node
|
|
1683
|
+
*
|
|
1684
|
+
* @returns 'camera vector'
|
|
1682
1685
|
*/ toString() {
|
|
1683
1686
|
return 'camera vector';
|
|
1684
1687
|
}
|
|
1685
|
-
/**
|
|
1686
|
-
* Gets the serialization descriptor for this node type
|
|
1687
|
-
*
|
|
1688
|
-
* @returns Serialization class descriptor
|
|
1688
|
+
/**
|
|
1689
|
+
* Gets the serialization descriptor for this node type
|
|
1690
|
+
*
|
|
1691
|
+
* @returns Serialization class descriptor
|
|
1689
1692
|
*/ static getSerializationCls() {
|
|
1690
1693
|
return {
|
|
1691
1694
|
ctor: CameraVectorNode,
|
|
@@ -1695,63 +1698,63 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1695
1698
|
}
|
|
1696
1699
|
};
|
|
1697
1700
|
}
|
|
1698
|
-
/**
|
|
1699
|
-
* Validates the node state
|
|
1700
|
-
*
|
|
1701
|
-
* @returns Empty string (always valid)
|
|
1701
|
+
/**
|
|
1702
|
+
* Validates the node state
|
|
1703
|
+
*
|
|
1704
|
+
* @returns Empty string (always valid)
|
|
1702
1705
|
*/ validate() {
|
|
1703
1706
|
return '';
|
|
1704
1707
|
}
|
|
1705
|
-
/**
|
|
1706
|
-
* Gets the output type for a specific output slot
|
|
1707
|
-
*
|
|
1708
|
-
* @param id - The output slot ID
|
|
1709
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full vector
|
|
1708
|
+
/**
|
|
1709
|
+
* Gets the output type for a specific output slot
|
|
1710
|
+
*
|
|
1711
|
+
* @param id - The output slot ID
|
|
1712
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec3' for full vector
|
|
1710
1713
|
*/ getType(id) {
|
|
1711
1714
|
return id > 1 ? 'float' : 'vec3';
|
|
1712
1715
|
}
|
|
1713
1716
|
}
|
|
1714
|
-
/**
|
|
1715
|
-
* Sky environment texture input node
|
|
1716
|
-
*
|
|
1717
|
-
* @remarks
|
|
1718
|
-
* Provides access to the scene's sky/environment cubemap texture.
|
|
1719
|
-
* This is typically used for skybox rendering, environment reflections,
|
|
1720
|
-
* and image-based lighting (IBL).
|
|
1721
|
-
*
|
|
1722
|
-
* The texture is a cubemap (texCube) that can be sampled using a 3D direction vector.
|
|
1723
|
-
*
|
|
1724
|
-
* Used for:
|
|
1725
|
-
* - Skybox rendering
|
|
1726
|
-
* - Environment reflections on metallic surfaces
|
|
1727
|
-
* - Image-based lighting (IBL)
|
|
1728
|
-
* - Ambient lighting from environment
|
|
1729
|
-
* - Reflections and refractions
|
|
1730
|
-
*
|
|
1731
|
-
* Output:
|
|
1732
|
-
* - Output 1: Cubemap texture sampler (texCube)
|
|
1733
|
-
*
|
|
1734
|
-
* @example
|
|
1735
|
-
* ```typescript
|
|
1736
|
-
* const skyTexture = new SkyEnvTextureNode();
|
|
1737
|
-
* const reflectionDir = new ReflectNode();
|
|
1738
|
-
*
|
|
1739
|
-
* // Sample environment for reflection
|
|
1740
|
-
* const envSample = new TextureSampleCubeNode();
|
|
1741
|
-
* envSample.connectInput(1, skyTexture, 1);
|
|
1742
|
-
* envSample.connectInput(2, reflectionDir, 1);
|
|
1743
|
-
*
|
|
1744
|
-
* // Use for metallic reflections
|
|
1745
|
-
* metalColor.connectInput(1, envSample, 1);
|
|
1746
|
-
* ```
|
|
1747
|
-
*
|
|
1748
|
-
* @public
|
|
1717
|
+
/**
|
|
1718
|
+
* Sky environment texture input node
|
|
1719
|
+
*
|
|
1720
|
+
* @remarks
|
|
1721
|
+
* Provides access to the scene's sky/environment cubemap texture.
|
|
1722
|
+
* This is typically used for skybox rendering, environment reflections,
|
|
1723
|
+
* and image-based lighting (IBL).
|
|
1724
|
+
*
|
|
1725
|
+
* The texture is a cubemap (texCube) that can be sampled using a 3D direction vector.
|
|
1726
|
+
*
|
|
1727
|
+
* Used for:
|
|
1728
|
+
* - Skybox rendering
|
|
1729
|
+
* - Environment reflections on metallic surfaces
|
|
1730
|
+
* - Image-based lighting (IBL)
|
|
1731
|
+
* - Ambient lighting from environment
|
|
1732
|
+
* - Reflections and refractions
|
|
1733
|
+
*
|
|
1734
|
+
* Output:
|
|
1735
|
+
* - Output 1: Cubemap texture sampler (texCube)
|
|
1736
|
+
*
|
|
1737
|
+
* @example
|
|
1738
|
+
* ```typescript
|
|
1739
|
+
* const skyTexture = new SkyEnvTextureNode();
|
|
1740
|
+
* const reflectionDir = new ReflectNode();
|
|
1741
|
+
*
|
|
1742
|
+
* // Sample environment for reflection
|
|
1743
|
+
* const envSample = new TextureSampleCubeNode();
|
|
1744
|
+
* envSample.connectInput(1, skyTexture, 1);
|
|
1745
|
+
* envSample.connectInput(2, reflectionDir, 1);
|
|
1746
|
+
*
|
|
1747
|
+
* // Use for metallic reflections
|
|
1748
|
+
* metalColor.connectInput(1, envSample, 1);
|
|
1749
|
+
* ```
|
|
1750
|
+
*
|
|
1751
|
+
* @public
|
|
1749
1752
|
*/ class SkyEnvTextureNode extends BaseGraphNode {
|
|
1750
|
-
/**
|
|
1751
|
-
* Creates a new sky environment texture node
|
|
1752
|
-
*
|
|
1753
|
-
* @remarks
|
|
1754
|
-
* Initializes with one output slot for the cubemap sampler.
|
|
1753
|
+
/**
|
|
1754
|
+
* Creates a new sky environment texture node
|
|
1755
|
+
*
|
|
1756
|
+
* @remarks
|
|
1757
|
+
* Initializes with one output slot for the cubemap sampler.
|
|
1755
1758
|
*/ constructor(){
|
|
1756
1759
|
super();
|
|
1757
1760
|
this._outputs = [
|
|
@@ -1761,17 +1764,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1761
1764
|
}
|
|
1762
1765
|
];
|
|
1763
1766
|
}
|
|
1764
|
-
/**
|
|
1765
|
-
* Generates a string representation of this node
|
|
1766
|
-
*
|
|
1767
|
-
* @returns 'SkyEnvTexture'
|
|
1767
|
+
/**
|
|
1768
|
+
* Generates a string representation of this node
|
|
1769
|
+
*
|
|
1770
|
+
* @returns 'SkyEnvTexture'
|
|
1768
1771
|
*/ toString() {
|
|
1769
1772
|
return 'SkyEnvTexture';
|
|
1770
1773
|
}
|
|
1771
|
-
/**
|
|
1772
|
-
* Gets the serialization descriptor for this node type
|
|
1773
|
-
*
|
|
1774
|
-
* @returns Serialization class descriptor
|
|
1774
|
+
/**
|
|
1775
|
+
* Gets the serialization descriptor for this node type
|
|
1776
|
+
*
|
|
1777
|
+
* @returns Serialization class descriptor
|
|
1775
1778
|
*/ static getSerializationCls() {
|
|
1776
1779
|
return {
|
|
1777
1780
|
ctor: SkyEnvTextureNode,
|
|
@@ -1781,68 +1784,68 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1781
1784
|
}
|
|
1782
1785
|
};
|
|
1783
1786
|
}
|
|
1784
|
-
/**
|
|
1785
|
-
* Validates the node state
|
|
1786
|
-
*
|
|
1787
|
-
* @returns Empty string (always valid)
|
|
1788
|
-
*
|
|
1789
|
-
* @remarks
|
|
1790
|
-
* Sky environment texture nodes are always valid as they have no inputs.
|
|
1787
|
+
/**
|
|
1788
|
+
* Validates the node state
|
|
1789
|
+
*
|
|
1790
|
+
* @returns Empty string (always valid)
|
|
1791
|
+
*
|
|
1792
|
+
* @remarks
|
|
1793
|
+
* Sky environment texture nodes are always valid as they have no inputs.
|
|
1791
1794
|
*/ validate() {
|
|
1792
1795
|
return '';
|
|
1793
1796
|
}
|
|
1794
|
-
/**
|
|
1795
|
-
* Gets the output type
|
|
1796
|
-
*
|
|
1797
|
-
* @returns 'texCube' (cubemap texture sampler)
|
|
1797
|
+
/**
|
|
1798
|
+
* Gets the output type
|
|
1799
|
+
*
|
|
1800
|
+
* @returns 'texCube' (cubemap texture sampler)
|
|
1798
1801
|
*/ getType() {
|
|
1799
1802
|
return 'texCube';
|
|
1800
1803
|
}
|
|
1801
1804
|
}
|
|
1802
|
-
/**
|
|
1803
|
-
* Camera near/far plane input node
|
|
1804
|
-
*
|
|
1805
|
-
* @remarks
|
|
1806
|
-
* Provides the camera's near and far clipping plane distances.
|
|
1807
|
-
* These values define the camera's visible depth range:
|
|
1808
|
-
* - Near plane: The closest distance at which objects are rendered
|
|
1809
|
-
* - Far plane: The farthest distance at which objects are rendered
|
|
1810
|
-
*
|
|
1811
|
-
* Used for:
|
|
1812
|
-
* - Depth linearization (converting from NDC depth to linear depth)
|
|
1813
|
-
* - Fog calculations based on depth
|
|
1814
|
-
* - Custom depth-of-field effects
|
|
1815
|
-
* - Z-buffer precision calculations
|
|
1816
|
-
* - Distance-based effects
|
|
1817
|
-
*
|
|
1818
|
-
* Outputs:
|
|
1819
|
-
* - Output 1: Both values as vec2 (x = near, y = far)
|
|
1820
|
-
* - Output 2: Near plane distance (float)
|
|
1821
|
-
* - Output 3: Far plane distance (float)
|
|
1822
|
-
*
|
|
1823
|
-
* @example
|
|
1824
|
-
* ```typescript
|
|
1825
|
-
* const nearFar = new CameraNearFarNode();
|
|
1826
|
-
* const depth = new DepthNode();
|
|
1827
|
-
*
|
|
1828
|
-
* // Linearize depth buffer value
|
|
1829
|
-
* // linearDepth = (2.0 * near) / (far + near - depth * (far - near))
|
|
1830
|
-
* const farMinusNear = new CompSubNode();
|
|
1831
|
-
* farMinusNear.connectInput(1, nearFar, 3); // far
|
|
1832
|
-
* farMinusNear.connectInput(2, nearFar, 2); // near
|
|
1833
|
-
*
|
|
1834
|
-
* // Use for distance fog
|
|
1835
|
-
* const fogFactor = new SaturateNode();
|
|
1836
|
-
* fogFactor.connectInput(1, linearDepthCalc, 1);
|
|
1837
|
-
* ```
|
|
1838
|
-
*
|
|
1839
|
-
* @public
|
|
1805
|
+
/**
|
|
1806
|
+
* Camera near/far plane input node
|
|
1807
|
+
*
|
|
1808
|
+
* @remarks
|
|
1809
|
+
* Provides the camera's near and far clipping plane distances.
|
|
1810
|
+
* These values define the camera's visible depth range:
|
|
1811
|
+
* - Near plane: The closest distance at which objects are rendered
|
|
1812
|
+
* - Far plane: The farthest distance at which objects are rendered
|
|
1813
|
+
*
|
|
1814
|
+
* Used for:
|
|
1815
|
+
* - Depth linearization (converting from NDC depth to linear depth)
|
|
1816
|
+
* - Fog calculations based on depth
|
|
1817
|
+
* - Custom depth-of-field effects
|
|
1818
|
+
* - Z-buffer precision calculations
|
|
1819
|
+
* - Distance-based effects
|
|
1820
|
+
*
|
|
1821
|
+
* Outputs:
|
|
1822
|
+
* - Output 1: Both values as vec2 (x = near, y = far)
|
|
1823
|
+
* - Output 2: Near plane distance (float)
|
|
1824
|
+
* - Output 3: Far plane distance (float)
|
|
1825
|
+
*
|
|
1826
|
+
* @example
|
|
1827
|
+
* ```typescript
|
|
1828
|
+
* const nearFar = new CameraNearFarNode();
|
|
1829
|
+
* const depth = new DepthNode();
|
|
1830
|
+
*
|
|
1831
|
+
* // Linearize depth buffer value
|
|
1832
|
+
* // linearDepth = (2.0 * near) / (far + near - depth * (far - near))
|
|
1833
|
+
* const farMinusNear = new CompSubNode();
|
|
1834
|
+
* farMinusNear.connectInput(1, nearFar, 3); // far
|
|
1835
|
+
* farMinusNear.connectInput(2, nearFar, 2); // near
|
|
1836
|
+
*
|
|
1837
|
+
* // Use for distance fog
|
|
1838
|
+
* const fogFactor = new SaturateNode();
|
|
1839
|
+
* fogFactor.connectInput(1, linearDepthCalc, 1);
|
|
1840
|
+
* ```
|
|
1841
|
+
*
|
|
1842
|
+
* @public
|
|
1840
1843
|
*/ class CameraNearFarNode extends BaseGraphNode {
|
|
1841
|
-
/**
|
|
1842
|
-
* Creates a new camera near/far node
|
|
1843
|
-
*
|
|
1844
|
-
* @remarks
|
|
1845
|
-
* Initializes with 3 output slots: combined vec2 and individual near/far values.
|
|
1844
|
+
/**
|
|
1845
|
+
* Creates a new camera near/far node
|
|
1846
|
+
*
|
|
1847
|
+
* @remarks
|
|
1848
|
+
* Initializes with 3 output slots: combined vec2 and individual near/far values.
|
|
1846
1849
|
*/ constructor(){
|
|
1847
1850
|
super();
|
|
1848
1851
|
this._outputs = [
|
|
@@ -1862,17 +1865,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1862
1865
|
}
|
|
1863
1866
|
];
|
|
1864
1867
|
}
|
|
1865
|
-
/**
|
|
1866
|
-
* Generates a string representation of this node
|
|
1867
|
-
*
|
|
1868
|
-
* @returns 'camera near far'
|
|
1868
|
+
/**
|
|
1869
|
+
* Generates a string representation of this node
|
|
1870
|
+
*
|
|
1871
|
+
* @returns 'camera near far'
|
|
1869
1872
|
*/ toString() {
|
|
1870
1873
|
return 'camera near far';
|
|
1871
1874
|
}
|
|
1872
|
-
/**
|
|
1873
|
-
* Gets the serialization descriptor for this node type
|
|
1874
|
-
*
|
|
1875
|
-
* @returns Serialization class descriptor
|
|
1875
|
+
/**
|
|
1876
|
+
* Gets the serialization descriptor for this node type
|
|
1877
|
+
*
|
|
1878
|
+
* @returns Serialization class descriptor
|
|
1876
1879
|
*/ static getSerializationCls() {
|
|
1877
1880
|
return {
|
|
1878
1881
|
ctor: CameraNearFarNode,
|
|
@@ -1882,35 +1885,35 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1882
1885
|
}
|
|
1883
1886
|
};
|
|
1884
1887
|
}
|
|
1885
|
-
/**
|
|
1886
|
-
* Validates the node state
|
|
1887
|
-
*
|
|
1888
|
-
* @returns Empty string (always valid)
|
|
1889
|
-
*
|
|
1890
|
-
* @remarks
|
|
1891
|
-
* Camera near/far nodes are always valid as they have no inputs.
|
|
1888
|
+
/**
|
|
1889
|
+
* Validates the node state
|
|
1890
|
+
*
|
|
1891
|
+
* @returns Empty string (always valid)
|
|
1892
|
+
*
|
|
1893
|
+
* @remarks
|
|
1894
|
+
* Camera near/far nodes are always valid as they have no inputs.
|
|
1892
1895
|
*/ validate() {
|
|
1893
1896
|
return '';
|
|
1894
1897
|
}
|
|
1895
|
-
/**
|
|
1896
|
-
* Gets the output type for a specific output slot
|
|
1897
|
-
*
|
|
1898
|
-
* @param id - The output slot ID
|
|
1899
|
-
* @returns 'float' for individual component outputs (id \> 1), 'vec2' for combined output
|
|
1898
|
+
/**
|
|
1899
|
+
* Gets the output type for a specific output slot
|
|
1900
|
+
*
|
|
1901
|
+
* @param id - The output slot ID
|
|
1902
|
+
* @returns 'float' for individual component outputs (id \> 1), 'vec2' for combined output
|
|
1900
1903
|
*/ getType(id) {
|
|
1901
1904
|
return id > 1 ? 'float' : 'vec2';
|
|
1902
1905
|
}
|
|
1903
1906
|
}
|
|
1904
|
-
/**
|
|
1905
|
-
* Vertex position resolver node
|
|
1906
|
-
*
|
|
1907
|
-
* @remarks
|
|
1908
|
-
* Provides the resolved vertex position in object space (After applying skinning and morphing)
|
|
1909
|
-
*
|
|
1910
|
-
* @public
|
|
1907
|
+
/**
|
|
1908
|
+
* Vertex position resolver node
|
|
1909
|
+
*
|
|
1910
|
+
* @remarks
|
|
1911
|
+
* Provides the resolved vertex position in object space (After applying skinning and morphing)
|
|
1912
|
+
*
|
|
1913
|
+
* @public
|
|
1911
1914
|
*/ class ResolveVertexPositionNode extends BaseGraphNode {
|
|
1912
|
-
/**
|
|
1913
|
-
* Creates a new vertex position resolver node
|
|
1915
|
+
/**
|
|
1916
|
+
* Creates a new vertex position resolver node
|
|
1914
1917
|
*/ constructor(){
|
|
1915
1918
|
super();
|
|
1916
1919
|
this._outputs = [
|
|
@@ -1920,17 +1923,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1920
1923
|
}
|
|
1921
1924
|
];
|
|
1922
1925
|
}
|
|
1923
|
-
/**
|
|
1924
|
-
* Generates a string representation of this node
|
|
1925
|
-
*
|
|
1926
|
-
* @returns 'vertex position resolved'
|
|
1926
|
+
/**
|
|
1927
|
+
* Generates a string representation of this node
|
|
1928
|
+
*
|
|
1929
|
+
* @returns 'vertex position resolved'
|
|
1927
1930
|
*/ toString() {
|
|
1928
1931
|
return 'vertex position resolved';
|
|
1929
1932
|
}
|
|
1930
|
-
/**
|
|
1931
|
-
* Gets the serialization descriptor for this node type
|
|
1932
|
-
*
|
|
1933
|
-
* @returns Serialization class descriptor
|
|
1933
|
+
/**
|
|
1934
|
+
* Gets the serialization descriptor for this node type
|
|
1935
|
+
*
|
|
1936
|
+
* @returns Serialization class descriptor
|
|
1934
1937
|
*/ static getSerializationCls() {
|
|
1935
1938
|
return {
|
|
1936
1939
|
ctor: ResolveVertexPositionNode,
|
|
@@ -1940,34 +1943,34 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1940
1943
|
}
|
|
1941
1944
|
};
|
|
1942
1945
|
}
|
|
1943
|
-
/**
|
|
1944
|
-
* Validates the node state
|
|
1945
|
-
*
|
|
1946
|
-
* @returns Empty string (always valid)
|
|
1947
|
-
*
|
|
1948
|
-
* @remarks
|
|
1949
|
-
* Vertex position resolver nodes are always valid as they have no inputs.
|
|
1946
|
+
/**
|
|
1947
|
+
* Validates the node state
|
|
1948
|
+
*
|
|
1949
|
+
* @returns Empty string (always valid)
|
|
1950
|
+
*
|
|
1951
|
+
* @remarks
|
|
1952
|
+
* Vertex position resolver nodes are always valid as they have no inputs.
|
|
1950
1953
|
*/ validate() {
|
|
1951
1954
|
return '';
|
|
1952
1955
|
}
|
|
1953
|
-
/**
|
|
1954
|
-
* Gets the output type for a specific output slot
|
|
1955
|
-
*
|
|
1956
|
-
* @returns vec3
|
|
1956
|
+
/**
|
|
1957
|
+
* Gets the output type for a specific output slot
|
|
1958
|
+
*
|
|
1959
|
+
* @returns vec3
|
|
1957
1960
|
*/ getType() {
|
|
1958
1961
|
return 'vec3';
|
|
1959
1962
|
}
|
|
1960
1963
|
}
|
|
1961
|
-
/**
|
|
1962
|
-
* Vertex normal resolver node
|
|
1963
|
-
*
|
|
1964
|
-
* @remarks
|
|
1965
|
-
* Provides the resolved vertex normal in object space (After applying skinning and morphing)
|
|
1966
|
-
*
|
|
1967
|
-
* @public
|
|
1964
|
+
/**
|
|
1965
|
+
* Vertex normal resolver node
|
|
1966
|
+
*
|
|
1967
|
+
* @remarks
|
|
1968
|
+
* Provides the resolved vertex normal in object space (After applying skinning and morphing)
|
|
1969
|
+
*
|
|
1970
|
+
* @public
|
|
1968
1971
|
*/ class ResolveVertexNormalNode extends BaseGraphNode {
|
|
1969
|
-
/**
|
|
1970
|
-
* Creates a new vertex normal resolver node
|
|
1972
|
+
/**
|
|
1973
|
+
* Creates a new vertex normal resolver node
|
|
1971
1974
|
*/ constructor(){
|
|
1972
1975
|
super();
|
|
1973
1976
|
this._outputs = [
|
|
@@ -1977,17 +1980,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1977
1980
|
}
|
|
1978
1981
|
];
|
|
1979
1982
|
}
|
|
1980
|
-
/**
|
|
1981
|
-
* Generates a string representation of this node
|
|
1982
|
-
*
|
|
1983
|
-
* @returns 'vertex normal resolved'
|
|
1983
|
+
/**
|
|
1984
|
+
* Generates a string representation of this node
|
|
1985
|
+
*
|
|
1986
|
+
* @returns 'vertex normal resolved'
|
|
1984
1987
|
*/ toString() {
|
|
1985
1988
|
return 'vertex normal resolved';
|
|
1986
1989
|
}
|
|
1987
|
-
/**
|
|
1988
|
-
* Gets the serialization descriptor for this node type
|
|
1989
|
-
*
|
|
1990
|
-
* @returns Serialization class descriptor
|
|
1990
|
+
/**
|
|
1991
|
+
* Gets the serialization descriptor for this node type
|
|
1992
|
+
*
|
|
1993
|
+
* @returns Serialization class descriptor
|
|
1991
1994
|
*/ static getSerializationCls() {
|
|
1992
1995
|
return {
|
|
1993
1996
|
ctor: ResolveVertexNormalNode,
|
|
@@ -1997,34 +2000,34 @@ import { BaseGraphNode } from '../node.js';
|
|
|
1997
2000
|
}
|
|
1998
2001
|
};
|
|
1999
2002
|
}
|
|
2000
|
-
/**
|
|
2001
|
-
* Validates the node state
|
|
2002
|
-
*
|
|
2003
|
-
* @returns Empty string (always valid)
|
|
2004
|
-
*
|
|
2005
|
-
* @remarks
|
|
2006
|
-
* Vertex normal resolve node are always valid as they have no inputs.
|
|
2003
|
+
/**
|
|
2004
|
+
* Validates the node state
|
|
2005
|
+
*
|
|
2006
|
+
* @returns Empty string (always valid)
|
|
2007
|
+
*
|
|
2008
|
+
* @remarks
|
|
2009
|
+
* Vertex normal resolve node are always valid as they have no inputs.
|
|
2007
2010
|
*/ validate() {
|
|
2008
2011
|
return '';
|
|
2009
2012
|
}
|
|
2010
|
-
/**
|
|
2011
|
-
* Gets the output type for a specific output slot
|
|
2012
|
-
*
|
|
2013
|
-
* @returns vec3
|
|
2013
|
+
/**
|
|
2014
|
+
* Gets the output type for a specific output slot
|
|
2015
|
+
*
|
|
2016
|
+
* @returns vec3
|
|
2014
2017
|
*/ getType() {
|
|
2015
2018
|
return 'vec3';
|
|
2016
2019
|
}
|
|
2017
2020
|
}
|
|
2018
|
-
/**
|
|
2019
|
-
* Vertex tangent resolver node
|
|
2020
|
-
*
|
|
2021
|
-
* @remarks
|
|
2022
|
-
* Provides the resolved vertex tangent in object space (After applying skinning and morphing)
|
|
2023
|
-
*
|
|
2024
|
-
* @public
|
|
2021
|
+
/**
|
|
2022
|
+
* Vertex tangent resolver node
|
|
2023
|
+
*
|
|
2024
|
+
* @remarks
|
|
2025
|
+
* Provides the resolved vertex tangent in object space (After applying skinning and morphing)
|
|
2026
|
+
*
|
|
2027
|
+
* @public
|
|
2025
2028
|
*/ class ResolveVertexTangentNode extends BaseGraphNode {
|
|
2026
|
-
/**
|
|
2027
|
-
* Creates a new vertex tangent resolver node
|
|
2029
|
+
/**
|
|
2030
|
+
* Creates a new vertex tangent resolver node
|
|
2028
2031
|
*/ constructor(){
|
|
2029
2032
|
super();
|
|
2030
2033
|
this._outputs = [
|
|
@@ -2034,17 +2037,17 @@ import { BaseGraphNode } from '../node.js';
|
|
|
2034
2037
|
}
|
|
2035
2038
|
];
|
|
2036
2039
|
}
|
|
2037
|
-
/**
|
|
2038
|
-
* Generates a string representation of this node
|
|
2039
|
-
*
|
|
2040
|
-
* @returns 'vertex tangent resolved'
|
|
2040
|
+
/**
|
|
2041
|
+
* Generates a string representation of this node
|
|
2042
|
+
*
|
|
2043
|
+
* @returns 'vertex tangent resolved'
|
|
2041
2044
|
*/ toString() {
|
|
2042
2045
|
return 'vertex tangent resolved';
|
|
2043
2046
|
}
|
|
2044
|
-
/**
|
|
2045
|
-
* Gets the serialization descriptor for this node type
|
|
2046
|
-
*
|
|
2047
|
-
* @returns Serialization class descriptor
|
|
2047
|
+
/**
|
|
2048
|
+
* Gets the serialization descriptor for this node type
|
|
2049
|
+
*
|
|
2050
|
+
* @returns Serialization class descriptor
|
|
2048
2051
|
*/ static getSerializationCls() {
|
|
2049
2052
|
return {
|
|
2050
2053
|
ctor: ResolveVertexTangentNode,
|
|
@@ -2054,20 +2057,20 @@ import { BaseGraphNode } from '../node.js';
|
|
|
2054
2057
|
}
|
|
2055
2058
|
};
|
|
2056
2059
|
}
|
|
2057
|
-
/**
|
|
2058
|
-
* Validates the node state
|
|
2059
|
-
*
|
|
2060
|
-
* @returns Empty string (always valid)
|
|
2061
|
-
*
|
|
2062
|
-
* @remarks
|
|
2063
|
-
* Vertex tangent resolve node are always valid as they have no inputs.
|
|
2060
|
+
/**
|
|
2061
|
+
* Validates the node state
|
|
2062
|
+
*
|
|
2063
|
+
* @returns Empty string (always valid)
|
|
2064
|
+
*
|
|
2065
|
+
* @remarks
|
|
2066
|
+
* Vertex tangent resolve node are always valid as they have no inputs.
|
|
2064
2067
|
*/ validate() {
|
|
2065
2068
|
return '';
|
|
2066
2069
|
}
|
|
2067
|
-
/**
|
|
2068
|
-
* Gets the output type for a specific output slot
|
|
2069
|
-
*
|
|
2070
|
-
* @returns vec4
|
|
2070
|
+
/**
|
|
2071
|
+
* Gets the output type for a specific output slot
|
|
2072
|
+
*
|
|
2073
|
+
* @returns vec4
|
|
2071
2074
|
*/ getType() {
|
|
2072
2075
|
return 'vec4';
|
|
2073
2076
|
}
|