소스 검색

SoftwareRenderer: Use Math.nextPowerOfTwo.

Mr.doob 10 년 전
부모
커밋
c0a1a36478
1개의 변경된 파일1개의 추가작업 그리고 12개의 파일을 삭제
  1. 1 12
      examples/js/renderers/SoftwareRenderer.js

+ 1 - 12
examples/js/renderers/SoftwareRenderer.js

@@ -1117,18 +1117,7 @@ THREE.SoftwareRenderer.Texture = function() {
 		}
 
 		var dim = image.width > image.height ? image.width : image.height;
-		if(dim <= 32)
-			dim = 32;
-		else if(dim <= 64)
-			dim = 64;
-		else if(dim <= 128)
-			dim = 128;
-		else if(dim <= 256)
-			dim = 256;
-		else if(dim <= 512)
-			dim = 512;
-		else
-			dim = 1024;
+		dim = THREE.Math.nextPowerOfTwo( dim );
 
 		if(canvas.width != dim || canvas.height != dim) {
 			canvas.width = canvas.height = dim;