Closed poberlohr closed 4 years ago
I think you are right but wouldn't it break compatibility?
It definitely could, especially if someone already calls noise.get_noise_2d(y, x)
because it works that way.
The safest solution I can think of is introducing a fixed version of the function using a different name (or signature) and marking the existing one as deprecated.
What about passing a Vector2
instead of separate x- and y-values? That should work in c++, but how does this translate to GDScript?
Maybe add a breaks-compatibility tag?
Godot version: v3.1.stable.official
Issue description:
In a small expirement I created a NoiseTexture using OpenSimplexNoise and added it to the scene as background image. Then I tried to query the noise value at a specific position, but it didn't match with what was shown on the screen.
It took me a while to figure out, that OpenSimplexNoise.get_image() swaps the x- and y-axis:
See open_simplex_noise.cpp
Steps to reproduce:
Minimal reproduction project:
NoiseImageFlippedAxesDemo.zip
Remarks: It is of course easy to work around this issue by just calling
noise.get_noise_2d(y, x)
instead, but that's something one has to figure out first. What I don't know is, if fixing the order in open_simplex_noise.cpp would cause some side-effects for other projects. Alternatively the docs should just mention this issue, that would be helping too.