提交 5eb496d9 编写于 作者: M Mr.doob

Code clean up.

上级 2f86e3de
......@@ -5604,14 +5604,23 @@ THREE.WebGLRenderer = function ( parameters ) {
for ( var i = 0, il = mipmaps.length; i < il; i ++ ) {
mipmap = mipmaps[ i ];
if ( texture.format !== THREE.RGBAFormat && texture.format !== THREE.RGBFormat ) {
if ( _compressedTextureFormats.indexOf( glFormat ) > -1 ) {
_gl.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
} else {
console.warn( "Attempt to load unsupported compressed texture format" );
}
} else {
_gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
}
}
......@@ -5750,20 +5759,29 @@ THREE.WebGLRenderer = function ( parameters ) {
for ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) {
mipmap = mipmaps[ j ];
if ( texture.format !== THREE.RGBAFormat && texture.format !== THREE.RGBFormat ) {
if ( _compressedTextureFormats.indexOf( glFormat ) > -1 ) {
_gl.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
} else {
console.warn( "Attempt to load unsupported compressed texture format" );
}
} else {
_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
}
}
}
}
if ( texture.generateMipmaps && isImagePowerOfTwo ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册