Constructor
new RenderTarget3D(width, height, depth)
Name | Type | Description |
---|---|---|
width | number | The width of the render target. |
height | number | The height of the render target. |
depth | number | The depth of the render target. |
Extends
Members
activeLayer :number
Specifies the layer. This is only available in WebGL2.
- number
- Default Value
- 0
activeMipmapLevel :number
Specifies the active mipmap level. This is only available in WebGL2.
- number
- Default Value
- 0
clearColor :boolean
Whether to clear the color buffer before rendering to this render target.
- boolean
- Overrides
- Default Value
- true
clearDepth :boolean
Whether to clear the depth buffer before rendering to this render target.
- boolean
- Overrides
- Default Value
- true
clearStencil :boolean
Whether to clear the stencil buffer before rendering to this render target.
- boolean
- Overrides
- Default Value
- true
colorClearValue :Color4
Clear color value.
- Overrides
depthClearValue :number
Clear depth value.
- number
- Overrides
- Default Value
- 1
height :number
The height of the render target.
- number
- Overrides
(readonly) isRenderTarget :boolean
This flag can be used for type testing.
- boolean
- Overrides
- Default Value
- true
(readonly) isRenderTarget3D :boolean
This flag can be used for type testing.
- boolean
- Default Value
- true
occlusionQuerySet :QuerySet|null
A querySet that will store the occlusion query results. If null, occlusion queries are disabled.
- QuerySet |
null
- Overrides
- Default Value
- null
stencilClearValue :number
Clear stencil value.
- number
- Overrides
- Default Value
- 0
timestampWrites :object
An array of objects defining where and when timestamp query values will be written.
- object
Name | Type | Description |
---|---|---|
querySet | QuerySet | | A timestamp querySet. If null, timestamp queries are disabled. |
beginningOfPassWriteIndex | number | A number specifying the query index in querySet where the timestamp at the beginning of the render pass will be written. |
endOfPassWriteIndex | number | A number specifying the query index in querySet where the timestamp at the end of the render pass will be written. |
- Overrides
width :number
The width of the render target.
- number
- Overrides
Methods
addEventListener(type, listener)
Adds a listener to an event type.
Name | Type | Description |
---|---|---|
type | string | The type of event to listen to. |
listener | function | The function that gets called when the event is fired. |
- Overrides
attach(target, attachmentopt)
Attach a texture(RTT) or renderbuffer to the framebuffer. Notice: For now, dynamic Attachment during rendering is not supported.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
target | Texture3D | | |||
attachment | ATTACHMENT | <optional> | ATTACHMENT.COLOR_ATTACHMENT0 |
detach(attachmentopt)
Detach a texture(RTT) or renderbuffer.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
attachment | ATTACHMENT | <optional> | ATTACHMENT.COLOR_ATTACHMENT0 |
dispatchEvent(event)
Fire an event.
Name | Type | Description |
---|---|---|
event | object | The event that gets fired. |
- Overrides
dispose(disposeAttachmentsopt)
Dispose the render target.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
disposeAttachments | boolean | <optional> | true | whether to dispose textures and render buffers attached on this render target. |
- Overrides
removeEventListener(type, listener)
Removes a listener from an event type.
Name | Type | Description |
---|---|---|
type | string | The type of the listener that gets removed. |
listener | function | The listener function that gets removed. |
- Overrides
resize(width, height, depth) → {boolean}
Resize the render target.
Name | Type | Description |
---|---|---|
width | number | The width of the render target. |
height | number | The height of the render target. |
depth | number | The depth of the render target. |
- Overrides
- If size changed.
- Type:
- boolean
setClear(coloropt, depthopt, stencilopt) → {RenderTargetBase}
Sets the clear state.
Name | Type | Attributes | Description |
---|---|---|---|
color | boolean | <optional> | Whether to clear the color buffer. |
depth | boolean | <optional> | Whether to clear the depth buffer. |
stencil | boolean | <optional> | Whether to clear the stencil buffer. |
- Overrides
A reference to this render target.
- Type:
- RenderTargetBase
setColorClearValue(r, g, b, a) → {RenderTargetBase}
Sets the clear values.
Name | Type | Description |
---|---|---|
r | number | Red channel value between 0.0 and 1.0. |
g | number | Green channel value between 0.0 and 1.0. |
b | number | Blue channel value between 0.0 and 1.0. |
a | number | Alpha channel value between 0.0 and 1.0. |
- Overrides
A reference to this render target.
- Type:
- RenderTargetBase
setDepthClearValue(depth) → {RenderTargetBase}
Sets the clear depth value.
Name | Type | Description |
---|---|---|
depth | number | The depth value. |
- Overrides
A reference to this render target.
- Type:
- RenderTargetBase
setOcclusionQuerySet(querySet) → {RenderTargetBase}
Sets the occlusion query set.
Name | Type | Description |
---|---|---|
querySet | QuerySet | | The occlusion query set. If null, occlusion queries are disabled. |
A reference to this render target.
- Type:
- RenderTargetBase
setStencilClearValue(stencil) → {RenderTargetBase}
Sets the clear stencil value.
Name | Type | Description |
---|---|---|
stencil | number | The stencil value. |
A reference to this render target.
- Type:
- RenderTargetBase
setTimestampWrites(querySet, beginIndexopt, endIndexopt) → {RenderTargetBase}
Sets the timestamp query set and the query indices.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
querySet | QuerySet | | The timestamp query set. If null, timestamp queries are disabled. | ||
beginIndex | number | <optional> | 0 | The query index in querySet where the timestamp at the beginning of the render pass will be written. |
endIndex | number | <optional> | 1 | The query index in querySet where the timestamp at the end of the render pass will be written. |
- Overrides
A reference to this render target.
- Type:
- RenderTargetBase