Docs

Guides

Bricks, blocks and pavers

Use the Aligned method on bricks, blocks, pavers and planks so mortar lines and joints stay unbroken, and build a joint table.

Aligned keeps every mortar line where it is. It needs to know where the courses are in your texture:

  • Regular courses: set CourseCount (courses in one texture tile) and CoursePhase (the V of the first mortar line, 0..1). Leave UseCourseLines at 0.
  • Hand-laid courses of different heights (most scans): set UseCourseLines = 1 and type the V of every mortar line, ascending, into CourseLines0 to CourseLines3 (4 values each, up to 16 lines), and CourseCount to how many you typed. The three Aligned presets ship their measured lines.
  • A regular bond (every brick the same length): OffsetStepsU = bricks per course, so shifts snap to whole bricks. Hand-laid scans keep 0 (free).
  • CellsU is the length of a re-randomised segment along a course in tiles (0.75 default); CourseShuffle 1 starts every tile row at a random course so the course rhythm does not repeat every tile; CourseMatch lets a course swap with one of a similar height. These three drive the runtime picks; a table with a baked layout (the presets, next point) has them built in.
  • The presets: a baked layout, so no run repeats along a course. A shader colours each pixel on its own and cannot lay a course left to right, so for Blocks, Bricks and Pavers the course is laid once, offline, and stored in the preset's JointTable: a virtual wall of 48 x 48 tiles (96 m on the 2 m Bricks, 144 m on the 3 m Blocks and Pavers), every course filled left to right with runs of whole stones that start and end in a measured joint (no stone is cut), in varied lengths (0.30-1.20 tile, so no segment length sets a rhythm). Rules, checked on the shipped tables over the whole layout (tilebreak_stack.json): the same run back to back in a course 0 on Blocks, 0 on Bricks, 0 on Pavers; a stone shared with the next segment 0 on Blocks, 0 on Bricks, 0 on Pavers; the same run again within 4 segments 0 on Blocks, 0 on Bricks, 0 on Pavers; a stone stacked on its own copy in the course above or below 0 on Blocks, 0 on Bricks, 0 on Pavers (plain tiling has none of these either). Each course draws on at least 98 (Blocks), 123 (Bricks), 35 (Pavers) different runs, and no run takes more than 5.8 % of a course. Runs are laid at their own length except the last one or two of a course, stretched to close it (0.9-1.1 % of segments stretched by more than 1 %, at most 4.1 %). A course may take a source course of another height, stretched to fit (up to 35 % taller or shorter), to keep stones off and away from their own copies (Blocks 6258 of 24457 segments; Bricks 15000 of 40537 segments; Pavers 708 of 16064 segments). The shader only reads the layout (no search); Seed moves the whole layout by whole tiles and rows, so nothing is cut. In an earlier pre-release build, without this layout, neighbouring segments drew the same run back to back 22 % on Blocks, 23 % on Bricks, 33 % on Pavers of the time, a repeat at the segment length.
  • Vertical joints (JointTable) on your own texture: with a 32 x 16 table and no layout, a segment is CellsU long and is a run of whole stones: it starts on a joint and ends on the joint closest to CellsU further along (3 candidate runs from consecutive start joints, the closest fit wins, stretched to fit), so no stone is cut in two; every second course avoids the source course of the segments just below and above it, so no stone sits on its own copy. With few joints per course this leaves only a handful of runs, so a run can come back along a course at the segment length (Limits). Without a table (the default, T_TileBreak_JointTable_None) a segment ends anywhere along the course: fine for small bricks, but on large blocks and slabs it can cut a stone in two (Limits).
  • A joint table for your own texture: a 32 x 16 texture, one row per course in CourseLines order. Texel 0 of a row: R = number of joints (up to 15), B = 74 (marks the row as valid). Texels 1-15: each joint's U (0..1, ascending, read off the texture: pixel x / width) as 16 bits of round(U x 65536), R = high byte, G = low byte. Texels 16-31: a lookup that makes the search cheap, 4 entries per texel (R, G, B, A): entry b = 64 + the index of the first joint at or after U = b / 64. Alpha is never 0. Import it with Compression VectorDisplacementmap, sRGB off, Mip Gen Settings NoMipmaps and Filter Nearest, and set it as JointTable. This writes one (Python 3, no packages):
python
import struct, zlib

def joint_table(path, courses):
    """courses: one list of joint U positions (0..1) per course, in CourseLines order"""
    rows = []
    for k in range(16):
        us = courses[k] if k < len(courses) else []
        q = sorted(min(round(u * 65536), 65535) for u in us)[:15]
        px = [(len(q), 0, 74 if q else 0, 255)]
        px += [(v >> 8, v & 255, 0, 255) for v in q]
        px += [(0, 0, 0, 255)] * (16 - len(px))
        lut = [255] * 64
        if q:
            lut = [64 + next((i for i, v in enumerate(q) if v >= b * 1024), len(q))
                   for b in range(64)]
        px += [tuple(lut[4 * i:4 * i + 4]) for i in range(16)]
        rows.append(b"\0" + bytes(c for p in px for c in p))

    def chunk(t, d):
        return struct.pack(">I", len(d)) + t + d + struct.pack(">I", zlib.crc32(t + d))

    head = struct.pack(">IIBBBBB", 32, 16, 8, 6, 0, 0, 0)
    png = (b"\x89PNG\r\n\x1a\n" + chunk(b"IHDR", head)
           + chunk(b"IDAT", zlib.compress(b"".join(rows))) + chunk(b"IEND", b""))
    open(path, "wb").write(png)
Bricks on a 50 m wall seen square-on from 11 m, OFF above ON with Aligned, with the measured repeat; Hex as the wrong tool; ShowCells shows the segments, each starting and ending in a joint.