{"id":982,"date":"2018-03-28T19:01:02","date_gmt":"2018-03-28T17:01:02","guid":{"rendered":"http:\/\/fraktalia.org\/?p=982"},"modified":"2018-06-18T00:01:42","modified_gmt":"2018-06-17T22:01:42","slug":"accepted-2","status":"publish","type":"post","link":"https:\/\/fraktalia.org\/de\/accepted-2\/","title":{"rendered":"3D Textures: Perlin Noise"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h1>Volumetric Noise algorithms:<\/h1>\n<p>In video games, noise algorithms are used whenevery randomness is required. For example water movement is often simulated using a noise function. For such application, it is sufficient to have a noise function which generates a 2D output.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-medium wp-image-983 alignright\" src=\"http:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-300x230.png\" alt=\"noise\" width=\"300\" height=\"230\" srcset=\"https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-300x230.png 300w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise.png 452w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>2D noise functions can be used for volumetric datasets if it should only affect the height like terrain height in minecraft. However the disadvantage is the unability to describe the inner structure of the volumetric dataset. Therefore 3D noise algorithms are needed.<\/p>\n<p>When working with 3D Textures, having an good editor is must have as it is difficult to visualize results. One method is to just apply it as a material like in the right screenshot. Another important point is that the genartion of such textures are huge datasets so it is recommended to use the GPU for the generation process.<\/p>\n<h2>Available noise algorithms:<\/h2>\n<p class=\"vcard-names\">There is various existing work already available as they are used many times. The orginal code was provided by <span class=\"profile-name\"><a href=\"https:\/\/gist.github.com\/patriciogonzalezvivo\/670c22f3966e662d2f83\">Patricio Gonzalez Vivo<\/a> in GLSL which I have converted to an Unity Compute Shader. The github page contains a list of common noise algorithms like Perlin, Voronoi or Simplex. <\/span><\/p>\n<p>Another source of Noise function is from <span class=\"p-name vcard-fullname d-block overflow-hidden\"><a href=\"https:\/\/github.com\/keijiro\/NoiseShader\">Keijiro Takahashi <\/a>which inludes compute shaders to calculate common noise functions. Allthough they are made for Unity, they are in HLSL and GLSL and also had to be converted into compute shader in order to generate 3D Textures..<\/span><\/p>\n<p>Next is <a href=\"https:\/\/github.com\/ashima\/webgl-noise\/tree\/master\/src\">Ashima<\/a> which also offers\u00a0 unusual 4D noise algorithms. 4D algorithms are needed when the volumetric dataset should animate. The fourth dimension would be the timeline.<\/p>\n<p class=\"vcard-names\">The last source of useable algorithms is <a href=\"https:\/\/github.com\/BrianSharpe\/Wombat\">Wombat<\/a> which is a free noise libary written in GLSL<\/p>\n<p class=\"vcard-names\">Below is a list of currently implemented noise algorithms. The mesh for the visualisation is a simple fractal which I have created with the fractal generator so it is easier to see the inner structure of a 3D texture.<\/p>\n<h3>Noise 1: Pseudo Randomness<\/h3>\n<p><img decoding=\"async\" class=\"size-medium wp-image-984 alignright\" src=\"http:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-1-300x203.png\" alt=\"noise\" width=\"300\" height=\"203\" srcset=\"https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-1-300x203.png 300w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-1.png 574w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>The first sample is a simple generic noise algorithm tested, It produces decent results.<\/p>\n<p>Original Source code was provided by <span class=\"profile-name\"><a href=\"https:\/\/gist.github.com\/patriciogonzalezvivo\/670c22f3966e662d2f83\">Patricio Gonzalez Vivo<\/a><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Noise 2: 3DPerlin<\/h3>\n<p><img decoding=\"async\" class=\"size-medium wp-image-985 alignright\" src=\"http:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-2-300x188.png\" alt=\"noise\" width=\"300\" height=\"188\" srcset=\"https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-2-300x188.png 300w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-2-400x250.png 400w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-2.png 542w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>This is a sample of the 3DPerlin function from <a href=\"https:\/\/github.com\/BrianSharpe\/Wombat\">Wombat<\/a>. The difference between the first one and this is almost diminishing especially when octaves are included.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><\/h3>\n<h3>Noise 3: Cellular<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-986 alignright\" src=\"http:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-3-300x202.png\" alt=\"noise\" width=\"300\" height=\"202\" srcset=\"https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-3-300x202.png 300w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-3.png 474w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>This is a cellular noise algorithm or worley. The original source is from <a href=\"https:\/\/github.com\/ashima\/webgl-noise\/tree\/master\/src\">Ashima<\/a>,<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Noise 4: Classic<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-987 alignright\" src=\"http:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-4-300x179.png\" alt=\"noise\" width=\"300\" height=\"179\" srcset=\"https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-4-300x179.png 300w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-4.png 564w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>This is another classic noise function provided by <span class=\"p-name vcard-fullname d-block overflow-hidden\"><a href=\"https:\/\/github.com\/keijiro\/NoiseShader\">Keijiro Takahashi<\/a><\/span>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Noise 5: Lines<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-988 alignright\" src=\"http:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-5-300x183.png\" alt=\"noise\" width=\"300\" height=\"183\" srcset=\"https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-5-300x183.png 300w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-5.png 418w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>This was an attemt to implement a noise function according to this<a href=\"http:\/\/flafla2.github.io\/2014\/08\/09\/perlinnoise.html\"> tutorial<\/a>. However it seems that something went wrong here. However the resullt is pretty interesting and yield concrete like results when done with octaves,<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Noise 6: Simplex<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-989 alignright\" src=\"http:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-6-300x169.png\" alt=\"noise\" width=\"300\" height=\"169\" srcset=\"https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-6-300x169.png 300w, https:\/\/fraktalia.org\/wp-content\/uploads\/2018\/03\/noise-6.png 468w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>The last one is a sample of a simplex noise algorithm. The original sourcecode is from Ashima<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Conclusion:<\/h3>\n<p>There are many algorithms for the generation of random noise and these are the most common one. The next post will contain infomation about octaves which improve the detail of noise algorithms.<\/p>","protected":false},"excerpt":{"rendered":"<p>&nbsp; Volumetric Noise algorithms: In video games, noise algorithms are used whenevery randomness is required. For example water movement is often simulated using a noise function. For such application, it is sufficient to have a noise function which generates a 2D output. 2D noise functions can be used for volumetric datasets if it should only [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":983,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76],"tags":[],"class_list":["post-982","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-masterarbeit"],"_links":{"self":[{"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/comments?post=982"}],"version-history":[{"count":0,"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/posts\/982\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/media\/983"}],"wp:attachment":[{"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/media?parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/categories?post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fraktalia.org\/de\/wp-json\/wp\/v2\/tags?post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}