Lua FBO: Difference between revisions

From Spring
Jump to navigationJump to search
JK (talk | contribs)
mNo edit summary
JK (talk | contribs)
mNo edit summary
Line 31: Line 31:
'''gl.BlitFBO''' <font color=red>needs GLEW_EXT_framebuffer_blit</font>
'''gl.BlitFBO''' <font color=red>needs GLEW_EXT_framebuffer_blit</font>
   ( int x0Src,y0Src,x1Src,y1Src,  int x0Dst,y0Dst,x1Dst,y1Dst
   ( int x0Src,y0Src,x1Src,y1Src,  int x0Dst,y0Dst,x1Dst,y1Dst
     [, number mask = GL_COLOR_BUFFER_BIT [, number filter = GL_NEAREST ] ) -> nil
     [, number mask = GL_COLOR_BUFFER_BIT [, number filter = GL_NEAREST ] ] ) -> nil
   ( <font color=yellow>fboSrc</font>, int x0Src,y0Src,x1Src,y1Src,  <font color=yellow>fboDst</font>, int x0Dst,y0Dst,x1Dst,y1Dst
   ( <font color=yellow>fboSrc</font>, int x0Src,y0Src,x1Src,y1Src,  <font color=yellow>fboDst</font>, int x0Dst,y0Dst,x1Dst,y1Dst
     [, number mask = GL_COLOR_BUFFER_BIT [, number filter = GL_NEAREST ] ) -> nil
     [, number mask = GL_COLOR_BUFFER_BIT [, number filter = GL_NEAREST ] ] ) -> nil

Revision as of 11:27, 5 March 2008

FBO

gl.CreateFBO

 ( [ table initialization ] ) -> userdata fbo

 initialization table can contain:
   {
     depth   = luaTex or RBO or nil,
     stencil = luaTex or RBO or nil,
     color0  = luaTex or nil,
     color1  = luaTex or nil,
     color2  = luaTex or nil,
     ..
     color15 = luaTex or nil,
     drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}
   }

gl.DeleteFBO (this doesn't delete the attached objects!)

 ( fbo ) -> nil

gl.IsValidFBO (search the internet for glCheckFramebufferStatusEXT to learn more about the status param)

 ( fbo [, number target ] ) -> boolean valid [, number status ]

gl.ActiveFBO

 ( fbo [, number target] [, boolean loadIdentities ] , lua_function, arg1, arg2, ... ) -> nil

gl.UnsafeSetFBO (similar to gl.ActiveFBO(). NOTE: don't forget to unbind you FBO!)

 ( nil [, number target = GL_FRAMEBUFFER_EXT ] ) -> nil (this will load the screenbuffer)
 ( fbo [, number target = fbo.target ] ) -> nil

gl.BlitFBO needs GLEW_EXT_framebuffer_blit

 ( int x0Src,y0Src,x1Src,y1Src,  int x0Dst,y0Dst,x1Dst,y1Dst
   [, number mask = GL_COLOR_BUFFER_BIT [, number filter = GL_NEAREST ] ] ) -> nil
 ( fboSrc, int x0Src,y0Src,x1Src,y1Src,  fboDst, int x0Dst,y0Dst,x1Dst,y1Dst
   [, number mask = GL_COLOR_BUFFER_BIT [, number filter = GL_NEAREST ] ] ) -> nil