Difference between revisions of "Noise"

From GiderosMobile
(some more links added/created)
(reordered methods)
Line 101: Line 101:
 
[[Special:MyLanguage/Noise.new|Noise.new]] ''<translate>creates a new Noise object</translate>''<br/><!-- GIDEROSMTD:Noise.new() creates a new Noise object -->
 
[[Special:MyLanguage/Noise.new|Noise.new]] ''<translate>creates a new Noise object</translate>''<br/><!-- GIDEROSMTD:Noise.new() creates a new Noise object -->
  
[[Special:MyLanguage/Noise:reset|Noise:reset]] ''<translate>reset noise parameters to default</translate>''<br/><!-- GIDEROSMTD:FastNoise:reset() reset noise parameters to default -->
+
[[Special:MyLanguage/Noise:getCellularDistanceFunction|Noise:getCellularDistanceFunction]] ''<translate>returns distance function type</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularDistanceFunction() returns distance function type -->
[[Special:MyLanguage/Noise:noise|Noise:noise]] ''<translate>get noise value</translate>''<br/><!-- GIDEROSMTD:Noise:noise([x,y,z]) get noise value -->
+
[[Special:MyLanguage/Noise:getCellularJitter|Noise:getCellularJitter]] ''<translate>returns cellular jitter value</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularJitter() returns cellular jitter value -->
[[Special:MyLanguage/Noise:noise2D|Noise:noise2D]] ''<translate>get 2D noise value</translate>''<br/><!-- GIDEROSMTD:Noise:noise2D(x,y) get 2D noise value -->
+
[[Special:MyLanguage/Noise:getCellularNoiseLookup|Noise:getCellularNoiseLookup]] ''<translate>returns Noise object that was set by setCellularNoiseLookup() function</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularNoiseLookup() returns Noise object that was set by setCellularNoiseLookup() function -->
[[Special:MyLanguage/Noise:noise3D|Noise:noise3D]] ''<translate>get 3D noise value</translate>''<br/><!-- GIDEROSMTD:Noise:noise3D(x,y,z) get 3D noise value -->
+
[[Special:MyLanguage/Noise:getCellularReturnType|Noise:getCellularReturnType]] ''<translate>returns cellular return type</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularReturnType() returns cellular return type -->
[[Special:MyLanguage/Noise:whiteNoise4D|Noise:whiteNoise4D]] ''<translate>get 4D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise4D(x,y,z,w) get 4D white noise value -->
+
[[Special:MyLanguage/Noise:getFractalGain|Noise:getFractalGain]] ''<translate>return noise gain</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalGain() return noise gain -->
[[Special:MyLanguage/Noise:whiteNoise2DInt|Noise:whiteNoise2DInt]] ''<translate>get integer 2D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise2DInt(x,y) get integer 2D white noise value -->
+
[[Special:MyLanguage/Noise:getFractalLacunarity|Noise:getFractalLacunarity]] ''<translate>returns noise lacunarity</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalLacunarity() returns noise lacunarity -->
[[Special:MyLanguage/Noise:whiteNoise3DInt|Noise:whiteNoise3DInt]] ''<translate>get integer 3D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise3DInt(x,y,z) get integer 3D white noise value -->
+
[[Special:MyLanguage/Noise:getFractalOctaves|Noise:getFractalOctaves]] ''<translate>returns number of fractal octaves</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalOctaves() returns number of fractal octaves -->
[[Special:MyLanguage/Noise:whiteNoise4DInt|Noise:whiteNoise4DInt]] ''<translate>get integer 4D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise4DInt(x,y,z,w) get integer 4D white noise value -->
+
[[Special:MyLanguage/Noise:getFractalType|Noise:getFractalType]] ''<translate>returns noise type</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalType() returns noise type -->
[[Special:MyLanguage/Noise:simplex4D|Noise:simplex4D]] ''<translate>get 4D simplex noise value</translate>''<br/><!-- GIDEROSMTD:Noise:simplex4D(x,y,z,w) get 4D simplex noise value -->
+
[[Special:MyLanguage/Noise:getFrequency|Noise:getFrequency]] ''<translate>returns noise frequency</translate>''<br/><!-- GIDEROSMTD:Noise:getFrequency() returns noise frequency -->
 +
[[Special:MyLanguage/Noise:getGradientPerturbAmp|Noise:getGradientPerturbAmp]] ''<translate>returns gradient perturb amplitude.</translate>''<br/><!-- GIDEROSMTD:Noise:getGradientPerturbAmp() returns gradient perturb amplitude. -->
 +
[[Special:MyLanguage/Noise:getInterp()|Noise:getInterp()]] ''<translate>returns interpolation type</translate>''<br/><!-- GIDEROSMTD:Noise:getInterp() returns interpolation type -->
 +
[[Special:MyLanguage/Noise:getNoiseType|Noise:getNoiseType]] ''<translate>returns noise type</translate>''<br/><!-- GIDEROSMTD:Noise:getNoiseType() returns noise type -->
 +
[[Special:MyLanguage/Noise:getSeed|Noise:getSeed]] ''<translate>returns generator's seed</translate>''<br/><!-- GIDEROSMTD:Noise:getSeed() returns generator's seed -->
 
[[Special:MyLanguage/Noise:gradientPerturb2D|Noise:gradientPerturb2D]] ''<translate>returns modified x, y</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturb2D(x,y) returns modified x, y -->
 
[[Special:MyLanguage/Noise:gradientPerturb2D|Noise:gradientPerturb2D]] ''<translate>returns modified x, y</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturb2D(x,y) returns modified x, y -->
 
[[Special:MyLanguage/Noise:gradientPerturb3D|Noise:gradientPerturb3D]] ''<translate>returns modified x, y, z</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturb3D(x,y,z) returns modified x, y, z -->
 
[[Special:MyLanguage/Noise:gradientPerturb3D|Noise:gradientPerturb3D]] ''<translate>returns modified x, y, z</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturb3D(x,y,z) returns modified x, y, z -->
 
[[Special:MyLanguage/Noise:gradientPerturbFractal2D|Noise:gradientPerturbFractal2D]] ''<translate>returns modified x,y</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturbFractal2D(x,y) returns modified x,y -->
 
[[Special:MyLanguage/Noise:gradientPerturbFractal2D|Noise:gradientPerturbFractal2D]] ''<translate>returns modified x,y</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturbFractal2D(x,y) returns modified x,y -->
 
[[Special:MyLanguage/Noise:gradientPerturbFractal3D|Noise:gradientPerturbFractal3D]] ''<translate>returns modified x,y,z</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturbFractal3D(x,y,z) returns modified x,y,z -->
 
[[Special:MyLanguage/Noise:gradientPerturbFractal3D|Noise:gradientPerturbFractal3D]] ''<translate>returns modified x,y,z</translate>''<br/><!-- GIDEROSMTD:Noise:gradientPerturbFractal3D(x,y,z) returns modified x,y,z -->
[[Special:MyLanguage/Noise:setNoiseType|Noise:setNoiseType]] ''<translate>sets the type of noise returned by noise()</translate>''<br/><!-- GIDEROSMTD:Noise:setNoiseType(noiseType) sets the type of noise returned by noise() -->
+
[[Special:MyLanguage/Noise:noise|Noise:noise]] ''<translate>get noise value</translate>''<br/><!-- GIDEROSMTD:Noise:noise([x,y,z]) get noise value -->
 +
[[Special:MyLanguage/Noise:noise2D|Noise:noise2D]] ''<translate>get 2D noise value</translate>''<br/><!-- GIDEROSMTD:Noise:noise2D(x,y) get 2D noise value -->
 +
[[Special:MyLanguage/Noise:noise3D|Noise:noise3D]] ''<translate>get 3D noise value</translate>''<br/><!-- GIDEROSMTD:Noise:noise3D(x,y,z) get 3D noise value -->
 +
[[Special:MyLanguage/Noise:reset|Noise:reset]] ''<translate>reset noise parameters to default</translate>''<br/><!-- GIDEROSMTD:FastNoise:reset() reset noise parameters to default -->
 +
[[Special:MyLanguage/Noise:setCellularDistance2Indices|Noise:setCellularDistance2Indices]] ''<translate>sets the 2 distance indicies used for distance2 return types</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularDistance2Indices(index0, index1) sets the 2 distance indicies used for distance2 return types -->
 +
[[Special:MyLanguage/Noise:setCellularDistanceFunction|Noise:setCellularDistanceFunction]] ''<translate>the distance function used to calculate the cell for a given point</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularDistanceFunction(distanceFunctionType) the distance function used to calculate the cell for a given point -->
 +
[[Special:MyLanguage/Noise:setCellularJitter|Noise:setCellularJitter]] ''<translate>sets the maximum distance a cellular point can move from its grid position</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularJitter(jitter) sets the maximum distance a cellular point can move from its grid position -->
 +
[[Special:MyLanguage/Noise:setCellularNoiseLookup|Noise:setCellularNoiseLookup]] ''<translate>noise used to calculate a cell value</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularNoiseLookup(Noise) noise used to calculate a cell value -->
 +
[[Special:MyLanguage/Noise:setCellularReturnType|Noise:setCellularReturnType]] ''<translate>what value does the cellular function return from its calculations</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularReturnType(returnType) what value does the cellular function return from its calculations -->
 +
[[Special:MyLanguage/Noise:setFractalGain|Noise:setFractalGain]] ''<translate>the relative strength of noise from each layer when compared to the last</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalGain(gain) the relative strength of noise from each layer when compared to the last -->
 +
[[Special:MyLanguage/Noise:setFractalLacunarity|Noise:setFractalLacunarity]] ''<translate>the frequency multiplier between each octave</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalLacunarity(lacunarity) the frequency multiplier between each octave -->
 
[[Special:MyLanguage/Noise:setFractalOctaves|Noise:setFractalOctaves]] ''<translate>the amount of noise layers used to create the fractal</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalOctaves(n) the amount of noise layers used to create the fractal -->
 
[[Special:MyLanguage/Noise:setFractalOctaves|Noise:setFractalOctaves]] ''<translate>the amount of noise layers used to create the fractal</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalOctaves(n) the amount of noise layers used to create the fractal -->
 +
[[Special:MyLanguage/Noise:setFractalType|Noise:setFractalType]] ''<translate>used in all fractal noise generation</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalType(noiseType) used in all fractal noise generation -->
 +
[[Special:MyLanguage/Noise:setFrequency|Noise:setFrequency]] ''<translate>affects how coarse the noise output is</translate>''<br/><!-- GIDEROSMTD:Noise:setFrequency(frequency) affects how coarse the noise output is -->
 +
[[Special:MyLanguage/Noise:setGradientPerturbAmp|Noise:setGradientPerturbAmp]] ''<translate>sets the maximum perturb distance from original location when using gradientPerturb()</translate>''<br/><!-- GIDEROSMTD:Noise:setGradientPerturbAmp(amp) sets the maximum perturb distance from original location when using gradientPerturb() -->
 
[[Special:MyLanguage/Noise:setInterp|Noise:setInterp]] ''<translate>changes the interpolation method used to smooth between noise values</translate>''<br/><!-- GIDEROSMTD:Noise:setInterp(interpolation) changes the interpolation method used to smooth between noise values -->
 
[[Special:MyLanguage/Noise:setInterp|Noise:setInterp]] ''<translate>changes the interpolation method used to smooth between noise values</translate>''<br/><!-- GIDEROSMTD:Noise:setInterp(interpolation) changes the interpolation method used to smooth between noise values -->
 +
[[Special:MyLanguage/Noise:setNoiseType|Noise:setNoiseType]] ''<translate>sets the type of noise returned by noise()</translate>''<br/><!-- GIDEROSMTD:Noise:setNoiseType(noiseType) sets the type of noise returned by noise() -->
 
[[Special:MyLanguage/Noise:setSeed|Noise:setSeed]] ''<translate>using different seeds will cause the noise output to change</translate>''<br/><!-- GIDEROSMTD:Noise:setSeed() using different seeds will cause the noise output to change -->
 
[[Special:MyLanguage/Noise:setSeed|Noise:setSeed]] ''<translate>using different seeds will cause the noise output to change</translate>''<br/><!-- GIDEROSMTD:Noise:setSeed() using different seeds will cause the noise output to change -->
[[Special:MyLanguage/Noise:setFrequency|Noise:setFrequency]] ''<translate>affects how coarse the noise output is</translate>''<br/><!-- GIDEROSMTD:Noise:setFrequency(frequency) affects how coarse the noise output is -->
+
[[Special:MyLanguage/Noise:simplex4D|Noise:simplex4D]] ''<translate>get 4D simplex noise value</translate>''<br/><!-- GIDEROSMTD:Noise:simplex4D(x,y,z,w) get 4D simplex noise value -->
[[Special:MyLanguage/Noise:setFractalLacunarity|Noise:setFractalLacunarity]] ''<translate>the frequency multiplier between each octave</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalLacunarity(lacunarity) the frequency multiplier between each octave -->
+
[[Special:MyLanguage/Noise:whiteNoise2DInt|Noise:whiteNoise2DInt]] ''<translate>get integer 2D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise2DInt(x,y) get integer 2D white noise value -->
[[Special:MyLanguage/Noise:setFractalGain|Noise:setFractalGain]] ''<translate>the relative strength of noise from each layer when compared to the last</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalGain(gain) the relative strength of noise from each layer when compared to the last -->
+
[[Special:MyLanguage/Noise:whiteNoise3DInt|Noise:whiteNoise3DInt]] ''<translate>get integer 3D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise3DInt(x,y,z) get integer 3D white noise value -->
[[Special:MyLanguage/Noise:setFractalType|Noise:setFractalType]] ''<translate>used in all fractal noise generation</translate>''<br/><!-- GIDEROSMTD:Noise:setFractalType(noiseType) used in all fractal noise generation -->
+
[[Special:MyLanguage/Noise:whiteNoise4D|Noise:whiteNoise4D]] ''<translate>get 4D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise4D(x,y,z,w) get 4D white noise value -->
[[Special:MyLanguage/Noise:setCellularDistanceFunction|Noise:setCellularDistanceFunction]] ''<translate>the distance function used to calculate the cell for a given point</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularDistanceFunction(distanceFunctionType) the distance function used to calculate the cell for a given point -->
+
[[Special:MyLanguage/Noise:whiteNoise4DInt|Noise:whiteNoise4DInt]] ''<translate>get integer 4D white noise value</translate>''<br/><!-- GIDEROSMTD:Noise:whiteNoise4DInt(x,y,z,w) get integer 4D white noise value -->
[[Special:MyLanguage/Noise:setCellularReturnType|Noise:setCellularReturnType]] ''<translate>what value does the cellular function return from its calculations</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularReturnType(returnType) what value does the cellular function return from its calculations -->
 
[[Special:MyLanguage/Noise:setCellularNoiseLookup|Noise:setCellularNoiseLookup]] ''<translate>noise used to calculate a cell value</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularNoiseLookup(Noise) noise used to calculate a cell value -->
 
[[Special:MyLanguage/Noise:setCellularDistance2Indices|Noise:setCellularDistance2Indices]] ''<translate>sets the 2 distance indicies used for distance2 return types</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularDistance2Indices(index0, index1) sets the 2 distance indicies used for distance2 return types -->
 
[[Special:MyLanguage/Noise:setCellularJitter|Noise:setCellularJitter]] ''<translate>sets the maximum distance a cellular point can move from its grid position</translate>''<br/><!-- GIDEROSMTD:Noise:setCellularJitter(jitter) sets the maximum distance a cellular point can move from its grid position -->
 
[[Special:MyLanguage/Noise:setGradientPerturbAmp|Noise:setGradientPerturbAmp]] ''<translate>sets the maximum perturb distance from original location when using gradientPerturb()</translate>''<br/><!-- GIDEROSMTD:Noise:setGradientPerturbAmp(amp) sets the maximum perturb distance from original location when using gradientPerturb() -->
 
[[Special:MyLanguage/Noise:getNoiseType|Noise:getNoiseType]] ''<translate>returns noise type</translate>''<br/><!-- GIDEROSMTD:Noise:getNoiseType() returns noise type -->
 
[[Special:MyLanguage/Noise:getFractalOctaves|Noise:getFractalOctaves]] ''<translate>returns number of fractal octaves</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalOctaves() returns number of fractal octaves -->
 
[[Special:MyLanguage/Noise:getInterp()|Noise:getInterp()]] ''<translate>returns interpolation type</translate>''<br/><!-- GIDEROSMTD:Noise:getInterp() returns interpolation type -->
 
[[Special:MyLanguage/Noise:getSeed|Noise:getSeed]] ''<translate>returns generator's seed</translate>''<br/><!-- GIDEROSMTD:Noise:getSeed() returns generator's seed -->
 
[[Special:MyLanguage/Noise:getFrequency|Noise:getFrequency]] ''<translate>returns noise frequency</translate>''<br/><!-- GIDEROSMTD:Noise:getFrequency() returns noise frequency -->
 
[[Special:MyLanguage/Noise:getFractalLacunarity|Noise:getFractalLacunarity]] ''<translate>returns noise lacunarity</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalLacunarity() returns noise lacunarity -->
 
[[Special:MyLanguage/Noise:getFractalGain|Noise:getFractalGain]] ''<translate>return noise gain</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalGain() return noise gain -->
 
[[Special:MyLanguage/Noise:getFractalType|Noise:getFractalType]] ''<translate>returns noise type</translate>''<br/><!-- GIDEROSMTD:Noise:getFractalType() returns noise type -->
 
[[Special:MyLanguage/Noise:getCellularDistanceFunction|Noise:getCellularDistanceFunction]] ''<translate>returns distance function type</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularDistanceFunction() returns distance function type -->
 
[[Special:MyLanguage/Noise:getCellularReturnType|Noise:getCellularReturnType]] ''<translate>returns cellular return type</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularReturnType() returns cellular return type -->
 
[[Special:MyLanguage/Noise:getCellularNoiseLookup|Noise:getCellularNoiseLookup]] ''<translate>returns Noise object that was set by setCellularNoiseLookup() function</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularNoiseLookup() returns Noise object that was set by setCellularNoiseLookup() function -->
 
[[Special:MyLanguage/Noise:getCellularJitter|Noise:getCellularJitter]] ''<translate>returns cellular jitter value</translate>''<br/><!-- GIDEROSMTD:Noise:getCellularJitter() returns cellular jitter value -->
 
[[Special:MyLanguage/Noise:getGradientPerturbAmp|Noise:getGradientPerturbAmp]] ''<translate>returns gradient perturb amplitude.</translate>''<br/><!-- GIDEROSMTD:Noise:getGradientPerturbAmp() returns gradient perturb amplitude. -->
 
  
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== <translate>Events</translate> ===
 
=== <translate>Events</translate> ===
 
=== <translate>Constants</translate> ===
 
=== <translate>Constants</translate> ===
[[Special:MyLanguage/Noise.FBM|Noise.FBM]]<br/><!-- GIDEROSCST:Noise.FBM fbm-->
 
 
[[Special:MyLanguage/Noise.BILLOW|Noise.BILLOW]]<br/><!-- GIDEROSCST:Noise.BILLOW billow-->
 
[[Special:MyLanguage/Noise.BILLOW|Noise.BILLOW]]<br/><!-- GIDEROSCST:Noise.BILLOW billow-->
[[Special:MyLanguage/Noise.RIGID_MULTI|Noise.RIGID_MULTI]]<br/><!-- GIDEROSCST:Noise.RIGID_MULTI rigid_multi-->
 
[[Special:MyLanguage/Noise.VALUE|Noise.VALUE]]<br/><!-- GIDEROSCST:Noise.VALUE value-->
 
[[Special:MyLanguage/Noise.VALUE_FRACTAL|Noise.VALUE_FRACTAL]]<br/><!-- GIDEROSCST:Noise.VALUE_FRACTAL value_fractal-->
 
[[Special:MyLanguage/Noise.PERLIN|Noise.PERLIN]]<br/><!-- GIDEROSCST:Noise.PERLIN perlin-->
 
[[Special:MyLanguage/Noise.PERLIN_FRACTAL|Noise.PERLIN_FRACTAL]]<br/><!-- GIDEROSCST:Noise.PERLIN_FRACTAL perlin_fractal-->
 
[[Special:MyLanguage/Noise.SIMPLEX|Noise.SIMPLEX]]<br/><!-- GIDEROSCST:Noise.SIMPLEX simplex-->
 
[[Special:MyLanguage/Noise.SIMPLEX_FRACTAL|Noise.SIMPLEX_FRACTAL]]<br/><!-- GIDEROSCST:Noise.SIMPLEX_FRACTAL simplex_fractal-->
 
 
[[Special:MyLanguage/Noise.CELLULAR|Noise.CELLULAR]]<br/><!-- GIDEROSCST:Noise.CELLULAR cellular-->
 
[[Special:MyLanguage/Noise.CELLULAR|Noise.CELLULAR]]<br/><!-- GIDEROSCST:Noise.CELLULAR cellular-->
[[Special:MyLanguage/Noise.WHITE_NOISE|Noise.WHITE_NOISE]]<br/><!-- GIDEROSCST:Noise.WHITE_NOISE white_noise-->
+
[[Special:MyLanguage/Noise.CELL_VALUE|Noise.CELL_VALUE]]<br/><!-- GIDEROSCST:Noise.CELL_VALUE cell_value-->
 
[[Special:MyLanguage/Noise.CUBIC|Noise.CUBIC]]<br/><!-- GIDEROSCST:Noise.CUBIC cubic-->
 
[[Special:MyLanguage/Noise.CUBIC|Noise.CUBIC]]<br/><!-- GIDEROSCST:Noise.CUBIC cubic-->
 
[[Special:MyLanguage/Noise.CUBIC_FRACTAL|Noise.CUBIC_FRACTAL]]<br/><!-- GIDEROSCST:Noise.CUBIC_FRACTAL cubic_fractal-->
 
[[Special:MyLanguage/Noise.CUBIC_FRACTAL|Noise.CUBIC_FRACTAL]]<br/><!-- GIDEROSCST:Noise.CUBIC_FRACTAL cubic_fractal-->
[[Special:MyLanguage/Noise.CELL_VALUE|Noise.CELL_VALUE]]<br/><!-- GIDEROSCST:Noise.CELL_VALUE cell_value-->
 
[[Special:MyLanguage/Noise.NOISE_LOOKUP|Noise.NOISE_LOOKUP]]<br/><!-- GIDEROSCST:Noise.NOISE_LOOKUP noise_lookup-->
 
 
[[Special:MyLanguage/Noise.DISTANCE|Noise.DISTANCE]]<br/><!-- GIDEROSCST:Noise.DISTANCE distance-->
 
[[Special:MyLanguage/Noise.DISTANCE|Noise.DISTANCE]]<br/><!-- GIDEROSCST:Noise.DISTANCE distance-->
 
[[Special:MyLanguage/Noise.DISTANCE_2|Noise.DISTANCE_2]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2 distance_2-->
 
[[Special:MyLanguage/Noise.DISTANCE_2|Noise.DISTANCE_2]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2 distance_2-->
 
[[Special:MyLanguage/Noise.DISTANCE_2_ADD|Noise.DISTANCE_2_ADD]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_ADD distance_2_add-->
 
[[Special:MyLanguage/Noise.DISTANCE_2_ADD|Noise.DISTANCE_2_ADD]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_ADD distance_2_add-->
 +
[[Special:MyLanguage/Noise.DISTANCE_2_DIV|Noise.DISTANCE_2_DIV]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_DIV distance_2_div-->
 +
[[Special:MyLanguage/Noise.DISTANCE_2_MUL|Noise.DISTANCE_2_MUL]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_MUL distance_2_mul-->
 
[[Special:MyLanguage/Noise.DISTANCE_2_SUB|Noise.DISTANCE_2_SUB]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_SUB distance_2_sub-->
 
[[Special:MyLanguage/Noise.DISTANCE_2_SUB|Noise.DISTANCE_2_SUB]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_SUB distance_2_sub-->
[[Special:MyLanguage/Noise.DISTANCE_2_MUL|Noise.DISTANCE_2_MUL]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_MUL distance_2_mul-->
+
[[Special:MyLanguage/Noise.EUCLIDEAN|Noise.EUCLIDEAN]]<br/><!-- GIDEROSCST:Noise.EUCLIDEAN euclidean-->
[[Special:MyLanguage/Noise.DISTANCE_2_DIV|Noise.DISTANCE_2_DIV]]<br/><!-- GIDEROSCST:Noise.DISTANCE_2_DIV distance_2_div-->
+
[[Special:MyLanguage/Noise.FBM|Noise.FBM]]<br/><!-- GIDEROSCST:Noise.FBM fbm-->
 +
[[Special:MyLanguage/Noise.HERMITE|Noise.HERMITE]]<br/><!-- GIDEROSCST:Noise.HERMITE hermite-->
 
[[Special:MyLanguage/Noise.LINEAR|Noise.LINEAR]]<br/><!-- GIDEROSCST:Noise.LINEAR linear-->
 
[[Special:MyLanguage/Noise.LINEAR|Noise.LINEAR]]<br/><!-- GIDEROSCST:Noise.LINEAR linear-->
[[Special:MyLanguage/Noise.HERMITE|Noise.HERMITE]]<br/><!-- GIDEROSCST:Noise.HERMITE hermite-->
 
[[Special:MyLanguage/Noise.QUINTIC|Noise.QUINTIC]]<br/><!-- GIDEROSCST:Noise.QUINTIC quintic-->
 
[[Special:MyLanguage/Noise.EUCLIDEAN|Noise.EUCLIDEAN]]<br/><!-- GIDEROSCST:Noise.EUCLIDEAN euclidean-->
 
 
[[Special:MyLanguage/Noise.MANHATTAN|Noise.MANHATTAN]]<br/><!-- GIDEROSCST:Noise.MANHATTAN manhattan-->
 
[[Special:MyLanguage/Noise.MANHATTAN|Noise.MANHATTAN]]<br/><!-- GIDEROSCST:Noise.MANHATTAN manhattan-->
 
[[Special:MyLanguage/Noise.NATURAL|Noise.NATURAL]]<br/><!-- GIDEROSCST:Noise.NATURAL natural-->
 
[[Special:MyLanguage/Noise.NATURAL|Noise.NATURAL]]<br/><!-- GIDEROSCST:Noise.NATURAL natural-->
 +
[[Special:MyLanguage/Noise.NOISE_LOOKUP|Noise.NOISE_LOOKUP]]<br/><!-- GIDEROSCST:Noise.NOISE_LOOKUP noise_lookup-->
 +
[[Special:MyLanguage/Noise.PERLIN|Noise.PERLIN]]<br/><!-- GIDEROSCST:Noise.PERLIN perlin-->
 +
[[Special:MyLanguage/Noise.PERLIN_FRACTAL|Noise.PERLIN_FRACTAL]]<br/><!-- GIDEROSCST:Noise.PERLIN_FRACTAL perlin_fractal-->
 +
[[Special:MyLanguage/Noise.QUINTIC|Noise.QUINTIC]]<br/><!-- GIDEROSCST:Noise.QUINTIC quintic-->
 +
[[Special:MyLanguage/Noise.RIGID_MULTI|Noise.RIGID_MULTI]]<br/><!-- GIDEROSCST:Noise.RIGID_MULTI rigid_multi-->
 +
[[Special:MyLanguage/Noise.SIMPLEX|Noise.SIMPLEX]]<br/><!-- GIDEROSCST:Noise.SIMPLEX simplex-->
 +
[[Special:MyLanguage/Noise.SIMPLEX_FRACTAL|Noise.SIMPLEX_FRACTAL]]<br/><!-- GIDEROSCST:Noise.SIMPLEX_FRACTAL simplex_fractal-->
 +
[[Special:MyLanguage/Noise.VALUE|Noise.VALUE]]<br/><!-- GIDEROSCST:Noise.VALUE value-->
 +
[[Special:MyLanguage/Noise.VALUE_FRACTAL|Noise.VALUE_FRACTAL]]<br/><!-- GIDEROSCST:Noise.VALUE_FRACTAL value_fractal-->
 +
[[Special:MyLanguage/Noise.WHITE_NOISE|Noise.WHITE_NOISE]]<br/><!-- GIDEROSCST:Noise.WHITE_NOISE white_noise-->
 
|}
 
|}
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Revision as of 17:27, 25 March 2020

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2019.12

Description

FastNoise is an open source noise generation library with a large collection of different noise algorithms.

FastNoise home page

Orignal documentation: https://github.com/Auburns/FastNoise/wiki

Features

  • Value Noise 2D, 3D
  • Perlin Noise 2D, 3D
  • Simplex Noise 2D, 3D, 4D
  • Cubic Noise 2D, 3D
  • Gradient Perturb 2D, 3D
  • Multiple fractal options for all of the above
  • Cellular (Voronoi) Noise 2D, 3D
  • White Noise 2D, 3D, 4D
  • Texture generation
  • Array generation

Examples

Example 1.

require "FastNoise"
 
local myNoise = Noise.new() -- create FastNoise instance
 
myNoise:setSeed(456) -- set generation seed
myNoise:setFrequency(0.04) -- how coarse the noise output is
myNoise:setInterp(Noise.HERMITE) -- set noise interpolation type
myNoise:setNoiseType(Noise.SIMPLEX) -- set noise type
 
for y = 1, 4 do 
	for x = 1, 4 do 
		local v = myNoise:noise(x, y) -- generate 2D noise
		-- other possible function:
		-- myNoise:noise(x) -- 1D noise
		-- myNoise:noise(x, y, z) -- 3D noise
		-- myNoise:noise2D(x, y) -- true 2D noise
		-- myNoise:noise3D(x, y, z) -- true 3D noise
		-- difference between noise2D(x, y) and noise(x, y) is that "noise" function uses 3D noise with 
		-- x = 0, y = 0, z = 0 by default where noise2D uses only 2 values. In other words: noise(x) == noise(x,0,0);  
		-- noise(x, y) == noise(x,y,0); noise(x,y) == noise2D(x,y); noise(x,y,z) == noise3D(x,y,z)
		print(v)
	end
end

Example 2. Grayscaled noise image

require "FastNoise"

local n = Noise.new() 
-- generate 128x128 texture
local tex = n:generateTexture(128, 128)
-- add it to scene
stage:addChild(Bitmap.new(tex))

Example 3. Colored seamless noise image

require "FastNoise"

local n = Noise.new() 
n:setFrequency(0.03)
n:setFractalOctaves(5)
n:setFractalLacunarity(2.5)
n:setInterp(Noise.HERMITE)
n:setFractalGain(0.6)
n:setNoiseType(Noise.SIMPLEX_FRACTAL)
-- create a color table used by noise
-- h: height value in range [0..1]
-- color: in RGBA format
local colors = {
	{h = 0.3, color = {52,99,195,255}},
	{h = 0.4, color = {54,102,198,255}},
	{h = 0.45, color = {209,208,128,255}},
	{h = 0.55, color = {88,151,24,255}},
	{h = 0.6, color = {63,106,20,255}},
	{h = 0.7, color = {92,68,61,255}},
	{h = 0.9, color = {75,60,55,255}},
	{h = 1, color = {255,255,255,255}},
}
-- generate 128x128 texture
local tex = n:generateTexture(128, 128, false, {wrap=Texture.REPEAT}, {tileable = true, colors = colors})
-- add it to scene
stage:addChild(Pixel.new(tex, 256,256))

See 3D examples here

Notes

Methods

Noise.new creates a new Noise object

Noise:getCellularDistanceFunction returns distance function type
Noise:getCellularJitter returns cellular jitter value
Noise:getCellularNoiseLookup returns Noise object that was set by setCellularNoiseLookup() function
Noise:getCellularReturnType returns cellular return type
Noise:getFractalGain return noise gain
Noise:getFractalLacunarity returns noise lacunarity
Noise:getFractalOctaves returns number of fractal octaves
Noise:getFractalType returns noise type
Noise:getFrequency returns noise frequency
Noise:getGradientPerturbAmp returns gradient perturb amplitude.
Noise:getInterp() returns interpolation type
Noise:getNoiseType returns noise type
Noise:getSeed returns generator's seed
Noise:gradientPerturb2D returns modified x, y
Noise:gradientPerturb3D returns modified x, y, z
Noise:gradientPerturbFractal2D returns modified x,y
Noise:gradientPerturbFractal3D returns modified x,y,z
Noise:noise get noise value
Noise:noise2D get 2D noise value
Noise:noise3D get 3D noise value
Noise:reset reset noise parameters to default
Noise:setCellularDistance2Indices sets the 2 distance indicies used for distance2 return types
Noise:setCellularDistanceFunction the distance function used to calculate the cell for a given point
Noise:setCellularJitter sets the maximum distance a cellular point can move from its grid position
Noise:setCellularNoiseLookup noise used to calculate a cell value
Noise:setCellularReturnType what value does the cellular function return from its calculations
Noise:setFractalGain the relative strength of noise from each layer when compared to the last
Noise:setFractalLacunarity the frequency multiplier between each octave
Noise:setFractalOctaves the amount of noise layers used to create the fractal
Noise:setFractalType used in all fractal noise generation
Noise:setFrequency affects how coarse the noise output is
Noise:setGradientPerturbAmp sets the maximum perturb distance from original location when using gradientPerturb()
Noise:setInterp changes the interpolation method used to smooth between noise values
Noise:setNoiseType sets the type of noise returned by noise()
Noise:setSeed using different seeds will cause the noise output to change
Noise:simplex4D get 4D simplex noise value
Noise:whiteNoise2DInt get integer 2D white noise value
Noise:whiteNoise3DInt get integer 3D white noise value
Noise:whiteNoise4D get 4D white noise value
Noise:whiteNoise4DInt get integer 4D white noise value

Events

Constants

Noise.BILLOW
Noise.CELLULAR
Noise.CELL_VALUE
Noise.CUBIC
Noise.CUBIC_FRACTAL
Noise.DISTANCE
Noise.DISTANCE_2
Noise.DISTANCE_2_ADD
Noise.DISTANCE_2_DIV
Noise.DISTANCE_2_MUL
Noise.DISTANCE_2_SUB
Noise.EUCLIDEAN
Noise.FBM
Noise.HERMITE
Noise.LINEAR
Noise.MANHATTAN
Noise.NATURAL
Noise.NOISE_LOOKUP
Noise.PERLIN
Noise.PERLIN_FRACTAL
Noise.QUINTIC
Noise.RIGID_MULTI
Noise.SIMPLEX
Noise.SIMPLEX_FRACTAL
Noise.VALUE
Noise.VALUE_FRACTAL
Noise.WHITE_NOISE