Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Perlin Noise (virgin.net)
67 points by jashmenn on April 9, 2011 | hide | past | favorite | 16 comments


If you like this topic check out "Texturing and Modeling: a Procedural Approach" which covers Perlin noise and other similar algorithms. The books shows you how Pixar generates life like surfaces and effects in Renderman. http://www.amazon.com/Texturing-Modeling-Third-Procedural-Ap...


Discussion on Minecraft's use of Perlin noise: http://news.ycombinator.com/item?id=1733157



Hugo's stuff is great. A lot of the content is derived from the work he and Matt Fairclough did on Terragen, which was (and presumably still is) a fantastic piece of software (http://planetside.co.uk/)


Don't use Perlin noise, use Simplex noise. Less artifacts, faster, just slightly harder to understand.


Perlin noise has a fundamental problem that I believe Simplex noise accentuates:

(Begin quote) When rendering, it is common to texture 2D surfaces by sampling a 3D noise function, but the resulting 2D texture will in general not be band-limited, even if the 3D function is perfectly band-limited. This means that the loss-of-detail vs. aliasing tradeoff cannot be solved simply by constructing a band-limited 3D function. To our knowledge this problem has never even been identified, much less addressed. (End quote)

I think this is responsible for the questionable look of the screenshots of 3D and 4D simplex noise at the end of this pdf (sorry, couldn't find a html version):

www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf

Another practical problem:

(Begin quote) A Perlin band near the Nyquist limit contains both frequencies that are low enough to be representable (i.e., they contain detail that should be in the image) and frequencies that are high enough to be unrepresentable (i.e, they can cause aliasing). Excluding the band causes loss-of-detail artifacts, but including it causes aliasing artifacts. Balancing this tradeoff between loss of detail and aliasing has been a constant source of frustration for shader writers at Pixar and elsewhere. Because aliasing is usually more unacceptable than loss of detail in feature film production, bands are attenuated aggressively. An unfortunate consequence of this is that as you zoom into a scene the texture detail becomes visible later than the geometry detail, so the texture doesn’t appear to be tied to its geometry. Instead, the texture appears to fade in unnaturally as if there were a haze that obscured only some aspects of the surface appearance and only when it was farther away. (End quote)

Enter wavelet noise. It's heavier in the theoretical side, but the paper that presents it claims it's efficient and solves the above problems.

http://graphics.pixar.com/library/WaveletNoise/paper.pdf


Check out https://github.com/ashima/webgl-noise for a broadly compatible, very fast implementation of both Perlin and Simplex noise. It works with WebGL and requires no textures or arrays!

The software was originally developed for my WebGL OCaml game engine demo, Ooman: http://ashimagames.com/


A reasonable FOSS library in C++ for those attempting to quickly play with coherent noise (Perlin, cellular) is http://libnoise.sourceforge.net/ Used it in a couple of projects and been happy with the ease of use. Also has some good doc pages to supplement those in the linked article.


I wrote a rough-and-ready jQuery plugin that sticks Perlin noise in the background of an element. This is a great writeup, I wish I had it when I was figuring everything out.

http://www.njl.us/projects/jquery-perlin/


the linked article is wrong.

that, or http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.... (from euccastro's comment below) is. but the latter looks more authoritative to me and checks against http://en.wikipedia.org/wiki/Perlin_noise.

perlin noise is gradient noise (so the gradient is chosen at random, not the height.


Check out his other work too: http://mrl.nyu.edu/~perlin/ (submitted this to hn a while ago)


I love Perlin noise. There's seriously no better way to generate a lot of classes of textures. E.g. I used it in a pixel shader to get wood grain textures for a maze game I built: http://sites.google.com/site/codybrocious/proto.jpg


Surprisingly, there is a complete C implementation of perlin noise in the w3c SVG specification : http://www.w3.org/TR/SVG/filters.html#feTurbulenceElement


Question: for the random number generator, instead of changing the internal prime numbers, can't you use a seeded generator (e.g.: mersenne twister), using the "i" value (the function number) as a seed?


I remember consulting this page when making what must be the canonical "my first Perlin", a terrain heightmap generator!

http://i.imgur.com/fTiWC.png


There is a nice talk by Perlin here at http://www.noisemachine.com/talk1/, too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: