Prechádzať zdrojové kódy

WebGLRenderer: Added s uniform back. See 593bb7976509bbec33885cc38f1cc3fe27adfb03.

Mr.doob 9 rokov pred
rodič
commit
23dadbe3ce
1 zmenil súbory, kde vykonal 6 pridanie a 34 odobranie
  1. 6 34
      src/renderers/WebGLRenderer.js

+ 6 - 34
src/renderers/WebGLRenderer.js

@@ -2311,50 +2311,22 @@ THREE.WebGLRenderer = function ( parameters ) {
 			// single THREE.Color
 			_gl.uniform3f( location, value.r, value.g, value.b );
 
-		/*
 		} else if ( type === 's' ) {
 
 			// TODO: Optimize this
 
-			for ( var propertyName in uniform.properties ) {
-
-				var property = uniform.properties[ propertyName ];
-				var locationProperty =  location[ propertyName ];
-				var valueProperty = value[ propertyName ];
-
-				type = property.type;
-
-				if ( type === 'i' ) {
-
-					_gl.uniform1i( locationProperty, valueProperty );
-
-				} else if ( type === 'f' ) {
-
-					_gl.uniform1f( locationProperty, valueProperty );
-
-				} else if ( type === 'v2' ) {
-
-					_gl.uniform2f( locationProperty, valueProperty.x, valueProperty.y );
-
-				} else if ( type === 'v3' ) {
-
-					_gl.uniform3f( locationProperty, valueProperty.x, valueProperty.y, valueProperty.z );
-
-				} else if ( type === 'v4' ) {
-
-					_gl.uniform4f( locationProperty, valueProperty.x, valueProperty.y, valueProperty.z, valueProperty.w );
+			var properties = uniform.properties;
 
-				} else if ( type === 'c' ) {
+			for ( var name in properties ) {
 
-					_gl.uniform3f( locationProperty, valueProperty.r, valueProperty.g, valueProperty.b );
+				var property = properties[ name ];
+				var locationProperty = location[ name ];
+				var valueProperty = value[ name ];
 
-				}
+				loadUniform( property, property.type, locationProperty, valueProperty );
 
 			}
 
-
-		*/
-
 		} else if ( type === 'sa' ) {
 
 			// TODO: Optimize this