瀏覽代碼

WebGLUniforms: Removed set().

Mr.doob 8 年之前
父節點
當前提交
c794292c77
共有 2 個文件被更改,包括 7 次插入15 次删除
  1. 7 7
      src/renderers/WebGLRenderer.js
  2. 0 8
      src/renderers/webgl/WebGLUniforms.js

+ 7 - 7
src/renderers/WebGLRenderer.js

@@ -1699,7 +1699,7 @@ function WebGLRenderer( parameters ) {
 
 		if ( refreshProgram || camera !== _currentCamera ) {
 
-			p_uniforms.set( _gl, camera, 'projectionMatrix' );
+			p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
 
 			if ( capabilities.logarithmicDepthBuffer ) {
 
@@ -1752,8 +1752,8 @@ function WebGLRenderer( parameters ) {
 
 			}
 
-			p_uniforms.set( _gl, _this, 'toneMappingExposure' );
-			p_uniforms.set( _gl, _this, 'toneMappingWhitePoint' );
+			p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
+			p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint );
 
 		}
 
@@ -1799,8 +1799,8 @@ function WebGLRenderer( parameters ) {
 
 					}
 
-					p_uniforms.set( _gl, skeleton, 'boneTexture' );
-					p_uniforms.set( _gl, skeleton, 'boneTextureSize' );
+					p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture );
+					p_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize );
 
 				} else {
 
@@ -1913,8 +1913,8 @@ function WebGLRenderer( parameters ) {
 
 		// common matrices
 
-		p_uniforms.set( _gl, object, 'modelViewMatrix' );
-		p_uniforms.set( _gl, object, 'normalMatrix' );
+		p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );
+		p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );
 		p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );
 
 		return program;

+ 0 - 8
src/renderers/webgl/WebGLUniforms.js

@@ -510,14 +510,6 @@ WebGLUniforms.prototype.setValue = function ( gl, name, value ) {
 
 };
 
-WebGLUniforms.prototype.set = function ( gl, object, name ) {
-
-	var u = this.map[ name ];
-
-	if ( u !== undefined ) u.setValue( gl, object[ name ], this.renderer );
-
-};
-
 WebGLUniforms.prototype.setOptional = function ( gl, object, name ) {
 
 	var v = object[ name ];