Constructor
new RenderTarget3D(width, height, depth)
Parameters:
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.
Type:
- Number
- Default Value
- 0
activeMipmapLevel :Number
Specifies the active mipmap level. This is only available in WebGL2.
Type:
- Number
- Default Value
- 0
height :Number
The height of the render target.
Type:
- Number
- Overrides
(readonly) isRenderTarget :Boolean
Type:
- Boolean
- Overrides
- Default Value
- true
(readonly) isRenderTarget3D :Boolean
Type:
- Boolean
- Default Value
- true
width :Number
The width of the render target.
Type:
- Number
- Overrides
Methods
addEventListener(type, listener, thisObjectopt)
Adds a listener to an event type.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | String | The type of event to listen to. | ||
listener | function | The function that gets called when the event is fired. | ||
thisObject | Object | <optional> | this | The Object of calling listener method. |
attach(target, attachmentopt)
Attach a texture(RTT) or renderbuffer to the framebuffer. Notice: For now, dynamic Attachment during rendering is not supported.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
target | t3d. | |||
attachment | t3d. | <optional> | t3d.ATTACHMENT.COLOR_ATTACHMENT0 |
detach(attachmentopt)
Detach a texture(RTT) or renderbuffer.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
attachment | t3d. | <optional> | t3d.ATTACHMENT.COLOR_ATTACHMENT0 |
dispatchEvent(event)
Fire an event.
Parameters:
Name | Type | Description |
---|---|---|
event | Object | The event that gets fired. |
- Overrides
dispose(disposeAttachmentsopt)
Dispose the render target.
Parameters:
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, thisObjectopt)
Removes a listener from an event type.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | String | The type of the listener that gets removed. | ||
listener | function | The listener function that gets removed. | ||
thisObject | Object | <optional> | this | thisObject - The Object of calling listener method. |
resize(width, height, depth) → {Boolean}
Resize the render target.
Parameters:
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
Returns:
- If size changed.
- Type:
- Boolean