diff options
author | JFonS <joan.fonssanchez@gmail.com> | 2018-08-25 00:25:06 +0200 |
---|---|---|
committer | JFonS <joan.fonssanchez@gmail.com> | 2018-09-14 15:24:34 +0200 |
commit | f12a1b88636f6147d2445749d728ecd9585bc3c4 (patch) | |
tree | 9c12a94df2870cfdf0f81087f88108cf414e0ec3 /modules/opensimplex/doc_classes/SimplexNoise.xml | |
parent | 4d228e66b45a6a3859decde6b2452c78728f8958 (diff) |
Add SimplexNoise and NoiseTexture as new resources
SimplexNoise can be used to generate parameterized fractal noise based on Open Simplex.
NoiseTexture uses SimplexNoise to generate noise textures for using in
shaders/visual effects.
Diffstat (limited to 'modules/opensimplex/doc_classes/SimplexNoise.xml')
-rw-r--r-- | modules/opensimplex/doc_classes/SimplexNoise.xml | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/modules/opensimplex/doc_classes/SimplexNoise.xml b/modules/opensimplex/doc_classes/SimplexNoise.xml new file mode 100644 index 0000000000..2dd2318681 --- /dev/null +++ b/modules/opensimplex/doc_classes/SimplexNoise.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SimplexNoise" inherits="Resource" category="Core" version="3.1"> + <brief_description> + Noise generator based on Open Simplex. + </brief_description> + <description> + This resource allows you to configure and sample a fractal noise space. + + Here is a brief usage example that configures a SimplexNoise and gets samples at various positions and dimensions: + [codeblock] + var noise = SimplexNoise.new() + + # Configure + noise.seed = randi() + noise.octaves = 4 + noise.period = 20.0 + noise.persistance = 0.8 + + #Sample + print("Values:") + print(noise.get_noise_2d(1.0,1.0)) + print(noise.get_noise_3d(0.5,3.0,15.0)) + print(noise.get_noise_3d(0.5,1.9,4.7,0.0)) + [/codeblock] + + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="get_image"> + <return type="Image"> + </return> + <argument index="0" name="width" type="int"> + </argument> + <argument index="1" name="height" type="int"> + </argument> + <description> + 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_2d"> + <return type="float"> + </return> + <argument index="0" name="x" type="float"> + </argument> + <argument index="1" name="y" type="float"> + </argument> + <description> + 2D noise value [-1,1] at position [code]x[/code],[code]y[/code]. + </description> + </method> + <method name="get_noise_2dv"> + <return type="float"> + </return> + <argument index="0" name="pos" type="Vector2"> + </argument> + <description> + 2D noise value [-1,1] at position [code]pos.x[/code],[code]pos.y[/code]. + </description> + </method> + <method name="get_noise_3d"> + <return type="float"> + </return> + <argument index="0" name="x" type="float"> + </argument> + <argument index="1" name="y" type="float"> + </argument> + <argument index="2" name="z" type="float"> + </argument> + <description> + 3D noise value [-1,1] at position [code]x[/code],[code]y[/code],[code]z[/code]. + </description> + </method> + <method name="get_noise_3dv"> + <return type="float"> + </return> + <argument index="0" name="pos" type="Vector3"> + </argument> + <description> + 3D noise value [-1,1] at position [code]pos.x[/code],[code]pos.y[/code],[code]pos.z[/code]. + </description> + </method> + <method name="get_noise_4d"> + <return type="float"> + </return> + <argument index="0" name="x" type="float"> + </argument> + <argument index="1" name="y" type="float"> + </argument> + <argument index="2" name="z" type="float"> + </argument> + <argument index="3" name="w" type="float"> + </argument> + <description> + 4D noise value [-1,1] at position [code]x[/code],[code]y[/code],[code]z[/code],[code]w[/code]. + </description> + </method> + <method name="get_seamless_image"> + <return type="Image"> + </return> + <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]). + </description> + </method> + </methods> + <members> + <member name="lacunarity" type="float" setter="set_lacunarity" getter="get_lacunarity"> + Difference in period between [member octaves]. + </member> + <member name="octaves" type="int" setter="set_octaves" getter="get_octaves"> + Number of Simplex Noise layers that are sampled to get the fractal noise. + </member> + <member name="period" type="float" setter="set_period" getter="get_period"> + Period of the base octave. + A lower period results in a higher frequancy noise (more value changes across the same distance). + </member> + <member name="persistance" type="float" setter="set_persistance" getter="get_persistance"> + Contribuiton factor of the different octaves. + A [code]persistance[/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"> + Seed used to generate random values, different seeds will generate different noise maps. + </member> + </members> + <constants> + </constants> +</class> |