3d-cloth-material
できること
このスキルは、Web のシーンで、3D の布が本物の織物のように見えるようにする作業を案内します。リネン、シルク、カーテン、垂れ幕を含むシーンを作る開発者向けです。
使う場面
- ✓リネンやシルクや、カーテンの3D の布がプラスチックのように見えるとき。
- ✓3D のシーンで、襞、裾、縫い目を本物らしく見せたいとき。
- ✓垂れ幕、タペストリー、テーブルクロスに、説得力のある布の表面が必要なとき。
スキルのリンク
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-cloth-material/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私の3Dの部屋にあるリネンのカーテンを、柔らかい襞のある本物の織物のように見せてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、Three.js の面の上に、織りと光沢を素材として組み立てます。布の模様が伸びないように襞を整えます。布の種類ごとに見た目を調整します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
3D Cloth Material
Mechanism: hang the cloth as rows whose tangent angle is the fold signal, so arc length equals the rest coordinate s and the weave never stretches. Then let a thread-level weave, sheen, hem thickness and light through the gaps do the reading of "fabric".
Nearest neighbours: 3d-high-resolution-textures chooses texel density, mipmaps and delivery for any material; use it for the budget and stay here for what makes cloth different (weave interlacement, folds, sheen, hems). 3d-wood-material, 3d-paper-material and 3d-metal-material cover their own surfaces; this skill owns woven and sewn fabric only. It is not a cloth simulation: for a character's flowing cape or a flag that collides, simulate (Verlet or Blender cloth) and bake, then keep the material rules below.
Extracted from KIBORI 木彫, a dark WebGL workshop where a roll of indigo canvas (the dōgu-maki) lies under a warm key light and had to survive a macro close-up. Ported from there: the weave bake, the stitch shader, half-circle hem turn-under, wear on thread tops, the sheen constants. Newly built for this skill (Kibori has one indigo canvas, not three fabrics): the tangent-angle fold curve, satin and twill interlacements, silk/wool/linen tables, tabs on the rod, raw-edge fray, fold AO, backlit transmission, wind. demo.html is the reference.
Demo: Three.js r169 · WebGL · GLSL (MeshPhysicalMaterial + onBeforeCompile), vanilla JavaScript, no post chain.
The rules, each with the failure it prevents
- Integrate folds from an angle, not a height.
α(s) = a·(sinθ + 0.16 sin(2θ+0.8)) + …, thenx += ds·cos α,z += ds·sin α. Failure: a height fieldz = A·sin(kx)gives arc length 1 + slope², so the weave swims and stretches 30–80% on every fold. With the angle formuv = (s, v)in metres is exact. Keep|α| < 1.45rad; past that it clamps into flat plateaus and folds become tubes with black seams. - Uv is material metres, never re-fitted per frame. Do not recompute uv from the moving surface. Failure: weave shimmers and crawls in wind. Set
texture.repeat = 1/(threads × pitch)so one texel tile isNTthreads; linen 1.6 mm, silk 0.7 mm, wool 2.6 mm pitch. - Bake interlacement, not noise. Each thread has its own width (0.80–0.97), tone and a slub (Gaussian thickening up to 0.34). Warp height blends over/under across cell borders by
0.5·smoothstep(0.05, 0.5, |t|). Plain =(A+B)&1, twill 2/1 =(A+B)%3 < 2, 5-harness satin =(2A+B)%5 != 0warp-over.NTmust be a multiple of the repeat (32, 24, 40) or the tile shows a seam. Failure: a tiled noise normal map reads as stucco or leather. - Spun yarn gets a twist. Add
0.22·twist·sin(2π(5·along + 1.3·across))to each thread height (twist 0.10–0.14 for linen and wool, 0 for silk). Failure: linen looks like wire mesh. - Two dyes, per-thread tone. Colour
mix(warpDye, weftDye, weftOnTop·shot); silk uses shot 1.0 (madder red warp, gold weft), the rest 0. Tonemix(0.86, 1.14, threadTone), cavitymix(0.5, 1, smoothstep(0.05, 0.85, height)), blotch + warp-direction streaks1 + var·((blot−0.5)·0.62 + (streak−0.5)·0.22). Failure: one flat albedo on a woven map looks printed. - Sheen is the fabric, and it must be small.
sheen 0.5–1.0,sheenRoughness 0.28 (silk) – 0.82 (wool), andsheenColor = dye lightened × 0.62. Failure: near-whitesheenColorblows out to a milky rim under a warm key. Never setsheento exactly 0 at runtime (0.0001); crossing zero recompiles the program and hitches 200+ ms. - Silk gets anisotropy, wool gets fuzz. Silk
anisotropy 0.85, roughness 0.36; linen0.90rough with sheen 0.55; wool0.96rough with sheen 1.0. Keepanisotropyabove 0 at creation (0.0001) so the define never flips. - Fold occlusion is not optional. Cast and receive the key's shadow map (
normalBias 0.012,bias −0.0004,DoubleSideshadows) and add a vertex AO from the fold depth0.62 + 0.38·smoothstep(−0.075, 0.035, zFold)on indirect light. Failure: without both, valleys light up like the crests and the folds look painted. - Edges have thickness. Turn every free edge under on a half circle,
P = edge + out·r·sinφ − N·r(1−cosφ),φ ∈ [0, 0.94π],r= 1.1 mm silk, 2.2 mm linen, 4.6 mm wool. Return the bottom hem up the back at2r + 0.2 mmwith flipped normals. Failure: a zero-thickness cut edge is the loudest tell for CG cloth in a close-up. - Stitch in the shader, in cloth metres. Thread arches
よくある質問
布の物理シミュレーションですか?
いいえ。動きではなく、布の見た目についてです。ただし、シミュレーションされた垂れの動きにもこの規則は使えます。
どの布を扱いますか?
リネン、シルク、ウール、キャンバス、カーテン、垂れ幕、マント、タペストリーです。
まず何を知っておくべきですか?
スキルは素材とシェーダーを扱うため、Three.js の基礎知識が役立ちます。
詳細
作者による元の説明
Build convincing woven cloth in Three.js, with a thread-level weave normal map, sheen and anisotropic highlights, folds that never stretch the texture, hems with thickness, stitches, seams, frayed edges, fold occlusion, dye and wear variation, and light passing through thin fabric. Use for linen, silk, wool, canvas, curtains, banners, cloaks, tablecloths, tapestries or any 3D drape that currently looks like a plastic sheet, a stretched texture, or a flat coloured plane.
repo: MengTo/Skills
人気
- GitHubのスター
- 7.2k
- ランキング
- #13313
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
3d-falling-leaves
7.2k3D のシーンに、回転し、風に流され、カメラの動きに合わせて再利用される、本物らしい落ち葉を加えるようエージェントを支援します。
3d-four-seasons
7.2k3D のシーンに、春、夏、秋、冬の見た目を加え、シーン全体を作り直さずに、茂み、光、空、雪を変えるようエージェントを支援します。
3d-high-poly-models
7.2k滑らかな形と自然な縁をもつ、詳細な3Dモデルを作り、その後、Web で快適に動く軽いバージョンを準備するようエージェントを支援します。
3d-high-resolution-textures
7.2kダウンロードや読み込みが遅くなるほど大きくならずに、近くで見てもくっきりした、本物らしい3D の素材を作るようエージェントを支援します。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。