Skip to content

Commit

Permalink
Merge pull request #117 from ForeverZer0/cellular-jitter-parity
Browse files Browse the repository at this point in the history
Made cellular jitter constant consistent for all languages
  • Loading branch information
Auburn authored Sep 8, 2023
2 parents 95900f7 + f5c07b9 commit 5a4ab12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion C/FastNoiseLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ static float _fnlSingleCellular2D(fnl_state *state, int seed, FNLfloat x, FNLflo
float distance1 = FLT_MAX;
int closestHash = 0;

float cellularJitter = 0.5f * state->cellular_jitter_mod;
float cellularJitter = 0.43701595f * state->cellular_jitter_mod;

int xPrimed = (xr - 1) * PRIME_X;
int yPrimedBase = (yr - 1) * PRIME_Y;
Expand Down
4 changes: 2 additions & 2 deletions GLSL/FastNoiseLite.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ float _fnlSingleCellular2D(fnl_state state, int seed, FNLfloat x, FNLfloat y)
float distance1 = 1e10f;
int closestHash = 0;

float cellularJitter = 0.5f * state.cellular_jitter_mod;
float cellularJitter = 0.43701595f * state.cellular_jitter_mod;

int xPrimed = (xr - 1) * PRIME_X;
int yPrimedBase = (yr - 1) * PRIME_Y;
Expand Down Expand Up @@ -2254,4 +2254,4 @@ void fnlDomainWarp3D(fnl_state state, inout FNLfloat x, inout FNLfloat y, inout
_fnlDomainWarpFractalIndependent3D(state, x, y, z);
break;
}
}
}
4 changes: 2 additions & 2 deletions HLSL/FastNoiseLite.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ static float _fnlSingleCellular2D(fnl_state state, int seed, FNLfloat x, FNLfloa
float distance1 = 1e10f;
int closestHash = 0;

float cellularJitter = 0.5f * state.cellular_jitter_mod;
float cellularJitter = 0.43701595f * state.cellular_jitter_mod;

int xPrimed = (xr - 1) * PRIME_X;
int yPrimedBase = (yr - 1) * PRIME_Y;
Expand Down Expand Up @@ -2321,4 +2321,4 @@ void fnlDomainWarp3D(fnl_state state, inout FNLfloat x, inout FNLfloat y, inout
_fnlDomainWarpFractalIndependent3D(state, x, y, z);
break;
}
}
}

0 comments on commit 5a4ab12

Please sign in to comment.