|
@@ -2922,16 +2922,15 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );
|
|
|
_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );
|
|
|
|
|
|
- texture.image = clampToMaxSize( texture.image, capabilities.maxTextureSize );
|
|
|
+ var image = clampToMaxSize( texture.image, capabilities.maxTextureSize );
|
|
|
|
|
|
- if ( textureNeedsPowerOfTwo( texture ) && isPowerOfTwo( texture.image ) === false ) {
|
|
|
+ if ( textureNeedsPowerOfTwo( texture ) && isPowerOfTwo( image ) === false ) {
|
|
|
|
|
|
- texture.image = makePowerOfTwo( texture.image );
|
|
|
+ image = makePowerOfTwo( image );
|
|
|
|
|
|
}
|
|
|
|
|
|
- var image = texture.image,
|
|
|
- isImagePowerOfTwo = isPowerOfTwo( image ),
|
|
|
+ var isImagePowerOfTwo = isPowerOfTwo( image ),
|
|
|
glFormat = paramThreeToGL( texture.format ),
|
|
|
glType = paramThreeToGL( texture.type );
|
|
|
|
|
@@ -3009,7 +3008,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, texture.image );
|
|
|
+ state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, image );
|
|
|
|
|
|
}
|
|
|
|