For today's update on shading I'm going to touch upon something called Procedural Shading. Procedural shading is an alternative work-flow over traditional texture based pipelines. Both work-flows have their own advantages and disadvantages.  We often mix the two for the best results.

What is procedural shading? To understand that we need to look at the traditional texture based work-flow. Traditional texturing is akin to painting on top of a real object. We apply layers of paint all over the object, which emulate real world brushes and techniques. Although this often provides excellent results it is often time consuming and requires lots of computer memory.

Procedural shading is a technique where we add colour and shading to an object using mathematical equations. This sounds technical but is surprisingly simple. The best example of this is something called Perlin noise. Perlin noise is a type of noise that is completely generated using a mathematical formula. This noise can be scaled and mixed to produce fractal noise. If you have ever used the Photoshop 'cloud' filter, that is fractal noise. Here is an example of Perlin noise, and fractal noise.

Using mathematically generated textures we can create complex results very quickly with typically lower computer memory requirements. The downside to procedural shading is less control and higher processing power. Lets take a look at a procedural approach we use frequently at Carse and Waterman.

Here is a fairly simple render of porcelain dragon with a strong light source to the left and an orange paint shader applied. Notice how the dragon itself looks flat. The overall colour is too uniform and details are lost. We could go through and paint all the crevices but this could take a couple of hours. Lets use a procedural shader to do the work for us. We use a curvature map. This is a shader which looks at the curvature of the mesh and where it finds a concave area (a crease) it will darken, and subsequently a convex area it will lighten.

Here you can see the results of a curvature shader applied to our dragon. Notice how details on the mesh are being highlighted and creases are darkened. Lets use the curvature shader and pipe that into our porcelain shader.

Normally we use this effect subtly however here I've exaggerated the effect. This appears more vivid and details are highlighted. The object looks a lot more realistic. This effect took less than a minute to setup and we have the exact effect we're looking for, versus a couple of hours to hand-paint the model.

There are various procedural techniques we can use to produce often complex results. When used in combination with traditional texturing we can create stunning results in a fraction of the time.

Thoughts by,

Rich