Brick Pattern

The following videos demonstrate how I was able to use fragment and vertex shaders to create a set of brick patterns that would become the foundation for most of the brick buildings seen in the upcoming feature film 'Turning Red'

The first node in the video is a Tile Generator that I created by spawning a triangle (we discard the edges of the triangle outside the square center) for each tile and offsetting them based on their instanceID. By modifying the size and position of each triangle I can set the mortar size, alternating row offset and brick count. For the height and shape, I am manipulating the uvs for each tile, so I can have controls for rotation, slope, height and bevel, as well as using each tile's unique ID as a hash to add randomness to all these parameters.

The second node in the video shows a Cell Noise shader that has controls for the blend type (max or screen), bias, cell size, as well as all the usual controls for a cell noise, including scale, octaves, lacunarity, and random opacity and chaos.

The third node in the video shows a Slope Blur shader which behaves in a similar way to the node in Substance Designer. In two separate passes, I first find the normal from the second texture input (the Cell Noise) to give me the slope direction for each pixel. I then iterate over each pixel based on a sample count and distort the UV's of the first texture input (the Tile Generator) with the cell noise normal by an increasing amount before blending the result with a min function to create a smooth blur that pushes and pulls the darker areas of the tiles.

The fourth node shows a simple split-screen preview of two input textures, which is useful for previewing both the underlying Cell Noise fractal as I make changes to it, and the resulting slope-blur node as it interacts with the Tile Generator.

The two other nodes generate a normal, and give a simple preview of the pattern by running a dot product on the normal and a fake light vector (I didn't make these two nodes).

I've also included some renders of the stylized and fully procedural brick shader created with various brick pattern signals generated in our Motif tool. I created 5 different texture signals (Height, Occlusion, ID, ramps, mortar mask) and combine these textures with a bunch of other texture nodes and functions in our in-house shading tool 'Flow' to create a versatile shader with multiple controls for artists to create lots of variety. This shader can be seen in the new film Turning Red.