diff --git a/src/core/RenderTarget.js b/src/core/RenderTarget.js index cde6a2b53c2869..77188fcc4ba61e 100644 --- a/src/core/RenderTarget.js +++ b/src/core/RenderTarget.js @@ -124,10 +124,6 @@ class RenderTarget extends EventDispatcher { */ this.viewport = new Vector4( 0, 0, width, height ); - const image = { width: width, height: height, depth: options.depth }; - - const texture = new Texture( image ); - /** * An array of textures. Each color attachment is represented as a separate texture. * Has at least a single entry for the default color attachment. @@ -136,6 +132,9 @@ class RenderTarget extends EventDispatcher { */ this.textures = []; + const image = { width: width, height: height, depth: options.depth }; + const texture = new Texture( image ); + const count = options.count; for ( let i = 0; i < count; i ++ ) {