Previous:Working With Layered Textures Main Index Next:Another Layered Textures Example

#### Declaring Layered Textures

In the event we want to reuse a layered texture on several objects in our scene, it is perfectly legal to declare a layered texture. We won't repeat the whole texture from above, but the general format would be something like this:

      #declare Abused_Metal =

        texture { /* insert your base texture here... */ }

        texture { /* and your rust flecks here... */ }

        texture { /* and of course, your sooty burn marks here */ }

POV-Ray has no problem spotting where the declaration ends, because the textures follow one after the other with no objects or directives in between. The layered texture to be declared will be assumed to continue until it finds something other than another texture, so any number of layers can be added in to a declaration in this fashion.

One final word about layered textures: whatever layered texture we create, whether declared or not, we must not leave off the texture wrapper. In conventional single textures a common shorthand is to have just a pigment, or just a pigment and finish, or just a normal, or whatever, and leave them outside of a texture statement. This shorthand does not extend to layered textures. As far as POV-Ray is concerned we can layer entire textures, but not individual pieces of textures. For example

      #declare Bad_Texture =

        texture { /* insert your base texture here... */ }

        pigment { Red filter .5 }

        normal { bumps 1 }

will not work. The pigment and the normal are just floating there without being part of any particular texture. Inside an object, with just a single texture, we can do this sort of thing, but with layered textures, we would just generate an error whether inside the object or in a declaration.

Previous:Working With Layered Textures Main Index Next:Another Layered Textures Example