The brick shader generates a pattern the bricks on the given surface of the 3D mesh object; this is another very good example of procedural texturing. The brick pattern is made up of two components (a brick and the mortar); these are represented using two different colors, as shown in the following figure. These colors are defined using BrickColor
and MortarColor
as the global variables in the vertex shader.
The rectangular size of the brick consists of brick and mortal materials; the total dimension of the rectangular region is 0.40 x 0.10 square units, out of which 90 percent of the horizontal dimension (0.40) is reserved for the dimension of the bricks along the x axis; the remaining 10 percent is used for the mortar along the same axis. Similarly, the brick vertical dimension is 85 percent along the y axis and the remaining 15 percent is used by the mortar's vertical dimension: