Lua FBO: Difference between revisions
From Spring
Jump to navigationJump to search
mNo edit summary |
|||
| Line 4: | Line 4: | ||
<font color=darkgreen> | <font color=darkgreen> | ||
initialization table can contain: | initialization table can contain: | ||
attachment ::= luaTex or RBO or nil or { luaTex [, num target [, num level ] ] } | |||
{ | { | ||
depth = | depth = attachment, | ||
stencil = | stencil = attachment, | ||
color0 = | color0 = attachment, | ||
color1 = | color1 = attachment, | ||
color2 = | color2 = attachment, | ||
.. | .. | ||
color15 = | color15 = attachment, | ||
drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..} | drawbuffers = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT3_EXT, ..} | ||
} | } | ||
| Line 25: | Line 28: | ||
( fbo [, number target] [, boolean loadIdentities ] , lua_function, arg1, arg2, ... ) -> nil | ( fbo [, number target] [, boolean loadIdentities ] , lua_function, arg1, arg2, ... ) -> nil | ||
'''gl.UnsafeSetFBO''' <font color= | '''gl.UnsafeSetFBO''' <font color=darkgreen>(similar to gl.ActiveFBO(). </font><font color=red>NOTE:</font><font color=darkgreen> don't forget to unbind your FBO!)</font> | ||
( nil [, number target = GL_FRAMEBUFFER_EXT ] ) -> nil <font color=darkgreen>(this will | ( nil [, number target = GL_FRAMEBUFFER_EXT ] ) -> nil <font color=darkgreen>(this will bind the screenbuffer)</font> | ||
( fbo [, number target = fbo.target ] ) -> nil | ( fbo [, number target = fbo.target ] ) -> nil | ||
| Line 32: | Line 35: | ||
( 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 | ||
==Userdata FBO== | |||
<font color=darkgreen>attachment ::= luaTex or RBO or nil or { luaTex or RBO [, num target [, num level ]] }</font> | |||
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 | |||
Revision as of 14:43, 5 March 2008
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, ..}
}
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 your FBO!)
( nil [, number target = GL_FRAMEBUFFER_EXT ] ) -> nil (this will bind 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
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