Bläddra i källkod

Merge pull request #14125 from sunag/dev-nodeuniform

NodeUniform - fix caching for SingleUniform
Mr.doob 7 år sedan
förälder
incheckning
84ae82bef6

+ 2 - 1
examples/js/loaders/NodeMaterialLoader.js

@@ -184,9 +184,10 @@ Object.assign( THREE.NodeMaterialLoader.prototype, {
 
 			switch ( node.type ) {
 
+				case "IntNode":
 				case "FloatNode":
 
-					object.number = node.number;
+					object.value = node.value;
 
 					break;
 

+ 2 - 2
examples/js/nodes/InputNode.js

@@ -42,7 +42,7 @@ THREE.InputNode.prototype.generate = function ( builder, output, uuid, type, ns,
 
 			if ( ! data.vertex ) {
 
-				data.vertex = material.createVertexUniform( type, this.value, ns, needsUpdate );
+				data.vertex = material.createVertexUniform( type, this, ns, needsUpdate );
 
 			}
 
@@ -52,7 +52,7 @@ THREE.InputNode.prototype.generate = function ( builder, output, uuid, type, ns,
 
 			if ( ! data.fragment ) {
 
-				data.fragment = material.createFragmentUniform( type, this.value, ns, needsUpdate );
+				data.fragment = material.createFragmentUniform( type, this, ns, needsUpdate );
 
 			}
 

+ 8 - 8
examples/js/nodes/NodeMaterial.js

@@ -282,16 +282,16 @@ THREE.NodeMaterial.prototype.mergeUniform = function ( uniforms ) {
 
 };
 
-THREE.NodeMaterial.prototype.createUniform = function ( type, value, ns, needsUpdate ) {
+THREE.NodeMaterial.prototype.createUniform = function ( type, node, ns, needsUpdate ) {
 
 	var index = this.uniformList.length;
 
-	var uniform = {
+	var uniform = new THREE.NodeUniform( {
 		type: type,
-		value: value,
 		name: ns ? ns : 'nVu' + index,
+		node: node,
 		needsUpdate: needsUpdate
-	};
+	} );
 
 	this.uniformList.push( uniform );
 
@@ -487,9 +487,9 @@ THREE.NodeMaterial.prototype.getCodePars = function ( pars, prefix ) {
 
 };
 
-THREE.NodeMaterial.prototype.createVertexUniform = function ( type, value, ns, needsUpdate ) {
+THREE.NodeMaterial.prototype.createVertexUniform = function ( type, node, ns, needsUpdate ) {
 
-	var uniform = this.createUniform( type, value, ns, needsUpdate );
+	var uniform = this.createUniform( type, node, ns, needsUpdate );
 
 	this.vertexUniform.push( uniform );
 	this.vertexUniform[ uniform.name ] = uniform;
@@ -500,9 +500,9 @@ THREE.NodeMaterial.prototype.createVertexUniform = function ( type, value, ns, n
 
 };
 
-THREE.NodeMaterial.prototype.createFragmentUniform = function ( type, value, ns, needsUpdate ) {
+THREE.NodeMaterial.prototype.createFragmentUniform = function ( type, node, ns, needsUpdate ) {
 
-	var uniform = this.createUniform( type, value, ns, needsUpdate );
+	var uniform = this.createUniform( type, node, ns, needsUpdate );
 
 	this.fragmentUniform.push( uniform );
 	this.fragmentUniform[ uniform.name ] = uniform;

+ 29 - 0
examples/js/nodes/NodeUniform.js

@@ -0,0 +1,29 @@
+/**
+ * @author sunag / http://www.sunag.com.br/
+ */
+
+THREE.NodeUniform = function ( params ) {
+
+	params = params || {};
+
+	this.name = params.name;
+	this.type = params.type;
+	this.node = params.node;
+	this.needsUpdate = params.needsUpdate;
+
+};
+
+Object.defineProperties( THREE.NodeUniform.prototype, {
+	value: {
+		get: function () {
+
+			return this.node.value;
+
+		},
+		set: function ( val ) {
+
+			this.node.value = val;
+
+		}
+	}
+} );

+ 4 - 4
examples/js/nodes/accessors/CameraNode.js

@@ -150,8 +150,8 @@ THREE.CameraNode.prototype.onUpdateFrame = function ( frame ) {
 
 			var camera = this.camera;
 
-			this.near.number = camera.near;
-			this.far.number = camera.far;
+			this.near.value = camera.near;
+			this.far.value = camera.far;
 
 			break;
 
@@ -175,8 +175,8 @@ THREE.CameraNode.prototype.toJSON = function ( meta ) {
 
 			case THREE.CameraNode.DEPTH:
 
-				data.near = this.near.number;
-				data.far = this.far.number;
+				data.near = this.near.value;
+				data.far = this.far.value;
 
 				break;
 

+ 4 - 19
examples/js/nodes/inputs/FloatNode.js

@@ -6,7 +6,7 @@ THREE.FloatNode = function ( value ) {
 
 	THREE.InputNode.call( this, 'fv1' );
 
-	this.value = [ value || 0 ];
+	this.value = value || 0;
 
 };
 
@@ -14,26 +14,11 @@ THREE.FloatNode.prototype = Object.create( THREE.InputNode.prototype );
 THREE.FloatNode.prototype.constructor = THREE.FloatNode;
 THREE.FloatNode.prototype.nodeType = "Float";
 
-Object.defineProperties( THREE.FloatNode.prototype, {
-	number: {
-		get: function () {
-
-			return this.value[ 0 ];
-
-		},
-		set: function ( val ) {
-
-			this.value[ 0 ] = val;
-
-		}
-	}
-} );
-
 THREE.FloatNode.prototype.generateReadonly = function ( builder, output, uuid, type, ns, needsUpdate ) {
 
-	var value = this.number;
+	var val = this.value;
 
-	return builder.format( Math.floor( value ) !== value ? value : value + ".0", type, output );
+	return builder.format( Math.floor( val ) !== val ? val : val + ".0", type, output );
 
 };
 
@@ -45,7 +30,7 @@ THREE.FloatNode.prototype.toJSON = function ( meta ) {
 
 		data = this.createJSONNode( meta );
 
-		data.number = this.number;
+		data.value = this.value;
 
 		if ( this.readonly === true ) data.readonly = true;
 

+ 3 - 18
examples/js/nodes/inputs/IntNode.js

@@ -6,7 +6,7 @@ THREE.IntNode = function ( value ) {
 
 	THREE.InputNode.call( this, 'iv1' );
 
-	this.value = [ Math.floor( value || 0 ) ];
+	this.value = Math.floor( value || 0 );
 
 };
 
@@ -14,24 +14,9 @@ THREE.IntNode.prototype = Object.create( THREE.InputNode.prototype );
 THREE.IntNode.prototype.constructor = THREE.IntNode;
 THREE.IntNode.prototype.nodeType = "Int";
 
-Object.defineProperties( THREE.IntNode.prototype, {
-	number: {
-		get: function () {
-
-			return this.value[ 0 ];
-
-		},
-		set: function ( val ) {
-
-			this.value[ 0 ] = Math.floor( val );
-
-		}
-	}
-} );
-
 THREE.IntNode.prototype.generateReadonly = function ( builder, output, uuid, type, ns, needsUpdate ) {
 
-	return builder.format( this.number, type, output );
+	return builder.format( this.value, type, output );
 
 };
 
@@ -43,7 +28,7 @@ THREE.IntNode.prototype.toJSON = function ( meta ) {
 
 		data = this.createJSONNode( meta );
 
-		data.number = this.number;
+		data.value = this.value;
 
 		if ( this.readonly === true ) data.readonly = true;
 

+ 4 - 4
examples/js/nodes/utils/BlurNode.js

@@ -59,15 +59,15 @@ THREE.BlurNode.prototype.updateFrame = function ( frame ) {
 
 	if ( this.size ) {
 
-		this.horizontal.number = this.radius.x / this.size.x;
-		this.vertical.number = this.radius.y / this.size.y;
+		this.horizontal.value = this.radius.x / this.size.x;
+		this.vertical.value = this.radius.y / this.size.y;
 
 	} else if ( this.value.value && this.value.value.image ) {
 
 		var image = this.value.value.image;
 
-		this.horizontal.number = this.radius.x / image.width;
-		this.vertical.number = this.radius.y / image.height;
+		this.horizontal.value = this.radius.x / image.width;
+		this.vertical.value = this.radius.y / image.height;
 
 	}
 

+ 3 - 3
examples/js/nodes/utils/TimerNode.js

@@ -42,19 +42,19 @@ THREE.TimerNode.prototype.updateFrame = function ( frame ) {
 
 		case THREE.TimerNode.LOCAL:
 
-			this.number += frame.delta * scale;
+			this.value += frame.delta * scale;
 
 			break;
 
 		case THREE.TimerNode.DELTA:
 
-			this.number = frame.delta * scale;
+			this.value = frame.delta * scale;
 
 			break;
 
 		default:
 
-			this.number = frame.time * scale;
+			this.value = frame.time * scale;
 
 	}
 

+ 2 - 2
examples/js/nodes/utils/VelocityNode.js

@@ -74,7 +74,7 @@ THREE.VelocityNode.prototype.setTarget = function ( target ) {
 
 	if ( target ) {
 
-		this.position = target.getWorldPosition();
+		this.position = target.getWorldPosition( this.position || new THREE.Vector3() );
 		this.oldPosition = this.position.clone();
 
 	}
@@ -85,7 +85,7 @@ THREE.VelocityNode.prototype.updateFrameVelocity = function ( frame ) {
 
 	if ( this.target ) {
 
-		this.position = this.target.getWorldPosition();
+		this.position = this.target.getWorldPosition( this.position || new THREE.Vector3() );
 		this.velocity.subVectors( this.position, this.oldPosition );
 		this.oldPosition.copy( this.position );
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
examples/nodes/caustic.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
examples/nodes/displace.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
examples/nodes/wave.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
examples/nodes/xray.json


+ 1 - 0
examples/webgl_loader_nodes.html

@@ -50,6 +50,7 @@
 		<script src="js/nodes/FunctionNode.js"></script>
 		<script src="js/nodes/FunctionCallNode.js"></script>
 		<script src="js/nodes/AttributeNode.js"></script>
+		<script src="js/nodes/NodeUniform.js"></script>
 		<script src="js/nodes/NodeBuilder.js"></script>
 		<script src="js/nodes/NodeLib.js"></script>
 		<script src="js/nodes/NodeFrame.js"></script>

+ 102 - 101
examples/webgl_materials_nodes.html

@@ -50,6 +50,7 @@
 		<script src="js/nodes/FunctionNode.js"></script>
 		<script src="js/nodes/FunctionCallNode.js"></script>
 		<script src="js/nodes/AttributeNode.js"></script>
+		<script src="js/nodes/NodeUniform.js"></script>
 		<script src="js/nodes/NodeBuilder.js"></script>
 		<script src="js/nodes/NodeLib.js"></script>
 		<script src="js/nodes/NodeFrame.js"></script>
@@ -432,33 +433,33 @@
 
 					}, true );
 
-					addGui( 'roughnessA', roughnessA.number, function ( val ) {
+					addGui( 'roughnessA', roughnessA.value, function ( val ) {
 
-						roughnessA.number = val;
+						roughnessA.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'metalnessA', metalnessA.number, function ( val ) {
+					addGui( 'metalnessA', metalnessA.value, function ( val ) {
 
-						metalnessA.number = val;
+						metalnessA.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'roughnessB', roughnessB.number, function ( val ) {
+					addGui( 'roughnessB', roughnessB.value, function ( val ) {
 
-						roughnessB.number = val;
+						roughnessB.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'metalnessB', metalnessB.number, function ( val ) {
+					addGui( 'metalnessB', metalnessB.value, function ( val ) {
 
-						metalnessB.number = val;
+						metalnessB.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'normalScale', normalScale.number, function ( val ) {
+					addGui( 'normalScale', normalScale.value, function ( val ) {
 
-						normalScale.number = val;
+						normalScale.value = val;
 
 					}, false, 0, 1 );
 
@@ -539,51 +540,51 @@
 
 					}, true );
 
-					addGui( 'reflectivity', reflectivity.number, function ( val ) {
+					addGui( 'reflectivity', reflectivity.value, function ( val ) {
 
-						reflectivity.number = val;
+						reflectivity.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'clearCoat', clearCoat.number, function ( val ) {
+					addGui( 'clearCoat', clearCoat.value, function ( val ) {
 
-						clearCoat.number = val;
+						clearCoat.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'clearCoatRoughness', clearCoatRoughness.number, function ( val ) {
+					addGui( 'clearCoatRoughness', clearCoatRoughness.value, function ( val ) {
 
-						clearCoatRoughness.number = val;
+						clearCoatRoughness.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'roughnessA', roughnessA.number, function ( val ) {
+					addGui( 'roughnessA', roughnessA.value, function ( val ) {
 
-						roughnessA.number = val;
+						roughnessA.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'metalnessA', metalnessA.number, function ( val ) {
+					addGui( 'metalnessA', metalnessA.value, function ( val ) {
 
-						metalnessA.number = val;
+						metalnessA.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'roughnessB', roughnessB.number, function ( val ) {
+					addGui( 'roughnessB', roughnessB.value, function ( val ) {
 
-						roughnessB.number = val;
+						roughnessB.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'metalnessB', metalnessB.number, function ( val ) {
+					addGui( 'metalnessB', metalnessB.value, function ( val ) {
 
-						metalnessB.number = val;
+						metalnessB.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'normalScale', normalScale.number, function ( val ) {
+					addGui( 'normalScale', normalScale.value, function ( val ) {
 
-						normalScale.number = val;
+						normalScale.value = val;
 
 					}, false, 0, 1 );
 
@@ -663,21 +664,21 @@
 
 					// GUI
 
-					addGui( 'speed', speed.number, function ( val ) {
+					addGui( 'speed', speed.value, function ( val ) {
 
-						speed.number = val;
+						speed.value = val;
 
 					}, false, 0, 10 );
 
-					addGui( 'scale', scale.number, function ( val ) {
+					addGui( 'scale', scale.value, function ( val ) {
 
-						scale.number = val;
+						scale.value = val;
 
 					}, false, 0, 3 );
 
-					addGui( 'worldScale', worldScale.number, function ( val ) {
+					addGui( 'worldScale', worldScale.value, function ( val ) {
 
-						worldScale.number = val;
+						worldScale.value = val;
 
 					}, false, 0, 1 );
 
@@ -753,14 +754,14 @@
 						intensity = val;
 
 						viewZ.b.z = - intensity;
-						rim.b.number = intensity;
+						rim.b.value = intensity;
 
 
 					}, false, 0, 3 );
 
-					addGui( 'power', power.number, function ( val ) {
+					addGui( 'power', power.value, function ( val ) {
 
-						power.number = val;
+						power.value = val;
 
 					}, false, 0, 6 );
 
@@ -812,33 +813,33 @@
 
 					// GUI
 
-					addGui( 'hue', hue.number, function ( val ) {
+					addGui( 'hue', hue.value, function ( val ) {
 
-						hue.number = val;
+						hue.value = val;
 
 					}, false, 0, Math.PI * 2 );
 
-					addGui( 'saturation', sataturation.number, function ( val ) {
+					addGui( 'saturation', sataturation.value, function ( val ) {
 
-						sataturation.number = val;
+						sataturation.value = val;
 
 					}, false, 0, 2 );
 
-					addGui( 'vibrance', vibrance.number, function ( val ) {
+					addGui( 'vibrance', vibrance.value, function ( val ) {
 
-						vibrance.number = val;
+						vibrance.value = val;
 
 					}, false, - 1, 1 );
 
-					addGui( 'brightness', brightness.number, function ( val ) {
+					addGui( 'brightness', brightness.value, function ( val ) {
 
-						brightness.number = val;
+						brightness.value = val;
 
 					}, false, 0, .5 );
 
-					addGui( 'contrast', contrast.number, function ( val ) {
+					addGui( 'contrast', contrast.value, function ( val ) {
 
-						contrast.number = val;
+						contrast.value = val;
 
 					}, false, 0, 2 );
 
@@ -1026,15 +1027,15 @@
 
 					// GUI
 
-					addGui( 'reflectance', reflectance.number, function ( val ) {
+					addGui( 'reflectance', reflectance.value, function ( val ) {
 
-						reflectance.number = val;
+						reflectance.value = val;
 
 					}, false, 0, 3 );
 
-					addGui( 'power', power.number, function ( val ) {
+					addGui( 'power', power.value, function ( val ) {
 
-						power.number = val;
+						power.value = val;
 
 					}, false, 0, 5 );
 
@@ -1079,15 +1080,15 @@
 
 					// GUI
 
-					addGui( 'offset', offset.number, function ( val ) {
+					addGui( 'offset', offset.value, function ( val ) {
 
-						offset.number = val;
+						offset.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'scale', scale.number, function ( val ) {
+					addGui( 'scale', scale.value, function ( val ) {
 
-						scale.number = val;
+						scale.value = val;
 
 					}, false, 0, 10 );
 
@@ -1123,9 +1124,9 @@
 
 					// GUI
 
-					addGui( 'saturation', sat.number, function ( val ) {
+					addGui( 'saturation', sat.value, function ( val ) {
 
-						sat.number = val;
+						sat.value = val;
 
 					}, false, 0, 2 );
 
@@ -1166,15 +1167,15 @@
 
 					// GUI
 
-					addGui( 'hard', hard.number, function ( val ) {
+					addGui( 'hard', hard.value, function ( val ) {
 
-						hard.number = val;
+						hard.value = val;
 
 					}, false, 0, 20 );
 
-					addGui( 'offset', offset.number, function ( val ) {
+					addGui( 'offset', offset.value, function ( val ) {
 
-						offset.number = val;
+						offset.value = val;
 
 					}, false, - 10, 10 );
 
@@ -1244,15 +1245,15 @@
 
 					// GUI
 
-					addGui( 'speed', speed.number, function ( val ) {
+					addGui( 'speed', speed.value, function ( val ) {
 
-						speed.number = val;
+						speed.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'scale', scale.number, function ( val ) {
+					addGui( 'scale', scale.value, function ( val ) {
 
-						scale.number = val;
+						scale.value = val;
 
 					}, false, 0, 10 );
 
@@ -1333,8 +1334,8 @@
 					var colorB = new THREE.ColorNode( 0x0054df );
 
 					var depth = new THREE.CameraNode( THREE.CameraNode.DEPTH );
-					depth.near.number = 1;
-					depth.far.number = 200;
+					depth.near.value = 1;
+					depth.far.value = 200;
 
 					var colors = new THREE.Math3Node(
 						colorB,
@@ -1348,15 +1349,15 @@
 
 					// GUI
 
-					addGui( 'near', depth.near.number, function ( val ) {
+					addGui( 'near', depth.near.value, function ( val ) {
 
-						depth.near.number = val;
+						depth.near.value = val;
 
 					}, false, 1, 1200 );
 
-					addGui( 'far', depth.far.number, function ( val ) {
+					addGui( 'far', depth.far.value, function ( val ) {
 
-						depth.far.number = val;
+						depth.far.value = val;
 
 					}, false, 1, 1200 );
 
@@ -1502,27 +1503,27 @@
 
 					// GUI
 
-					addGui( 'timeScale', timeScale.number, function ( val ) {
+					addGui( 'timeScale', timeScale.value, function ( val ) {
 
-						timeScale.number = val;
+						timeScale.value = val;
 
 					}, false, 0, 5 );
 
-					addGui( 'intensity', intensity.number, function ( val ) {
+					addGui( 'intensity', intensity.value, function ( val ) {
 
-						intensity.number = val;
+						intensity.value = val;
 
 					}, false, 0, 3 );
 
-					addGui( 'scale', scale.number, function ( val ) {
+					addGui( 'scale', scale.value, function ( val ) {
 
-						scale.number = val;
+						scale.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'alpha', alpha.number, function ( val ) {
+					addGui( 'alpha', alpha.value, function ( val ) {
 
-						alpha.number = val;
+						alpha.value = val;
 
 					}, false, 0, 1 );
 
@@ -1611,9 +1612,9 @@
 
 					}, false, 0, .95 );
 
-					addGui( 'scale', scale.number, function ( val ) {
+					addGui( 'scale', scale.value, function ( val ) {
 
-						scale.number = val;
+						scale.value = val;
 
 					}, false, 0, 3 );
 
@@ -1678,15 +1679,15 @@
 
 					}, true );
 
-					addGui( 'mildness', mildness.number, function ( val ) {
+					addGui( 'mildness', mildness.value, function ( val ) {
 
-						mildness.number = val;
+						mildness.value = val;
 
 					}, false, 1, 2 );
 
-					addGui( 'fur', fur.number, function ( val ) {
+					addGui( 'fur', fur.value, function ( val ) {
 
-						fur.number = val;
+						fur.value = val;
 
 					}, false, 0, 2 );
 
@@ -1774,15 +1775,15 @@
 
 					}, true );
 
-					addGui( 'wrapLight', wrapLight.number, function ( val ) {
+					addGui( 'wrapLight', wrapLight.value, function ( val ) {
 
-						wrapLight.number = val;
+						wrapLight.value = val;
 
 					}, false, 0, 3 );
 
-					addGui( 'wrapShadow', wrapShadow.number, function ( val ) {
+					addGui( 'wrapShadow', wrapShadow.value, function ( val ) {
 
-						wrapShadow.number = val;
+						wrapShadow.value = val;
 
 					}, false, - 1, 0 );
 
@@ -1877,21 +1878,21 @@
 
 					}, true );
 
-					addGui( 'count', count.number, function ( val ) {
+					addGui( 'count', count.value, function ( val ) {
 
-						count.number = val;
+						count.value = val;
 
 					}, false, 1, 8 );
 
-					addGui( 'lineSize', lineSize.number, function ( val ) {
+					addGui( 'lineSize', lineSize.value, function ( val ) {
 
-						lineSize.number = val;
+						lineSize.value = val;
 
 					}, false, 0, 1 );
 
-					addGui( 'lineInner', lineInner.number, function ( val ) {
+					addGui( 'lineInner', lineInner.value, function ( val ) {
 
-						lineInner.number = val;
+						lineInner.value = val;
 
 					}, false, 0, 1 );
 
@@ -1947,9 +1948,9 @@
 
 					// GUI
 
-					addGui( 'speed', speed.number, function ( val ) {
+					addGui( 'speed', speed.value, function ( val ) {
 
-						speed.number = val;
+						speed.value = val;
 
 					}, false, 0, 1 );
 
@@ -2081,9 +2082,9 @@
 
 					// GUI
 
-					addGui( 'alpha', alpha.number, function ( val ) {
+					addGui( 'alpha', alpha.value, function ( val ) {
 
-						alpha.number = val;
+						alpha.value = val;
 
 					}, false, 0, 1 );
 
@@ -2139,9 +2140,9 @@
 
 					// GUI
 
-					addGui( 'speed', speed.number, function ( val ) {
+					addGui( 'speed', speed.value, function ( val ) {
 
-						speed.number = val;
+						speed.value = val;
 
 					}, false, 0, 3 );
 
@@ -2292,9 +2293,9 @@
 
 					}, true );
 
-					addGui( 'area', sss.b.number, function ( val ) {
+					addGui( 'area', sss.b.value, function ( val ) {
 
-						sss.b.number = val;
+						sss.b.value = val;
 
 					}, false, 0, 1 );
 

+ 1 - 0
examples/webgl_mirror_nodes.html

@@ -48,6 +48,7 @@
 		<script src="js/nodes/ConstNode.js"></script>
 		<script src="js/nodes/FunctionNode.js"></script>
 		<script src="js/nodes/FunctionCallNode.js"></script>
+		<script src="js/nodes/NodeUniform.js"></script>
 		<script src="js/nodes/NodeBuilder.js"></script>
 		<script src="js/nodes/NodeLib.js"></script>
 		<script src="js/nodes/NodeFrame.js"></script>

+ 23 - 22
examples/webgl_postprocessing_nodes.html

@@ -49,6 +49,7 @@
 		<script src="js/nodes/ConstNode.js"></script>
 		<script src="js/nodes/FunctionNode.js"></script>
 		<script src="js/nodes/FunctionCallNode.js"></script>
+		<script src="js/nodes/NodeUniform.js"></script>
 		<script src="js/nodes/NodeBuilder.js"></script>
 		<script src="js/nodes/NodeLib.js"></script>
 		<script src="js/nodes/NodeFrame.js"></script>
@@ -201,33 +202,33 @@
 
 						// GUI
 
-						addGui( 'hue', hue.number, function ( val ) {
+						addGui( 'hue', hue.value, function ( val ) {
 
-							hue.number = val;
+							hue.value = val;
 
 						}, false, 0, Math.PI * 2 );
 
-						addGui( 'saturation', sataturation.number, function ( val ) {
+						addGui( 'saturation', sataturation.value, function ( val ) {
 
-							sataturation.number = val;
+							sataturation.value = val;
 
 						}, false, 0, 2 );
 
-						addGui( 'vibrance', vibrance.number, function ( val ) {
+						addGui( 'vibrance', vibrance.value, function ( val ) {
 
-							vibrance.number = val;
+							vibrance.value = val;
 
 						}, false, - 1, 1 );
 
-						addGui( 'brightness', brightness.number, function ( val ) {
+						addGui( 'brightness', brightness.value, function ( val ) {
 
-							brightness.number = val;
+							brightness.value = val;
 
 						}, false, 0, .5 );
 
-						addGui( 'contrast', contrast.number, function ( val ) {
+						addGui( 'contrast', contrast.value, function ( val ) {
 
-							contrast.number = val;
+							contrast.value = val;
 
 						}, false, 0, 2 );
 
@@ -257,9 +258,9 @@
 
 						}, true );
 
-						addGui( 'fade', percent.number, function ( val ) {
+						addGui( 'fade', percent.value, function ( val ) {
 
-							percent.number = val;
+							percent.value = val;
 
 						}, false, 0, 1 );
 
@@ -285,9 +286,9 @@
 
 						// GUI
 
-						addGui( 'alpha', alpha.number, function ( val ) {
+						addGui( 'alpha', alpha.value, function ( val ) {
 
-							alpha.number = val;
+							alpha.value = val;
 
 						}, false, 0, 1 );
 
@@ -345,9 +346,9 @@
 
 						// GUI
 
-						addGui( 'saturation', sat.number, function ( val ) {
+						addGui( 'saturation', sat.value, function ( val ) {
 
-							sat.number = val;
+							sat.value = val;
 
 						}, false, 0, 2 );
 
@@ -398,9 +399,9 @@
 
 						// GUI
 
-						addGui( 'scale', scale.number, function ( val ) {
+						addGui( 'scale', scale.value, function ( val ) {
 
-							scale.number = val;
+							scale.value = val;
 
 						}, false, 0, 1 );
 
@@ -450,15 +451,15 @@
 
 						// GUI
 
-						addGui( 'scale', scale.number, function ( val ) {
+						addGui( 'scale', scale.value, function ( val ) {
 
-							scale.number = val;
+							scale.value = val;
 
 						}, false, 16, 1024 );
 
-						addGui( 'fade', fade.number, function ( val ) {
+						addGui( 'fade', fade.value, function ( val ) {
 
-							fade.number = val;
+							fade.value = val;
 
 						}, false, 0, 1 );
 

+ 1 - 0
examples/webgl_sprites_nodes.html

@@ -49,6 +49,7 @@
 		<script src="js/nodes/FunctionNode.js"></script>
 		<script src="js/nodes/FunctionCallNode.js"></script>
 		<script src="js/nodes/AttributeNode.js"></script>
+		<script src="js/nodes/NodeUniform.js"></script>
 		<script src="js/nodes/NodeBuilder.js"></script>
 		<script src="js/nodes/NodeLib.js"></script>
 		<script src="js/nodes/NodeFrame.js"></script>

Vissa filer visades inte eftersom för många filer har ändrats