mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 20:23:53 +00:00
Merge pull request #30424 from raphael10241024/fix_noise
Fix OpenSimplexNoise get_image() swap axes
This commit is contained in:
commit
f71e258512
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user