Safe Haskell | None |
---|---|
Language | Haskell2010 |
Framebuffers, FBO, RBO...
Example
This example program renders an animating object to an off-screen framebuffer. The resulting texture is then show on a full-screen quad with an effect.
The vertex shader for this program is
The two fragment shaders, one for the object, one for the effect, are
And the output looks like
- newFBO :: IO FBO
- bindFramebuffer :: Framebuffer a => a -> IO ()
- deleteFBO :: FBO -> IO ()
- attachTex2D :: Attachable a => Tex2D a -> IO ()
- attachCubeMap :: Attachable a => CubeMap a -> Side -> IO ()
- attachRBO :: Attachable a => RBO a -> IO ()
- newRBO :: InternalFormat a => Int -> Int -> IO (RBO a)
- deleteRBO :: RBO a -> IO ()
- data FBO
- data DefaultFramebuffer = DefaultFramebuffer
- data RBO a
Documentation
Create a new framebuffer object. Before the framebuffer can be used for rendering it must have a color image attachment.
bindFramebuffer :: Framebuffer a => a -> IO () Source
Binds an FBO or the default framebuffer to the framebuffer binding target. Replaces the framebuffer already bound there.
attachTex2D :: Attachable a => Tex2D a -> IO () Source
Attach a 2D texture to the FBO currently bound to the framebuffer binding target.
attachCubeMap :: Attachable a => CubeMap a -> Side -> IO () Source
Attach one of the sides of a cubemap texture to the FBO currently bound to the framebuffer binding target.
attachRBO :: Attachable a => RBO a -> IO () Source
Attach an RBO to the FBO currently bound to the framebuffer binding target.
newRBO :: InternalFormat a => Int -> Int -> IO (RBO a) Source
Create a new renderbuffer with the specified dimensions.
A framebuffer object is an alternative rendering destination. Once an FBO is bound to framebuffer binding target, it is possible to attach images (textures or RBOs) for color, depth, or stencil rendering.
data DefaultFramebuffer Source
The default framebuffer.