提交 3c50ca7a 编写于 作者: M Mr.doob

Merge pull request #5208 from henri-astre-msft/uploadTexture

add uploadTexture to WebGLRenderer
......@@ -5610,9 +5610,7 @@ THREE.WebGLRenderer = function ( parameters ) {
};
this.setTexture = function ( texture, slot ) {
if ( texture.needsUpdate ) {
this.uploadTexture = function ( texture ) {
if ( ! texture.__webglInit ) {
......@@ -5626,7 +5624,6 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_gl.activeTexture( _gl.TEXTURE0 + slot );
_gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
......@@ -5709,9 +5706,18 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( texture.onUpdate ) texture.onUpdate();
} else {
};
this.setTexture = function ( texture, slot ) {
_gl.activeTexture( _gl.TEXTURE0 + slot );
if ( texture.needsUpdate ) {
_this.uploadTexture( texture );
} else {
_gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册