new Fbo(gl, width, height, optsopt)
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | then webgl context this Fbo belongs to | ||||||||||||||||||||||||||
width |
uint | initial width of the fbo, the size can be later changed using Fbo#resize() | ||||||||||||||||||||||||||
height |
uint | initial height of the fbo, the size can be later changed using Fbo#resize() | ||||||||||||||||||||||||||
opts |
Object |
<optional> |
Properties
|
Methods
bind()
Bind the Fbo and set gl viewport to it's size
bindColor(location, unit)
Bind the color texture of this Fbo to a sampler2D location and a unit
The related program must be in use.
Parameters:
Name | Type | Description |
---|---|---|
location |
WebGLUniformLocation | the program's sampler to bind the textue to |
unit |
the texture unit to use |
clear()
Clear all buffer of the Fbo.
The Fbo must be explicitly bound before calling this method
dispose()
Delete all webgl objects related to this Fbo (fbo, color attachment and depth/stencil renderbuffer )
getActualType()
return the actual pixel type of the underlying color texture (UNSIGNED_BYTE, FLOAT, HALF_FLOAT_EOS etc)
after possibles types has been tested
isValid()
Check if the Fbo is valid,
The Fbo must be explicitely bound before calling this method
resize(w, h)
Resize FBO attachments
Parameters:
Name | Type | Description |
---|---|---|
w |
uint | new width |
h |
uint | new height |