Class GlowFilter

java.lang.Object
gaiasky.render.postprocess.filters.Filter<GlowFilter>
gaiasky.render.postprocess.filters.GlowFilter
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public final class GlowFilter extends Filter<GlowFilter>
A filter that implements a glow effect using a shader.

This filter takes light sources (positions, intensities, and colors) and the depth buffer of the scene to render a glow effect occluded by the objects in front of each light. It is used as a sub-component of the LightGlow effect.

  • Constructor Details

    • GlowFilter

      public GlowFilter(int width, int height)
  • Method Details

    • setBackBufferScale

      public void setBackBufferScale(float s)
    • setFovFactor

      public void setFovFactor(float fovFactor)
      Sets the field of view factor of the camera.
    • setViewportSize

      public void setViewportSize(float width, float height)
    • setLightPositions

      public void setLightPositions(int nLights, float[] vec)
    • setNLights

      public void setNLights(int nLights)
    • setLightViewAngles

      public void setLightViewAngles(float[] ang)
    • setLightIntensities

      public void setLightIntensities(float[] intensities)
      Sets the glow intensity of each light, in [0,1], computed from its apparent magnitude.
    • setLightDepths

      public void setLightDepths(float[] depths)
      Sets the distance from the camera to each light, in the same space as the depth buffer.
    • setZFarK

      public void setZFarK(float zfar, float k)
      Sets the z-far and K of the logarithmic depth buffer, to recover a distance from a depth value.
    • setDepthTexelSize

      public void setDepthTexelSize(float width, float height)
      Sets the size of one texel of the depth buffer, in uv coordinates.
    • setOcclusionEnabled

      public void setOcclusionEnabled(boolean enabled)
      Enables or disables the occlusion of the lights by the geometry in front of them.
    • setLightColors

      public void setLightColors(float[] colors)
    • setTextureScale

      public void setTextureScale(float scl)
      Sets the maximum halo radius, in pixels at the reference height.
    • getLightGlowTexture

      public com.badlogic.gdx.graphics.Texture getLightGlowTexture()
    • setLightGlowTexture

      public void setLightGlowTexture(com.badlogic.gdx.graphics.Texture tex)
    • getDepthTexture

      public com.badlogic.gdx.graphics.Texture getDepthTexture()
    • setDepthTexture

      public void setDepthTexture(com.badlogic.gdx.graphics.Texture tex)
    • rebind

      public void rebind()
      Specified by:
      rebind in class Filter<GlowFilter>
    • onBeforeRender

      protected void onBeforeRender()
      Description copied from class: Filter
      This method will get called just before a rendering operation occurs.
      Specified by:
      onBeforeRender in class Filter<GlowFilter>