浏览代码

Nodes: Static STRING style (#24807)

sunag 2 年之前
父节点
当前提交
ee75e22c4b

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

@@ -18,7 +18,7 @@ class Object3DNode extends Node {
 		this.scope = scope;
 		this.scope = scope;
 		this.object3d = object3d;
 		this.object3d = object3d;
 
 
-		this.updateType = NodeUpdateType.Object;
+		this.updateType = NodeUpdateType.OBJECT;
 
 
 		this._uniformNode = new UniformNode( null );
 		this._uniformNode = new UniformNode( null );
 
 

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

@@ -16,7 +16,7 @@ class ReferenceNode extends Node {
 
 
 		this.node = null;
 		this.node = null;
 
 
-		this.updateType = NodeUpdateType.Object;
+		this.updateType = NodeUpdateType.OBJECT;
 
 
 		this.setNodeType( uniformType );
 		this.setNodeType( uniformType );
 
 

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

@@ -73,7 +73,7 @@ class SkinningNode extends Node {
 
 
 		this.skinnedMesh = skinnedMesh;
 		this.skinnedMesh = skinnedMesh;
 
 
-		this.updateType = NodeUpdateType.Object;
+		this.updateType = NodeUpdateType.OBJECT;
 
 
 		//
 		//
 
 

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

@@ -12,7 +12,7 @@ class Node {
 
 
 		this.nodeType = nodeType;
 		this.nodeType = nodeType;
 
 
-		this.updateType = NodeUpdateType.None;
+		this.updateType = NodeUpdateType.NONE;
 
 
 		this.uuid = MathUtils.generateUUID();
 		this.uuid = MathUtils.generateUUID();
 
 

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

@@ -117,7 +117,7 @@ class NodeBuilder {
 
 
 			const updateType = node.getUpdateType( this );
 			const updateType = node.getUpdateType( this );
 
 
-			if ( updateType !== NodeUpdateType.None ) {
+			if ( updateType !== NodeUpdateType.NONE ) {
 
 
 				this.updateNodes.push( node );
 				this.updateNodes.push( node );
 
 

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

@@ -22,7 +22,7 @@ class NodeFrame {
 
 
 	updateNode( node ) {
 	updateNode( node ) {
 
 
-		if ( node.updateType === NodeUpdateType.Frame ) {
+		if ( node.updateType === NodeUpdateType.FRAME ) {
 
 
 			if ( this.updateMap.get( node ) !== this.frameId ) {
 			if ( this.updateMap.get( node ) !== this.frameId ) {
 
 
@@ -32,7 +32,7 @@ class NodeFrame {
 
 
 			}
 			}
 
 
-		} else if ( node.updateType === NodeUpdateType.Object ) {
+		} else if ( node.updateType === NodeUpdateType.OBJECT ) {
 
 
 			node.update( this );
 			node.update( this );
 
 

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

@@ -40,10 +40,10 @@ class VaryingNode extends Node {
 
 
 		}
 		}
 
 
-		const propertyName = builder.getPropertyName( nodeVarying, NodeShaderStage.Vertex );
+		const propertyName = builder.getPropertyName( nodeVarying, NodeShaderStage.VERTEX );
 
 
 		// force node run in vertex stage
 		// force node run in vertex stage
-		builder.flowNodeFromShaderStage( NodeShaderStage.Vertex, node, type, propertyName );
+		builder.flowNodeFromShaderStage( NodeShaderStage.VERTEX, node, type, propertyName );
 
 
 		return builder.getPropertyName( nodeVarying );
 		return builder.getPropertyName( nodeVarying );
 
 

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

@@ -1,21 +1,21 @@
 export const NodeShaderStage = {
 export const NodeShaderStage = {
-	Vertex: 'vertex',
-	Fragment: 'fragment'
+	VERTEX: 'vertex',
+	FRAGMENT: 'fragment'
 };
 };
 
 
 export const NodeUpdateType = {
 export const NodeUpdateType = {
-	None: 'none',
-	Frame: 'frame',
-	Object: 'object'
+	NONE: 'none',
+	FRAME: 'frame',
+	OBJECT: 'object'
 };
 };
 
 
 export const NodeType = {
 export const NodeType = {
-	Boolean: 'bool',
-	Integer: 'int',
-	Float: 'float',
-	Vector2: 'vec2',
-	Vector3: 'vec3',
-	Vector4: 'vec4',
-	Matrix3: 'mat3',
-	Matrix4: 'mat4'
+	BOOLEAN: 'bool',
+	INTEGER: 'int',
+	FLOAT: 'float',
+	VECTOR2: 'vec2',
+	VECTOR3: 'vec3',
+	VECTOR4: 'vec4',
+	MATRIX3: 'mat3',
+	MATRIX4: 'mat4'
 };
 };

+ 1 - 1
examples/jsm/nodes/gpgpu/ComputeNode.js

@@ -15,7 +15,7 @@ class ComputeNode extends Node {
 		this.workgroupSize = workgroupSize;
 		this.workgroupSize = workgroupSize;
 		this.dispatchCount = 0;
 		this.dispatchCount = 0;
 
 
-		this.updateType = NodeUpdateType.Object;
+		this.updateType = NodeUpdateType.OBJECT;
 
 
 		this.updateDispatchCount();
 		this.updateDispatchCount();
 
 

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

@@ -10,7 +10,7 @@ class AnalyticLightNode extends LightingNode {
 
 
 		super();
 		super();
 
 
-		this.updateType = NodeUpdateType.Object;
+		this.updateType = NodeUpdateType.OBJECT;
 
 
 		this.light = light;
 		this.light = light;
 
 

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

@@ -9,7 +9,7 @@ class MaxMipLevelNode extends UniformNode {
 
 
 		this.texture = texture;
 		this.texture = texture;
 
 
-		this.updateType = NodeUpdateType.Frame;
+		this.updateType = NodeUpdateType.FRAME;
 
 
 	}
 	}
 
 

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

@@ -15,7 +15,7 @@ class TimerNode extends UniformNode {
 		this.scope = scope;
 		this.scope = scope;
 		this.scale = scale;
 		this.scale = scale;
 
 
-		this.updateType = NodeUpdateType.Frame;
+		this.updateType = NodeUpdateType.FRAME;
 
 
 	}
 	}
 /*
 /*

+ 1 - 1
examples/webgl_nodes_materials_instance_uniform.html

@@ -42,7 +42,7 @@
 
 
 					super( 'vec3' );
 					super( 'vec3' );
 
 
-					this.updateType = NodeUpdateType.Object;
+					this.updateType = NodeUpdateType.OBJECT;
 
 
 					this.uniformNode = uniform( new THREE.Color() );
 					this.uniformNode = uniform( new THREE.Color() );
 
 

+ 1 - 1
examples/webgpu_instance_uniform.html

@@ -44,7 +44,7 @@
 
 
 					super( 'vec3' );
 					super( 'vec3' );
 
 
-					this.updateType = NodeUpdateType.Object;
+					this.updateType = NodeUpdateType.OBJECT;
 
 
 					this.uniformNode = uniform( new THREE.Color() );
 					this.uniformNode = uniform( new THREE.Color() );