Computer Graphics World

JANUARY 2010

Issue link: https://digital.copcomm.com/i/6179

Contents of this Issue

Navigation

Page 7 of 43

Procedural Randomness T he most basic pitfall of creating shaders or materials for 3D render- ings is the use of too clean, too perfect textures. In reality, every singe object, surface, or material is worn, dirty, or naturally imper- fect to some extent. By photographing or scanning real textures, we get these patterns for free, which helps to "sell" the final 3D image. While procedural textures, generated completely by mathematical algorithms, have many advantages over acquired image textures, reproducing the natural randomness may be especially challenging. As we will see, there is much more to natural-looking noise textures than simply perturbing the RGB values with random numbers. Randomness itself is a tricky thing in the realm of computer science, where everything is based on a series of deterministic commands. ere is no way to let a typical processor flip a coin or roll dice; thus, it is not possible to produce "true" random numbers. Instead, computational algorithms are used to generate long sequences of apparently random results, called pseudo-random numbers. e heart of such algorithms is the iteration step: given an input number, we compute another, ap- parently independent one. By repeating this step, we can produce ex- tremely long pseudo-random sequences that are prefect for many ap- plications: computer games, music playlists, dynamic simulations, or even computer animation. For applications where true randomness is c ritical—lottery or cryptography, for instance—higher quality random numbers are required. Before the 1950s, large tables of random num- bers were published for use by mathematicians and scientists, but now it is possible to buy hardware-based random number generators (RNGs) or to rely on services, such as www.random.org, where the numbers are produced based on the physical measurement of atmospheric noise. To emulate natural random processes, we can generate a series of pseudo-random numbers and, thus, form a digital random signal. However, not all noise signals are the same. Audio noise—a one-dimen- sional signal—may refer to a high-frequency "hiss" sound or a lower- frequency "humming" noise, as well. Based on their spectral statistical characteristics, one-dimensional noise signals are often classified using the "color" terminology: white noise, pink noise, brown noise, purple noise, and so forth. ese typical (and sometimes only theoretical) ran- dom signals have an important role and are commonly used in acous- tics, electrical engineering, and physics. White noise—for example, a signal that has the same power over all the frequencies—is essential in calibrating amplification systems (and is likely to drive you crazy if you happen to arrive too early to a summer music festival). By feeding the sound system with white noise, the audio engineer is able to determine which frequencies need to be equalized by measuring the power distri- bution of the output sound. In computer graphics, one-dimensional random signals are primarily used to perturb animation channels. An "inactive" human character standing still in a computer game will never appear realistic unless some low-frequency random motion is applied to its muscles. e constant motion due to our body's physiological actions, including pumping blood or breathing, as well as the constant oscillation of muscle tissue, is typically very slow, thus we need a random signal without any high- frequency components. A simple series of random numbers is of no use for such applications: We need algorithms generating random signals of controllable frequency range. e same concept is true for noise tex- tures—the secret ingredients to make realistic particle or crowd simula- tions, shaders, or lights. ese, two- or three-dimensional noise signals are not simply "soups" of random pixels, but an apparently random series of dark/bright spots. By constraining the sizes of the variations into a well-defined range, we get a chance to match any natural random pattern and avoid aliasing artifacts. (We certainly do not want random variations smaller than a pixel in the final image.) e visual properties—such as contrast and density—of noise tex- tures need to be precisely controllable so we can use them as a building block to create various natural-looking shading networks. As all natural CG By GerGely Vass Planetside Software's Terragen 2 uses procedural noise textures to create virtual landscapes. January 2010 A former Maya TD and instructor, Gergely Vass eventually moved to the Image Science Team of Autodesk Media and Entertainment. Currently he is developing advanced postproduction tools for Colorfront in Hungary, one of Europe's lead- ing DI and post facilities. Vass can be reached at gergely@colorfront.com. Image by Saurav Subedi.


Articles in this issue

Links on this page

Archives of this issue

view archives of Computer Graphics World - JANUARY 2010