Constructor
new RenderTarget( width : number, height : number, options : RenderTarget~Options )
Constructs a new render target.
| width |
The width of the render target. Default is |
| height |
The height of the render target. Default is |
| options |
The configuration object. |
Properties
.depth : number
The depth of the render target.
Default is 1.
.depthBuffer : boolean
Whether to allocate a depth buffer or not.
Default is true.
.depthTexture : DepthTexture
Instead of saving the depth in a renderbuffer, a texture can be used instead which is useful for further processing e.g. in context of post-processing.
Default is null.
.height : number
The height of the render target.
Default is 1.
.isRenderTarget : boolean (readonly)
This flag can be used for type testing.
Default is true.
.multiview : boolean
Whether to this target is used in multiview rendering.
Default is false.
.resolveDepthBuffer : boolean
Whether to resolve the depth buffer or not.
Default is true.
.resolveStencilBuffer : boolean
Whether to resolve the stencil buffer or not.
Default is true.
.samples : number
The number of MSAA samples.
A value of 0 disables MSAA.
Default is 0.
.scissor : Vector4
A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
Default is (0,0,width,height).
.scissorTest : boolean
Indicates whether the scissor test should be enabled when rendering into this render target or not.
Default is false.
.stencilBuffer : boolean
Whether to allocate a stencil buffer or not.
Default is false.
.textures : Array.<Texture>
An array of textures. Each color attachment is represented as a separate texture. Has at least a single entry for the default color attachment.
.viewport : Vector4
A rectangular area representing the render target's viewport.
Default is (0,0,width,height).
.width : number
The width of the render target.
Default is 1.
Methods
.clone() : RenderTarget
Returns a new render target with copied values from this instance.
- Returns: A clone of this instance.
.copy( source : RenderTarget ) : RenderTarget
Copies the settings of the given render target. This is a structural copy so no resources are shared between render targets after the copy. That includes all MRT textures and the depth texture.
| source |
The render target to copy. |
- Returns: A reference to this instance.
.dispose()
Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
Fires:
- RenderTarget#event:dispose
.setSize( width : number, height : number, depth : number )
Sets the size of this render target.
| width |
The width. |
| height |
The height. |
| depth |
The depth. Default is |
Type Definitions
.Options
Render target options.
|
generateMipmaps
boolean |
Whether to generate mipmaps or not. Default is |
|
magFilter
number |
The mag filter. Default is |
|
minFilter
number |
The min filter. Default is |
|
format
number |
The texture format. Default is |
|
type
number |
The texture type. Default is |
|
internalFormat
string |
The texture's internal format. Default is |
|
wrapS
number |
The texture's uv wrapping mode. Default is |
|
wrapT
number |
The texture's uv wrapping mode. Default is |
|
anisotropy
number |
The texture's anisotropy value. Default is |
|
colorSpace
string |
The texture's color space. Default is |
|
depthBuffer
boolean |
Whether to allocate a depth buffer or not. Default is |
|
stencilBuffer
boolean |
Whether to allocate a stencil buffer or not. Default is |
|
resolveDepthBuffer
boolean |
Whether to resolve the depth buffer or not. Default is |
|
resolveStencilBuffer
boolean |
Whether to resolve the stencil buffer or not. Default is |
|
depthTexture
Texture |
Reference to a depth texture. Default is |
|
samples
number |
The MSAA samples count. Default is |
|
count
number |
Defines the number of color attachments . Must be at least Default is |
|
depth
number |
The texture depth. Default is |
|
multiview
boolean |
Whether this target is used for multiview rendering. Default is |