Materials: Pigment

The pigment material groups several materials only differenced by the color pattern. For more precission, pigment materials behave like plastic, but you can change the color pattern by specifying one of the supported pigments. The best news about pigments is that they are easily extensible using C# or any other .NET language.

In this image, we show two spheres with different gradient pigments, and the ground has been modeled with a checker pigment:

There's a corresponding metalPigment material that behaves as metals, but allows plugging a pigment definition.

Syntax

The syntax for the pigment material is identical to the syntax of plastic, except that, instead of a color, you must supply a pigment object:

The pigment parameter that plays the role of a color in the pigment material is just an instance of one of these four classes:

Pigments: Gradient

The gradient pigment starts with two different points in the 3D space. For finding the color associated with an arbitrary point, the point is projected onto the line that joins the two inicial points. If the projected point is outside the segment defined by the extreme points, the point is assigned with the corresponding extreme color. Otherwise, the color is interpolated from the extremes according to its relative position in the segment:

Pigments: Checker

The checker pigment divides the 3D space into equally sized cubes, and assigns them alternative colors. You can specify a scale for changing the size of the cubes:

Pigments: Stripes

Stripes are implemented by defining a preferent direction. An arbitrary point is projected into the corresponding line, and the distance to the origin of coordinates is filtered through the cosine function to get the interpolation parameter between the extreme colors:

The power parameter can be used to emphasize the transition between stripes. This image has been generated with several stripe patterns, using a high power. As you can see, bands from one of the colors are reduced to lines:

Pigments: Spots

Spots is based on the raw Perlin noise function, just like the Spotted material.

spots(lightSteelBlue, royalBlue, [0.5, 8, 2], 3, 2)

See also

Home | Small Instantiation Language | Materials | Plastic | Metal | Marble | Spotted | MetalPigment | Shapes