summaryrefslogtreecommitdiff
path: root/modules/opensimplex/open_simplex_noise.cpp
diff options
context:
space:
mode:
authorRaphaelHunter <Raphael10241024@gmail.com>2019-07-08 16:39:48 +0800
committerRaphaelHunter <raphael10241024@gmail.com>2020-07-01 11:40:14 +0800
commit00cac6e9b66ea3ac97a66628db04013770479e22 (patch)
tree23d027646be110766f64f6a01d6647359f48a71d /modules/opensimplex/open_simplex_noise.cpp
parente820a73f58d7e25562ff2be75e975ec517a6c35b (diff)
Fix OpenSimplexNoise get_image() swap axes
Diffstat (limited to 'modules/opensimplex/open_simplex_noise.cpp')
-rw-r--r--modules/opensimplex/open_simplex_noise.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp
index 00b3d47db9..b08219d258 100644
--- a/modules/opensimplex/open_simplex_noise.cpp
+++ b/modules/opensimplex/open_simplex_noise.cpp
@@ -110,7 +110,7 @@ Ref<Image> 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;