Previous:Using Pigment and Patterns   Main Index   Next:Using Transparent Pigments and Layered Textures



Using Pattern Modifiers

Let's take a look at some pattern modifiers. First, we change the pattern type to bozo. Then we add the following change.

  pigment {

    bozo

    frequency 3            // <- add this line

    color_map {

      [0.00 color Red]

      [0.33 color Blue]

      [0.66 color Yellow]

      [1.00 color Red]

    }

    rotate -45*z

  }

The frequency modifier determines the number of times the color map repeats itself per unit of size. This change makes the bozo pattern we saw earlier have many more bands in it. Now we change the pattern type to marble. When we rendered this earlier, we saw a banded pattern similar to gradient y that really did not look much like marble at all. This is because marble really is a kind of gradient and it needs another pattern modifier to look like marble. This modifier is called turbulence. We change the line frequency 3 to turbulence 1 and render again. That's better! Now let's put frequency 3 back in right after the turbulence and take another look. Even more interesting!

But wait, it gets better! Turbulence itself has some modifiers of its own. We can adjust the turbulence several ways. First, the float that follows the turbulence keyword can be any value with higher values giving us more turbulence. Second, we can use the keywords omega, lambda and octaves to change the turbulence parameters. Let's try this now:

  pigment {

    marble

    turbulence 0.5

    lambda 1.5

    omega 0.8

    octaves 5

    frequency 3

    color_map {

      [0.00 color Red]

      [0.33 color Blue]

      [0.66 color Yellow]

      [1.00 color Red]

    }

    rotate 45*z

  }

Rendering this we see that the turbulence has changed and the pattern looks different. We play around with the numerical values of turbulence, lambda, omega and octaves to see what they do.



Previous:Using Pigment and Patterns   Main Index   Next:Using Transparent Pigments and Layered Textures