Class NoiseFilter

java.lang.Object
gaiasky.render.postprocess.filters.Filter<NoiseFilter>
gaiasky.render.postprocess.filters.NoiseFilter
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Direct Known Subclasses:
ProceduralSurfaceFilter

public class NoiseFilter extends Filter<NoiseFilter>
  • Field Details

    • viewport

      protected final com.badlogic.gdx.math.Vector2 viewport
      Viewport size.
    • scale

      protected final com.badlogic.gdx.math.Vector3 scale
      Noise scale in x, y and z.
    • color

      protected final com.badlogic.gdx.math.Vector4 color
      Color.
    • baseLevel

      protected float baseLevel
      Base level.
    • remap

      protected boolean remap
      Remap to [0,1] after base level operation.
    • seed

      protected float seed
      RNG seed.
    • persistence

      protected float persistence
      Factor by which successive noise octaves decrease in amplitude. This is in (0, 1).
    • frequency

      protected float frequency
      The initial frequency of the noise function.
    • lacunarity

      protected float lacunarity
      Factor by which successive noise octaves increase in frequency. This is in [1, n).
    • octaves

      protected int octaves
      Number of octaves.
    • smoothing

      protected boolean smoothing
      Apply smoothing function or not.
    • turbulence

      protected boolean turbulence
      Apply absolute value function.
    • ridge

      protected boolean ridge
      Convert the fBm to ridge noise.
    • channels

      protected int channels
      Create different noise patterns in each of the different RGB channels.
    • plains

      protected final com.badlogic.gdx.math.Vector2 plains
      Plains parameters:
      • Height - flatten the areas between base level and this level, in [0,1].
      • Slope - the slope of the plains.
    • warp

      protected final com.badlogic.gdx.math.Vector2 warp
      Domain warping:
      • Strength - how much warping is applied, in [0,1].
      • Frequency - frequency of the warping noise.
    • type

      protected NoiseType type
      The noise type.
  • Constructor Details

    • NoiseFilter

      public NoiseFilter(int viewportWidth, int viewportHeight, int targets, String shader)
    • NoiseFilter

      public NoiseFilter(com.badlogic.gdx.math.Vector2 viewportSize, int targets)
    • NoiseFilter

      public NoiseFilter(com.badlogic.gdx.math.Vector2 viewportSize, int targets, String shader)
    • NoiseFilter

      public NoiseFilter(com.badlogic.gdx.graphics.glutils.ShaderProgram program, com.badlogic.gdx.math.Vector2 viewportSize)
  • Method Details

    • updateProgram

      public void updateProgram()
      Description copied from class: Filter
      Disposes the current shader, reloads it from disk and re-compiles it. Run synchronously.
      Overrides:
      updateProgram in class Filter<NoiseFilter>
    • setViewportSize

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

      public void setColor(float r, float g, float b, float a)
    • setScale

      public void setScale(float scaleX, float scaleY, float scaleZ)
    • setBaseLevel

      public void setBaseLevel(float baseLevel)
    • setRemap

      public void setRemap(boolean remap)
    • setScale

      public void setScale(float scale)
    • setSeed

      public void setSeed(float seed)
    • setPersistence

      public void setPersistence(float p)
    • setFrequency

      public void setFrequency(float f)
    • setLacunarity

      public void setLacunarity(float lacunarity)
    • setOctaves

      public void setOctaves(int octaves)
    • setSmoothing

      public void setSmoothing(boolean smoothing)
    • setTurbulence

      public void setTurbulence(boolean turbulence)
    • setRidge

      public void setRidge(boolean ridge)
    • setChannels

      public void setChannels(int channels)
    • setType

      public void setType(NoiseType type)
    • setPlainsHeight

      public void setPlainsHeight(float ph)
    • setPlainsSlope

      public void setPlainsSlope(float ps)
    • setWarpStrength

      public void setWarpStrength(float ws)
    • setWarpFrequency

      public void setWarpFrequency(float wf)
    • rebindNoEnd

      protected void rebindNoEnd()
    • rebind

      public void rebind()
      Specified by:
      rebind in class Filter<NoiseFilter>
    • 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<NoiseFilter>