@@ -426,7 +426,7 @@ index 6cffa933..5d5cc161 100644
426
426
427
427
addNodeClass('FunctionNode', FunctionNode);
428
428
diff --git a/src-testing/src/nodes/core/ContextNode.ts b/src-testing/src/nodes/core/ContextNode.ts
429
- index fcd488eb..84e3c972 100644
429
+ index 674f1cda..cfb748a8 100644
430
430
--- a/src-testing/src/nodes/core/ContextNode.ts
431
431
+++ b/src-testing/src/nodes/core/ContextNode.ts
432
432
@@ -1,8 +1,14 @@
@@ -436,19 +436,19 @@ index fcd488eb..84e3c972 100644
436
436
+ import NodeBuilder from './NodeBuilder.js';
437
437
438
438
- class ContextNode extends Node {
439
- - constructor(node, context = {}) {
439
+ - constructor(node, value = {}) {
440
440
+ class ContextNode<TContext> extends Node {
441
441
+ readonly isContextNode: true;
442
442
+
443
443
+ node: Node;
444
- + context : TContext;
444
+ + value : TContext;
445
445
+
446
- + constructor(node: Node, context : TContext = {} as TContext) {
446
+ + constructor(node: Node, value : TContext = {} as TContext) {
447
447
super();
448
448
449
449
this.isContextNode = true;
450
450
@@ -11,15 +17,15 @@ class ContextNode extends Node {
451
- this.context = context ;
451
+ this.value = value ;
452
452
}
453
453
454
454
- getNodeType(builder) {
@@ -465,7 +465,7 @@ index fcd488eb..84e3c972 100644
465
465
+ setup(builder: NodeBuilder) {
466
466
const previousContext = builder.getContext();
467
467
468
- builder.setContext({ ...builder.context, ...this.context });
468
+ builder.setContext({ ...builder.context, ...this.value });
469
469
@@ -31,7 +37,7 @@ class ContextNode extends Node {
470
470
return node;
471
471
}
@@ -474,7 +474,7 @@ index fcd488eb..84e3c972 100644
474
474
+ generate(builder: NodeBuilder, output?: string | null) {
475
475
const previousContext = builder.getContext();
476
476
477
- builder.setContext({ ...builder.context, ...this.context });
477
+ builder.setContext({ ...builder.context, ...this.value });
478
478
@@ -47,7 +53,7 @@ class ContextNode extends Node {
479
479
export default ContextNode;
480
480
@@ -2518,10 +2518,10 @@ index 9417df5a..43761555 100644
2518
2518
2519
2519
const getViewZ = builder.context.getViewZ;
2520
2520
diff --git a/src-testing/src/nodes/lighting/LightingContextNode.ts b/src-testing/src/nodes/lighting/LightingContextNode.ts
2521
- index 02a8b51f..1d11c859 100644
2521
+ index a6262f9a..22657e2e 100644
2522
2522
--- a/src-testing/src/nodes/lighting/LightingContextNode.ts
2523
2523
+++ b/src-testing/src/nodes/lighting/LightingContextNode.ts
2524
- @@ -1,9 +1,31 @@
2524
+ @@ -1,9 +1,30 @@
2525
2525
import ContextNode from '../core/ContextNode.js';
2526
2526
- import { addNodeClass } from '../core/Node.js';
2527
2527
- import { addNodeElement, nodeProxy, float, vec3 } from '../shadernode/ShaderNode.js';
@@ -2547,17 +2547,16 @@ index 02a8b51f..1d11c859 100644
2547
2547
+ }
2548
2548
+
2549
2549
+ class LightingContextNode extends ContextNode<LightingContext> {
2550
- + // lightingModel;
2551
2550
+ backdropNode: Node | null;
2552
2551
+ backdropAlphaNode: Node | null;
2553
2552
+
2554
- + _context : LightingContext | null;
2553
+ + _value : LightingContext | null;
2555
2554
+
2556
2555
+ constructor(node: Node, lightingModel = null, backdropNode = null, backdropAlphaNode = null) {
2557
2556
super(node);
2558
2557
2559
2558
this.lightingModel = lightingModel;
2560
- @@ -28,7 +50 ,7 @@ class LightingContextNode extends ContextNode {
2559
+ @@ -28,7 +49 ,7 @@ class LightingContextNode extends ContextNode {
2561
2560
indirectSpecular,
2562
2561
};
2563
2562
@@ -2566,14 +2565,14 @@ index 02a8b51f..1d11c859 100644
2566
2565
radiance: vec3().temp('radiance'),
2567
2566
irradiance: vec3().temp('irradiance'),
2568
2567
iblIrradiance: vec3().temp('iblIrradiance'),
2569
- @@ -41,7 +63 ,7 @@ class LightingContextNode extends ContextNode {
2568
+ @@ -41,7 +62 ,7 @@ class LightingContextNode extends ContextNode {
2570
2569
return context;
2571
2570
}
2572
2571
2573
2572
- setup(builder) {
2574
2573
+ setup(builder: NodeBuilder) {
2575
- this.context = this._context || (this._context = this.getContext());
2576
- this.context .lightingModel = this.lightingModel || builder.context.lightingModel;
2574
+ this.value = this._value || (this._value = this.getContext());
2575
+ this.value .lightingModel = this.lightingModel || builder.context.lightingModel;
2577
2576
2578
2577
diff --git a/src-testing/src/nodes/lighting/LightsNode.ts b/src-testing/src/nodes/lighting/LightsNode.ts
2579
2578
index 9a41cc7d..df337a72 100644
0 commit comments