提交 ae249e1b 编写于 作者: Y yomotsu

move texture.image order

上级 8e4507d1
......@@ -23,13 +23,12 @@ Object.assign( TextureLoader.prototype, {
var loader = new ImageLoader( this.manager );
loader.setCrossOrigin( this.crossOrigin );
loader.setPath( this.path );
loader.load( url, function ( image ) {
var image = loader.load( url, function ( image ) {
// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
texture.format = isJPEG ? RGBFormat : RGBAFormat;
texture.image = image;
texture.needsUpdate = true;
if ( onLoad !== undefined ) {
......@@ -40,6 +39,7 @@ Object.assign( TextureLoader.prototype, {
}, onProgress, onError );
texture.image = image;
return texture;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册