Class Bloom

java.lang.Object
arc.graphics.g2d.Bloom

public class Bloom extends Object
Requires bloom shaders in 'bloomshaders' folder.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
     
    int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a bloom instance with no blending, no depth and 1/4 the screen size.
    Bloom(boolean useBlending)
     
    Bloom(int width, int height, boolean hasDepth, boolean useBlending)
    Initializes bloom class that encapsulates original scene capturate, thresholding, gaussian blurring and blending.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    Call this before rendering scene.
    void
    Start capturing again after pause, no clearing is done to the buffer.
    void
    Pause capturing to the buffer.
    void
    Disposes all resources.
    void
    Renders the bloomed scene.
    void
    resize(int width, int height)
     
    void
    resize(int width, int height, int scaling)
     
    void
    Rebinds the context.
    void
    setBloomIntensity(float intensity)
    Set intensity for bloom.
    void
    setBloomIntesity(float intensity)
    Deprecated.
    void
    setClearColor(float r, float g, float b, float a)
    Set clearing color for capturing buffer.
    void
    setOriginalIntensity(float intensity)
    Set intensity for original scene.
    void
    setOriginalIntesity(float intensity)
    Deprecated.
    void
    setThreshold(float threshold)
    Threshold for bright parts.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • blurPasses

      public int blurPasses
    • blending

      public boolean blending
  • Constructor Details

    • Bloom

      public Bloom()
      Creates a bloom instance with no blending, no depth and 1/4 the screen size.
    • Bloom

      public Bloom(boolean useBlending)
    • Bloom

      public Bloom(int width, int height, boolean hasDepth, boolean useBlending)
      Initializes bloom class that encapsulates original scene capturate, thresholding, gaussian blurring and blending.
      Parameters:
      hasDepth - Enables depth buffer.
      useBlending - Enables alpha blending, allowing combining background graphics and only doing blooming on certain objects.
  • Method Details

    • resume

      public void resume()
      Rebinds the context. Necessary on Android/IOS. TODO or is it?
    • resize

      public void resize(int width, int height)
    • resize

      public void resize(int width, int height, int scaling)
    • setClearColor

      public void setClearColor(float r, float g, float b, float a)
      Set clearing color for capturing buffer.
    • capture

      public void capture()
      Call this before rendering scene.
    • capturePause

      public void capturePause()
      Pause capturing to the buffer.
    • captureContinue

      public void captureContinue()
      Start capturing again after pause, no clearing is done to the buffer.
    • render

      public void render()
      Renders the bloomed scene.
    • setBloomIntesity

      @Deprecated public void setBloomIntesity(float intensity)
      Deprecated.
    • setOriginalIntesity

      @Deprecated public void setOriginalIntesity(float intensity)
      Deprecated.
    • setBloomIntensity

      public void setBloomIntensity(float intensity)
      Set intensity for bloom. Higher means more brightening for spots that are over threshold.
      Parameters:
      intensity - Multiplier for blurred texture in combining phase. Must be positive.
    • setOriginalIntensity

      public void setOriginalIntensity(float intensity)
      Set intensity for original scene. Under 1 means darkening and over 1 means lightening.
      Parameters:
      intensity - Multiplier for captured texture in combining phase. Must be positive.
    • setThreshold

      public void setThreshold(float threshold)
      Threshold for bright parts. Everything under threshold is set to 0.
      Parameters:
      threshold - Must be in range [0..1].
    • buffer

      public FrameBuffer buffer()
      Returns:
      The unprocessed frame buffer this bloom captures. Advanced uses only.
    • dispose

      public void dispose()
      Disposes all resources.