CommunityImagegithub.com

clay-material

The Textured Clay Studio material. Makes any subject look like a small object sculpted from thick, brushed oil paint, with satin studio light. Use for illustrations, icons, scenes, animations and any painted asset. Ships a tested renderer (scripts/paint.py). Colours come from clay-palette; interfaces also use clay-ui-kit.

What is clay-material?

clay-material is a Claude Code agent skill that the Textured Clay Studio material. Makes any subject look like a small object sculpted from thick, brushed oil paint, with satin studio light. Use for illustrations, icons, scenes, animations and any painted asset. Ships a tested renderer (scripts/paint.py). Colours come from clay-palette; interfaces also use clay-ui-kit.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Bassam-bulaihi/3d-clay-illustration-style/tree/HEAD/clay-material

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Clay Material

This skill defines how things are made, not what they show. Any subject (a pear, a coffee cup, a house, a key, a bar in a chart, a button) should look like a small physical object modelled in thick oil paint, sitting on a warm table under soft studio light.

1. The material in one paragraph

Each object is a few soft, rounded masses of thick paint. The paint is laid down with a loaded brush or palette knife, in short strokes that follow the form. Each stroke tapers at its ends, has a slightly flattened top, and carries fine bristle grooves. Light from the upper left catches the ridges with a satin sheen. Colour barely varies inside a mass: the texture comes from relief. Edges are soft, slightly raised rims, and a short, soft, warm shadow sits underneath. Backgrounds are calm and nearly flat, so the objects carry all the texture.

2. Non-negotiables

  1. Relief, not stripes. Texture comes from light and shade on raised paint. If the strokes would still read as coloured bands without the lighting, the colour variation is too strong.

  2. Two layers that are one paint body. The marks sit on brushed paint and grow out of it. They are never stamped onto a smooth base.

    • Underpainting: cover the whole mass with 6–14 broad sweeps (1/2 to 1/1 of the mass) that follow the main contour. It is still brushed paint: visible long bristle grooves, gentle ridges where sweeps overlap, and about 40% of the relief of the top marks. Never smooth, glossy or plastic. If any area looks like moulded plastic, it needs bristle texture.
    • Top marks: about 40–100 per large mass and 10–20 per small one (a button, knob or dab). They are elongated, at a length-to-width ratio of about 4–7:1, and overlap like scales along the contour, so they read as one brushed surface rather than separate objects. A few lonely marks on a small object read as smudges.
    • Marks merge into the body:
      • Each mark rises out of the underpainting with soft shoulders (heights are blended: take the higher one, or add with falloff).
      • No ridge, outline, halo or emboss ring around a mark.
      • At least half of each mark's edge fades into its neighbours.
      • A mark that looks like a sticker, decal or stamped glyph is wrong.
    • Calm and busy: leave about 25–35% of the mass with only the underpainting, and cluster marks where the form turns. Even spacing is the pattern to avoid. If the surface looks busy, remove marks. If it looks like a few lonely marks on plastic, add marks and give the base more texture.
  3. Every mark is a different gesture. Pick each top mark's type at random from this set, so no one type is more than ~40% of the marks:

    MarkShapeTypical size
    DragA long, straight-ish stroke with a loaded start and a dry, broken tail1/4–1/2 of the mass
    SweepA curved arc that bends with the form1/5–1/3
    S-strokeA gentle double curve, as a wrist turns1/5–1/3
    Knife smearWide and flat, with one sharp edge and one feathered edge, little or no bristle grooves1/6–1/4, very wide
    Comma / dabA short, loaded press with a small flick1/12–1/8
    Dry scumbleA broken, textured patch with a ragged edge, where the brush skipped1/8–1/5
    Cross-hatch pairTwo short strokes at 20–40° to each other1/10–1/6
    • Width varies 3–4× across the marks of one mass, from thin flicks to wide knife smears.
    • Pressure varies along a stroke: a heavier start, a lighter end, and sometimes a lift in the middle.
    • Direction: about 88% of the marks follow the main contour (±10°). About 12% are deliberate counter-strokes at 15–35°. Many crossing strokes read as straw or sticks, and random angles read as confetti.
    • Never repeat one primitive with only its size and angle changed. If two neighbouring marks look like copies, change one's type.
  4. Brushed, not putty.

    • Drags, sweeps, S-strokes and commas have tapered ends, flattened tops and 3–6 fine bristle grooves.
    • Knife smears are flat and smooth, with a sharp ridge on one edge.
    • Round, inflated, worm- or toothpaste-like strokes are wrong, and so are rows of identical leaf, seed or fish shapes.
  5. Direction follows the form.

    • Wide masses: the underpainting runs along the dominant edge.
    • Round masses: crescents wrapping the curve with jittered centres. Never concentric rings.
    • Long shapes: along the long axis.
  6. Narrow value range: the colour comes from the palette, the pattern doesn't. Paint every mark in the role's base, highlight or shade from clay-palette, with lightness varying only ±5–8%. A mark should be visible because of its relief and shape, not because it's a different colour. If the marks read as coloured spots, the colour range is too wide.

    • No blobs or camouflage patches on any painted surface: objects, buttons, swatches, tiles or backgrounds.
    • If you can see a shape inside a mass that isn't a stroke, cut the variation.

3. Form and composition

  • Few masses. Use 1–5 main masses per object or scene. Simple silhouettes that overlap or interlock, with a distinct value each (light, mid, dark), so the image reads in greyscale.
  • Rims are all or nothing. A rim is a soft raised edge that follows the whole silhouette evenly: lit on the upper left, shaded on the lower right. Never paint a rim on just one or two sides, and never as a separate strip laid over an edge.
  • Shadows are short, soft, close to the object and warm-dark. No large offset drop shadows, which read as cut paper. No thin ink outlines (painted borders in interfaces are covered by clay-ui-kit).
  • Backgrounds and tiles have at most 3% lightness variation, as a faint non-directional grain.
  • Contact shadows stay close: offset at most ~4% of the object's size, opacity 25–35% (up to 50% on dark grounds). An icon tile's shadow sits beneath and to the lower right, never as a dark halo around the whole tile.
  • Icons and marks:
    • A rounded square with corner radius ~22%.
    • One unified mark filling 60–75% of the tile, built from 1–3 masses that interlock. It must stay recognisable at 32 px.
  • Clutter: add no decorative extras the request didn't ask for.

4. Light

  • One key light from the upper left (~45°), the same for every object, shadow and UI element in a piece.
  • Satin, never gloss. If any highlight looks wet, plastic or metallic, halve the specular strength. Highlights are small, warm-white and only on ridges. With SVG lighting, keep specularConstant ≤ 0.35 and specularExponent 8–15.
  • Shade is warm-dark and never grey.
  • On dark grounds: contact shadows become a deeper tone of the ground at higher opacity (40–55%). Add a faint warm rim light (the role's highlight at 30–40%) on the upper-left edge, so masses don't sink into the background.

5. Colour

Colours come from clay-palette as roles (ground, surface, warm accent, secondary, deep, signals). Each mass uses one role's base, highlight and shade. No large smooth gradients.

6. Producing it

A. Use the bundled renderer, scripts/paint.py (preferred whenever you can run Python). It implements everything in §1–4: a brushed underpainting, varied elongated marks merged into the body, contour or swirl flow, a whole-edge rim, satin light from the upper left, warm contact shadows, and 2× render with Lanczos downsampling. Don't write your own painter. Tune the parameters instead. Read the script's docstring first. scripts/demo.png shows the expected look.

import sys; sys.path.insert(0, "<this skill>/scripts")
from paint import Canvas, ellipse, rounded_rect, smooth
c = Canvas(1024, 1024, ground="#F5EEDC")              # ground=None -> transparent PNG
tile = rounded_rect(112, 112, 800, 800, 180)
c.mass(tile, *ground_role, calm=True, relief=0.5)    # calm tile: rim + faint grain
c.mass(ellipse(512, 360, 128, 128), *accent_role)    # round -> swirl strokes
c.mass(smooth([...hill points...]), *deep_role, angle=-12, clip=tile)
c.save("icon.png")
AssetCall
Illustration massmass(points, base, hi, lo, angle=<main direction>). Use flow="axis" for strict direction. Round shapes swirl automatically
Icon tile, ground, text surfacemass(..., calm=True, relief=0.5)
Things inside a tileclip=tile
Button slab behind textrelief=0.4–0.5. Keep the label zone readable and measure it
Painted border or ringmass(outline, ..., band=<px>, shadow=False). The width varies ±20%, hand-painted
Disc, knob, dab, avatarmass(ellipse(...), ...) at its exact display size
Anything on a dark groundCanvas(..., dark=True): deeper shadows and a warm rim light
Busier or calmer surfacedetail=0.6–1.4, or marks=N
  • Each call costs about 1–40 s depending on size. Render each asset once, at its exact display size, and reuse it.
  • Composite masses back to front, as a painter would.
  • Look at every render and adjust the parameters. If a result fails §8, tune it; don't hand-edit pixels.

B. Without the script, but with Python: follow the same model. Build a height map per mass: brushed underpainting sweeps, then elongated marks whose cross-section is flat with slight edge ridges and bristle grooves, merged by additive falloff. Light it with diffuse plus a low specular from the upper left, and render at 2×.

C. Without image rendering (SVG or HTML only).

  1. Clip each mass and fill it with the base colour.
  2. Draw each stroke as a tapered path, three times:
    • A shade copy offset (+1.5, +2) px and 12–18% darker.
    • The body.
    • A thin highlight offset (−1, −1.5) px and 15–25% lighter.
  3. Add 3–5 hairline grooves in the shade colour at ~25% opacity.
  4. Add the rim with blurred inner bands, and the contact shadow.

Never fake the material with CSS gradients, inset box-shadows, noise overlays or repeating textures.

6a. Large scenes (hero illustrations, posters, page headers)

  • Scale the marks to the mass, not to the canvas. A large hill gets bigger and more numerous marks; small objects in the scene get small ones. Don't paint a whole wide scene with one stroke size.
  • Keep 3–5 masses even at large sizes. Add depth by overlap and value (lighter and less saturated in the distance, with lower relief and fewer marks far away).
  • A wide hero leaves calm space where text will go: ground or sky with only faint grain, at least 35–45% of the width.
  • On a dark background, the painted objects keep their own colours. Only the ground, the shadows and the rim light change (§4).

7. Motion

  • Texture moves with its object.
  • Motion is slow, eased, small and seamlessly looped.
  • Don't add elements just to animate them.

8. Check before delivering

  1. At 100%, do the strokes read as brushed oil paint (tapered, grooved, satin)? Not as tubes, seeds, stripes, rows or rings?
  2. Is it one paint body? Is the underpainting brushed (never smooth or plastic)? Do the marks merge into it with no halos or sticker edges? Are they elongated and overlapping along the contour, not short blobs, straw or confetti?
  3. Are the marks different? Are several mark types visible, with widths varying 3–4×? Do any two neighbours look like copies?
  4. Do most strokes follow each mass's main contour, with a minority of deliberate counter-strokes?
  5. Is there anything blob-like inside any painted surface?
  6. Do the rims run evenly around whole silhouettes?
  7. Squint or view in greyscale: separate values, and does the silhouette read?
  8. At the smallest size, is the image sharp (not blurry) and still recognisable?
  9. Are backgrounds within 3%, with no clutter?

Related Skills