提交 ce76a740 编写于 作者: A Andrew Wason

Need to set correct slot as gl.activeTexture in setTexture

Fixes lightMap bug https://github.com/mrdoob/three.js/issues/458
上级 b3f758bd
......@@ -4842,6 +4842,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_gl.activeTexture( _gl.TEXTURE0 + slot );
_gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
if ( texture.image.data ) {
......@@ -4856,10 +4857,11 @@ THREE.WebGLRenderer = function ( parameters ) {
setTextureParameters( _gl.TEXTURE_2D, texture, texture.image );
_gl.bindTexture( _gl.TEXTURE_2D, null );
texture.needsUpdate = false;
} else {
_gl.activeTexture( _gl.TEXTURE0 + slot );
_gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
}
/*
......@@ -4890,10 +4892,6 @@ THREE.WebGLRenderer = function ( parameters ) {
}
*/
_gl.activeTexture( _gl.TEXTURE0 + slot );
_gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
};
function setCubeTexture( texture, slot ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册