Skip to content

Commit

Permalink
Wrap gradient indices in Noise::noise
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
artfwo committed May 27, 2018
1 parent fdf4ecc commit de29d06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Noise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ float Noise::noise(float z, float offset)
float g1, g2, d2;
float result = 0;

int z1 = (int) z;
int z2 = (z1 + 1);
int z1 = (int) z % 65536U;
int z2 = (z1 + 1) % 65536U;

float dz1 = z - z1;
float dz2 = dz1 - 1.0f;
Expand Down

1 comment on commit de29d06

@JimiHFord
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woohoooo!!! 🎉 🎈 thanks!

Please sign in to comment.