t3d. RenderBuffer

Render Buffer can be attached to RenderTarget.

Constructor

new RenderBuffer(width, height, formatopt, multipleSamplingopt)

Parameters:
NameTypeAttributesDefaultDescription
widthNumberThe width of the render buffer.
heightNumberThe height of the render buffer.
formatt3d.PIXEL_FORMAT<optional>
t3d.PIXEL_FORMAT.RGBA8The internal format of the render buffer.
multipleSamplingNumber<optional>
0If bigger than zero, this renderBuffer will support multipleSampling. (Only usable in WebGL 2.0)

Extends

Members

format :t3d.PIXEL_FORMAT

Render buffer texel storage data format. DEPTH_COMPONENT16: for depth attachments. DEPTH_STENCIL: for depth stencil attachments. RGBA8:for multiple sampled color attachments. DEPTH_COMPONENT16: for multiple sampled depth attachments. DEPTH24_STENCIL8: for multiple sampled depth stencil attachments.
Default Value
  • t3d.PIXEL_FORMAT.RGBA8

height :Number

The height of the render buffer.
Type:
  • Number

(readonly) isRenderBuffer :Boolean

Type:
  • Boolean
Default Value
  • true

multipleSampling :Number

If bigger than zero, this renderBuffer will support multipleSampling. (Only usable in WebGL 2.0) A Render Target's attachments must have the same multipleSampling value. Texture can't be attached to the same render target with a multiple sampled render buffer. Max support 8.
Type:
  • Number
Default Value
  • 0

width :Number

The width of the render buffer.
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.

clone() → {t3d.RenderBuffer}

Returns a clone of this render buffer.
Returns:
Type: 
t3d.RenderBuffer

copy(source) → {t3d.RenderBuffer}

Copy the given render buffer into this render buffer.
Parameters:
NameTypeDescription
sourcet3d.RenderBufferThe render buffer to be copied.
Returns:
Type: 
t3d.RenderBuffer

dispatchEvent(event)

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

dispose()

Dispatches a dispose event.

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 buffer.
Parameters:
NameTypeDescription
widthNumberThe width of the render buffer.
heightNumberThe height of the render buffer.
Returns:
- If size changed.
Type: 
Boolean