Class PostChain

java.lang.Object
lol.trq.helios.effect.PostChain

public final class PostChain extends Object
A chain of full-screen passes applied to what is drawn so far: the screen is captured, each pass reads the previous result and writes a new one, and the last result replaces the screen.

Each program must be built on Passes.FULLSCREEN_VERTEX and read u_texture (unit 0) at v_uv; it also receives u_texel, one source pixel in texture coordinates.

  • Constructor Details

    • PostChain

      public PostChain(Passes passes)
      Creates an empty chain.
      Parameters:
      passes - the shared passes
  • Method Details

    • then

      public PostChain then(ShaderProgram program, Consumer<ShaderProgram> uniforms)
      Appends a pass.
      Parameters:
      program - the program
      uniforms - sets its own uniforms each time it runs
      Returns:
      this chain
    • size

      public int size()
      Returns how many passes the chain has.
      Returns:
      the pass count
    • apply

      public void apply()
      Runs the chain on the bound framebuffer. Does nothing when the chain is empty.