t3d. RenderTarget3D

Render Target that render to 3d texture.

Constructor

new RenderTarget3D(width, height, depth)

Parameters:
NameTypeDescription
widthNumberThe width of the render target.
heightNumberThe height of the render target.
depthNumberThe 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

(readonly) isRenderTarget :Boolean

Type:
  • Boolean
Default Value
  • true

(readonly) isRenderTarget3D :Boolean

Type:
  • Boolean
Default Value
  • true

width :Number

The width of the render target.
Type:
  • Number

Methods

addEventListener(type, listener, thisObjectopt)

Adds a listener to an event type.
Parameters:
NameTypeAttributesDefaultDescription
typeStringThe type of event to listen to.
listenerfunctionThe function that gets called when the event is fired.
thisObjectObject<optional>
thisThe 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:
NameTypeAttributesDefaultDescription
targett3d.Texture3D | t3d.RenderBuffer
attachmentt3d.ATTACHMENT<optional>
t3d.ATTACHMENT.COLOR_ATTACHMENT0

detach(attachmentopt)

Detach a texture(RTT) or renderbuffer.
Parameters:
NameTypeAttributesDefaultDescription
attachmentt3d.ATTACHMENT<optional>
t3d.ATTACHMENT.COLOR_ATTACHMENT0

dispatchEvent(event)

Fire an event.
Parameters:
NameTypeDescription
eventObjectThe event that gets fired.

dispose(disposeAttachmentsopt)

Dispose the render target.
Parameters:
NameTypeAttributesDefaultDescription
disposeAttachmentsBoolean<optional>
truewhether to dispose textures and render buffers attached on this render target.

removeEventListener(type, listener, thisObjectopt)

Removes a listener from an event type.
Parameters:
NameTypeAttributesDefaultDescription
typeStringThe type of the listener that gets removed.
listenerfunctionThe listener function that gets removed.
thisObjectObject<optional>
thisthisObject - The Object of calling listener method.

resize(width, height, depth) → {Boolean}

Resize the render target.
Parameters:
NameTypeDescription
widthNumberThe width of the render target.
heightNumberThe height of the render target.
depthNumberThe depth of the render target.
Returns:
- If size changed.
Type: 
Boolean