Skip to content

Commit

Permalink
RenderTarget: Clean up. (mrdoob#26775)
Browse files Browse the repository at this point in the history
* RenderTarget: Clean up.

* use `Object.assign()`

* remove duplicate code
  • Loading branch information
linbingquan authored Sep 23, 2023
1 parent 72d0d3c commit 27f0400
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/core/RenderTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,29 @@ class RenderTarget extends EventDispatcher {

}

options = Object.assign( {
generateMipmaps: false,
internalFormat: null,
minFilter: LinearFilter,
depthBuffer: true,
stencilBuffer: false,
depthTexture: null,
samples: 0
}, options );

this.texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
this.texture.isRenderTargetTexture = true;

this.texture.flipY = false;
this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;
this.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null;
this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;
this.texture.generateMipmaps = options.generateMipmaps;
this.texture.internalFormat = options.internalFormat;

this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false;
this.depthBuffer = options.depthBuffer;
this.stencilBuffer = options.stencilBuffer;

this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;
this.depthTexture = options.depthTexture;

this.samples = options.samples !== undefined ? options.samples : 0;
this.samples = options.samples;

}

Expand Down

0 comments on commit 27f0400

Please sign in to comment.