You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Increase the maximum number of octaves in OpenSimplexNoise to 9
An error message is now printed when trying to set the number of octaves
above the maximum allowed value.
The magic constant was also replaced with a define that can be
easily changed.
This closes #28714.
(cherry picked from commit 13622d40fc)
This commit is contained in:
committed by
Rémi Verschelde
parent
cbd4784d14
commit
1898240af8
@@ -37,11 +37,16 @@
|
||||
|
||||
#include "thirdparty/misc/open-simplex-noise.h"
|
||||
|
||||
// The maximum number of octaves allowed. Note that these are statically allocated.
|
||||
// Higher values become exponentially slower, so this shouldn't be set too high
|
||||
// to avoid freezing the editor for long periods of time.
|
||||
#define MAX_OCTAVES 9
|
||||
|
||||
class OpenSimplexNoise : public Resource {
|
||||
GDCLASS(OpenSimplexNoise, Resource);
|
||||
OBJ_SAVE_TYPE(OpenSimplexNoise);
|
||||
|
||||
osn_context contexts[6];
|
||||
osn_context contexts[MAX_OCTAVES];
|
||||
|
||||
int seed;
|
||||
float persistence; // Controls details, value in [0,1]. Higher increases grain, lower increases smoothness.
|
||||
|
||||
Reference in New Issue
Block a user