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

Commit

Permalink
Cellular noise lookup return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed Feb 1, 2017
1 parent f449f69 commit 3a98881
Show file tree
Hide file tree
Showing 2 changed files with 375 additions and 186 deletions.
14 changes: 12 additions & 2 deletions FastNoiseSIMD/FastNoiseSIMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

// Reduced minimum of zSize from 8 to 4 when not using a vector set
// Causes slightly performance loss on non-"mulitple of 8" zSize
#define FN_MIN_Z_4
//#define FN_MIN_Z_4

/*
Tested Compilers:
Expand Down Expand Up @@ -103,7 +103,7 @@ class FastNoiseSIMD
enum PerturbType { None, Gradient, GradientFractal };

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

// Creates new FastNoiseSIMD for the highest supported instuction set of the CPU
static FastNoiseSIMD* NewFastNoiseSIMD(int seed = 1337);
Expand Down Expand Up @@ -184,6 +184,14 @@ class FastNoiseSIMD
// Default: Euclidean
void SetCellularDistanceFunction(CellularDistanceFunction cellularDistanceFunction) { m_cellularDistanceFunction = cellularDistanceFunction; }

// Sets the type of noise used if cellular return type is set the NoiseLookup
// Default: Simplex
void SetCellularNoiseLookupType(NoiseType cellularNoiseLookupType) { m_cellularNoiseLookupType = cellularNoiseLookupType; }

// Sets relative frequency on the cellular noise lookup return type
// Default: 0.2
void SetCellularNoiseLookupFrequency(float cellularNoiseLookupFrequency) { m_cellularNoiseLookupFrequency = cellularNoiseLookupFrequency; }


// Enables position perturbing for all noise types
// Default: None
Expand Down Expand Up @@ -271,6 +279,8 @@ class FastNoiseSIMD

CellularDistanceFunction m_cellularDistanceFunction = Euclidean;
CellularReturnType m_cellularReturnType = Distance;
NoiseType m_cellularNoiseLookupType = Simplex;
float m_cellularNoiseLookupFrequency = 0.2f;

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

0 comments on commit 3a98881

Please sign in to comment.