Skip to content

Commit 2e8c40d

Browse files
committed
add support for specifying the desired mipmap level of a cube to render into.
1 parent 44cb3ca commit 2e8c40d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/renderers/WebGLRenderTargetCube.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ THREE.WebGLRenderTargetCube = function ( width, height, options ) {
77
THREE.WebGLRenderTarget.call( this, width, height, options );
88

99
this.activeCubeFace = 0; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5
10+
this.activeMipMapLevel = 0;
1011

1112
};
1213

src/renderers/WebGLRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3391,7 +3391,7 @@ THREE.WebGLRenderer = function ( parameters ) {
33913391
if ( isCube ) {
33923392

33933393
var textureProperties = properties.get( renderTarget.texture );
3394-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, textureProperties.__webglTexture, 0 );
3394+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, textureProperties.__webglTexture, renderTarget.activeMipMapLevel );
33953395

33963396
}
33973397

0 commit comments

Comments
 (0)