Shader: "wrapped wood floor"

"wrapped wood floor"

ClassColour
Synopsis Reproduces wooden flooring using a number of different plank replication patterns and wood types. Some of the arguments control the flooring pattern (planks, squares, herringbone, etc.) and some control the appearance of the wood itself.
Arguments

"scale" Type: LtFloat
Default:1.0
Range:[ 1e-006, inf ]
Hint:[ 0.01, 1000 ]
"replication type" Type: LtEnum
Default:LI_REPLICATION_SQUARES
Range: 1, 2, 3, 4
Hint:-
"strips" Type: LtNat32
Default:4
Range:[ 1, 10 ]
Hint:[ 1, 4 ]
"plank length" Type: LtFloat
Default:0.4
Range:[ 0.0001, inf ]
Hint:[ 0.3, 1 ]
"plank width" Type: LtFloat
Default:0.1
Range:[ 0.0001, inf ]
Hint:[ 0.0001, 1 ]
"offset" Type: LtFloat
Default:0.5
Range:[ 0, 1 ]
Hint:[ 0, 0.5 ]
"groove width" Type: LtFloat
Default:0.02
Range:[ 0, 0.5 ]
Hint:[ 0, 0.02 ]
"groove colour" Type: LtColour
Default:(0.05, 0.05, 0.0)
Range: [ 0, inf ], [ 0, inf ], [ 0, inf ]
Hint: [ 0, 1 ], [ 0, 1 ], [ 0, 1 ]
"plank variation" Type: LtFloat
Default:0.1
Range:[ 0, 1 ]
Hint:[ 0, 0.5 ]
"pattern scale" Type: LtFloat
Default:0.01
Range:[ 1e-006, inf ]
Hint:[ 0.001, 1 ]
"wood colour" Type: LtColour
Default:(1.00, 0.96, 0.8)
Range: [ 0, inf ], [ 0, inf ], [ 0, inf ]
Hint: [ 0, 1 ], [ 0, 1 ], [ 0, 1 ]
"ring colour" Type: LtColour
Default:(0.98, 0.85, 0.53)
Range: [ 0, inf ], [ 0, inf ], [ 0, inf ]
Hint: [ 0, 1 ], [ 0, 1 ], [ 0, 1 ]
"ring width" Type: LtFloat
Default:0.5
Range:[ 0, 1 ]
Hint:[ 0.1, 0.6 ]
"ring fuzz in" Type: LtFloat
Default:0.3
Range:[ 0, 1 ]
Hint:[ 0, 1 ]
"ring fuzz out" Type: LtFloat
Default:0.1
Range:[ 0, 1 ]
Hint:[ 0, 1 ]
"gnarl" Type: LtFloat
Default:0.5
Range:[ 0, inf ]
Hint:[ 0, 2 ]
"grain" Type: LtFloat
Default:0.0
Range:[ 0, inf ]
Hint:[ 0, 2 ]
"ring fuzz grain" Type: LtFloat
Default:0.3
Range:[ 0, inf ]
Hint:[ 0, 0.5 ]
"grain colour" Type: LtColour
Default:(0.15, 0.05, 0.05)
Range: [ 0, inf ], [ 0, inf ], [ 0, inf ]
Hint: [ 0, 1 ], [ 0, 1 ], [ 0, 1 ]
"grain scale" Type: LtFloat
Default:0.4
Range:[ 1e-006, inf ]
Hint:-
Locationlishclas
Description A wrapped texture which uses many of the same arguments as "wood" to specify the appearance of the wood (allowing most types of wood to be accurately re-produced) and applies the wood as a texture in repeating patterns (representing the common ways of laying out planks or tiles for flooring).

Replicated wrapped wood shaders generate the plank-style replicated pattern. The planks are filled with the wood pattern defined by the parameters from wood pattern group. There can be grooves in the defined colour on the plank borders. The brightness of planks can be randomly attenuated.

The position of the replicated pattern is determined by the texture space assigned to the object surface. The (s,t) co-ordinates of the point being textured are initially scaled according to the overall scale argument:

s' = t / scale

t' = t / scale

All the size parameters, such as plank length, plank width, groove width, and pattern scale are defined in relation to scaled (s',t') co-ordinates. Therefore a change of the overall scale parameter causes proportional scaling of all image elements. The origin point of the replication scheme is fixed at (0,0) in s,t texture space. Replication pattern base line is along s axis.

The rest of the arguments can be thought of as belonging to two distinct groups; those that control the pattern of the floorboards, and those that control the appearance of the wood out of which the boards are made.

Floor pattern arguments:

There are four replication schemes, specified by the parameter replication type:

  • LI_REPLICATION_FLOORBOARDS---simple floorboards
  • LI_REPLICATION_HERRINGBONE---herringbone
  • LI_REPLICATION_SQUARES---squares
  • LI_REPLICATION_LADDER---ladder pattern

Each scheme consists of a basic geometric element (a rectangle) replicated in the appropriate way. The rectangle consists of a number of the rectangular planks (the argument strips specifies the number) arranged side by side. The single plank is characterised by two parameters: plank length and plank width. For the SQUARES replication scheme, the plank width argument is ignored; instead, the width is taken to be the plank length divided by the value of the strips argument, to ensure that we end up with a square-shaped collection of planks.

For the floorboards and ladder replication scheme there is additional parameter, offset. For floorboards this determines the relative displacement of basic rectangles in odd and even rows of the scheme. For ladder it determines the relative displacement between the even and odd columns of vertical planks. The parameter is ignored in the remaining replication schemes.

The replication pattern position is determined by the (s,t) texture co-ordinates. The base line of the pattern is parallel to the s co-ordinate axis. The origin of the replication pattern is in the (s,t) point (0,0).

Plank combination arguments:

The argument groove width is the width of the groove in (s',t') space units; 0.0 means no groove. If the groove width is too large compared to the plank width (so we end up with all groove, and no plank) then the shader will correct it. For the SQUARES replication scheme, this correction will work with the plank width that we have calculated (from plank length and strips).

The colour of the groove is specified by groove colour,

The variation of brightness between planks is determined by plank variation. Each plank is assigned a randomly calculated brightness attenuation factor. The colour of each point on the plank calculated according to wood pattern parameters is then attenuated by the factor assigned to the plank. 0.0 means no variation, i.e., each plank is in the original colour calculated according to wood pattern parameters. 1.0 means maximal variation.

Wood pattern arguments:

Using all the features of this shader it is possible to re-create the appearance of virtually any type of wood. For common types of wood such as oak, maple, birch, cherry and pine, however, specific shaders are provided which simply have the relevant values for the arguments pre-set (colour shaders "oak", "maple" and so on). It is recommended that, for most applications, you begin with one of these shaders and modify argument values gradually to acheive the effect you want. The arguments/features of this general shader are presented here so that you can see how to create your own specific types of wood if you desire.

An overall scaling factor is supplied in argument "pattern scale", which determines the radius difference of two adjacent rings. 0.01 means that there are 100 rings per unit length of the scaled s,t texture space.

The remaining arguments are all identical to the arguments of the "wood" shader, but are given here for completeness.

The colour of the rings and the wood between the rings is specified in arguments "ring colour" (the darker rings) and "wood colour" (the lighter coloured wood representing spring growth in the tree), respectively.

The width of the rings relative to the tree's trunk is specified by argument "ring width". 0.0 means no ring at all, 1.0 means that all the trunk area is covered by the ring colour. The default value, 0.5, gives a reasonable look for many simple situations. Only values between 0.0 and 1.0 are acceptable.

In addition, the `fuzziness' of the boundary between the areas of ring colour and standard wood colour can be specified using the arguments "ring fuzz in" and "ring fuzz out". These specify the sharpness of the edges of the inside and outside of the rings respectively (the values actually represent the fraction of the ring width over which the interpolation from one colour to the other is done). Values between 0.0 and 1.0 are acceptable. Again, sensible default values have been chosen for these values, which essentially represent common growing cycles in temperate climates (a reasonably quick start of new growth in the spring followed by a slower decline in growth during the late summer).

The "gnarl" argument allows random perturbation of the regular rings inside the trunk. This allows localised `knot' patterns to form, for example. The higher value of the parameter the more `gnarled' the rings pattern becomes.

This shader also accounts for the appearance of random flecks or grains within the wood pattern, and for random perturbations of the ring pattern, which helps give a much more life-like appearance to the wood.

The "grain" parameter determines the intensity of the random grain effect. 0.0 means no grain at all, with higher values making the grains more distinct and visible (values in the order of 0.5, 1.0 or 2.0 create reasonable effects). The colour of these grains is specified by the argument "grain colour".

The amplitude of the high-frequency perturbations of the ring edges is controlled by the argument ring fuzz grain". (the value represents the fraction of the ring width over which the largest pertubations extend---values of less than 0.5 are recommended).

Finally, "grain scale" determines the size of the grain in relation to ring size (both the random grain flecks and the ring fuzz grain). Values between 0.1 and 2.0 are reasonable---1.0 means that the grain size is comparable to the distance between two adjacent rings.

Previous page alphabetically (wrappedtstripedisplacement)
Next page alphabetically (wrappedwoodfloordisplacement)
Index


Copyright © 1990-2005, 2006 LightWork Design Limited. All rights reserved