|
@@ -3351,8 +3351,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- _gl.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
- _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
|
|
|
+ state.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
+ state.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
|
|
|
|
|
|
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
|
|
|
_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );
|
|
@@ -3469,8 +3469,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- _gl.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
- _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
|
|
|
+ state.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
+ state.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture );
|
|
|
|
|
|
};
|
|
|
|
|
@@ -3516,8 +3516,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- _gl.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
- _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.image.__webglTextureCube );
|
|
|
+ state.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
+ state.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.image.__webglTextureCube );
|
|
|
|
|
|
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
|
|
|
|
|
@@ -3605,8 +3605,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- _gl.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
- _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.image.__webglTextureCube );
|
|
|
+ state.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
+ state.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.image.__webglTextureCube );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -3616,8 +3616,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
function setCubeTextureDynamic ( texture, slot ) {
|
|
|
|
|
|
- _gl.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
- _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.__webglTexture );
|
|
|
+ state.activeTexture( _gl.TEXTURE0 + slot );
|
|
|
+ state.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.__webglTexture );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -3684,7 +3684,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
renderTarget.__webglFramebuffer = [];
|
|
|
renderTarget.__webglRenderbuffer = [];
|
|
|
|
|
|
- _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTarget.__webglTexture );
|
|
|
+ state.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTarget.__webglTexture );
|
|
|
+
|
|
|
setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget, isTargetPowerOfTwo );
|
|
|
|
|
|
for ( var i = 0; i < 6; i ++ ) {
|
|
@@ -3715,7 +3716,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- _gl.bindTexture( _gl.TEXTURE_2D, renderTarget.__webglTexture );
|
|
|
+ state.bindTexture( _gl.TEXTURE_2D, renderTarget.__webglTexture );
|
|
|
setTextureParameters( _gl.TEXTURE_2D, renderTarget, isTargetPowerOfTwo );
|
|
|
|
|
|
_gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
|
|
@@ -3748,11 +3749,11 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
if ( isCube ) {
|
|
|
|
|
|
- _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, null );
|
|
|
+ state.bindTexture( _gl.TEXTURE_CUBE_MAP, null );
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- _gl.bindTexture( _gl.TEXTURE_2D, null );
|
|
|
+ state.bindTexture( _gl.TEXTURE_2D, null );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -3859,15 +3860,15 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
if ( renderTarget instanceof THREE.WebGLRenderTargetCube ) {
|
|
|
|
|
|
- _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTarget.__webglTexture );
|
|
|
+ state.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTarget.__webglTexture );
|
|
|
_gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );
|
|
|
- _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, null );
|
|
|
+ state.bindTexture( _gl.TEXTURE_CUBE_MAP, null );
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- _gl.bindTexture( _gl.TEXTURE_2D, renderTarget.__webglTexture );
|
|
|
+ state.bindTexture( _gl.TEXTURE_2D, renderTarget.__webglTexture );
|
|
|
_gl.generateMipmap( _gl.TEXTURE_2D );
|
|
|
- _gl.bindTexture( _gl.TEXTURE_2D, null );
|
|
|
+ state.bindTexture( _gl.TEXTURE_2D, null );
|
|
|
|
|
|
}
|
|
|
|