Procedural Shading

When the objects in the scene are colored while rendering, there are two possibilities to do this:

  • By applying an image to the surface (a texture) or
  • by calculating the color of the surface by some mathematical formulae.

In action

The first method can be observed at several places in the picture: The walls, the stones and the floor are textured using images.
The rest is shaded with procedural wood (the door, the barrel and the planks in the water) or marble shaders (the border of the water pool, the bottom of the walls, the table surface and the mortar).


A close-up of the mortar from the scene, shaded with the procedural black marble shader

Implementation idea

Procedural textures can be used at any resolution or level of detail, because the colors are calculated from continous functions. The use of so called noise functions is very common, with a very famous example being the ones invented by Ken Perlin. The color of a pixel which is to be shaded is computed based on its location in the coordinate system, but then distorted by the values of the Perlin Noise and Turbulence functions, giving irregular continuous color patterns on the objects.

Changes made