From f12a1b88636f6147d2445749d728ecd9585bc3c4 Mon Sep 17 00:00:00 2001 From: JFonS Date: Sat, 25 Aug 2018 00:25:06 +0200 Subject: 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. --- modules/opensimplex/doc_classes/NoiseTexture.xml | 50 +++++++++ modules/opensimplex/doc_classes/SimplexNoise.xml | 132 +++++++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 modules/opensimplex/doc_classes/NoiseTexture.xml create mode 100644 modules/opensimplex/doc_classes/SimplexNoise.xml (limited to 'modules/opensimplex/doc_classes') diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml new file mode 100644 index 0000000000..c7dc373f59 --- /dev/null +++ b/modules/opensimplex/doc_classes/NoiseTexture.xml @@ -0,0 +1,50 @@ + + + + [SimplexNoise] filled texture. + + + Uses a [SimplexNoise] to fill the texture data. You can specify the texture size but keep in mind that larger textures will take longer to generate and seamless noise only works with square sized textures. + NoiseTexture can also generate normalmap textures. + + + + + + + + + + + + + Set texture height. + + + + + + + + + Set texture width. + + + + + + If true, the resulting texture contains a normal map created from the original noise interpreted as a bump map. + + + The [SimplexNoise] instance used to generate the noise. + + + Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate. + + + Size of the generated texture. + + + + + 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 @@ + + + + Noise generator based on Open Simplex. + + + 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] + + + + + + + + + + + + + + + + Generate a noise image with the requested [code]width[/code] and [code]height[/code], based on the current noise parameters. + + + + + + + + + + + 2D noise value [-1,1] at position [code]x[/code],[code]y[/code]. + + + + + + + + + 2D noise value [-1,1] at position [code]pos.x[/code],[code]pos.y[/code]. + + + + + + + + + + + + + 3D noise value [-1,1] at position [code]x[/code],[code]y[/code],[code]z[/code]. + + + + + + + + + 3D noise value [-1,1] at position [code]pos.x[/code],[code]pos.y[/code],[code]pos.z[/code]. + + + + + + + + + + + + + + + 4D noise value [-1,1] at position [code]x[/code],[code]y[/code],[code]z[/code],[code]w[/code]. + + + + + + + + + Generate a tileable noise image, based on the current noise parameters. + Generated seamless images are always square ([code]size[/code]x[code]size[/code]). + + + + + + Difference in period between [member octaves]. + + + Number of Simplex Noise layers that are sampled to get the fractal noise. + + + Period of the base octave. + A lower period results in a higher frequancy noise (more value changes across the same distance). + + + 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. + + + Seed used to generate random values, different seeds will generate different noise maps. + + + + + -- cgit v1.2.3