未验证 提交 70c68fba 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #13944 from takahirox/FixCopyTextureToTexture

Fix WebGLRenderer copyTextureToTexture
......@@ -2577,11 +2577,18 @@ function WebGLRenderer( parameters ) {
var height = srcTexture.image.height;
var glFormat = utils.convert( dstTexture.format );
var glType = utils.convert( dstTexture.type );
var pixels = srcTexture.isDataTexture ? srcTexture.image.data : srcTexture.image;
this.setTexture2D( dstTexture, 0 );
_gl.texSubImage2D( _gl.TEXTURE_2D, level || 0, position.x, position.y, width, height, glFormat, glType, pixels );
if ( srcTexture.isDataTexture ) {
_gl.texSubImage2D( _gl.TEXTURE_2D, level || 0, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data );
} else {
_gl.texSubImage2D( _gl.TEXTURE_2D, level || 0, position.x, position.y, glFormat, glType, srcTexture.image );
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册