lua.wetgenes.gamecake.framebuffers.create
local fbo=framebuffers.dirty()
local fbo=framebuffers.dirty(x,y)
local fbo=framebuffers.dirty(x,y,framebuffers.NEED_TEXTURE_AND_DEPTH)
local fbo=framebuffers.dirty(0,0,0,{
depth_format={gl.DEPTH_COMPONENT32F,gl.DEPTH_COMPONENT,gl.FLOAT},
texture_format={gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE},
TEXTURE_MIN_FILTER=gl.LINEAR,
TEXTURE_MAG_FILTER=gl.LINEAR,
TEXTURE_WRAP_S=gl.CLAMP_TO_EDGE,
TEXTURE_WRAP_T=gl.CLAMP_TO_EDGE,
}) -- note this table will be returned as the fbo
Create a new framebuffer object and optionally provide an inital size and depth. The depth can use -1,0,1 or the following verbose flags framebuffers.NEED_DEPTH,framebuffers.NEED_TEXTURE or framebuffers.NEED_TEXTURE_AND_DEPTH to request a depth buffer(1,-1) or not(0).
Finally you can pass in a table to be returned as the fbo that contains defaults or set defaults in the fbo that is returned.
fbo.depth_format={gl.DEPTH_COMPONENT32F,gl.DEPTH_COMPONENT,gl.FLOAT}
Can be used to control exactly how a depth buffer is allocated with gl.TexImage2D when you care about that sort of thing, IE hardware issues.
fbo.texture_format={gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE}
Can be used to control exactly how a texture buffer is allocated with gl.TexImage2D when you care about that sort of thing, IE hardware issues.
fbo.TEXTURE_MIN_FILTER=gl.LINEAR
fbo.TEXTURE_MAG_FILTER=gl.LINEAR
fbo.TEXTURE_WRAP_S=gl.CLAMP_TO_EDGE
fbo.TEXTURE_WRAP_T=gl.CLAMP_TO_EDGE
These can be used to control default TexParameters in the fbo.
fbo.no_uptwopow=true
By deafult we will use power of 2 sizes for the fbo that fit the requested size. This disables that and doing so will of course cause problems with some hardware. Generally if you avoid mipmaps it probably wont be a problem.
See #lua.wetgenes.gamecake.framebuffers.fbo for all the functions you can call on the fbo returned.