# [name]

[link:https://webglfundamentals.org/webgl/lessons/webgl-render-to-texture.html render target]是一个缓冲，就是在这个缓冲中，视频卡为正在后台渲染的场景绘制像素。 它用于不同的效果，例如用于在一个图像显示在屏幕上之前先做一些处理。

## 构造器

### [name]([param:Number width], [param:Number height], [param:Object options])

[page:Float width] -renderTarget的宽度. Default is `1`.
[page:Float height] - renderTarget的高度. Default is `1`.
options - (可选)一个保存着自动生成的目标纹理的纹理参数以及表示是否使用深度缓存/模板缓存的布尔值的对象 以下是一些合法选项：
[page:Constant wrapS] - 默认是[page:Textures ClampToEdgeWrapping].
[page:Constant wrapT] - 默认是[page:Textures ClampToEdgeWrapping].
[page:Constant magFilter] - 默认是[page:Textures LinearFilter].
[page:Constant minFilter] - 默认是[page:Textures LinearFilter].
[page:Boolean generateMipmaps] - 默认是`false`.
[page:Constant format] - 默认是[page:Textures RGBAFormat].
[page:Constant type] - 默认是[page:Textures UnsignedByteType].
[page:Number anisotropy] - 默认是`1`. 参见[page:Texture.anisotropy]
[page:Constant colorSpace] - 默认是[page:Textures NoColorSpace].
[page:String internalFormat] - 默认是 `null`.
[page:Boolean depthBuffer] - 默认是`true`.
[page:Boolean stencilBuffer] - 默认是`false`.
[page:Boolean resolveDepthBuffer] - 默认是`true`.
[page:Boolean resolveStencilBuffer] - 默认是`true`.
[page:Number samples] - 默认是`0`.
[page:Number count] - default is `1`.
创建一个新[name]

## 属性

### [property:Boolean isWebGLRenderTarget]

Read-only flag to check if a given object is of type [name].

### [property:number width]

渲染目标宽度

### [property:number height]

渲染目标高度

### [property:Vector4 scissor]

渲染目标视口内的一个矩形区域，区域之外的片元将会被丢弃

### [property:Boolean scissorTest]

表明是否激活了剪裁测试

### [property:Vector4 viewport]

渲染目标的视口

### [property:Texture texture]

纹理实例保存这渲染的像素，用作进一步处理的输入值

### [property:Texture textures]

An array holding the [page:WebGLRenderTarget.texture texture] references of multiple render targets configured with the [page:Number count] option.

### [property:Boolean depthBuffer]

渲染到深度缓冲区。默认true.

### [property:Boolean stencilBuffer]

渲染到模板缓冲区。默认为false.

### [property:Boolean resolveDepthBuffer]

Defines whether the depth buffer should be resolved when rendering into a multisampled render target. 默认为`true`.

### [property:Boolean resolveStencilBuffer]

Defines whether the stencil buffer should be resolved when rendering into a multisampled render target. This property has no effect when [page:.resolveDepthBuffer] is set to `false`. 默认为`true`.

### [property:DepthTexture depthTexture]

如果设置，那么场景的深度将会被渲染到此纹理上。默认为null

### [property:Number samples]

Defines the count of MSAA samples. Default is *0*.

## 方法

### [method:null setSize]( [param:Number width], [param:Number height] )

设置渲染目标的大小

### [method:WebGLRenderTarget clone]()

创建一个渲染目标副本

### [method:this copy]( [param:WebGLRenderTarget source] )

采用传入的渲染目标的设置

### [method:null dispose]()

发出一个处理事件

### [page:EventDispatcher EventDispatcher]方法可从此类中获得

## 源码

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]