Help end child hunger
Mar 192011

A new noise function for GLSL is being proposed by Ian McEwan at Ashima Art. It does not require any setup, i.e. no textures nor uniform arrays. Just add it to your shader source code and call it wherever you want. This means that it is easier to distribute the final shader so that it can be used in other application. It is based on Stefan Gustavson’s paper “Simplex noise demystified” and it runs on OpenGL 1.2 and up.

In GLSL specs there has always been a noise function. However no implementation is directly available so far on common hardware. The hardware manufacturers have chosen not to implement this function (has any major vendor implement the noise function in commodity hardware?), so if you want to use noise you’ll have to implement it yourself or grab someone else’s code.

A hardware implementation is not to be expected as hardware is getting more generic to to accommodate not only graphics but also with scientific computations (CUDA, OpenCL and Direct Compute).

Despite that, a software noise function could be provided in software. However, unless all manufacturers agree on the same implementation we will start seeing different results in different hardware. Do we want this?

So far its true that available noise implementations from the community have required a setup from the application side to work properly. They required texture units, or uniform arrays and these imply changes in the application side. While it is also true that this is not an obstacle for the pros working in the gaming industry it is not friendly enough to make noise a mainstream feature.

Yet noise has many applications, one of them being procedural texturing. Noise can help us get a more natural look, and help disguising the patterns that arise from using tileable textures. Noise based animation also looks really cool and natural.

Some argue that the hardware is not ready yet for a noise function, as it is too demanding from a computational point of view to be used for complex effects in real-time. Others note that today’s high-end hardware looks ready and that a noise implementation will have people starting to use it.

Yes, it is true that noise takes its toll on performance, and maybe the hardware is not quite ready for using noise for already demanding and complex effects. But it is also true that the hardware was not ready for displaying high triangle count scenes just a decade ago and that didn’t prevent us from playing with graphics.

In fact, the lack of resources often leads to creativity. It requires programmers and artists to invent new approaches to get that new effect – Necessity is the mother of Invention. And Invention is what moves CG forward.

If you want to read more about noise, check out the presentation from Ken Perlin at GDC 1999. Hugo Elias has a nice page where some uses for noise are presented.


  One Response to “Noise for GLSL”

  1. Thank you very much for this article and these links :)

 Leave a Reply




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>