Skip to content
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 new Tessellator.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 this Tessellator.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 this Tessellator.BufferedRenderer relative to the rendering target. Defaults to 1.
  • ARGUMENT bufferAttachments: The attachments to send to the Frame Buffer Object. Defaults to a lone Tessellator.TextureModel.AttachmentColor.
  • NOTE: The rendering target resolution is obtaioned by getting the window uniform from the Tessellator.RenderMatrix designated to this renderer.
  • SEE: Tessellator.TextureModel

  • Tessellator.BufferedRenderer(Tessellator.Program shader, Tessellator.RendererAbstract renderer, <optional>float res, <optional>boolean bufferAttachments)
    Constructs a new Tessellator.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 this Tessellator.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 this Tessellator.BufferedRenderer relative to the rendering target. Defaults to 1.
  • ARGUMENT bufferAttachments: If true, it will add a Tessellator.TextureModel.AttachmentDepth in addition to the Tessellator.TextureModel.AttachmentColor that will be passed to the underlying Frame Buffer Object.
  • NOTE: The rendering target resolution is obtaioned by getting the window uniform from the Tessellator.RenderMatrix designated to this renderer.
  • SEE: Tessellator.TextureModel

  • Tessellator.BufferedRenderer(Tessellator.RendererAbstract renderer, <optional>float res, <optional>Array bufferAttachments)
    Constructs a new Tessellator.BufferedRenderer object. This is a shortcut constructor from the previous two that automatically creates a Tessellator.PIXEL_SHADER_RASS for the output shader. The Tessellator 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 this Tessellator.BufferedRenderer relative to the rendering target. Defaults to 1.
  • ARGUMENT bufferAttachments: The attachments to send to the Frame Buffer Object. Defaults to a lone Tessellator.TextureModel.AttachmentColor
  • NOTE: The rendering target resolution is obtaioned by getting the window uniform from the Tessellator.RenderMatrix designated to this renderer.
  • SEE: Tessellator.TextureModel

  • Tessellator.BufferedRenderer(Tessellator.RendererAbstract renderer, <optional>float res, <optional>boolean bufferAttachments)
    Constructs a new Tessellator.BufferedRenderer object. This is a shortcut constructor from the previous two that automatically creates a Tessellator.PIXEL_SHADER_RASS for the output shader. The Tessellator 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 this Tessellator.BufferedRenderer relative to the rendering target. Defaults to 1.
  • ARGUMENT bufferAttachments: If true, it will add a Tessellator.TextureModel.AttachmentDepth in addition to the Tessellator.TextureModel.AttachmentColor that will be passed to the underlying Frame Buffer Object.
  • NOTE: The rendering target resolution is obtaioned by getting the window uniform from the Tessellator.RenderMatrix designated to this renderer.
  • SEE: Tessellator.TextureModel

###Properties

  • .setResolutionScale(float res)
    This sets the coefficient to calculate the resolution of the internal Frame 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 internal Frame 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 internal Frame Buffer Object.
  • ARGUMENT renderer: The renderer to set the existing renderer to.

  • .buffer
    The internal Tessellator.TextureModel to act as the buffer that stores the buffered data.
  • DEFAULT: Set by the constructor.

  • .rendererAttachment The Tessellator.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.
Clone this wiki locally