Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Visual Studio 2015/2017 cache/options directory
.vs/

# Build results
[Dd]ebug/
[Rr]elease/
x64/
[Bb]in/
[Oo]bj/
9 changes: 7 additions & 2 deletions SimplexNoise/Noise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ public static int Seed
}
else
{
// permutation matrix is duplicated to handle rollovers
_perm = new byte[512];
var random = new Random(value);
random.NextBytes(_perm);

var perm = new byte[256];
new Random(value).NextBytes(perm);

Array.Copy(perm, 0, _perm, 0, 256);
Array.Copy(perm, 0, _perm, 256, 256);
}

_seed = value;
Expand Down