ai21.net
言語

ゼリー素材エフェクトのモデル比較テスト

ゼリー素材エフェクトのモデル比較テスト — 1

プロンプト

Build "Citrus Jelly" — a single self-contained HTML file (inline JS/CSS, no libraries) with a real-time WebGPU soft-body jelly shaped like a half-moon citrus slice that the user can grab, stretch and let go.

Object
- A rounded half-moon slice: half-disk profile extruded into a thick slab with softly rounded edges; flat cut edge on the bottom, arc on top.
- Three material zones by radius: translucent fruit flesh inside, a pale pith band, and a thin glossy rind along the arc (the cut edge is all flesh).
- Inside the jelly: thin milky radial membranes between the segments (inset from both faces), a few seeds, small air bubbles with a faint rim and a pin-point highlight, and tiny sub-surface glints like sugar crystals.

Physics (XPBD tetrahedral soft body)
- Mesh: 2D Bowyer–Watson Delaunay of the profile, extruded into prisms and split into tets. Render mesh embedded in sim tets with barycentric coordinates.
- Constraints:
- co-rotational per-tet shape matching (warm-started quaternion, Müller 2016), which recovers inverted tets;
- tet volume constraints for near-incompressibility;
- hard edge strain limits (max 1.8×, min 0.35× rest length).
- Fixed timestep, "small steps" XPBD (many substeps, 1 iteration each).
- Damping: relative-velocity damping along edges, light air drag, and settling that bleeds off residual jitter.
- Floor contact with Coulomb-style positional friction (static and kinetic). Never crush the held patch into the floor; lift the patch instead.
- Grab and pull:
- pick a surface point with the mouse or touch;
- the patch around it is attached softly;
- reach is bounded, so stretching is strong but never unbounded;
- on release the slice wobbles back.
- Safety: reset gently if any value becomes NaN.

Rendering (WebGPU / WGSL)
- Procedural photo studio: pale cyclorama paper sweep, overhead softbox, back-left strip light, front-right fill card.
- Jelly material:
- refraction of the scene through the slice;
- view-ray thickness from a back-face depth pass, used for Beer–Lambert absorption;
- Fresnel studio reflections and a key highlight.
- Soft PCSS-style floor shadows, tinted by the jelly color.
- Post: exposure, Khronos PBR Neutral tone mapping, sRGB, dither. Optional mesh-overlay debug view.

UI (minimal editorial style, English)
- Corner label "Material Studies / No. 010", big title "Citrus / Jelly.", hint "Grab. Stretch. Let go."
- Variety swatches: Orange, Blood Orange, Lemon. Each changes the flesh, pith and rind colors.
- Sliders: Firmness (log-mapped edge compliance) and Internal damping.
- Buttons:
- "Give it a nudge": a small hop with a twist;
- Reset;
- Pause.
- Keys: Space to pause, N to nudge, R to reset.
- Fallback screen "This slice needs WebGPU." when the browser has no WebGPU.
- Responsive: works on mobile with touch and no horizontal scroll.

日本語訳

“Citrus Jelly”を構築してください。単一の自己完結型 HTML ファイル(インライン JS/CSS、ライブラリなし)で、半月形の柑橘スライスをかたどったリアルタイム WebGPU ソフトボディのゼリーを作成します。ユーザーはそれをつかみ、伸ばし、離すことができます。

オブジェクト
- 丸みのある半月形のスライス:半円のプロファイルを厚いスラブに押し出し、エッジを柔らかく丸めたもの。下部は平らな切断面、上部は弧。
- 半径によって3つのマテリアルゾーン:内側は半透明の果肉、淡い白皮の帯、弧に沿った薄い光沢のある果皮(切断面はすべて果肉)。
- ゼリーの内部:セグメント間の薄い乳白色の放射状の膜(両面から内側に引っ込んでいる)、いくつかの種、かすかな縁取りとピンポイントのハイライトを持つ小さな気泡、そして砂糖の結晶のような微小な表面下のきらめき。

物理(XPBD 四面体ソフトボディ)
- メッシュ:プロファイルの2D Bowyer–Watson Delaunay 分割をプリズムに押し出し、四面体に分割します。レンダーメッシュは重心座標を用いてシミュレーション用四面体に埋め込みます。
- 制約:
- 四面体ごとの共回転形状マッチング(ウォームスタートされたクォータニオン、Müller 2016)。これにより反転した四面体が復元されます。
- ほぼ非圧縮性を実現する四面体体積制約。
- ハードなエッジひずみ制限(最大 1.8 倍、最小 0.35 倍の静止長)。
- 固定タイムステップ、"小さなステップ" の XPBD(多数のサブステップ、各1回の反復)。
- 減衰:エッジに沿った相対速度減衰、軽い空気抵抗、残留ジッターを抜き取る収束処理。
- 床との接触にはクーロン的な位置ベースの摩擦(静止摩擦と動摩擦)を使用。つかんだパッチを床に押し潰さないでください。代わりにパッチを持ち上げてください。
- つかんで引っ張る:
- マウスまたはタッチで表面上の点を選びます。
- その周囲のパッチが柔らかく接着されます。
- 到達範囲は制限されるため、伸びは強力ですが決して無限にはなりません。
- 離すとスライスは揺れながら元に戻ります。
- 安全性:いずれかの値が NaN になった場合は穏やかにリセットしてください。

レンダリング(WebGPU / WGSL)
- 手続き的なフォトスタジオ:淡いサイクロラマ紙のスイープ、頭上にソフトボックス、左後方にストリップライト、右前方にフィルカード。
- ゼリーのマテリアル:
- スライスを通したシーンの屈折。
- バックフェイスの深度パスから求めた視線方向の厚みを Beer–Lambert 吸収に使用。
- フレネルのスタジオ反射とキーハイライト。
- ソフトな PCSS 風の床の影。ゼリーの色で色付けされます。
- ポスト:露出、Khronos PBR Neutral トーンマッピング、sRGB、ディザ。オプションのメッシュオーバーレイのデバッグビュー。

UI(ミニマルなエディトリアルスタイル、英語)
- コーナーラベル "Material Studies / No. 010"、大きなタイトル "Citrus / Jelly."、ヒント "Grab. Stretch. Let go."
- バラエティスウォッチ:Orange、Blood Orange、Lemon。それぞれが果肉、白皮、果皮の色を変更します。
- スライダー:Firmness(対数マップされたエッジコンプライアンス)と Internal damping。
- ボタン:
- "Give it a nudge":ひねりを加えた小さな跳ね;
- Reset;
- Pause。
- キー:Space で一時停止、N でナッジ、R でリセット。
- ブラウザが WebGPU を持たない場合のフォールバック画面 "This slice needs WebGPU."。
- レスポンシブ:モバイルでもタッチで動作し、横スクロールは発生しません。

出典

原作者
vib3coded
公開日
2026-10-11(由推文 ID 反解)
原典
元の投稿を見る ↗
収録元
zhuyansen/awesome-opus-5.5-video · 2109424502237016076 · ライセンス未表明