summaryrefslogtreecommitdiff
path: root/modules/opensimplex
diff options
context:
space:
mode:
Diffstat (limited to 'modules/opensimplex')
-rw-r--r--modules/opensimplex/SCsub2
-rw-r--r--modules/opensimplex/doc_classes/NoiseTexture.xml15
-rw-r--r--modules/opensimplex/doc_classes/OpenSimplexNoise.xml24
-rw-r--r--modules/opensimplex/icons/icon_noise_texture.svg3
-rw-r--r--modules/opensimplex/noise_texture.h6
-rw-r--r--modules/opensimplex/open_simplex_noise.h2
6 files changed, 31 insertions, 21 deletions
diff --git a/modules/opensimplex/SCsub b/modules/opensimplex/SCsub
index 4235f6a0b9..311d33b047 100644
--- a/modules/opensimplex/SCsub
+++ b/modules/opensimplex/SCsub
@@ -12,7 +12,7 @@ thirdparty_sources = [
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
-env_opensimplex.Append(CPPPATH=[thirdparty_dir])
+env_opensimplex.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_opensimplex.Clone()
env_thirdparty.disable_warnings()
diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml
index 25f104b221..07d5eb27d6 100644
--- a/modules/opensimplex/doc_classes/NoiseTexture.xml
+++ b/modules/opensimplex/doc_classes/NoiseTexture.xml
@@ -9,26 +9,25 @@
</description>
<tutorials>
</tutorials>
- <demos>
- </demos>
<methods>
</methods>
<members>
- <member name="as_normalmap" type="bool" setter="set_as_normalmap" getter="is_normalmap">
- If true, the resulting texture contains a normal map created from the original noise interpreted as a bump map.
+ <member name="as_normalmap" type="bool" setter="set_as_normalmap" getter="is_normalmap" default="false">
+ If [code]true[/code], the resulting texture contains a normal map created from the original noise interpreted as a bump map.
</member>
- <member name="bump_strength" type="float" setter="set_bump_strength" getter="get_bump_strength">
+ <member name="bump_strength" type="float" setter="set_bump_strength" getter="get_bump_strength" default="8.0">
</member>
- <member name="height" type="int" setter="set_height" getter="get_height">
+ <member name="flags" type="int" setter="set_flags" getter="get_flags" override="true" default="7" />
+ <member name="height" type="int" setter="set_height" getter="get_height" default="512">
Height of the generated texture.
</member>
<member name="noise" type="OpenSimplexNoise" setter="set_noise" getter="get_noise">
The [OpenSimplexNoise] instance used to generate the noise.
</member>
- <member name="seamless" type="bool" setter="set_seamless" getter="get_seamless">
+ <member name="seamless" type="bool" setter="set_seamless" getter="get_seamless" default="false">
Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate.
</member>
- <member name="width" type="int" setter="set_width" getter="get_width">
+ <member name="width" type="int" setter="set_width" getter="get_width" default="512">
Width of the generated texture.
</member>
</members>
diff --git a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml
index b5bc35df69..f3fbbab3da 100644
--- a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml
+++ b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml
@@ -23,8 +23,6 @@
</description>
<tutorials>
</tutorials>
- <demos>
- </demos>
<methods>
<method name="get_image">
<return type="Image">
@@ -37,6 +35,16 @@
Generate a noise image with the requested [code]width[/code] and [code]height[/code], based on the current noise parameters.
</description>
</method>
+ <method name="get_noise_1d">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <description>
+ Returns the 1D noise value [code][-1,1][/code] at the given x-coordinate.
+ [b]Note:[/b] This method actually returns the 2D noise value [code][-1,1][/code] with fixed y-coordinate value 0.0.
+ </description>
+ </method>
<method name="get_noise_2d">
<return type="float">
</return>
@@ -100,24 +108,24 @@
<argument index="0" name="size" type="int">
</argument>
<description>
- Generate a tileable noise image, based on the current noise parameters. Generated seamless images are always square ([code]size[/code] x [code]size[/code]).
+ Generate a tileable noise image, based on the current noise parameters. Generated seamless images are always square ([code]size[/code] × [code]size[/code]).
</description>
</method>
</methods>
<members>
- <member name="lacunarity" type="float" setter="set_lacunarity" getter="get_lacunarity">
+ <member name="lacunarity" type="float" setter="set_lacunarity" getter="get_lacunarity" default="2.0">
Difference in period between [member octaves].
</member>
- <member name="octaves" type="int" setter="set_octaves" getter="get_octaves">
+ <member name="octaves" type="int" setter="set_octaves" getter="get_octaves" default="3">
Number of OpenSimplex noise layers that are sampled to get the fractal noise.
</member>
- <member name="period" type="float" setter="set_period" getter="get_period">
+ <member name="period" type="float" setter="set_period" getter="get_period" default="64.0">
Period of the base octave. A lower period results in a higher-frequency noise (more value changes across the same distance).
</member>
- <member name="persistence" type="float" setter="set_persistence" getter="get_persistence">
+ <member name="persistence" type="float" setter="set_persistence" getter="get_persistence" default="0.5">
Contribution factor of the different octaves. A [code]persistence[/code] value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one.
</member>
- <member name="seed" type="int" setter="set_seed" getter="get_seed">
+ <member name="seed" type="int" setter="set_seed" getter="get_seed" default="0">
Seed used to generate random values, different seeds will generate different noise maps.
</member>
</members>
diff --git a/modules/opensimplex/icons/icon_noise_texture.svg b/modules/opensimplex/icons/icon_noise_texture.svg
new file mode 100644
index 0000000000..5908c2b2d4
--- /dev/null
+++ b/modules/opensimplex/icons/icon_noise_texture.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path d="m2 1c-0.55228 0-1 0.44772-1 1v12c0 0.55228 0.44772 1 1 1h12c0.55228 0 1-0.44772 1-1v-12c0-0.55228-0.44772-1-1-1zm1 2h10v8h-10zm3 1v2h2v-2zm2 2v2h2v2h2v-6h-2v2zm0 2h-2v-2h-2v4h4z" fill="#e0e0e0" fill-opacity=".99608"/>
+</svg>
diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h
index 0d00ee154d..5e4a02fcee 100644
--- a/modules/opensimplex/noise_texture.h
+++ b/modules/opensimplex/noise_texture.h
@@ -40,7 +40,7 @@
#include "editor/property_editor.h"
class NoiseTexture : public Texture {
- GDCLASS(NoiseTexture, Texture)
+ GDCLASS(NoiseTexture, Texture);
private:
Ref<Image> data;
@@ -77,12 +77,12 @@ public:
Ref<OpenSimplexNoise> get_noise();
void set_width(int p_width);
- void set_height(int p_hieght);
+ void set_height(int p_height);
void set_seamless(bool p_seamless);
bool get_seamless();
- void set_as_normalmap(bool p_seamless);
+ void set_as_normalmap(bool p_as_normalmap);
bool is_normalmap();
void set_bump_strength(float p_bump_strength);
diff --git a/modules/opensimplex/open_simplex_noise.h b/modules/opensimplex/open_simplex_noise.h
index 96885f5893..c31cbf68c3 100644
--- a/modules/opensimplex/open_simplex_noise.h
+++ b/modules/opensimplex/open_simplex_noise.h
@@ -38,7 +38,7 @@
#include "thirdparty/misc/open-simplex-noise.h"
class OpenSimplexNoise : public Resource {
- GDCLASS(OpenSimplexNoise, Resource)
+ GDCLASS(OpenSimplexNoise, Resource);
OBJ_SAVE_TYPE(OpenSimplexNoise);
osn_context contexts[6];