Package arc.fx

Class FxFilter

java.lang.Object
arc.fx.FxFilter
All Implemented Interfaces:
Disposable
Direct Known Subclasses:
BiasFilter, BloomFilter, BlurFilter, ChromaticAberrationFilter, CombineFilter, Convolve1dFilter, CopyFilter, CrtFilter, FilmGrainFilter, FisheyeDistortionFilter, FxaaFilter, HdrFilter, LensFlareFilter, LevelsFilter, MixFilter, MotionBlurFilter, NfaaFilter, NoiseFilter, OldTvFilter, RadialBlurFilter, RadialDistortionFilter, RippleFilter, ThresholdFilter, VignettingFilter, ZoomFilter

public abstract class FxFilter extends Object implements Disposable
Base class for any single-pass filter.
  • Field Details

    • u_texture0

      protected static final int u_texture0
      See Also:
    • u_texture1

      protected static final int u_texture1
      See Also:
    • u_texture2

      protected static final int u_texture2
      See Also:
    • u_texture3

      protected static final int u_texture3
      See Also:
    • shader

      protected final Shader shader
    • inputTexture

      protected Texture inputTexture
    • outputBuffer

      protected FrameBuffer outputBuffer
    • disabled

      protected boolean disabled
    • autobind

      protected boolean autobind
    • time

      public float time
  • Constructor Details

    • FxFilter

      public FxFilter()
    • FxFilter

      public FxFilter(String vert, String frag)
    • FxFilter

      public FxFilter(Shader shader)
  • Method Details

    • compileShader

      public static Shader compileShader(Fi vertexFile, Fi fragmentFile)
    • compileShader

      public static Shader compileShader(Fi vertexFile, Fi fragmentFile, String defines)
    • setInput

      public FxFilter setInput(Texture input)
    • setInput

      public FxFilter setInput(FrameBuffer input)
    • setOutput

      public FxFilter setOutput(FrameBuffer output)
    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface Disposable
    • resize

      public void resize(int width, int height)
      This method should be called once filter will be added. Also it must be called on every application resize as usual.
    • rebind

      public void rebind()
    • setParams

      protected void setParams()
      Concrete objects shall be responsible to recreate or rebind its own resources whenever its needed, usually when the OpenGL context is lost. Eg., framebuffer textures should be updated and shader parameters should be reuploaded/rebound.
    • render

      public void render()
    • onBeforeRender

      protected void onBeforeRender()
      This method gets called just before rendering.
    • render

      public void render(FrameBuffer src, FrameBuffer dst)
      Concrete objects shall implements its own rendering, given the source and destination buffers.
    • isDisabled

      public boolean isDisabled()
      Whether or not this effect is disabled and shouldn't be processed
    • setDisabled

      public void setDisabled(boolean enabled)
      Sets this effect disabled or not
    • update

      public void update()