copy method

RenderTarget copy(
  1. RenderTarget source
)

Implementation

RenderTarget copy(RenderTarget source){
		height = source.height;
  width = source.width;
		depth = source.depth;

		scissor.setFrom( source.scissor );
		scissorTest = source.scissorTest;

		viewport.setFrom( source.viewport );

		textures.length = 0;

		for (int i = 0, il = source.textures.length; i < il; i ++ ) {
			textures.add(source.textures[ i ].clone());
			textures[ i ].isRenderTargetTexture = true;
		}

		// ensure image object is not shared, see #20328

		final image = source.texture.image;
		texture.source = Source( image );

		depthBuffer = source.depthBuffer;
		stencilBuffer = source.stencilBuffer;

		resolveDepthBuffer = source.resolveDepthBuffer;
		resolveStencilBuffer = source.resolveStencilBuffer;

		if ( source.depthTexture != null ) depthTexture = source.depthTexture!.clone();

		samples = source.samples;

		return this;
}