-
new Framebuffer(renderer, params)
-
帧缓冲
Name Type Description renderer
WebGLRenderer params
Object optional 初始化参数,所有params都会复制到实例上
Members Show Inherited
Name | Type | Default | Description |
---|---|---|---|
className
|
String | Framebuffer | |
isFramebuffer
|
Boolean | true | |
bufferInternalFormat
|
GLenum | gl.DEPTH_STENCIL |
bufferInternalFormat |
framebufferTarget
|
GLenum | gl.FRAMEBUFFER |
framebufferTarget |
target
|
GLenum | gl.TEXTURE_2D |
texture target |
format
|
GLenum | gl.RGBA |
texture format |
internalFormat
|
GLenum | gl.RGBA |
texture internalFormat |
type
|
GLenum | gl.UNSIGNED_BYTE |
texture type |
minFilter
|
GLenum | gl.NEAREST |
texture minFilter |
magFilter
|
GLenum | gl.NEAREST |
texture magFilter |
wrapS
|
GLenum | gl.CLAMP_TO_EDGE |
texture wrapS |
wrapT
|
GLenum | gl.CLAMP_TO_EDGE |
texture wrapS |
data
|
TypedArray | null |
texture data |
attachment
|
GLenum | gl.COLOR_ATTACHMENT0 |
attachment |
needRenderbuffer
|
Boolean | true |
是否需要renderbuffer |
useVao
|
Boolean | true |
是否使用VAO |
renderer
|
WebGLRenderer | null |
renderer |
texture
|
Texture |
texture |
|
renderbuffer
|
WebGLRenderbuffer |
renderbuffer |
|
framebuffer
|
WebGLFramebuffer |
framebuffer |
|
colorAttachmentInfos
|
Array.<AttachmentInfo> |
colorAttachmentInfos |
|
depthStencilAttachmentInfo
|
AttachmentInfo |
depthStencilAttachmentInfo |
|
framebuffer
|
WebGLFramebuffer |
framebuffer |
-
static,readonlyFramebuffer.cacheCache
-
缓存
Methods Show Inherited
-
staticFramebuffer.reset(gl)
-
重置所有framebuffer
Name Type Description gl
WebGLRenderingContext -
staticFramebuffer.destroy(gl)
-
销毁所有 Framebuffer
Name Type Description gl
WebGLRenderingContext -
init()
-
init
-
isComplete(){Boolean}
-
framebuffer 是否完成
Returns:
Type Description Boolean -
bind()
-
绑定
-
unbind()
-
解绑
-
render(x, y, width, height, clearColor)
-
渲染当前纹理
Name Type Default Description x
Number 0 optional y
Number 0 optional width
Number 1 optional height
Number 1 optional clearColor
Color null optional -
resize(width, height, force)
-
resize
Name Type Default Description width
Number height
Number force
Boolean true optional -
readPixels(x, y, width, height){TypedArray}
-
读取区域像素
Name Type Default Description x
Number y
Number width
Number 1 optional height
Number 1 optional Returns:
Type Description TypedArray -
copyFramebuffer()
-
copy framebuffer
-
destroy(){Framebuffer}
-
销毁资源
Returns:
Type Description Framebuffer this -
destroyResource(){Framebuffer}
-
只销毁 gl 资源
Returns:
Type Description Framebuffer this