소스 검색

Clean up.

Mr.doob 9 년 전
부모
커밋
4e9bfb2549
2개의 변경된 파일16개의 추가작업 그리고 12개의 파일을 삭제
  1. 8 6
      examples/js/postprocessing/AdaptiveToneMappingPass.js
  2. 8 6
      src/renderers/WebGLRenderer.js

+ 8 - 6
examples/js/postprocessing/AdaptiveToneMappingPass.js

@@ -132,9 +132,10 @@ THREE.AdaptiveToneMappingPass.prototype = {
 		if ( this.needsInit ) {
 
 			this.reset( renderer );
-			this.luminanceRT.type = readBuffer.type;
-			this.previousLuminanceRT.type = readBuffer.type;
-			this.currentLuminanceRT.type = readBuffer.type;
+
+			this.luminanceRT.texture.type = readBuffer.texture.type;
+			this.previousLuminanceRT.texture.type = readBuffer.texture.type;
+			this.currentLuminanceRT.texture.type = readBuffer.texture.type;
 			this.needsInit = false;
 
 		}
@@ -188,11 +189,12 @@ THREE.AdaptiveToneMappingPass.prototype = {
 		var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
 
 		this.luminanceRT = new THREE.WebGLRenderTarget( this.resolution, this.resolution, pars );
-		this.luminanceRT.generateMipmaps = false;
+		this.luminanceRT.texture.generateMipmaps = false;
+
 		this.previousLuminanceRT = new THREE.WebGLRenderTarget( this.resolution, this.resolution, pars );
-		this.previousLuminanceRT.generateMipmaps = false;
+		this.previousLuminanceRT.texture.generateMipmaps = false;
 
-		//We only need mipmapping for the current luminosity because we want a down-sampled version to sample in our adaptive shader
+		// We only need mipmapping for the current luminosity because we want a down-sampled version to sample in our adaptive shader
 		pars.minFilter = THREE.LinearMipMapLinearFilter;
 		this.currentLuminanceRT = new THREE.WebGLRenderTarget( this.resolution, this.resolution, pars );
 

+ 8 - 6
src/renderers/WebGLRenderer.js

@@ -1168,10 +1168,12 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( renderTarget ) {
 
 			var texture = renderTarget.texture;
-			var isTargetPowerOfTwo = isPowerOfTwo( renderTarget );
-			if ( texture.generateMipmaps && isTargetPowerOfTwo && texture.minFilter !== THREE.NearestFilter && texture.minFilter !== THREE.LinearFilter ) {
 
-				 updateRenderTargetMipmap( renderTarget );
+			if ( texture.generateMipmaps && isPowerOfTwo( renderTarget ) &&
+					texture.minFilter !== THREE.NearestFilter &&
+					texture.minFilter !== THREE.LinearFilter ) {
+
+				updateRenderTargetMipmap( renderTarget );
 
 			}
 
@@ -2621,7 +2623,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				}
 
 				var lightUniforms = light.__webglUniforms;
-				zlights.point[ writeIndexPoint ++ ] = lightUniforms; 
+				zlights.point[ writeIndexPoint ++ ] = lightUniforms;
 
 				if ( ! light.visible ) {
 					lightUniforms.color.setRGB( 0, 0, 0 );
@@ -2649,7 +2651,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				}
 
 				var lightUniforms = light.__webglUniforms;
-				zlights.spot[ writeIndexSpot ++ ] = lightUniforms; 
+				zlights.spot[ writeIndexSpot ++ ] = lightUniforms;
 
 				if ( ! light.visible ) {
 					lightUniforms.color.setRGB( 0, 0, 0 );
@@ -2682,7 +2684,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				}
 
 				var lightUniforms = light.__webglUniforms;
-				zlights.hemi[ writeIndexHemi ++ ] = lightUniforms; 
+				zlights.hemi[ writeIndexHemi ++ ] = lightUniforms;
 
 				if ( ! light.visible ) {
 					lightUniforms.skyColor.setRGB( 0, 0, 0 );