Capítulo 266 de 859
A render target is a buffer where the video card draws pixels for a scene that is being rendered in the background. It is used in different effects, such as applying postprocessing to a rendered image before displaying it on the screen.
Constructor
| Signature |
|---|
new RenderTarget( width : number, height : number, options : RenderTarget~Options ) |
Properties
| Property | Description |
|---|---|
.depth : number | The depth of the render target. |
.depthBuffer : boolean | Whether to allocate a depth buffer or not. |
.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. |
.height : number | The height of the render target. |
.isRenderTarget : boolean (readonly) | This flag can be used for type testing. |
.multiview : boolean | Whether to this target is used in multiview rendering. |
.resolveDepthBuffer : boolean | Whether to resolve the depth buffer or not. |
.resolveStencilBuffer : boolean | Whether to resolve the stencil buffer or not. |
.samples : number | The number of MSAA samples. |
.scissor : Vector4 | A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded. |
.scissorTest : boolean | Indicates whether the scissor test should be enabled when rendering into this render target or not. |
.stencilBuffer : boolean | Whether to allocate a stencil buffer or not. |
.texture : Texture | The texture representing the default color attachment. |
.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. |
.useArrayDepthTexture : boolean | Whether to create the depth texture as an array texture for per-layer depth testing. This is separate from multiview so layered render targets can use array depth without the multiview extension. |
.viewport : Vector4 | A rectangular area representing the render target's viewport. |
.width : number | The width of the render target. |
Methods
| Method | Description |
|---|---|
.clone() : RenderTarget | Returns a new render target with copied values from 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. |
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app. |
.setSize( width : number, height : number, depth : number ) | Sets the size of this render target. |