Skip to content

Commit 4ff5a1b

Browse files
sbryngelsonclaude
andcommitted
Fix 2D simplex noise using mod(i,255) instead of iand(i,255)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 41b6088 commit 4ff5a1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pre_process/m_simplex_noise.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ contains
205205
x2 = x0 - 1._wp + 2._wp*G2
206206
y2 = y0 - 1._wp + 2._wp*G2
207207

208-
ii = mod(i, 255)
209-
jj = mod(j, 255)
208+
ii = iand(i, 255)
209+
jj = iand(j, 255)
210210

211211
gi0 = mod(p_vec(ii + p_vec(jj)), 10) + 1
212212
gi1 = mod(p_vec(ii + i1 + p_vec(jj + j1)), 10) + 1

0 commit comments

Comments
 (0)