From 00cac6e9b66ea3ac97a66628db04013770479e22 Mon Sep 17 00:00:00 2001 From: RaphaelHunter Date: Mon, 8 Jul 2019 16:39:48 +0800 Subject: [PATCH] Fix OpenSimplexNoise get_image() swap axes --- modules/opensimplex/open_simplex_noise.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp index 00b3d47db9e..b08219d2580 100644 --- a/modules/opensimplex/open_simplex_noise.cpp +++ b/modules/opensimplex/open_simplex_noise.cpp @@ -110,7 +110,7 @@ Ref OpenSimplexNoise::get_image(int p_width, int p_height) { for (int i = 0; i < p_height; i++) { for (int j = 0; j < p_width; j++) { - float v = get_noise_2d(i, j); + float v = get_noise_2d(j, i); v = v * 0.5 + 0.5; // Normalize [0..1] uint8_t value = uint8_t(CLAMP(v * 255.0, 0, 255)); wd8[(i * p_width + j) * 4 + 0] = value;