@zephyr3d/scene 0.9.3 → 0.9.4

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