Class: RenderBuffer
渲染缓冲区对象。 由于渲染缓冲区对象是只写的,因此它们通常用作深度和模板关联对象。
实例代码:
const renderBuffer = new RenderBuffer(renderer, {
format: renderer.gl.DEPTH_COMPONENT16,
width: 1920,
height: 1080,
});
renderBuffer.bind();
renderBuffer.unbind();
Hierarchy
-
↳
RenderBuffer
Table of contents
Constructors
Properties
Accessors
Methods
- resize
- bind
- unbind
- removeStats
- destroy
- createHandle
- deleteHandle
- swapHandle
- restoreHandle
- delete
- toString
Constructors
constructor
• new RenderBuffer(renderer
, options?
): RenderBuffer
Parameters
Name | Type |
---|---|
renderer | Renderer |
options | Partial <RenderBufferOptions > |
Returns
Overrides
Defined in
Properties
renderer
• renderer: Renderer
Inherited from
Defined in
width
• width: number
渲染缓冲区宽度
Defined in
height
• height: number
渲染缓冲区高度
Defined in
id
• id: string
Inherited from
Defined in
name
• name: WithUndef
<string
>
Inherited from
Defined in
userData
• userData: any
Inherited from
Defined in
byteLength
• byteLength: number
Inherited from
Defined in
options
• options: Partial
<RenderBufferOptions
>
Inherited from
Defined in
Accessors
gl
• get
gl(): WebGLRenderingContext
| WebGL2RenderingContext
获取 webgl
实例
Returns
WebGLRenderingContext
| WebGL2RenderingContext
Inherited from
Resource.gl
Defined in
rendererState
• get
rendererState(): State
获取渲染状态
Returns
Inherited from
Resource.rendererState
Defined in
handle
• get
handle(): any
Returns
any
Inherited from
Resource.handle
Defined in
Methods
resize
▸ resize(width
, height
): void
设置此渲染对象的的大小
Parameters
Name | Type |
---|---|
width | any |
height | any |
Returns
void
Defined in
bind
▸ bind(): void
绑定渲染缓冲
Returns
void
Overrides
Defined in
unbind
▸ unbind(): void
解绑渲染缓冲
Returns
void
Overrides
Defined in
removeStats
▸ removeStats(): void
Returns
void
Overrides
Defined in
destroy
▸ destroy(): void
销毁此渲染对象
Returns
void
Overrides
Defined in
createHandle
▸ createHandle(): null
| WebGLRenderbuffer
创建 RBO
Returns
null
| WebGLRenderbuffer
Overrides
Defined in
deleteHandle
▸ deleteHandle(): void
移除 RBO
Returns
void
Overrides
Defined in
swapHandle
▸ swapHandle(handle
): void
交换为新的 handle
(一般我们会用在虚拟 webgl 环境中)
Parameters
Name | Type |
---|---|
handle | any |
Returns
void
Inherited from
Defined in
restoreHandle
▸ restoreHandle(): void
恢复为原有 handle
Returns
void
Inherited from
Defined in
delete
▸ delete(«destructured»?
): RenderBuffer
Parameters
Name | Type | Default value |
---|---|---|
«destructured» | Object | {} |
› deleteChildren | undefined | boolean | false |
Returns
Inherited from
Defined in
toString
▸ toString(): string
Returns
string