A plain texture consists of a single pigment, an optional normal, a single finish and optionally one or more halos. A special texture combines two or more textures using a pattern or blending function. Special textures may be made quite complex by nesting patterns within patterns. At the innermost levels however, they are made up from plain textures. Note that although we call a plain texture plain it may be a very complex texture. The term plain only means that it has a single pigment, normal, finish and halo.
The most complete form for defining a plain texture is as follows:
Each of the items in a texture are optional but if they are present the identifier must be first and the transformations must be last. The pigment, normal and finish parameters modify any pigment, normal and finish already specified in the TEXTURE_IDENTIFIER. Any halos are added to the already existing halos. If no texture identifier is specified the pigment, normal and finish statements modify the current default values and any halo is added to the default halo, if any. TRANSFORMATIONs are translate, rotate, scale and matrix statements. They should be specified last.
The sections below describe all of the options available in pigments, normals, finishes and halos. Special textures are covered later.
The color you define is the way you want the object to look if fully illuminated. You pick the basic color inherent in the object and POV-Ray brightens or darkens it depending on the lighting in the scene. The parameter is called pigment because we are defining the basic color the object actually is rather than how it looks.
The most complete form for defining a pigment is as follows:
Each of the items in a pigment are optional but if they are present, they should be in the order shown above to insure that the results are as expected. Any items after the PIGMENT_IDENTIFIER modify or override settings given in the identifier. If no identifier is specified then the items modify the pigment values in the current default texture. Valid PIGMENT_MODIFIERS are color_map, pigment_map, image_map and quick_color statements as well as any of the generic PATTERN_MODIFIERS such as translate, rotate, scale, turbulence, wave shape and warp statements. Such modifiers apply only to the pigment and not to other parts of the texture. Modifiers should be specified last.
The various pattern types fall into roughly four categories. Each category is discussed below. They are solid color, color list patterns, color mapped patterns and image maps.
A color specification consists of the option keyword color followed by a color identifier or by a specification of the amount of red, green, blue, filtered and unfiltered transparency in the surface. See section "Specifying Colors" for more details about colors. Any pattern modifiers used with a solid color are ignored because there is no pattern to modify.
Each COLORn is any valid color specification. There should be a comma between each color or the color keyword should be used as a separator so that POV-Ray can determine where each color specification starts and ends.
Each of the various pattern types available is in fact a mathematical function that takes any x, y, z location and turns it into a number between 0.0 and 1.0 inclusive. That number is used to specify what mix of colors to use from the color map.
A color map is specified by...
Where NUM_1, NUM_2, ... are float values between 0.0 and 1.0 inclusive. COLOR_1, COLOR_2, ... are color specifications. Note that the [] brackets are part of the actual statement. They are not notational symbols denoting optional parts. The brackets surround each entry in the color map. There may be from 2 to 256 entries in the map. The alternate spelling colour_map may be used.
For example
The pattern function is evaluated and the result is a value from 0.0 to 1.0. If the value is less than the first entry (in this case 0.1) then the first color (red) is used. Values from 0.1 to 0.3 use a blend of red and yellow using linear interpolation of the two colors. Similarly values from 0.3 to 0.6 blend from yellow to blue. Note that the 3rd and 4th entries both have values of 0.6. This causes an immediate abrupt shift of color from blue to green. Specifically a value that is less than 0.6 will be blue but exactly equal to 0.6 will be green. Moving along, values from 0.6 to 0.8 will be a blend of green and cyan. Finally any value greater than or equal to 0.8 will be cyan.
If you want areas of unchanging color you simply specify the same color for two adjacent entries. For example:
In this case any value from 0.3 to 0.6 will be pure yellow.
The color_map keyword may be used with any pattern except brick, checker, hexagon and image_map. You may declare and use color_map identifiers. For example:
A pigment map is specified by...
Where NUM_1, NUM_2, ... are float values between 0.0 and 1.0 inclusive. A PIGMENT_BODY is anything that would normally appear inside a pigment statement but the pigment keyword and {} braces are not needed. Note that the [] brackets are part of the actual statement. They are not notational symbols denoting optional parts. The brackets surround each entry in the map. There may be from 2 to 256 entries in the map.
For example
When the gradient x function returns values from 0.0 to 0.3 the scaled wood pigment is used. From 0.3 to 0.6 the pigment identifier Jade is used. From 0.6 up to 0.9 a blend of Jade and a turbulent marble is used. From 0.9 on up only the turbulent marble is used.
Pigment maps may be nested to any level of complexity you desire. The pigments in a map may have color maps or pigment maps or any type of pigment you want. Any entry of a pigment map may be a solid color however if all entries are solid colors you should use a color map which will render slightly faster.
Entire pigments may also be used with the block patterns such as checker, hexagon and brick. For example...
Note that in the case of block patterns the pigment wrapping is required around the pigment information.
A pigment map is also used with the average pigment type. See "Average" for details.
You may not use pigment_map or individual pigments with an image_map. See section "Texture Maps" for an alternative way to do this.
Section 7.6.1.1
Solid Color Pigments
Section 7.6.1.2
Color List Pigments
Section 7.6.1.3
Color Maps
Section 7.6.1.4
Pigment Maps
Table Of Contents