Constructor
new RenderBuffer(width, height, formatopt, multipleSamplingopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
width | number | The width of the render buffer. | ||
height | number | The height of the render buffer. | ||
format | PIXEL_FORMAT | <optional> | PIXEL_FORMAT.RGBA8 | The internal format of the render buffer. |
multipleSampling | number | <optional> | 0 | If bigger than zero, this renderBuffer will support multipleSampling. (Only usable in WebGL 2.0) |
Extends
Members
format :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
- PIXEL_FORMAT.RGBA8
height :number
The height of the render buffer.
- number
(readonly) isRenderBuffer :boolean
- 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.
- number
- Default Value
- 0
width :number
The width of the render buffer.
- number
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
clone() → {RenderBuffer}
Returns a clone of this render buffer.
- Type:
- RenderBuffer
copy(source) → {RenderBuffer}
Copy the given render buffer into this render buffer.
Name | Type | Description |
---|---|---|
source | RenderBuffer | The render buffer to be copied. |
- Type:
- RenderBuffer
dispatchEvent(event)
Fire an event.
Name | Type | Description |
---|---|---|
event | object | The event that gets fired. |
- Overrides
dispose()
Dispatches a dispose event.
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) → {boolean}
Resize the render buffer.
Name | Type | Description |
---|---|---|
width | number | The width of the render buffer. |
height | number | The height of the render buffer. |
- If size changed.
- Type:
- boolean