Encapsulates OpenGL ES 2.0 frame buffer objects. This is a simple helper class which should cover most FBO uses. It will automatically create a texture for the color attachment and a renderbuffer for the depth buffer. You can get a hold of the texture by {@link FrameBuffer#getColorBufferTexture()}. This class will only work with OpenGL ES 2.0.
FrameBuffers are managed. In case of an OpenGL context loss, which only happens on Android when a user switches to another application or receives an incoming call, the framebuffer will be automatically recreated.
A FrameBuffer must be disposed if it is no longer needed
@author mzechner FrameBuffer
s are rendering surfaces allowing off-screen rendering and render-to-texture functionality. Instead of the scene rendering to the screen, it is rendered into the FrameBuffer, the result can be either a texture or a buffer.
A FrameBuffer
supports two methods of rendering, using a {@link Texture} or using a buffer. When using a texture, the result of the rendering will be rendered onto the texture, after which the texture can be placed on an object and rendered as if the texture was uploaded from disk. When using a buffer, the result is rendered onto a buffer located on the GPU, the data of this buffer is not accessible to the user. buffers are useful if one wishes to retrieve only the color content of the scene, but still desires depth testing (which requires a depth buffer). Buffers can be copied to other framebuffers including the main screen, by using {@link Renderer#copyFrameBuffer(com.jme3.texture.FrameBuffer,com.jme3.texture.FrameBuffer) }. The content of a {@link RenderBuffer} can be retrieved by using {@link Renderer#readFrameBuffer(com.jme3.texture.FrameBuffer,java.nio.ByteBuffer) }.
FrameBuffer
s have several attachment points, there are several color attachment points and a single depth attachment point. The color attachment points support image formats such as {@link Format#RGBA8}, allowing rendering the color content of the scene. The depth attachment point requires a depth image format.
@see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer)
@author Kirill Vainer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|