3d-paper-material

Installation
SKILL.md

3D Paper Material

Paper is a fibre field cut out by a torn outline: a height map of laid fibres and formation clouds gives the surface, an alpha mask with pulled-out fibres gives the edge, offset copies give the thickness, and the back light is transmitted by how thin the formation is at each pixel. Drop any one and the sheet is a white plane.

Reach for paper-cinder-transition when the paper burns or is revealed by fire; this skill is the unburnt sheet. It is a hung or laid sheet in a scene. A page-turning book needs a bend rig this skill does not provide.

Read demo.html for a working build: MeshPhysicalMaterial patched with onBeforeCompile, maps baked once into half-float targets, masks painted with Canvas 2D. Its NOISE GLSL, formation, kozo-fibre and bark-fleck expressions, back-light transmission, tearLine and the fray loop are ported unchanged from the Kibori workshop page (kibori.html, washiMat, footTear).

The pipeline

  1. Bake fibres (GPU, once). One full-screen pass writes R height, G formation, B fibre, A fleck to a half-float target. Height is 0.5 + fibre*0.34 + (tooth-0.5)*0.1 - fleck*0.2 - crease*0.55. Keep samples: 0 on the target and mipmaps on.
  2. Warp the lattice. Domain-warp the fibre coordinates by 0.014 unit and rotate them by (gnoise(q*2.1)-0.5)*1.5 rad. Add a finer, fainter fibre set at 2.7x frequency (max 0.55).
  3. Paint the mask (Canvas 2D, on stock change). R thin strip inside the tear, G silhouette plus fray fibres, B ink with a low-alpha bleed halo, A the silhouette blurred by a shadow drawn off to the side (edge age). Read back with getImageData and write into a DataTexture, rows flipped, alpha as data.
  4. Shape the sheet. A 168 x 240 plane: hung bow, a mountain crease, pin dimples, and a cylinder roll (radius 0.23, angle 2.6*curl) that keeps length. Add three copies offset along the normal by thick/3, 2thick/3, thick.
  5. Shade. Albedo from formation and fibre, ink over it, toast and foxing by the age mask. Height goes through a world-unit bump (see gotchas). Alpha is coverage, not a cut.
  6. Transmit. emissive += L * tr, where tr = 0.74 + (0.5-form)*0.85 + (0.5-lowfbm)*0.45 - fibre*0.22 - fleck*0.45, times stock gain, plus the thin strip, minus ink. L is the garden behind: sky, sun patch, black bamboo stems sampled through a mip bias of 1.4.
  7. Macro. Re-bake a second height target and mask over a 0.5 unit window at the focus point and blend it over the base by window edge. Never tile a small texture.

Constants that landed

Installs
240
Repository
mengto/skills
GitHub Stars
6.9K
First Seen
Sep 30, 2026