POV-Ray : Documentation : 2.5.5.1 Texture Maps
  POV-Ray 3.6 Documentation Online View  
2.5.5 Patterned Textures   2.5.5.2 Tiles

2.5.5.1 Texture Maps

In addition to specifying blended color with a color map or a pigment map you may create a blend of textures using texture_map. The syntax for a texture map is identical to the pigment map except you specify a texture in each map entry.

The syntax for texture_map is as follows:

TEXTURE_MAP:
    texture_map { TEXTURE_MAP_BODY }
TEXTURE_MAP_BODY:
  TEXTURE_MAP_IDENTIFIER | TEXTURE_MAP_ENTRY...
TEXTURE_MAP_ENTRY:
    [ Value TEXTURE_BODY ]

Where Value is a float value between 0.0 and 1.0 inclusive and each TEXTURE_BODY is anything which can be inside a texture{...} statement. The texture keyword and {} braces need not be specified.

Note: the [] brackets are part of the actual TEXTURE_MAP_ENTRY. They are not notational symbols denoting optional parts. The brackets surround each entry in the texture map.

There may be from 2 to 256 entries in the map.

For example:

  texture {
    gradient x       //this is the PATTERN_TYPE
    texture_map {
      [0.3  pigment{Red} finish{phong 1}]
      [0.3  T_Wood11]    //this is a texture identifier
      [0.6  T_Wood11]
      [0.9  pigment{DMFWood4} finish{Shiny}]
    }
  }

When the gradient x function returns values from 0.0 to 0.3 the red highlighted texture is used. From 0.3 to 0.6 the texture identifier T_Wood11 is used. From 0.6 up to 0.9 a blend of T_Wood11 and a shiny DMFWood4 is used. From 0.9 on up only the shiny wood is used.

Texture maps may be nested to any level of complexity you desire. The textures in a map may have color maps or texture maps or any type of texture you want.

The blended area of a texture map works by fully calculating both contributing textures in their entirety and then linearly interpolating the apparent colors. This means that reflection, refraction and lighting calculations are done twice for every point. This is in contrast to using a pigment map and a normal map in a plain texture, where the pigment is computed, then the normal, then reflection, refraction and lighting are calculated once for that point.

Entire textures may also be used with the block patterns such as checker, hexagon and brick. For example...

  texture {
    checker
      texture { T_Wood12 scale .8 }
      texture {
        pigment { White_Marble }
        finish { Shiny }
        scale .5
      }
    }
  }

Note: that in the case of block patterns the texture wrapping is required around the texture information. Also note that this syntax prohibits the use of a layered texture however you can work around this by declaring a texture identifier for the layered texture and referencing the identifier.

A texture map is also used with the average texture type. See "Average" for details.

You may declare and use texture map identifiers but the only way to declare a texture block pattern list is to declare a texture identifier for the entire texture.

2.5.5 Patterned Textures   2.5.5.2 Tiles


Copyright 2003-2004 Persistence of Vision Raytracer Pty. Ltd.