Class NoiseComponent
java.lang.Object
gaiasky.scene.record.NamedComponent
gaiasky.scene.record.NoiseComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IComponent
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoublecom.badlogic.gdx.graphics.glutils.FrameBuffercom.badlogic.gdx.graphics.glutils.FrameBuffercom.badlogic.gdx.graphics.glutils.FrameBufferdoublebooleandoubleintintdoubledoubledouble[]booleandouble[]floatfloatbooleanFields inherited from class NamedComponent
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyFrom(NoiseComponent other) voiddispose()com.badlogic.gdx.graphics.glutils.FrameBuffergenerateBiome(int N, int M) Generates the biome, which is a set of two textures in a frame buffer.com.badlogic.gdx.graphics.glutils.FrameBuffergenerateNoise(int N, int M, int channels, int targets, float[] color) com.badlogic.gdx.graphics.glutils.FrameBuffergenerateSurface(int N, int M, String biomeLut, float biomeHueShift, float biomeSaturation, boolean generateNormalMap) Generates the surface textures with this noise component.voidprint(Logger.Log log) voidrandomizeAll(Random rand) voidrandomizeAll(Random rand, boolean clouds) voidrandomizeEarthLike(Random rand) voidrandomizeGasGiant(Random rand) voidrandomizeRockyPlanet(Random rand) voidrandomizeSnowPlanet(Random rand) voidsetAmplitude(Double amplitude) voidsetFractaltype(String fractalType) voidsetFractalType(String ignoredFractalType) voidsetFrequency(Double frequency) voidsetLacunarity(Double lacunarity) voidsetNumTerraces(Long numTerraces) voidsetOctaves(Long octaves) Sets the number of octaves.voidsetPersistence(Double persistence) voidvoidsetRange(double[] range) voidvoidsetScale(double[] noiseScale) voidvoidvoidvoidsetTerracesExp(Double terracesExp) voidsetTerraceSmoothness(Double terracesExp) voidvoidMethods inherited from class NamedComponent
createModelParameters, gaussian, gaussian, gaussian, initialize
-
Field Details
-
scale
public double[] scale -
power
public double power -
octaves
public int octaves -
amplitude
public double amplitude -
persistence
public double persistence -
frequency
public double frequency -
lacunarity
public double lacunarity -
range
public double[] range -
type
-
seed
public float seed -
turbulence
public boolean turbulence -
ridge
public boolean ridge -
numTerraces
public int numTerraces -
terracesExp
public float terracesExp -
genEmissiveMap
public boolean genEmissiveMap -
fbNoise
public com.badlogic.gdx.graphics.glutils.FrameBuffer fbNoise -
fbBiome
public com.badlogic.gdx.graphics.glutils.FrameBuffer fbBiome -
fbSurface
public com.badlogic.gdx.graphics.glutils.FrameBuffer fbSurface
-
-
Constructor Details
-
NoiseComponent
public NoiseComponent()
-
-
Method Details
-
generateNoise
public com.badlogic.gdx.graphics.glutils.FrameBuffer generateNoise(int N, int M, int channels, int targets, float[] color) -
generateBiome
public com.badlogic.gdx.graphics.glutils.FrameBuffer generateBiome(int N, int M) Generates the biome, which is a set of two textures in a frame buffer. The first render target in the frame buffer is the elevation, the second is the moisture, and the third the emission.- Parameters:
N- The width in pixels.M- The height in pixels.- Returns:
- The biome frame buffer, with two render targets.
-
generateSurface
public com.badlogic.gdx.graphics.glutils.FrameBuffer generateSurface(int N, int M, String biomeLut, float biomeHueShift, float biomeSaturation, boolean generateNormalMap) Generates the surface textures with this noise component. The main render target contains the diffuse texture, the second render target contains the specular texture, and the third render target optionally contains the normal texture.
Note that for this function to succeed,
generateBiome(int, int)must have been called beforehand, andfbBiomemust be available.- Parameters:
N- The width in pixels.M- The height in pixels.biomeLut- The biome look up table (LUT) path.biomeHueShift- The LUT hue shift as an angle in degrees.biomeSaturation- The LUT saturation value.generateNormalMap- Whether to generate a normal map.- Returns:
- The frame buffer with all the render targets.
-
setType
-
setFractalType
-
setFractaltype
-
setScale
-
setScale
public void setScale(double[] noiseScale) -
setOctaves
-
setAmplitude
-
setPersistence
-
setFrequency
-
setLacunarity
-
setPower
-
setNumTerraces
-
setTerracesExp
-
setTerraceSmoothness
-
setRange
public void setRange(double[] range) -
setSeed
-
setSeed
-
setTurbulence
-
setRidge
-
copyFrom
-
randomizeAll
-
randomizeAll
-
randomizeRockyPlanet
-
randomizeEarthLike
-
randomizeSnowPlanet
-
randomizeGasGiant
-
print
-
dispose
public void dispose()
-