Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
Cellular distance index setting, cellular cave noise
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed Apr 28, 2017
1 parent 80249ba commit faa3434
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -259,3 +259,4 @@ paket-files/
*.exe
/avxPerm
*.filters
/TEST/FastNoiseSIMD Preview
9 changes: 8 additions & 1 deletion FastNoiseSIMD/FastNoiseSIMD.h
Expand Up @@ -104,7 +104,7 @@ class FastNoiseSIMD
enum PerturbType { None, Gradient, GradientFractal, Normalise, Gradient_Normalise, GradientFractal_Normalise };

enum CellularDistanceFunction { Euclidean, Manhattan, Natural };
enum CellularReturnType { CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div, NoiseLookup };
enum CellularReturnType { CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div, NoiseLookup, Distance2Cave };

// Creates new FastNoiseSIMD for the highest supported instuction set of the CPU
static FastNoiseSIMD* NewFastNoiseSIMD(int seed = 1337);
Expand Down Expand Up @@ -139,6 +139,7 @@ class FastNoiseSIMD
// Create an empty (aligned) noise set for use with FillNoiseSet()
static float* GetEmptySet(int xSize, int ySize, int zSize) { return GetEmptySet(xSize*ySize*zSize); }

// Rounds the size up to the nearest aligned size for the current SIMD level
static int AlignedSize(int size);


Expand Down Expand Up @@ -195,6 +196,10 @@ class FastNoiseSIMD
// Default: 0.2
void SetCellularNoiseLookupFrequency(float cellularNoiseLookupFrequency) { m_cellularNoiseLookupFrequency = cellularNoiseLookupFrequency; }

// Sets the 2 distance indicies used for distance2 return types
// Default: 0, 1
void SetCellularDistance2Indicies(int cellularDistanceIndex0, int cellularDistanceIndex1) { m_cellularDistanceIndex0 = cellularDistanceIndex0; m_cellularDistanceIndex1 = cellularDistanceIndex1; }


// Enables position perturbing for all noise types
// Default: None
Expand Down Expand Up @@ -296,6 +301,8 @@ class FastNoiseSIMD
CellularReturnType m_cellularReturnType = Distance;
NoiseType m_cellularNoiseLookupType = Simplex;
float m_cellularNoiseLookupFrequency = 0.2f;
int m_cellularDistanceIndex0 = 0;
int m_cellularDistanceIndex1 = 1;

PerturbType m_perturbType = None;
float m_perturbAmp = 1.0f;
Expand Down

0 comments on commit faa3434

Please sign in to comment.