Constructor
new RenderTarget( width : number, height : number, options : RenderTarget~Options )
Constructs a new render target.
width |
The width of the render target. |
height |
The height of the render target. |
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. |
Type Definitions
.Options
Render target options.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
generateMipmaps |
boolean |
<optional> |
false | Whether to generate mipmaps or not. |
magFilter |
number |
<optional> |
LinearFilter | The mag filter. |
minFilter |
number |
<optional> |
LinearFilter | The min filter. |
format |
number |
<optional> |
RGBAFormat | The texture format. |
type |
number |
<optional> |
UnsignedByteType | The texture type. |
internalFormat |
string |
<optional> <nullable> |
null | The texture's internal format. |
wrapS |
number |
<optional> |
ClampToEdgeWrapping | The texture's uv wrapping mode. |
wrapT |
number |
<optional> |
ClampToEdgeWrapping | The texture's uv wrapping mode. |
anisotropy |
number |
<optional> |
1 | The texture's anisotropy value. |
colorSpace |
string |
<optional> |
NoColorSpace | The texture's color space. |
depthBuffer |
boolean |
<optional> |
true | Whether to allocate a depth buffer or not. |
stencilBuffer |
boolean |
<optional> |
false | Whether to allocate a stencil buffer or not. |
resolveDepthBuffer |
boolean |
<optional> |
true | Whether to resolve the depth buffer or not. |
resolveStencilBuffer |
boolean |
<optional> |
true | Whether to resolve the stencil buffer or not. |
depthTexture |
Texture |
<optional> <nullable> |
null | Reference to a depth texture. |
samples |
number |
<optional> |
0 | The MSAA samples count. |
count |
number |
<optional> |
1 | Defines the number of color attachments . Must be at least |
depth |
number |
<optional> |
1 | The texture depth. |
multiview |
boolean |
<optional> |
false | Whether this target is used for multiview rendering. |