lua.wetgenes.gamecake.framebuffers.fbo.bind_depth
fbo:bind_depth()
BindTexture the depth texture part of this fbo.
If there is no texture we will bind 0.
lua.wetgenes.gamecake.framebuffers.fbo.bind_depth_snapshot
fbo:bind_depth_snapshot()
BindTexture the depth snapshot texture part of this fbo.
If there is no snapshot texture we will bind 0.
lua.wetgenes.gamecake.framebuffers.fbo.bind_frame
fbo:bind_depth()
BindFramebuffer the framebuffer of this fbo.
If there is no framebuffer we will bind 0.
lua.wetgenes.gamecake.framebuffers.fbo.bind_texture
fbo:bind_texture()
BindTexture the rgba texture part of this fbo.
If there is no texture we will bind 0.
lua.wetgenes.gamecake.framebuffers.fbo.bind_texture_snapshot
fbo:bind_texture_snapshot()
BindTexture the rgba snapshot texture part of this fbo.
If there is no snapshot texture we will bind 0.
lua.wetgenes.gamecake.framebuffers.fbo.check
fbo:check()
Check and allocatie if missing and needed (eg depth texture may not be needed) all our openGL buffers.
lua.wetgenes.gamecake.framebuffers.fbo.clean
fbo:clean()
Free all the opengl buffers.
lua.wetgenes.gamecake.framebuffers.fbo.download
fbo:download()
fbo:download(w,h,x,y)
Read back color data from a framebuffer and return it in an RGBA PREMULT grd object (which is probably what it is).
If a width,height is given then we will read the given pixels only from the x,y location.
lua.wetgenes.gamecake.framebuffers.fbo.free_depth
fbo:free_depth()
Free the depth texture only, is safe to call if there is no depth buffer.
lua.wetgenes.gamecake.framebuffers.fbo.free_frame
fbo:free_frame()
Free the frame buffer only, is safe to call if there is no frame buffer.
lua.wetgenes.gamecake.framebuffers.fbo.free_snapshot
fbo:free_snapshot()
Free the snapshot buffers, fbo.texture_snapshot and fbo.depth_snapshot if they exist.
lua.wetgenes.gamecake.framebuffers.fbo.free_texture
fbo:free_texture()
Free the rgba texture only, is safe to call if there is no rgba buffer.
lua.wetgenes.gamecake.framebuffers.fbo.mipmap
fbo:mipmap()
Build mipmaps for all existing texture buffers.
lua.wetgenes.gamecake.framebuffers.fbo.mipmap_depth
fbo:mipmap_depth()
Build mipmaps for our depth buffer if it exists and set TEXTURE_MIN_FILTER to LINEAR_MIPMAP_LINEAR so it will be used.
It is possible this may fail (hardware issues) and the TEXTURE_MIN_FILTER be reset to gl.NEAREST along with a flag to stop us even trying in the future,
lua.wetgenes.gamecake.framebuffers.fbo.mipmap_texture
fbo:mipmap_texture()
Build mipmaps for our texture buffer if it exists and set TEXTURE_MIN_FILTER to LINEAR_MIPMAP_LINEAR so it will be used.
lua.wetgenes.gamecake.framebuffers.fbo.pingpong
fbo:pingpong(fbout,shadername,callback)
framebuffers.pingpong({fbin1,fbin2},fbout,shadername,callback)
Render from one or more fbos into another using a fullscreen shader.
Sometime you need to repeatedly copy a texture back and though applying a shader, this is the function for you.
The textures will be bound to tex1,tex2,tex3,etc and the uvs supplied in a_texcoord with a_vertex being set to screen coords so can be used as is.
lua.wetgenes.gamecake.framebuffers.fbo.render_start
fbo:render_start()
Start rendering into this fbo.
Push old matrix and set the matrix mode to MODELVIEW
Set fbo.view and reset the gl state.
lua.wetgenes.gamecake.framebuffers.fbo.render_stop
fbo:render_stop()
Stop rendering into this fbo and restore the last fbo so these calls can be nested.
Restore the old view and old gl state.
Pop old matrix and set the matrix mode to MODELVIEW
lua.wetgenes.gamecake.framebuffers.fbo.resize
fbo:resize(w,h,d)
Change the size of our buffers, which probably means free and then reallocate them.
The w,h,d use the same rules as framebuffer.create
lua.wetgenes.gamecake.framebuffers.fbo.snapshot
fbo:snapshot()
Take a current snapshot copy of the texture and depth if they exist, store them in fbo.texture_snapshot and fbo.depth_snapshot for later binding.