Browse Source

Uniform: Removed type. See #8606.

Mr.doob 9 years ago
parent
commit
63e415206f
2 changed files with 10 additions and 4 deletions
  1. 2 2
      examples/webgl_interactive_instances_gpu.html
  2. 8 2
      src/core/Uniform.js

+ 2 - 2
examples/webgl_interactive_instances_gpu.html

@@ -614,7 +614,7 @@
 				vertexShader: vert,
 				fragmentShader: frag,
 				uniforms: {
-					color: new THREE.Uniform( 'c', new THREE.Color() ).onUpdate( updateColor )
+					color: new THREE.Uniform( new THREE.Color() ).onUpdate( updateColor )
 				}
 			} );
 			materialList.push( material );
@@ -629,7 +629,7 @@
 				vertexShader: "#define PICKING\n" + vert,
 				fragmentShader: "#define PICKING\n" + frag,
 				uniforms: {
-					pickingColor: new THREE.Uniform( 'c', new THREE.Color() ).onUpdate( updatePickingColor )
+					pickingColor: new THREE.Uniform( new THREE.Color() ).onUpdate( updatePickingColor )
 				}
 			} );
 			materialList.push( pickingMaterial );

+ 8 - 2
src/core/Uniform.js

@@ -2,9 +2,15 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
-THREE.Uniform = function ( type, value ) {
+THREE.Uniform = function ( value ) {
+
+	if ( typeof value === 'string' ) {
+
+		console.warn( 'THREE.Uniform: Type parameter is no longer needed.' );
+		value = arguments[ 1 ];
+
+	}
 
-	this.type = type;
 	this.value = value;
 
 	this.dynamic = false;