Class: Framebuffer

Framebuffer

new Framebuffer(renderer, params)

帧缓冲

Name Type Description
renderer WebGLRenderer
params Object

初始化参数,所有params都会复制到实例上

Members Show Inherited

Name Type Default Description
className String Framebuffer
isFramebuffer Boolean true
bufferInternalFormat GLenum gl.DEPTH_STENCIL

bufferInternalFormat

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

data TypedArray null

texture data

attachment GLenum gl.COLOR_ATTACHMENT0

attachment

needRenderbuffer Boolean true

是否需要renderbuffer

useVao Boolean true

是否使用VAO

renderer Renderer null

renderer

texture Texture

texture

renderbuffer WebGLRenderbuffer

renderbuffer

framebuffer WebGLFramebuffer

framebuffer

framebuffer WebGLFramebuffer

framebuffer

Methods Show Inherited

isComplete(){Boolean}

framebuffer 是否完成

Returns:
Type Description
Boolean

绑定

解绑

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

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

destroyResource()

销毁资源