Procedural Texture Article Index for
Procedural
Website Links For
Procedural
 

Information About

Procedural Texture




A procedural texture is a Computer Generated Image created using an Algorithm intended to create a realistic representation of natural elements such as Wood , Marble , Granite , Metal , Stone , and others.

Usually, the natural look of the rendered result is achieved by the usage of Fractal Noise and Turbulence Function s. These functions are used as a Numerical representation of the “ Randomness ” found in everything that surrounds us.

In general, these noise and fractal functions are simply used to ''“disturb”'' the texture in a natural way such as the undulations of the veins of the wood. In other cases, like marbles' textures, they are based on the graphical representation of fractal noise.


EXAMPLE OF A PROCEDURAL MARBLE TEXTURE:


(Taken from The Renderman Companion Book, by Steve Upstill)

  • Copyrighted Pixar 1988 ---/

  • From the RenderMan Companion p.355 ---/

  • Listing 16.19 Blue marble surface shader---/



  • blue_marble(): a marble stone texture in shades of blue

  • surface

  • /


blue_marble(
float Ks = .4,
Kd = .6,
Ka = .1,
roughness = .1,
txtscale = 1;
color specularcolor = 1)
{
  • scaled point in shader space ---/

  • color spline parameter ---/

  • forward-facing normal ---/

  • for specular() ---/

  • float pixelsize, twice, scale, weight, turbulence;


  • Obtain a forward-facing normal for lighting calculations. ---/

  • Nf = faceforward( normalize(N), I);

V = normalize(-I);


  • Compute "turbulence" a la {Link without Title} . Turbulence is a sum of

  • "noise" components with a "fractal" 1/f power spectrum. It gives the

  • visual impression of turbulent fluid flow (for example, as in the

  • formation of blue_marble from molten color splines!). Use the

  • surface element area in texture space to control the number of

  • noise components so that the frequency content is appropriate

  • to the scale. This prevents aliasing of the texture.

  • /

  • txtscale;

  • pixelsize = sqrt(area(PP));

  • pixelsize;

  • turbulence = 0;

for (scale = 1; scale > twice; scale /= 2)
  • noise(PP/scale);


  • Gradual fade out of highest-frequency component near limit ---/

  • if (scale > pixelsize) {

weight = (scale / pixelsize) - 1;
weight = clamp(weight, 0, 1);
  • scale --- noise(PP/scale);

  • }



  • Magnify the upper part of the turbulence range 0.75:1

  • to fill the range 0:1 and use it as the parameter of

  • a color spline through various shades of blue.

  • /

  • turbulence - 3, 0, 1);

  • Ci = color spline(csp,

  • pale blue ---/

  • pale blue ---/

  • medium blue ---/

  • medium blue ---/

  • medium blue ---/

  • pale blue ---/

  • pale blue ---/

  • medium dark blue ---/

  • medium dark blue ---/

  • dark blue ---/

  • dark blue ---/

  • pale blue ---/

  • dark blue ---/

  • );


  • Multiply this color by the diffusely reflected light. ---/

  • = Ka---ambient() + Kd---diffuse(Nf);


  • Adjust for opacity. ---/

  • Oi = Os;

  • Oi;


  • Add in specular highlights. ---/

  • Ks --- specular(Nf,V,roughness);

  • }


''This article was taken from The Photoshop Roadmap with written authorization''


SEE ALSO