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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|