From 590253bfe6c6790ed3f8764f545312f02a9aca8e Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 21 Feb 2026 00:03:27 -0500 Subject: [PATCH] Fix 2D simplex noise using mod(i,255) instead of iand(i,255) Co-Authored-By: Claude Opus 4.6 --- src/pre_process/m_simplex_noise.fpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pre_process/m_simplex_noise.fpp b/src/pre_process/m_simplex_noise.fpp index 442f0985d9..5dacdda7b6 100644 --- a/src/pre_process/m_simplex_noise.fpp +++ b/src/pre_process/m_simplex_noise.fpp @@ -205,8 +205,8 @@ contains x2 = x0 - 1._wp + 2._wp*G2 y2 = y0 - 1._wp + 2._wp*G2 - ii = mod(i, 255) - jj = mod(j, 255) + ii = iand(i, 255) + jj = iand(j, 255) gi0 = mod(p_vec(ii + p_vec(jj)), 10) + 1 gi1 = mod(p_vec(ii + i1 + p_vec(jj + j1)), 10) + 1