JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
Previous Page
Next Page

Chapter 15. Noise

In computer graphics, it's easy to make things look good. By definition, geometry is drawn and rendered precisely. However, when realism is a goal, perfection isn't always such a good thing. Real-world objects have dents and dings and scuffs. They show wear and tear. Computer graphics artists have to work hard to make a perfectly defined bowling pin look like it has been used and abused for 20 years in a bowling alley or to make a space ship that seems a little worse for wear after many years of galactic travel.

This was the problem that Ken Perlin was trying to solve when he worked for a company called Magi in the early 1980s. Magi was working with Disney on a feature film called Tron that was the most ambitious film in its use of computer graphics until that time. Perlin recognized the "imperfection" of the perfectly rendered objects in that film, and he resolved to do something about it.

In a seminal paper published in 1985, Perlin described a renderer that he had written that used a technique he called NOISE. His definition of noise was a little different from the everyday definition of noise. Normally, when we refer to noise, we're referring to something like a random pattern of pixels on a television channel with no signal (also called "snow") or to static on the radio on a frequency that doesn't have any nearby station broadcasting.

But a truly random function like this isn't that useful for computer graphics. For computer graphics, we need a function that is repeatable so that an object can be drawn from different view angles. We also need the ability to draw the object the same way, frame after frame, in an animation. Truly random functions do not depend on any input values, so an object rendered with such a function would look different each time it was drawn.

The visual artifacts caused by this type of rendering would look horrible as the object was moved about the screen. What is needed is a function that produces the same output value for a given input value every time and yet gives the appearance of randomness. This function also needs to be continuous at all levels of detail.

Perlin was the first to come up with a usable function for that purpose. Since then, a variety of similar noise functions have been defined and used in combinations to produce interesting rendering effects such as

  • Rendering natural phenomena (clouds, fire, smoke, wind effects, etc.)

  • Rendering natural materials (marble, granite, wood, mountains, etc.)

  • Rendering man-made materials (stucco, asphalt, cement, etc.)

  • Adding imperfections to perfect models (rust, dirt, smudges, dents, etc.)

  • Adding imperfections to perfect patterns (wiggles, bumps, color variations, etc.)

  • Adding imperfections to time periods (time between blinks, amount of change between successive frames, etc.)

  • Adding imperfections to motion (wobbles, jitters, bumps, etc.)

Actually, the list is endless. Today, most rendering libraries include support for Perlin noise or something nearly equivalent. It is a staple of realistic rendering, and it's been heavily used in the generation of computer graphics images for the movie industry. For his groundbreaking work in this area, Perlin was presented with an Academy Award for technical achievement in 1997.

Because noise is such an important technique, it is included as a built-in function in the OpenGL Shading Language. There are several ways to make use of noise within a fragment shader. After laying the groundwork for noise, we take a look at several shader examples that depend on noise to achieve an interesting effect.

Previous Page
Next Page

JavaScript EditorAjax Editor     JavaScript Editor