-
Notifications
You must be signed in to change notification settings - Fork 1
BufferedRenderer
Alexander Orzechowski edited this page Oct 20, 2015
·
3 revisions
This is a Renderer
that is mostly used for post processing. Special Shaders
can be applied to the renderer so that the output looks different.
The main idea is that the renderers buffers the output put out by the passed renderer so that it can be used later or modified. It uses a custom Frame Buffer Object (FBO)
to render to first then renders that FBO through a separate shader onto the system provided FBO or through another Tessellator.BufferedRenderer
EXTENDS: Tessellator.FullScreenRenderer
###Constructor
-
Tessellator.BufferedRenderer(Tessellator.Program shader, Tessellator.RendererAbstract renderer, <optional>float res, <optional>Array bufferAttachments)
Constructs a newTessellator.BufferedRenderer
object. - ARGUMENT shader: The shader to use when rendering the buffered
Frame Buffer Object
. This is reffered to the output shader as it is used when the buffered contents of thisTessellator.BufferedRenderer
is used. - ARGUMENT renderer: The renderer to piggyback on. This is the renderer that renders to the buffer contained within this
Tessellator.BufferedRenderer
. - ARGUMENT res: A float that represents the resolution of this
Tessellator.BufferedRenderer
relative to the resolution of the rendering target. This is a ratio so passing a value like 2 will double the resolution of thisTessellator.BufferedRenderer
relative to the rendering target. Defaults to 1. - ARGUMENT bufferAttachments: The attachments to send to the
Frame Buffer Object
. Defaults to a loneTessellator.TextureModel.AttachmentColor
. - NOTE: The rendering target resolution is obtaioned by getting the
window
uniform from theTessellator.RenderMatrix
designated to this renderer. - SEE:
Tessellator.TextureModel
-
Tessellator.BufferedRenderer(Tessellator.Program shader, Tessellator.RendererAbstract renderer, <optional>float res, <optional>boolean bufferAttachments)
Constructs a newTessellator.BufferedRenderer
object. - ARGUMENT shader: The shader to use when rendering the buffered
Frame Buffer Object
. This is reffered to the output shader as it is used when the buffered contents of thisTessellator.BufferedRenderer
is used. - ARGUMENT renderer: The renderer to piggyback on. This is the renderer that renders to the buffer contained within this
Tessellator.BufferedRenderer
. - ARGUMENT res: A float that represents the resolution of this
Tessellator.BufferedRenderer
relative to the resolution of the rendering target. This is a ratio so passing a value like 2 will double the resolution of thisTessellator.BufferedRenderer
relative to the rendering target. Defaults to 1. - ARGUMENT bufferAttachments: If true, it will add a
Tessellator.TextureModel.AttachmentDepth
in addition to theTessellator.TextureModel.AttachmentColor
that will be passed to the underlyingFrame Buffer Object
. - NOTE: The rendering target resolution is obtaioned by getting the
window
uniform from theTessellator.RenderMatrix
designated to this renderer. - SEE:
Tessellator.TextureModel
-
Tessellator.BufferedRenderer(Tessellator.RendererAbstract renderer, <optional>float res, <optional>Array bufferAttachments)
Constructs a newTessellator.BufferedRenderer
object. This is a shortcut constructor from the previous two that automatically creates aTessellator.PIXEL_SHADER_RASS
for the output shader. TheTessellator
object used to create the output shader is obtained from the passed renderer object. - ARGUMENT renderer: The renderer to piggyback on. This is the renderer that renders to the buffer contained within this
Tessellator.BufferedRenderer
. - ARGUMENT res: A float that represents the resolution of this
Tessellator.BufferedRenderer
relative to the resolution of the rendering target. This is a ratio so passing a value like 2 will double the resolution of thisTessellator.BufferedRenderer
relative to the rendering target. Defaults to 1. - ARGUMENT bufferAttachments: The attachments to send to the
Frame Buffer Object
. Defaults to a loneTessellator.TextureModel.AttachmentColor
- NOTE: The rendering target resolution is obtaioned by getting the
window
uniform from theTessellator.RenderMatrix
designated to this renderer. - SEE:
Tessellator.TextureModel
-
Tessellator.BufferedRenderer(Tessellator.RendererAbstract renderer, <optional>float res, <optional>boolean bufferAttachments)
Constructs a newTessellator.BufferedRenderer
object. This is a shortcut constructor from the previous two that automatically creates aTessellator.PIXEL_SHADER_RASS
for the output shader. TheTessellator
object used to create the output shader is obtained from the passed renderer object. - ARGUMENT renderer: The renderer to piggyback on. This is the renderer that renders to the buffer contained within this
Tessellator.BufferedRenderer
. - ARGUMENT res: A float that represents the resolution of this
Tessellator.BufferedRenderer
relative to the resolution of the rendering target. This is a ratio so passing a value like 2 will double the resolution of thisTessellator.BufferedRenderer
relative to the rendering target. Defaults to 1. - ARGUMENT bufferAttachments: If true, it will add a
Tessellator.TextureModel.AttachmentDepth
in addition to theTessellator.TextureModel.AttachmentColor
that will be passed to the underlyingFrame Buffer Object
. - NOTE: The rendering target resolution is obtaioned by getting the
window
uniform from theTessellator.RenderMatrix
designated to this renderer. - SEE:
Tessellator.TextureModel
###Properties
-
.setResolutionScale(float res)
This sets the coefficient to calculate the resolution of the internalFrame Buffer Object
depending on the resolution of the rendering target. - ARGUMENT res: The resolution coefficient.
-
.setResolutionScale(vec2 res)
This sets the coefficient to calculate the resolution of the internalFrame Buffer Object
depending on the resolution of the rendering target. The resolution width and height is calculated with independant coefficients by using this function. - ARGUMENT res: The resolution coefficient.
-
.setRenderer(Renderer renderer)
Sets the renderer that is used to update the internalFrame Buffer Object
. - ARGUMENT renderer: The renderer to set the existing renderer to.
-
.buffer
The internalTessellator.TextureModel
to act as the buffer that stores the buffered data. - DEFAULT: Set by the constructor.
-
.rendererAttachment
TheTessellator.TextureModel.AttachmentRenderer
that actually handles the rendering to the internal buffer. - SEE:
.buffer
- NOTE: This attachment is automatically concatenated to any attachments passed in the constructor.
-
source
Tessellator-
renderers
RendererAbstract
ModelRenderer
BufferedRenderer FullScreenRenderer -
shaders
Shader
Program
RenderMatrix -
geometry
Object
-