Skip to content

Commit 5ad6a8c

Browse files
authored
TSL: Add renderer context node (global) (#1907)
* TSL: Add renderer context node (global) * Update three.js * Add jsdoc * Update patch and delete jsdoc * Update declarations * Add src * Update patch and delete src
1 parent 6677c92 commit 5ad6a8c

File tree

8 files changed

+159
-129
lines changed

8 files changed

+159
-129
lines changed

jsdoc-testing/changes.patch

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6568,10 +6568,10 @@ index 1ffe1bd1b..94d4efb05 100644
65686568
+
65696569
+export default MeshToonNodeMaterial;
65706570
diff --git a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts
6571-
index b1fbbd80c..55b1ed149 100644
6571+
index 03097be43..abd419b15 100644
65726572
--- a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts
65736573
+++ b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts
6574-
@@ -1,37 +1,22 @@
6574+
@@ -1,37 +1,23 @@
65756575
-export default NodeMaterial;
65766576
-/**
65776577
- * Base class for all node materials.
@@ -6603,6 +6603,7 @@ index b1fbbd80c..55b1ed149 100644
66036603
+import NodeBuilder from "../../nodes/core/NodeBuilder.js";
66046604
+import ClippingNode from "../../nodes/accessors/ClippingNode.js";
66056605
+import LightingModel from "../../nodes/core/LightingModel.js";
6606+
+import ContextNode from '../../nodes/core/ContextNode.js';
66066607
+
66076608
+export interface NodeMaterialNodeProperties {
66086609
/**
@@ -6619,23 +6620,23 @@ index b1fbbd80c..55b1ed149 100644
66196620
* @default false
66206621
*/
66216622
lights: boolean;
6622-
@@ -40,7 +25,6 @@ declare class NodeMaterial extends Material {
6623+
@@ -40,7 +26,6 @@ declare class NodeMaterial extends Material {
66236624
* This property is managed by the engine and should not be
66246625
* modified by apps.
66256626
*
66266627
- * @type {boolean}
66276628
* @default false
66286629
*/
66296630
hardwareClipping: boolean;
6630-
@@ -57,7 +41,6 @@ declare class NodeMaterial extends Material {
6631+
@@ -57,7 +42,6 @@ declare class NodeMaterial extends Material {
66316632
* material.lightsNode = customLightsNode;
66326633
* ```
66336634
*
66346635
- * @type {?LightsNode}
66356636
* @default null
66366637
*/
66376638
lightsNode: LightsNode | null;
6638-
@@ -71,10 +54,9 @@ declare class NodeMaterial extends Material {
6639+
@@ -71,10 +55,9 @@ declare class NodeMaterial extends Material {
66396640
* material.envNode = pmremTexture( renderTarget.texture );
66406641
* ```
66416642
*
@@ -6647,7 +6648,7 @@ index b1fbbd80c..55b1ed149 100644
66476648
/**
66486649
* The lighting of node materials might be influenced by ambient occlusion.
66496650
* The default AO is inferred from an ambient occlusion map assigned to `aoMap`
6650-
@@ -84,10 +66,9 @@ declare class NodeMaterial extends Material {
6651+
@@ -84,10 +67,9 @@ declare class NodeMaterial extends Material {
66516652
* If you don't want to overwrite the diffuse color but modify the existing
66526653
* values instead, use {@link materialAO}.
66536654
*
@@ -6659,7 +6660,7 @@ index b1fbbd80c..55b1ed149 100644
66596660
/**
66606661
* The diffuse color of node materials is by default inferred from the
66616662
* `color` and `map` properties. This node property allows to overwrite the default
6662-
@@ -104,10 +85,9 @@ declare class NodeMaterial extends Material {
6663+
@@ -104,10 +86,9 @@ declare class NodeMaterial extends Material {
66636664
* material.colorNode = materialColor.mul( color( 0xff0000 ) ); // give diffuse colors a red tint
66646665
* ```
66656666
*
@@ -6671,7 +6672,7 @@ index b1fbbd80c..55b1ed149 100644
66716672
/**
66726673
* The normals of node materials are by default inferred from the `normalMap`/`normalScale`
66736674
* or `bumpMap`/`bumpScale` properties. This node property allows to overwrite the default
6674-
@@ -116,10 +96,9 @@ declare class NodeMaterial extends Material {
6675+
@@ -116,10 +97,9 @@ declare class NodeMaterial extends Material {
66756676
* If you don't want to overwrite the normals but modify the existing values instead,
66766677
* use {@link materialNormal}.
66776678
*
@@ -6683,7 +6684,7 @@ index b1fbbd80c..55b1ed149 100644
66836684
/**
66846685
* The opacity of node materials is by default inferred from the `opacity`
66856686
* and `alphaMap` properties. This node property allows to overwrite the default
6686-
@@ -128,10 +107,9 @@ declare class NodeMaterial extends Material {
6687+
@@ -128,10 +108,9 @@ declare class NodeMaterial extends Material {
66876688
* If you don't want to overwrite the opacity but modify the existing
66886689
* value instead, use {@link materialOpacity}.
66896690
*
@@ -6695,7 +6696,7 @@ index b1fbbd80c..55b1ed149 100644
66956696
/**
66966697
* This node can be used to implement a variety of filter-like effects. The idea is
66976698
* to store the current rendering into a texture e.g. via `viewportSharedTexture()`, use it
6698-
@@ -148,17 +126,15 @@ declare class NodeMaterial extends Material {
6699+
@@ -148,17 +127,15 @@ declare class NodeMaterial extends Material {
66996700
*
67006701
* Backdrop computations are part of the lighting so only lit materials can use this property.
67016702
*
@@ -6715,7 +6716,7 @@ index b1fbbd80c..55b1ed149 100644
67156716
/**
67166717
* The alpha test of node materials is by default inferred from the `alphaTest`
67176718
* property. This node property allows to overwrite the default and define the
6718-
@@ -167,17 +143,15 @@ declare class NodeMaterial extends Material {
6719+
@@ -167,17 +144,15 @@ declare class NodeMaterial extends Material {
67196720
* If you don't want to overwrite the alpha test but modify the existing
67206721
* value instead, use {@link materialAlphaTest}.
67216722
*
@@ -6735,7 +6736,7 @@ index b1fbbd80c..55b1ed149 100644
67356736
/**
67366737
* The local vertex positions are computed based on multiple factors like the
67376738
* attribute data, morphing or skinning. This node property allows to overwrite
6738-
@@ -190,10 +164,9 @@ declare class NodeMaterial extends Material {
6739+
@@ -190,10 +165,9 @@ declare class NodeMaterial extends Material {
67396740
* material.positionNode = positionLocal.add( displace );
67406741
* ```
67416742
*
@@ -6747,7 +6748,7 @@ index b1fbbd80c..55b1ed149 100644
67476748
/**
67486749
* This node property is intended for logic which modifies geometry data once or per animation step.
67496750
* Apps usually place such logic randomly in initialization routines or in the animation loop.
6750-
@@ -205,34 +178,30 @@ declare class NodeMaterial extends Material {
6751+
@@ -205,34 +179,30 @@ declare class NodeMaterial extends Material {
67516752
* simulation would be implemented as compute shaders and managed inside a `Fn` function. This function is
67526753
* eventually assigned to `geometryNode`.
67536754
*
@@ -6786,7 +6787,7 @@ index b1fbbd80c..55b1ed149 100644
67866787
/**
67876788
* This node can be used to influence how an object using this node material
67886789
* receive shadows.
6789-
@@ -245,10 +214,9 @@ declare class NodeMaterial extends Material {
6790+
@@ -245,10 +215,9 @@ declare class NodeMaterial extends Material {
67906791
* return shadow.mix( color( 0xff0000 ), 1 ); // modify shadow color
67916792
* } );
67926793
*
@@ -6798,7 +6799,7 @@ index b1fbbd80c..55b1ed149 100644
67986799
/**
67996800
* This node can be used to influence how an object using this node material
68006801
* casts shadows. To apply a color to shadows, you can simply do:
6801-
@@ -268,26 +236,23 @@ declare class NodeMaterial extends Material {
6802+
@@ -268,26 +237,23 @@ declare class NodeMaterial extends Material {
68026803
* } )();
68036804
* ```
68046805
*
@@ -6827,7 +6828,7 @@ index b1fbbd80c..55b1ed149 100644
68276828
* @default null
68286829
*/
68296830
mrtNode: MRTNode | null;
6830-
@@ -296,26 +261,34 @@ declare class NodeMaterial extends Material {
6831+
@@ -296,33 +262,40 @@ declare class NodeMaterial extends Material {
68316832
* the fragment shader. Assigning a node will replace the built-in material
68326833
* logic used in the fragment stage.
68336834
*
@@ -6846,6 +6847,13 @@ index b1fbbd80c..55b1ed149 100644
68466847
*/
68476848
- vertexNode: Node<any> | null;
68486849
+ vertexNode: Node | null;
6850+
/**
6851+
* This node can be used as a global context management component for this material.
6852+
*
6853+
- * @type {?ContextNode}
6854+
* @default null
6855+
*/
6856+
contextNode: ContextNode | null;
68496857
+}
68506858
+
68516859
+// eslint-disable-next-line @typescript-eslint/no-empty-interface
@@ -6870,7 +6878,7 @@ index b1fbbd80c..55b1ed149 100644
68706878
/**
68716879
* Builds this material with the given node builder.
68726880
*
6873-
@@ -361,28 +334,28 @@ declare class NodeMaterial extends Material {
6881+
@@ -368,28 +341,28 @@ declare class NodeMaterial extends Material {
68746882
* @param {NodeBuilder} builder - The current node builder.
68756883
* @return {Node<vec3>} The position in view space.
68766884
*/
@@ -6903,7 +6911,7 @@ index b1fbbd80c..55b1ed149 100644
69036911
/**
69046912
* Setups the computation of the material's diffuse color.
69056913
*
6906-
@@ -397,33 +370,33 @@ declare class NodeMaterial extends Material {
6914+
@@ -404,33 +377,33 @@ declare class NodeMaterial extends Material {
69076915
* @abstract
69086916
* @param {NodeBuilder} builder - The current node builder.
69096917
*/
@@ -6942,7 +6950,7 @@ index b1fbbd80c..55b1ed149 100644
69426950
/**
69436951
* Setups the lights node based on the scene, environment and material.
69446952
*
6945-
@@ -446,7 +419,7 @@ declare class NodeMaterial extends Material {
6953+
@@ -453,7 +426,7 @@ declare class NodeMaterial extends Material {
69466954
* @param {NodeBuilder} builder - The current node builder.
69476955
* @return {Node<vec3>} The outgoing light node.
69486956
*/
@@ -6951,7 +6959,7 @@ index b1fbbd80c..55b1ed149 100644
69516959
/**
69526960
* Setup the fog.
69536961
*
6954-
@@ -454,7 +427,7 @@ declare class NodeMaterial extends Material {
6962+
@@ -461,7 +434,7 @@ declare class NodeMaterial extends Material {
69556963
* @param {Node<vec4>} outputNode - The existing output node.
69566964
* @return {Node<vec4>} The output node.
69576965
*/
@@ -6960,7 +6968,7 @@ index b1fbbd80c..55b1ed149 100644
69606968
/**
69616969
* Setups premultiplied alpha.
69626970
*
6963-
@@ -462,7 +435,7 @@ declare class NodeMaterial extends Material {
6971+
@@ -469,7 +442,7 @@ declare class NodeMaterial extends Material {
69646972
* @param {Node<vec4>} outputNode - The existing output node.
69656973
* @return {Node<vec4>} The output node.
69666974
*/
@@ -6969,7 +6977,7 @@ index b1fbbd80c..55b1ed149 100644
69696977
/**
69706978
* Setups the output node.
69716979
*
6972-
@@ -470,7 +443,7 @@ declare class NodeMaterial extends Material {
6980+
@@ -477,7 +450,7 @@ declare class NodeMaterial extends Material {
69736981
* @param {Node<vec4>} outputNode - The existing output node.
69746982
* @return {Node<vec4>} The output node.
69756983
*/
@@ -6978,7 +6986,7 @@ index b1fbbd80c..55b1ed149 100644
69786986
/**
69796987
* Most classic material types have a node pendant e.g. for `MeshBasicMaterial`
69806988
* there is `MeshBasicNodeMaterial`. This utility method is intended for
6981-
@@ -485,7 +458,10 @@ declare class NodeMaterial extends Material {
6989+
@@ -492,7 +465,10 @@ declare class NodeMaterial extends Material {
69826990
* @param {NodeMaterial} source - The material to copy.
69836991
* @return {NodeMaterial} A reference to this node material.
69846992
*/

0 commit comments

Comments
 (0)