3d-paper-material
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
- Bake fibres (GPU, once). One full-screen pass writes
R height, G formation, B fibre, A fleckto a half-float target. Height is0.5 + fibre*0.34 + (tooth-0.5)*0.1 - fleck*0.2 - crease*0.55. Keepsamples: 0on the target and mipmaps on. - Warp the lattice. Domain-warp the fibre coordinates by 0.014 unit and rotate them by
(gnoise(q*2.1)-0.5)*1.5rad. Add a finer, fainter fibre set at 2.7x frequency (max 0.55). - Paint the mask (Canvas 2D, on stock change).
Rthin strip inside the tear,Gsilhouette plus fray fibres,Bink with a low-alpha bleed halo,Athe silhouette blurred by a shadow drawn off to the side (edge age). Read back withgetImageDataand write into aDataTexture, rows flipped, alpha as data. - 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 bythick/3,2thick/3,thick. - 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.
- Transmit.
emissive += L * tr, wheretr = 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.Lis the garden behind: sky, sun patch, black bamboo stems sampled through a mip bias of 1.4. - 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.