t3d. RenderTargetCube

Render Target that render to cube texture.

Constructor

new RenderTargetCube(width, height)

Parameters:
NameTypeDescription
widthNumberThe width of the render target.
heightNumberThe height of the render target.

Extends

Members

activeCubeFace :Number

The activeCubeFace property corresponds to a cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5).
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) isRenderTargetCube :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.TextureCube | 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) → {Boolean}

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