Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Lua FBO and RBO: Difference between revisions

From FIGHTORDER
imported>Jk
mNo edit summary
imported>Jk
mNo edit summary
Line 45: Line 45:
===Userdata FBO===
===Userdata FBO===
   <font color=#55ee99>attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }</font>
   <font color=#55ee99>attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num [[Lua_ConstGL#FBO_Targets|target]] [, num level ]] }</font>
 
<font color=#55ee99>
   write-only methods are:
   write-only methods are:
     '''fbo.depth'''  = attachment
     '''fbo.depth'''  = attachment
Line 54: Line 54:
     '''fbo.drawbuffers''' = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}
     '''fbo.drawbuffers''' = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}
     '''fbo.readbuffer'''  = GL_COLOR_ATTACHMENT0_EXT
     '''fbo.readbuffer'''  = GL_COLOR_ATTACHMENT0_EXT
 
</font>


==RBO==
==RBO==
Line 68: Line 68:


===Userdata RBO===
===Userdata RBO===
<font color=#55ee99>
   read-only methods are:
   read-only methods are:
     '''rbo.target''' = number
     '''rbo.target''' = number
Line 74: Line 75:
     '''rbo.ysize'''  = number
     '''rbo.ysize'''  = number
     '''rbo.valid'''  = boolean
     '''rbo.valid'''  = boolean
</font>

Revision as of 09:34, 3 January 2009

FBO

gl.CreateFBO

 ( [ table initialization ] ) -> userdata fbo

 initialization table can contain:
   attachment ::= luaTex or RBO or nil or { luaTex [, num target [, num level ] ] }
   {
     depth   = attachment,
     stencil = attachment,
     color0  = attachment,
     color1  = attachment,
     color2  = attachment,
     ..
     color15 = attachment,
     drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..},
     readbuffer = GL_COLOR_ATTACHMENT0_EXT,
   }

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

 ( fbo ) -> nil

gl.IsValidFBO

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

gl.ActiveFBO

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

gl.UnsafeSetFBO (Binds a FBO like gl.ActiveFBO() does, but you have to unbind it yourself!)

 ( nil [, number target = GL_FRAMEBUFFER_EXT ] ) -> nil (Bind default 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


Userdata FBO

  attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num target [, num level ]] }

 write-only methods are:
   fbo.depth   = attachment
   fbo.stencil = attachment
   fbo.color0  = attachment
    ..
   fbo.color15 = attachment
   fbo.drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..}
   fbo.readbuffer  = GL_COLOR_ATTACHMENT0_EXT

RBO

gl.CreateRBO

 ( int xsize, int ysize,
   [ {
     target = GL_RENDERBUFFER_EXT,
     format = GL_RGBA,
   } ]) -> userdata rbo

gl.DeleteRBO

 ( rbo ) -> nil

Userdata RBO

 read-only methods are:
   rbo.target = number
   rbo.format = number
   rbo.xsize  = number
   rbo.ysize  = number
   rbo.valid  = boolean

Contents