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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Filter
Filter.Parameter -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatBase level.protected intCreate different noise patterns in each of the different RGB channels.protected final com.badlogic.gdx.math.Vector4Color.protected floatThe initial frequency of the noise function.protected floatFactor by which successive noise octaves increase in frequency.protected intNumber of octaves.protected floatFactor by which successive noise octaves decrease in amplitude.protected final com.badlogic.gdx.math.Vector2Plains parameters: Height - flatten the areas between base level and this level, in [0,1].protected booleanRemap to [0,1] after base level operation.protected booleanConvert the fBm to ridge noise.protected final com.badlogic.gdx.math.Vector3Noise scale in x, y and z.protected floatRNG seed.protected booleanApply smoothing function or not.protected booleanApply absolute value function.protected NoiseTypeThe noise type.protected final com.badlogic.gdx.math.Vector2Viewport size.protected final com.badlogic.gdx.math.Vector2Domain warping: Strength - how much warping is applied, in [0,1].Fields inherited from class Filter
defines, fragmentShaderName, inputBuffer, inputTexture, outputBuffer, program, quad, u_texture0, u_texture1, u_texture2, u_texture3, vertexShaderNameModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected com.badlogic.gdx.graphics.glutils.FrameBufferprotected com.badlogic.gdx.graphics.Textureprotected com.badlogic.gdx.graphics.glutils.FrameBufferprotected com.badlogic.gdx.graphics.glutils.ShaderProgramprotected static final FullscreenQuadprotected static final intprotected static final intprotected static final intprotected static final intprotected String -
Constructor Summary
ConstructorsConstructorDescriptionNoiseFilter(int viewportWidth, int viewportHeight, int targets, String shader) NoiseFilter(com.badlogic.gdx.graphics.glutils.ShaderProgram program, com.badlogic.gdx.math.Vector2 viewportSize) NoiseFilter(com.badlogic.gdx.math.Vector2 viewportSize, int targets) NoiseFilter(com.badlogic.gdx.math.Vector2 viewportSize, int targets, String shader) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method will get called just before a rendering operation occurs.voidrebind()protected voidvoidsetBaseLevel(float baseLevel) voidsetChannels(int channels) voidsetColor(float r, float g, float b, float a) voidsetFrequency(float f) voidsetLacunarity(float lacunarity) voidsetOctaves(int octaves) voidsetPersistence(float p) voidsetPlainsHeight(float ph) voidsetPlainsSlope(float ps) voidsetRemap(boolean remap) voidsetRidge(boolean ridge) voidsetScale(float scale) voidsetScale(float scaleX, float scaleY, float scaleZ) voidsetSeed(float seed) voidsetSmoothing(boolean smoothing) voidsetTurbulence(boolean turbulence) voidvoidsetViewportSize(float width, float height) voidsetWarpFrequency(float wf) voidsetWarpStrength(float ws) voidDisposes the current shader, reloads it from disk and re-compiles it.Methods inherited from class Filter
dispose, endParams, realRender, render, setInput, setInput, setOutput, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParams, setParams, setParams, setParams, setParams, setParams, setParams, setParams, setParams, setParamsv, setParamv, updateProgramModifier and TypeMethodDescriptionvoiddispose()protected voidShould be called after any one or more setParams method calls.protected voidfinal voidrender()setInput(com.badlogic.gdx.graphics.glutils.FrameBuffer input) setInput(com.badlogic.gdx.graphics.Texture input) setOutput(com.badlogic.gdx.graphics.glutils.FrameBuffer output) protected voidsetParam(Filter.Parameter param, boolean value) protected voidsetParam(Filter.Parameter param, float value) protected voidsetParam(Filter.Parameter param, int value) protected voidsetParam(Filter.Parameter param, com.badlogic.gdx.graphics.Color value) protected NoiseFiltersetParam(Filter.Parameter param, com.badlogic.gdx.math.Matrix3 value) protected NoiseFiltersetParam(Filter.Parameter param, com.badlogic.gdx.math.Matrix4 value) protected voidsetParam(Filter.Parameter param, com.badlogic.gdx.math.Vector2 value) protected voidsetParam(Filter.Parameter param, com.badlogic.gdx.math.Vector3 value) protected voidsetParam(Filter.Parameter param, com.badlogic.gdx.math.Vector4 value) protected NoiseFiltersetParams(Filter.Parameter param, boolean value) protected NoiseFiltersetParams(Filter.Parameter param, float value) Sets the parameter to the specified value for this filter.protected NoiseFiltersetParams(Filter.Parameter param, int value) protected NoiseFiltersetParams(Filter.Parameter param, com.badlogic.gdx.graphics.Color value) protected NoiseFiltersetParams(Filter.Parameter param, com.badlogic.gdx.math.Matrix3 value) protected NoiseFiltersetParams(Filter.Parameter param, com.badlogic.gdx.math.Matrix4 value) protected NoiseFiltersetParams(Filter.Parameter param, com.badlogic.gdx.math.Vector2 value) protected NoiseFiltersetParams(Filter.Parameter param, com.badlogic.gdx.math.Vector3 value) protected NoiseFiltersetParams(Filter.Parameter param, com.badlogic.gdx.math.Vector4 value) protected NoiseFiltersetParamsv(Filter.Parameter param, float[] values, int offset, int length) protected NoiseFiltersetParamv(Filter.Parameter param, float[] values, int offset, int length) voidupdateProgram(com.badlogic.gdx.graphics.glutils.ShaderProgram program) Caution, disposes of the current program and updates it with the new one.
-
Field Details
-
viewport
protected final com.badlogic.gdx.math.Vector2 viewportViewport size. -
scale
protected final com.badlogic.gdx.math.Vector3 scaleNoise scale in x, y and z. -
color
protected final com.badlogic.gdx.math.Vector4 colorColor. -
baseLevel
protected float baseLevelBase level. -
remap
protected boolean remapRemap to [0,1] after base level operation. -
seed
protected float seedRNG seed. -
persistence
protected float persistenceFactor by which successive noise octaves decrease in amplitude. This is in (0, 1). -
frequency
protected float frequencyThe initial frequency of the noise function. -
lacunarity
protected float lacunarityFactor by which successive noise octaves increase in frequency. This is in [1, n). -
octaves
protected int octavesNumber of octaves. -
smoothing
protected boolean smoothingApply smoothing function or not. -
turbulence
protected boolean turbulenceApply absolute value function. -
ridge
protected boolean ridgeConvert the fBm to ridge noise. -
channels
protected int channelsCreate different noise patterns in each of the different RGB channels. -
plains
protected final com.badlogic.gdx.math.Vector2 plainsPlains 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 warpDomain warping:- Strength - how much warping is applied, in [0,1].
- Frequency - frequency of the warping noise.
-
type
The noise type.
-
-
Constructor Details
-
NoiseFilter
-
NoiseFilter
public NoiseFilter(com.badlogic.gdx.math.Vector2 viewportSize, int targets) -
NoiseFilter
-
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:FilterDisposes the current shader, reloads it from disk and re-compiles it. Run synchronously.- Overrides:
updateProgramin classFilter<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
-
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:
rebindin classFilter<NoiseFilter>
-
onBeforeRender
protected void onBeforeRender()Description copied from class:FilterThis method will get called just before a rendering operation occurs.- Specified by:
onBeforeRenderin classFilter<NoiseFilter>
-