-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added get_noise_1d #26634
Added get_noise_1d #26634
Conversation
9d25dd2
to
c170f70
Compare
Except as one value to the noise generator is always the 'seed' in essence, this is actually more of a 0d noise generator, it is useful for getting a single value from a single seed, I.E. it will always generate the exact same map every single time since there is no seed to adjust it. |
I'm not quite sure what you mean, you can change the seed and it generates a different map. Like this. |
Wait what on earth?! First time I looked at this code (still been using my C code) and the implementation seems... very inefficient... In addition, the 'seed' doesn't look strictly like a seed for the noise but rather a seed for the permutation array that is used by the noise generator, which is not the same thing as an individual value's seed. EDIT: In addition it seems the current generator is limited to only 4d, which is exceptionally limiting in many situations (I tend to end up using no less than 6d, on occasion I've hit more, although with the current implementation it is not super efficient as it stands though...). |
@OvermindDL1 well, you always can contribute to make it better |
Isn't that how Simplex noise work though. It permutes the grid values, otherwise it would have to generate too many values. |
Should always have a permutation array, but the permutation array is not necessarily for a seed adjustment but rather to find a good set of default data that generates 'good' noise. A bad permutation array can make noise that has lines or noticeable repeats. The 'seed' for a given value, like for a simple 1d heightmap you'd use, say, the X value for the seed for unique generation and the Y for the value 'along' the world to generate an output height value. |
@OvermindDL1 Godot's simplex noise implementation uses a slightly modified version of https://github.com/smcameron/open-simplex-noise-in-c, you can find it here. If you can provide a better implementation, it would be a nice addition to the engine. |
i think this is good enough and should be mergeable |
Thanks! |
Referencing #26457 . Although it seems trivial, it would be useful to have a
get_noise_1d()
function to build procedurally generated heightmaps ( used in 2D games like Terraria or Worms). This can be used directly without needing to understand how to generate it throughget_noise_2d()
.Bugsquad edit: Fixes #26457.