Forráskód Böngészése

Nodes: Rename `construct()` to `setup()` (#26840)

* Nodes: Rename `construct()` to `setup()`

* deprecated alert
sunag 1 éve
szülő
commit
2ccc5bc90f
70 módosított fájl, 126 hozzáadás és 118 törlés
  1. 1 1
      examples/jsm/nodes/accessors/BufferAttributeNode.js
  2. 1 1
      examples/jsm/nodes/accessors/CubeTextureNode.js
  3. 2 2
      examples/jsm/nodes/accessors/ExtendedMaterialNode.js
  4. 1 1
      examples/jsm/nodes/accessors/InstanceNode.js
  5. 1 1
      examples/jsm/nodes/accessors/LineMaterialNode.js
  6. 1 1
      examples/jsm/nodes/accessors/MaterialNode.js
  7. 2 2
      examples/jsm/nodes/accessors/MaterialReferenceNode.js
  8. 1 1
      examples/jsm/nodes/accessors/ModelViewProjectionNode.js
  9. 3 3
      examples/jsm/nodes/accessors/MorphNode.js
  10. 1 1
      examples/jsm/nodes/accessors/ReferenceNode.js
  11. 1 1
      examples/jsm/nodes/accessors/ReflectVectorNode.js
  12. 1 1
      examples/jsm/nodes/accessors/SceneNode.js
  13. 1 1
      examples/jsm/nodes/accessors/SkinningNode.js
  14. 1 1
      examples/jsm/nodes/accessors/TextureBicubicNode.js
  15. 2 2
      examples/jsm/nodes/accessors/TextureNode.js
  16. 1 1
      examples/jsm/nodes/code/ScriptableNode.js
  17. 1 1
      examples/jsm/nodes/code/ScriptableValueNode.js
  18. 1 1
      examples/jsm/nodes/core/ContextNode.js
  19. 14 6
      examples/jsm/nodes/core/Node.js
  20. 1 1
      examples/jsm/nodes/core/NodeBuilder.js
  21. 2 2
      examples/jsm/nodes/core/OutputStructNode.js
  22. 1 1
      examples/jsm/nodes/core/constants.js
  23. 1 1
      examples/jsm/nodes/display/BlendModeNode.js
  24. 1 1
      examples/jsm/nodes/display/BumpMapNode.js
  25. 1 1
      examples/jsm/nodes/display/ColorAdjustmentNode.js
  26. 1 1
      examples/jsm/nodes/display/ColorSpaceNode.js
  27. 1 1
      examples/jsm/nodes/display/NormalMapNode.js
  28. 1 1
      examples/jsm/nodes/display/PosterizeNode.js
  29. 1 1
      examples/jsm/nodes/display/ToneMappingNode.js
  30. 1 1
      examples/jsm/nodes/display/ViewportDepthNode.js
  31. 1 1
      examples/jsm/nodes/display/ViewportNode.js
  32. 1 1
      examples/jsm/nodes/fog/FogExp2Node.js
  33. 1 1
      examples/jsm/nodes/fog/FogNode.js
  34. 1 1
      examples/jsm/nodes/fog/FogRangeNode.js
  35. 1 1
      examples/jsm/nodes/geometry/RangeNode.js
  36. 1 1
      examples/jsm/nodes/lighting/AONode.js
  37. 1 1
      examples/jsm/nodes/lighting/AmbientLightNode.js
  38. 3 3
      examples/jsm/nodes/lighting/AnalyticLightNode.js
  39. 2 2
      examples/jsm/nodes/lighting/DirectionalLightNode.js
  40. 1 1
      examples/jsm/nodes/lighting/EnvironmentNode.js
  41. 1 1
      examples/jsm/nodes/lighting/HemisphereLightNode.js
  42. 1 1
      examples/jsm/nodes/lighting/LightNode.js
  43. 2 2
      examples/jsm/nodes/lighting/LightingContextNode.js
  44. 1 1
      examples/jsm/nodes/lighting/LightsNode.js
  45. 1 1
      examples/jsm/nodes/lighting/PointLightNode.js
  46. 2 2
      examples/jsm/nodes/lighting/SpotLightNode.js
  47. 5 5
      examples/jsm/nodes/materials/Line2NodeMaterial.js
  48. 1 1
      examples/jsm/nodes/materials/LineDashedNodeMaterial.js
  49. 1 1
      examples/jsm/nodes/materials/MeshLambertNodeMaterial.js
  50. 1 1
      examples/jsm/nodes/materials/MeshNormalNodeMaterial.js
  51. 2 2
      examples/jsm/nodes/materials/MeshPhongNodeMaterial.js
  52. 5 5
      examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js
  53. 2 2
      examples/jsm/nodes/materials/MeshStandardNodeMaterial.js
  54. 19 19
      examples/jsm/nodes/materials/NodeMaterial.js
  55. 1 1
      examples/jsm/nodes/materials/SpriteNodeMaterial.js
  56. 1 1
      examples/jsm/nodes/math/HashNode.js
  57. 1 1
      examples/jsm/nodes/procedural/CheckerNode.js
  58. 4 4
      examples/jsm/nodes/shadernode/ShaderNode.js
  59. 1 1
      examples/jsm/nodes/utils/EquirectUVNode.js
  60. 2 2
      examples/jsm/nodes/utils/LoopNode.js
  61. 1 1
      examples/jsm/nodes/utils/MatcapUVNode.js
  62. 1 1
      examples/jsm/nodes/utils/OscNode.js
  63. 1 1
      examples/jsm/nodes/utils/PackingNode.js
  64. 1 1
      examples/jsm/nodes/utils/RemapNode.js
  65. 1 1
      examples/jsm/nodes/utils/RotateUVNode.js
  66. 1 1
      examples/jsm/nodes/utils/SpecularMIPLevelNode.js
  67. 1 1
      examples/jsm/nodes/utils/SpriteSheetUVNode.js
  68. 1 1
      examples/jsm/nodes/utils/TriplanarTexturesNode.js
  69. 1 1
      examples/webgpu_instance_uniform.html
  70. 1 1
      examples/webgpu_occlusion.html

+ 1 - 1
examples/jsm/nodes/accessors/BufferAttributeNode.js

@@ -43,7 +43,7 @@ class BufferAttributeNode extends InputNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		if ( this.attribute !== null ) return;
 		if ( this.attribute !== null ) return;
 
 

+ 1 - 1
examples/jsm/nodes/accessors/CubeTextureNode.js

@@ -97,7 +97,7 @@ class CubeTextureNode extends TextureNode {
 
 
 			if ( builder.needsColorSpaceToLinear( this.value ) ) {
 			if ( builder.needsColorSpaceToLinear( this.value ) ) {
 
 
-				snippet = colorSpaceToLinear( expression( snippet, nodeType ), this.value.colorSpace ).construct( builder ).build( builder, nodeType );
+				snippet = colorSpaceToLinear( expression( snippet, nodeType ), this.value.colorSpace ).setup( builder ).build( builder, nodeType );
 
 
 			}
 			}
 
 

+ 2 - 2
examples/jsm/nodes/accessors/ExtendedMaterialNode.js

@@ -29,7 +29,7 @@ class ExtendedMaterialNode extends MaterialNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const material = builder.material;
 		const material = builder.material;
 		const scope = this.scope;
 		const scope = this.scope;
@@ -59,7 +59,7 @@ class ExtendedMaterialNode extends MaterialNode {
 
 
 		}
 		}
 
 
-		return node || super.construct( builder );
+		return node || super.setup( builder );
 
 
 	}
 	}
 
 

+ 1 - 1
examples/jsm/nodes/accessors/InstanceNode.js

@@ -17,7 +17,7 @@ class InstanceNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		let instanceMatrixNode = this.instanceMatrixNode;
 		let instanceMatrixNode = this.instanceMatrixNode;
 
 

+ 1 - 1
examples/jsm/nodes/accessors/LineMaterialNode.js

@@ -4,7 +4,7 @@ import { nodeImmutable } from '../shadernode/ShaderNode.js';
 
 
 class LineMaterialNode extends MaterialNode {
 class LineMaterialNode extends MaterialNode {
 
 
-	construct( /*builder*/ ) {
+	setup( /*builder*/ ) {
 
 
 		return this.getFloat( this.scope );
 		return this.getFloat( this.scope );
 
 

+ 1 - 1
examples/jsm/nodes/accessors/MaterialNode.js

@@ -49,7 +49,7 @@ class MaterialNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const material = builder.context.material;
 		const material = builder.context.material;
 		const scope = this.scope;
 		const scope = this.scope;

+ 2 - 2
examples/jsm/nodes/accessors/MaterialReferenceNode.js

@@ -23,13 +23,13 @@ class MaterialReferenceNode extends ReferenceNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const material = this.material !== null ? this.material : builder.material;
 		const material = this.material !== null ? this.material : builder.material;
 
 
 		this.node.value = material[ this.property ];
 		this.node.value = material[ this.property ];
 
 
-		return super.construct( builder );
+		return super.setup( builder );
 
 
 	}
 	}
 
 

+ 1 - 1
examples/jsm/nodes/accessors/ModelViewProjectionNode.js

@@ -15,7 +15,7 @@ class ModelViewProjectionNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return cameraProjectionMatrix.mul( modelViewMatrix ).mul( this.positionNode );
 		return cameraProjectionMatrix.mul( modelViewMatrix ).mul( this.positionNode );
 
 

+ 3 - 3
examples/jsm/nodes/accessors/MorphNode.js

@@ -19,7 +19,7 @@ class MorphNode extends Node {
 
 
 	}
 	}
 
 
-	constructAttribute( builder, name, assignNode = positionLocal ) {
+	setupAttribute( builder, name, assignNode = positionLocal ) {
 
 
 		const mesh = this.mesh;
 		const mesh = this.mesh;
 		const attributes = mesh.geometry.morphAttributes[ name ];
 		const attributes = mesh.geometry.morphAttributes[ name ];
@@ -39,9 +39,9 @@ class MorphNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
-		this.constructAttribute( builder, 'position' );
+		this.setupAttribute( builder, 'position' );
 
 
 	}
 	}
 
 

+ 1 - 1
examples/jsm/nodes/accessors/ReferenceNode.js

@@ -63,7 +63,7 @@ class ReferenceNode extends Node {
 
 
 	}
 	}
 
 
-	construct( /*builder*/ ) {
+	setup( /*builder*/ ) {
 
 
 		return this.node;
 		return this.node;
 
 

+ 1 - 1
examples/jsm/nodes/accessors/ReflectVectorNode.js

@@ -18,7 +18,7 @@ class ReflectVectorNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const reflectView = positionViewDirection.negate().reflect( transformedNormalView );
 		const reflectView = positionViewDirection.negate().reflect( transformedNormalView );
 
 

+ 1 - 1
examples/jsm/nodes/accessors/SceneNode.js

@@ -14,7 +14,7 @@ class SceneNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const scope = this.scope;
 		const scope = this.scope;
 		const scene = this.scene !== null ? this.scene : builder.scene;
 		const scene = this.scene !== null ? this.scene : builder.scene;

+ 1 - 1
examples/jsm/nodes/accessors/SkinningNode.js

@@ -30,7 +30,7 @@ class SkinningNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const { skinIndexNode, skinWeightNode, bindMatrixNode, bindMatrixInverseNode, boneMatricesNode } = this;
 		const { skinIndexNode, skinWeightNode, bindMatrixNode, bindMatrixInverseNode, boneMatricesNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/accessors/TextureBicubicNode.js

@@ -77,7 +77,7 @@ class TextureBicubicNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return textureBicubicMethod( this.textureNode, this.blurNode );
 		return textureBicubicMethod( this.textureNode, this.blurNode );
 
 

+ 2 - 2
examples/jsm/nodes/accessors/TextureNode.js

@@ -76,7 +76,7 @@ class TextureNode extends UniformNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const properties = builder.getNodeProperties( this );
 		const properties = builder.getNodeProperties( this );
 
 
@@ -187,7 +187,7 @@ class TextureNode extends UniformNode {
 
 
 			if ( builder.needsColorSpaceToLinear( this.value ) ) {
 			if ( builder.needsColorSpaceToLinear( this.value ) ) {
 
 
-				snippet = colorSpaceToLinear( expression( snippet, nodeType ), this.value.colorSpace ).construct( builder ).build( builder, nodeType );
+				snippet = colorSpaceToLinear( expression( snippet, nodeType ), this.value.colorSpace ).setup( builder ).build( builder, nodeType );
 
 
 			}
 			}
 
 

+ 1 - 1
examples/jsm/nodes/code/ScriptableNode.js

@@ -431,7 +431,7 @@ class ScriptableNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return this.getDefaultOutputNode();
 		return this.getDefaultOutputNode();
 
 

+ 1 - 1
examples/jsm/nodes/code/ScriptableValueNode.js

@@ -92,7 +92,7 @@ class ScriptableValueNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return this.value && this.value.isNode ? this.value : float();
 		return this.value && this.value.isNode ? this.value : float();
 
 

+ 1 - 1
examples/jsm/nodes/core/ContextNode.js

@@ -20,7 +20,7 @@ class ContextNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const previousContext = builder.getContext();
 		const previousContext = builder.getContext();
 
 

+ 14 - 6
examples/jsm/nodes/core/Node.js

@@ -134,7 +134,7 @@ class Node extends EventDispatcher {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const nodeProperties = builder.getNodeProperties( this );
 		const nodeProperties = builder.getNodeProperties( this );
 
 
@@ -149,6 +149,14 @@ class Node extends EventDispatcher {
 
 
 	}
 	}
 
 
+	construct( builder ) { // @deprecated, r157
+
+		console.warn( 'THREE.Node: construct() is deprecated. Use setup() instead.' );
+
+		return this.setup( builder );
+
+	}
+
 	analyze( builder ) {
 	analyze( builder ) {
 
 
 		const nodeData = builder.getDataFromNode( this );
 		const nodeData = builder.getDataFromNode( this );
@@ -212,7 +220,7 @@ class Node extends EventDispatcher {
 		builder.addChain( this );
 		builder.addChain( this );
 
 
 		/* Build stages expected results:
 		/* Build stages expected results:
-			- "construct"	-> Node
+			- "setup"		-> Node
 			- "analyze"		-> null
 			- "analyze"		-> null
 			- "generate"	-> String
 			- "generate"	-> String
 		*/
 		*/
@@ -220,18 +228,18 @@ class Node extends EventDispatcher {
 
 
 		const buildStage = builder.getBuildStage();
 		const buildStage = builder.getBuildStage();
 
 
-		if ( buildStage === 'construct' ) {
+		if ( buildStage === 'setup' ) {
 
 
 			const properties = builder.getNodeProperties( this );
 			const properties = builder.getNodeProperties( this );
 
 
 			if ( properties.initialized !== true || builder.context.tempRead === false ) {
 			if ( properties.initialized !== true || builder.context.tempRead === false ) {
 
 
-				const stackNodesBeforeConstruct = builder.stack.nodes.length;
+				const stackNodesBeforeSetup = builder.stack.nodes.length;
 
 
 				properties.initialized = true;
 				properties.initialized = true;
-				properties.outputNode = this.construct( builder );
+				properties.outputNode = this.setup( builder );
 
 
-				if ( properties.outputNode !== null && builder.stack.nodes.length !== stackNodesBeforeConstruct ) {
+				if ( properties.outputNode !== null && builder.stack.nodes.length !== stackNodesBeforeSetup ) {
 
 
 					properties.outputNode = builder.stack;
 					properties.outputNode = builder.stack;
 
 

+ 1 - 1
examples/jsm/nodes/core/NodeBuilder.js

@@ -945,7 +945,7 @@ class NodeBuilder {
 
 
 	build() {
 	build() {
 
 
-		// construct() -> stage 1: create possible new nodes and returns an output reference node
+		// setup() -> stage 1: create possible new nodes and returns an output reference node
 		// analyze()   -> stage 2: analyze nodes to possible optimization and validation
 		// analyze()   -> stage 2: analyze nodes to possible optimization and validation
 		// generate()  -> stage 3: generate shader
 		// generate()  -> stage 3: generate shader
 
 

+ 2 - 2
examples/jsm/nodes/core/OutputStructNode.js

@@ -13,9 +13,9 @@ class OutputStructNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
-		super.construct( builder );
+		super.setup( builder );
 
 
 		const members = this.members;
 		const members = this.members;
 		const types = [];
 		const types = [];

+ 1 - 1
examples/jsm/nodes/core/constants.js

@@ -22,6 +22,6 @@ export const NodeType = {
 };
 };
 
 
 export const defaultShaderStages = [ 'fragment', 'vertex' ];
 export const defaultShaderStages = [ 'fragment', 'vertex' ];
-export const defaultBuildStages = [ 'construct', 'analyze', 'generate' ];
+export const defaultBuildStages = [ 'setup', 'analyze', 'generate' ];
 export const shaderStages = [ ...defaultShaderStages, 'compute' ];
 export const shaderStages = [ ...defaultShaderStages, 'compute' ];
 export const vectorComponents = [ 'x', 'y', 'z', 'w' ];
 export const vectorComponents = [ 'x', 'y', 'z', 'w' ];

+ 1 - 1
examples/jsm/nodes/display/BlendModeNode.js

@@ -48,7 +48,7 @@ class BlendModeNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { blendMode, baseNode, blendNode } = this;
 		const { blendMode, baseNode, blendNode } = this;
 		const params = { base: baseNode, blend: blendNode };
 		const params = { base: baseNode, blend: blendNode };

+ 1 - 1
examples/jsm/nodes/display/BumpMapNode.js

@@ -55,7 +55,7 @@ class BumpMapNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const bumpScale = this.scaleNode !== null ? this.scaleNode : 1;
 		const bumpScale = this.scaleNode !== null ? this.scaleNode : 1;
 		const dHdxy = dHdxy_fwd( { bumpTexture: this.texture, bumpScale } );
 		const dHdxy = dHdxy_fwd( { bumpTexture: this.texture, bumpScale } );

+ 1 - 1
examples/jsm/nodes/display/ColorAdjustmentNode.js

@@ -48,7 +48,7 @@ class ColorAdjustmentNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { method, colorNode, adjustmentNode } = this;
 		const { method, colorNode, adjustmentNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/display/ColorSpaceNode.js

@@ -70,7 +70,7 @@ class ColorSpaceNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { method, node } = this;
 		const { method, node } = this;
 
 

+ 1 - 1
examples/jsm/nodes/display/NormalMapNode.js

@@ -52,7 +52,7 @@ class NormalMapNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const { normalMapType, scaleNode } = this;
 		const { normalMapType, scaleNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/display/PosterizeNode.js

@@ -13,7 +13,7 @@ class PosterizeNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { sourceNode, stepsNode } = this;
 		const { sourceNode, stepsNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/display/ToneMappingNode.js

@@ -104,7 +104,7 @@ class ToneMappingNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const colorNode = this.colorNode || builder.context.color;
 		const colorNode = this.colorNode || builder.context.color;
 		const toneMapping = this.toneMapping;
 		const toneMapping = this.toneMapping;

+ 1 - 1
examples/jsm/nodes/display/ViewportDepthNode.js

@@ -17,7 +17,7 @@ class ViewportDepthNode extends Node {
 
 
 	}
 	}
 
 
-	construct( /*builder*/ ) {
+	setup( /*builder*/ ) {
 
 
 		const { scope } = this;
 		const { scope } = this;
 
 

+ 1 - 1
examples/jsm/nodes/display/ViewportNode.js

@@ -55,7 +55,7 @@ class ViewportNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const scope = this.scope;
 		const scope = this.scope;
 
 

+ 1 - 1
examples/jsm/nodes/fog/FogExp2Node.js

@@ -15,7 +15,7 @@ class FogExp2Node extends FogNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const depthNode = positionView.z.negate();
 		const depthNode = positionView.z.negate();
 		const densityNode = this.densityNode;
 		const densityNode = this.densityNode;

+ 1 - 1
examples/jsm/nodes/fog/FogNode.js

@@ -20,7 +20,7 @@ class FogNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return this.factorNode;
 		return this.factorNode;
 
 

+ 1 - 1
examples/jsm/nodes/fog/FogRangeNode.js

@@ -17,7 +17,7 @@ class FogRangeNode extends FogNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return smoothstep( this.nearNode, this.farNode, positionView.z.negate() );
 		return smoothstep( this.nearNode, this.farNode, positionView.z.negate() );
 
 

+ 1 - 1
examples/jsm/nodes/geometry/RangeNode.js

@@ -36,7 +36,7 @@ class RangeNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const object = builder.object;
 		const object = builder.object;
 
 

+ 1 - 1
examples/jsm/nodes/lighting/AONode.js

@@ -11,7 +11,7 @@ class AONode extends LightingNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const aoIntensity = 1;
 		const aoIntensity = 1;
 		const aoNode = this.aoNode.x.sub( 1.0 ).mul( aoIntensity ).add( 1.0 );
 		const aoNode = this.aoNode.x.sub( 1.0 ).mul( aoIntensity ).add( 1.0 );

+ 1 - 1
examples/jsm/nodes/lighting/AmbientLightNode.js

@@ -12,7 +12,7 @@ class AmbientLightNode extends AnalyticLightNode {
 
 
 	}
 	}
 
 
-	construct( { context } ) {
+	setup( { context } ) {
 
 
 		context.irradiance.addAssign( this.colorNode );
 		context.irradiance.addAssign( this.colorNode );
 
 

+ 3 - 3
examples/jsm/nodes/lighting/AnalyticLightNode.js

@@ -37,7 +37,7 @@ class AnalyticLightNode extends LightingNode {
 
 
 	}
 	}
 
 
-	constructShadow( builder ) {
+	setupShadow( builder ) {
 
 
 		let shadowNode = this.shadowNode;
 		let shadowNode = this.shadowNode;
 
 
@@ -136,9 +136,9 @@ class AnalyticLightNode extends LightingNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
-		if ( this.light.castShadow ) this.constructShadow( builder );
+		if ( this.light.castShadow ) this.setupShadow( builder );
 
 
 	}
 	}
 
 

+ 2 - 2
examples/jsm/nodes/lighting/DirectionalLightNode.js

@@ -13,9 +13,9 @@ class DirectionalLightNode extends AnalyticLightNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
-		super.construct( builder );
+		super.setup( builder );
 
 
 		const lightingModel = builder.context.lightingModel;
 		const lightingModel = builder.context.lightingModel;
 
 

+ 1 - 1
examples/jsm/nodes/lighting/EnvironmentNode.js

@@ -24,7 +24,7 @@ class EnvironmentNode extends LightingNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		let envNode = this.envNode;
 		let envNode = this.envNode;
 		const properties = builder.getNodeProperties( this );
 		const properties = builder.getNodeProperties( this );

+ 1 - 1
examples/jsm/nodes/lighting/HemisphereLightNode.js

@@ -33,7 +33,7 @@ class HemisphereLightNode extends AnalyticLightNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const { colorNode, groundColorNode, lightDirectionNode } = this;
 		const { colorNode, groundColorNode, lightDirectionNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/lighting/LightNode.js

@@ -14,7 +14,7 @@ class LightNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { scope, light } = this;
 		const { scope, light } = this;
 
 

+ 2 - 2
examples/jsm/nodes/lighting/LightingContextNode.js

@@ -22,7 +22,7 @@ class LightingContextNode extends ContextNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const { lightingModel, backdropNode, backdropAlphaNode } = this;
 		const { lightingModel, backdropNode, backdropAlphaNode } = this;
 
 
@@ -76,7 +76,7 @@ class LightingContextNode extends ContextNode {
 
 
 		}
 		}
 
 
-		return super.construct( builder );
+		return super.setup( builder );
 
 
 	}
 	}
 
 

+ 1 - 1
examples/jsm/nodes/lighting/LightsNode.js

@@ -28,7 +28,7 @@ class LightsNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const lightNodes = this.lightNodes;
 		const lightNodes = this.lightNodes;
 
 

+ 1 - 1
examples/jsm/nodes/lighting/PointLightNode.js

@@ -30,7 +30,7 @@ class PointLightNode extends AnalyticLightNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		const { colorNode, cutoffDistanceNode, decayExponentNode, light } = this;
 		const { colorNode, cutoffDistanceNode, decayExponentNode, light } = this;
 
 

+ 2 - 2
examples/jsm/nodes/lighting/SpotLightNode.js

@@ -46,9 +46,9 @@ class SpotLightNode extends AnalyticLightNode {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
-		super.construct( builder );
+		super.setup( builder );
 
 
 		const lightingModel = builder.context.lightingModel;
 		const lightingModel = builder.context.lightingModel;
 
 

+ 5 - 5
examples/jsm/nodes/materials/Line2NodeMaterial.js

@@ -44,13 +44,13 @@ class Line2NodeMaterial extends NodeMaterial {
 		this.dashSizeNode = null;
 		this.dashSizeNode = null;
 		this.gapSizeNode = null;
 		this.gapSizeNode = null;
 
 
-		this.constructShaders();
+		this.setupShaders();
 
 
 		this.setValues( params );
 		this.setValues( params );
 
 
 	}
 	}
 
 
-	constructShaders() {
+	setupShaders() {
 
 
 		const useAlphaToCoverage = this.alphaToCoverage;
 		const useAlphaToCoverage = this.alphaToCoverage;
 		const useColor = this.useColor;
 		const useColor = this.useColor;
@@ -400,7 +400,7 @@ class Line2NodeMaterial extends NodeMaterial {
 		if ( this.useWorldUnits !== value ) {
 		if ( this.useWorldUnits !== value ) {
 
 
 			this.useWorldUnits = value;
 			this.useWorldUnits = value;
-			this.constructShaders();
+			this.setupShaders();
 
 
 		}
 		}
 
 
@@ -418,7 +418,7 @@ class Line2NodeMaterial extends NodeMaterial {
 		if ( this.useDash !== value ) {
 		if ( this.useDash !== value ) {
 
 
 			this.useDash = value;
 			this.useDash = value;
-			this.constructShaders();
+			this.setupShaders();
 
 
 		}
 		}
 
 
@@ -436,7 +436,7 @@ class Line2NodeMaterial extends NodeMaterial {
 		if ( this.useAlphaToCoverage !== value ) {
 		if ( this.useAlphaToCoverage !== value ) {
 
 
 			this.useAlphaToCoverage = value;
 			this.useAlphaToCoverage = value;
-			this.constructShaders();
+			this.setupShaders();
 
 
 		}
 		}
 
 

+ 1 - 1
examples/jsm/nodes/materials/LineDashedNodeMaterial.js

@@ -30,7 +30,7 @@ class LineDashedNodeMaterial extends NodeMaterial {
 
 
 	}
 	}
 
 
-	constructVariants( { stack } ) {
+	setupVariants( { stack } ) {
 
 
 		const offsetNode = this.offsetNode;
 		const offsetNode = this.offsetNode;
 		const dashScaleNode = this.dashScaleNode ? float( this.dashScaleNode ) : materialLineScale;
 		const dashScaleNode = this.dashScaleNode ? float( this.dashScaleNode ) : materialLineScale;

+ 1 - 1
examples/jsm/nodes/materials/MeshLambertNodeMaterial.js

@@ -21,7 +21,7 @@ class MeshLambertNodeMaterial extends NodeMaterial {
 
 
 	}
 	}
 
 
-	constructLightingModel( /*builder*/ ) {
+	setupLightingModel( /*builder*/ ) {
 
 
 		return new PhongLightingModel( false ); // ( specular ) -> force lambert
 		return new PhongLightingModel( false ); // ( specular ) -> force lambert
 
 

+ 1 - 1
examples/jsm/nodes/materials/MeshNormalNodeMaterial.js

@@ -25,7 +25,7 @@ class MeshNormalNodeMaterial extends NodeMaterial {
 
 
 	}
 	}
 
 
-	constructDiffuseColor( { stack } ) {
+	setupDiffuseColor( { stack } ) {
 
 
 		const opacityNode = this.opacityNode ? float( this.opacityNode ) : materialOpacity;
 		const opacityNode = this.opacityNode ? float( this.opacityNode ) : materialOpacity;
 
 

+ 2 - 2
examples/jsm/nodes/materials/MeshPhongNodeMaterial.js

@@ -27,13 +27,13 @@ class MeshPhongNodeMaterial extends NodeMaterial {
 
 
 	}
 	}
 
 
-	constructLightingModel( /*builder*/ ) {
+	setupLightingModel( /*builder*/ ) {
 
 
 		return new PhongLightingModel();
 		return new PhongLightingModel();
 
 
 	}
 	}
 
 
-	constructVariants( { stack } ) {
+	setupVariants( { stack } ) {
 
 
 		// SHININESS
 		// SHININESS
 
 

+ 5 - 5
examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js

@@ -44,15 +44,15 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
 
 
 	}
 	}
 
 
-	constructLightingModel( /*builder*/ ) {
+	setupLightingModel( /*builder*/ ) {
 
 
 		return new PhysicalLightingModel(); // @TODO: Optimize shader using parameters.
 		return new PhysicalLightingModel(); // @TODO: Optimize shader using parameters.
 
 
 	}
 	}
 
 
-	constructVariants( builder ) {
+	setupVariants( builder ) {
 
 
-		super.constructVariants( builder );
+		super.setupVariants( builder );
 
 
 		const { stack } = builder;
 		const { stack } = builder;
 
 
@@ -84,9 +84,9 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
 
 
 	}
 	}
 
 
-	constructNormal( builder ) {
+	setupNormal( builder ) {
 
 
-		super.constructNormal( builder );
+		super.setupNormal( builder );
 
 
 		// CLEARCOAT NORMAL
 		// CLEARCOAT NORMAL
 
 

+ 2 - 2
examples/jsm/nodes/materials/MeshStandardNodeMaterial.js

@@ -29,13 +29,13 @@ class MeshStandardNodeMaterial extends NodeMaterial {
 
 
 	}
 	}
 
 
-	constructLightingModel( /*builder*/ ) {
+	setupLightingModel( /*builder*/ ) {
 
 
 		return new PhysicalLightingModel( false, false ); // ( clearcoat, sheen ) -> standard
 		return new PhysicalLightingModel( false, false ); // ( clearcoat, sheen ) -> standard
 
 
 	}
 	}
 
 
-	constructVariants( { stack } ) {
+	setupVariants( { stack } ) {
 
 
 		// METALNESS
 		// METALNESS
 
 

+ 19 - 19
examples/jsm/nodes/materials/NodeMaterial.js

@@ -65,17 +65,17 @@ class NodeMaterial extends ShaderMaterial {
 
 
 	build( builder ) {
 	build( builder ) {
 
 
-		this.construct( builder );
+		this.setup( builder );
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		// < VERTEX STAGE >
 		// < VERTEX STAGE >
 
 
 		builder.addStack();
 		builder.addStack();
 
 
-		builder.stack.outputNode = this.constructPosition( builder );
+		builder.stack.outputNode = this.setupPosition( builder );
 
 
 		builder.addFlow( 'vertex', builder.removeStack() );
 		builder.addFlow( 'vertex', builder.removeStack() );
 
 
@@ -87,14 +87,14 @@ class NodeMaterial extends ShaderMaterial {
 
 
 		if ( this.unlit === false ) {
 		if ( this.unlit === false ) {
 
 
-			if ( this.normals === true ) this.constructNormal( builder );
+			if ( this.normals === true ) this.setupNormal( builder );
 
 
-			this.constructDiffuseColor( builder );
-			this.constructVariants( builder );
+			this.setupDiffuseColor( builder );
+			this.setupVariants( builder );
 
 
-			const outgoingLightNode = this.constructLighting( builder );
+			const outgoingLightNode = this.setupLighting( builder );
 
 
-			outputNode = this.constructOutput( builder, vec4( outgoingLightNode, diffuseColor.a ) );
+			outputNode = this.setupOutput( builder, vec4( outgoingLightNode, diffuseColor.a ) );
 
 
 			// OUTPUT NODE
 			// OUTPUT NODE
 
 
@@ -106,7 +106,7 @@ class NodeMaterial extends ShaderMaterial {
 
 
 		} else {
 		} else {
 
 
-			outputNode = this.constructOutput( builder, this.outputNode || vec4( 0, 0, 0, 1 ) );
+			outputNode = this.setupOutput( builder, this.outputNode || vec4( 0, 0, 0, 1 ) );
 
 
 		}
 		}
 
 
@@ -116,7 +116,7 @@ class NodeMaterial extends ShaderMaterial {
 
 
 	}
 	}
 
 
-	constructPosition( builder ) {
+	setupPosition( builder ) {
 
 
 		const object = builder.object;
 		const object = builder.object;
 		const geometry = object.geometry;
 		const geometry = object.geometry;
@@ -153,7 +153,7 @@ class NodeMaterial extends ShaderMaterial {
 
 
 	}
 	}
 
 
-	constructDiffuseColor( { stack, geometry } ) {
+	setupDiffuseColor( { stack, geometry } ) {
 
 
 		let colorNode = this.colorNode ? vec4( this.colorNode ) : materialColor;
 		let colorNode = this.colorNode ? vec4( this.colorNode ) : materialColor;
 
 
@@ -186,13 +186,13 @@ class NodeMaterial extends ShaderMaterial {
 
 
 	}
 	}
 
 
-	constructVariants( /*builder*/ ) {
+	setupVariants( /*builder*/ ) {
 
 
 		// Interface function.
 		// Interface function.
 
 
 	}
 	}
 
 
-	constructNormal( { stack } ) {
+	setupNormal( { stack } ) {
 
 
 		// NORMAL VIEW
 		// NORMAL VIEW
 
 
@@ -236,7 +236,7 @@ class NodeMaterial extends ShaderMaterial {
 
 
 	}
 	}
 
 
-	constructLights( builder ) {
+	setupLights( builder ) {
 
 
 		const envNode = this.getEnvNode( builder );
 		const envNode = this.getEnvNode( builder );
 
 
@@ -268,13 +268,13 @@ class NodeMaterial extends ShaderMaterial {
 
 
 	}
 	}
 
 
-	constructLightingModel( /*builder*/ ) {
+	setupLightingModel( /*builder*/ ) {
 
 
 		// Interface function.
 		// Interface function.
 
 
 	}
 	}
 
 
-	constructLighting( builder ) {
+	setupLighting( builder ) {
 
 
 		const { material } = builder;
 		const { material } = builder;
 		const { backdropNode, backdropAlphaNode, emissiveNode } = this;
 		const { backdropNode, backdropAlphaNode, emissiveNode } = this;
@@ -283,13 +283,13 @@ class NodeMaterial extends ShaderMaterial {
 
 
 		const lights = this.lights === true || this.lightsNode !== null;
 		const lights = this.lights === true || this.lightsNode !== null;
 
 
-		const lightsNode = lights ? this.constructLights( builder ) : null;
+		const lightsNode = lights ? this.setupLights( builder ) : null;
 
 
 		let outgoingLightNode = diffuseColor.rgb;
 		let outgoingLightNode = diffuseColor.rgb;
 
 
 		if ( lightsNode && lightsNode.hasLight !== false ) {
 		if ( lightsNode && lightsNode.hasLight !== false ) {
 
 
-			const lightingModelNode = this.constructLightingModel( builder );
+			const lightingModelNode = this.setupLightingModel( builder );
 
 
 			outgoingLightNode = lightingContext( lightsNode, lightingModelNode, backdropNode, backdropAlphaNode );
 			outgoingLightNode = lightingContext( lightsNode, lightingModelNode, backdropNode, backdropAlphaNode );
 
 
@@ -311,7 +311,7 @@ class NodeMaterial extends ShaderMaterial {
 
 
 	}
 	}
 
 
-	constructOutput( builder, outputNode ) {
+	setupOutput( builder, outputNode ) {
 
 
 		const renderer = builder.renderer;
 		const renderer = builder.renderer;
 
 

+ 1 - 1
examples/jsm/nodes/materials/SpriteNodeMaterial.js

@@ -38,7 +38,7 @@ class SpriteNodeMaterial extends NodeMaterial {
 
 
 	}
 	}
 
 
-	constructPosition( { object, context } ) {
+	setupPosition( { object, context } ) {
 
 
 		// < VERTEX STAGE >
 		// < VERTEX STAGE >
 
 

+ 1 - 1
examples/jsm/nodes/math/HashNode.js

@@ -11,7 +11,7 @@ class HashNode extends Node {
 
 
 	}
 	}
 
 
-	construct( /*builder*/ ) {
+	setup( /*builder*/ ) {
 
 
 		// Taken from https://www.shadertoy.com/view/XlGcRh, originally from pcg-random.org
 		// Taken from https://www.shadertoy.com/view/XlGcRh, originally from pcg-random.org
 
 

+ 1 - 1
examples/jsm/nodes/procedural/CheckerNode.js

@@ -25,7 +25,7 @@ class CheckerNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return checkerShaderNode( { uv: this.uvNode } );
 		return checkerShaderNode( { uv: this.uvNode } );
 
 

+ 4 - 4
examples/jsm/nodes/shadernode/ShaderNode.js

@@ -22,7 +22,7 @@ const parseSwizzle = ( props ) => props.replace( /r|s/g, 'x' ).replace( /g|t/g,
 
 
 const shaderNodeHandler = {
 const shaderNodeHandler = {
 
 
-	construct( NodeClosure, params ) {
+	setup( NodeClosure, params ) {
 
 
 		const inputs = params.shift();
 		const inputs = params.shift();
 
 
@@ -226,7 +226,7 @@ class ShaderCallNodeInternal extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
 		builder.addStack();
 		builder.addStack();
 
 
@@ -242,7 +242,7 @@ class ShaderCallNodeInternal extends Node {
 
 
 		if ( outputNode === null ) {
 		if ( outputNode === null ) {
 
 
-			// TSL: It's recommended to use `tslFn` in construct() pass.
+			// TSL: It's recommended to use `tslFn` in setup() pass.
 
 
 			return this.call( builder ).build( builder, output );
 			return this.call( builder ).build( builder, output );
 
 
@@ -270,7 +270,7 @@ class ShaderNodeInternal extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		return this.call();
 		return this.call();
 
 

+ 1 - 1
examples/jsm/nodes/utils/EquirectUVNode.js

@@ -13,7 +13,7 @@ class EquirectUVNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const dir = this.dirNode;
 		const dir = this.dirNode;
 
 

+ 2 - 2
examples/jsm/nodes/utils/LoopNode.js

@@ -53,9 +53,9 @@ class LoopNode extends Node {
 
 
 	}
 	}
 
 
-	construct( builder ) {
+	setup( builder ) {
 
 
-		// construct properties
+		// setup properties
 
 
 		this.getProperties( builder );
 		this.getProperties( builder );
 
 

+ 1 - 1
examples/jsm/nodes/utils/MatcapUVNode.js

@@ -12,7 +12,7 @@ class MatcapUVNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const x = vec3( positionViewDirection.z, 0, positionViewDirection.x.negate() ).normalize();
 		const x = vec3( positionViewDirection.z, 0, positionViewDirection.x.negate() ).normalize();
 		const y = positionViewDirection.cross( x );
 		const y = positionViewDirection.cross( x );

+ 1 - 1
examples/jsm/nodes/utils/OscNode.js

@@ -19,7 +19,7 @@ class OscNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const method = this.method;
 		const method = this.method;
 		const timeNode = nodeObject( this.timeNode );
 		const timeNode = nodeObject( this.timeNode );

+ 1 - 1
examples/jsm/nodes/utils/PackingNode.js

@@ -19,7 +19,7 @@ class PackingNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { scope, node } = this;
 		const { scope, node } = this;
 
 

+ 1 - 1
examples/jsm/nodes/utils/RemapNode.js

@@ -17,7 +17,7 @@ class RemapNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { node, inLowNode, inHighNode, outLowNode, outHighNode, doClamp } = this;
 		const { node, inLowNode, inHighNode, outLowNode, outHighNode, doClamp } = this;
 
 

+ 1 - 1
examples/jsm/nodes/utils/RotateUVNode.js

@@ -14,7 +14,7 @@ class RotateUVNode extends TempNode {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { uvNode, rotationNode, centerNode } = this;
 		const { uvNode, rotationNode, centerNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/utils/SpecularMIPLevelNode.js

@@ -13,7 +13,7 @@ class SpecularMIPLevelNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { textureNode, roughnessNode } = this;
 		const { textureNode, roughnessNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/utils/SpriteSheetUVNode.js

@@ -14,7 +14,7 @@ class SpriteSheetUVNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { frameNode, uvNode, countNode } = this;
 		const { frameNode, uvNode, countNode } = this;
 
 

+ 1 - 1
examples/jsm/nodes/utils/TriplanarTexturesNode.js

@@ -22,7 +22,7 @@ class TriplanarTexturesNode extends Node {
 
 
 	}
 	}
 
 
-	construct() {
+	setup() {
 
 
 		const { textureXNode, textureYNode, textureZNode, scaleNode, positionNode, normalNode } = this;
 		const { textureXNode, textureYNode, textureZNode, scaleNode, positionNode, normalNode } = this;
 
 

+ 1 - 1
examples/webgpu_instance_uniform.html

@@ -60,7 +60,7 @@
 
 
 				}
 				}
 
 
-				construct( /*builder*/ ) {
+				setup( /*builder*/ ) {
 
 
 					return this.uniformNode;
 					return this.uniformNode;
 
 

+ 1 - 1
examples/webgpu_occlusion.html

@@ -59,7 +59,7 @@
 
 
 				}
 				}
 
 
-				construct( /* builder */ ) {
+				setup( /* builder */ ) {
 
 
 					return this.uniformNode;
 					return this.uniformNode;