Topics

Friday, October 18, 2013

Noising up a texture procedurally

When applying texture to a CG surface, there are two basic options:

1) Texture mapping - using an image map to define the patterns
2) Procedural textures - using a mathematical algorithm to define the patterns

Naturally there are pros and cons to both methods. The first affords maximum artist control but incurs a memory and resolution limit. When you zoom in on an image texture too closely, it loses detail and becomes blurry. Procedural textures do not have this problem, but they are much more difficult to art-direct and may require programming skills beyond the more artistically inclined user.

With Project Eden there is really not much choice except to go with option 1. Even though fractal terrain generation and rendering has come a long way, the Earth has a highly recognizable face thanks to NASA photo imagery, so a purely procedural approach can be easily spotted.

I'm going to describe a method which can be used to push the image texture resolution limit a little further by making use of procedural noise. Typically, a CG texture artist would add noise to the color, diffuse, specular or bump channels, but we'll be doing something different today.

Here's a flat plane mapped with a grid image:


Here's the same grid with noise added. Notice that the grid pattern has been distorted procedurally, without needing to increase the resolution the original texture:


More noise can break up the pattern even further:


By now, some of you would have probably guessed how it's been done. Instead of adding noise to the pattern, we add noise to the UV lookup coordinates, so each texel lookup will return information that is offset from where it should be. Here's the Houdini shader network used:


You can see that a bit of turbulent noise has been added to each UV coordinate before being passed into the texture lookup node. The noise is based on surface position so it is independent of the resolution of the texture image.

Hence, we can use this simple trick to add more "resolution" to our image textures. A relatively inexpensive technique without the need for fancy Photoshop filters or edge detection algorithms. The results are especially applicable for naturalistic patterns, not so much for mechanical patterns. Now go out there are make some noise! ^^;;
 
Pixel art of world map found on the internet
Same pixelated texture reference by noisy UV lookup