ai21.net
言語

3Dスイカのファーレンダリング比較

3Dスイカのファーレンダリング比較 — 1

プロンプト

Build a single self-contained HTML page (no build step) showing an interactive 3D "Fluffy Watermelon" covered in long fur, rendered with WebGL using three.js r147 (UMD build: https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js). All UI text in English.

SCENE & LOOK
- Full-screen canvas on a soft watermelon-flesh pink studio background: vertical gradient #ECB3AB → #F7CFC7 (lighter band in the middle) → #E8A9A0, used as the scene background.
- A big oblong watermelon lying on its side along the X axis: half-length 1.38, radius 0.98, blunt barrel-like ends, small dimples at both ends, slightly flattened belly, subtle surface unevenness. Start in a 3/4 view (about -0.32 rad around Y, 0.1 rad tilt), camera FOV 30°, framed to fill ~80% of the height.
- Rind pattern under the fur: light green (#A8D66B) with 16 dark green (#1C4D1C) stripes running stem to blossom, with ragged finger-like edges (sine meander + value noise), plus a pale cream "field spot" on the underside. Each hair takes the colour of its own root, so the stripes stay crisp through the fur.
- A short, dried, ribbed stem stub at one end with a slightly domed pale cut cap, and a thin curly helical tendril springing from beside it.
- One directional light from upper-left-front, wrap diffuse, Kajiya-Kay anisotropic highlight along the hair tangent, darker roots (occlusion by hair height), slight per-hair brightness variation.

FUR (most important: it must look crisp, never blurry)
- Fur length 0.2 units. Hairs grow out along the normal, then bend: combed from the stem end toward the blossom end and draped down the flanks (no whorls at the ends), plus slight gravity.
- Undercoat: shell texturing with ~64 instanced shells of the body mesh that reach only 50% of the fur length. Procedural hair cells in UV space (density scaled so one cell is ~3.4 device pixels at the default view), two hair populations (long + fine underfur), hairs gathering into locks toward their tips, analytic anti-aliased coverage, alpha blending, shells write depth. Fade shells out where the surface is seen edge-on and discard faint fragments, so no dotted rim appears at the outline.
- Guard hairs: ~90,000 individual tapered, camera-facing ribbon strands (instanced, 7 segments each) that follow exactly the same bend function, with a minimum width of ~0.75 px so they stay sharp. Draw them twice: once before the shells and once after (depth-tested), so faint edge fur never hides them and they always lie crisply on top.
- Always render at the device's full pixel ratio (capped at 2) and NEVER lower it for performance. If frames are slow, reduce the shell count first (down to 32), then the guard-hair count.

INTERACTION
- Drag to rotate freely (trackball style) with inertia after a flick. The fur lags behind the rotation through a damped spring and flops back. Gentle idle breeze in the fur; after 3 s without input, a slow auto-turn.
- Mouse wheel / pinch to zoom (smooth dolly). Double-click or "0" resets with an eased animation. Arrow keys rotate.
- Custom cursor: the native grab hand plus a thin dark 46 px ring that follows the pointer and shrinks while dragging. Hovering gently parts the fur under the cursor, as if stroking it.
- Respect prefers-reduced-motion (no idle spin, no breeze).

UI & ROBUSTNESS
- Bottom-left caption: "Fluffy Watermelon" and a hint "Drag to rotate · Scroll to zoom · Double-click to reset" (on touch devices: "Drag to rotate · Pinch to zoom") that fades after the first interaction. Font: Onest from Google Fonts with system fallbacks.
- Guard against a zero-sized container at load: clamp width/height to at least 1 and, every frame, recover from any non-finite camera distance or rotation state.
- Show a small on-page note if the WebGL context is lost or a shader fails to compile, and a fallback message if WebGL is unavailable.

日本語訳

ビルド不要の単一の自己完結型HTMLページを構築し、長いファーに覆われたインタラクティブな3D「Fluffy Watermelon」を、three.js r147(UMDビルド: https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js)を用いてWebGLでレンダリングする。UIテキストはすべて英語で表示する。

シーンとルック
- スイカの果肉のような柔らかなピンクのスタジオ背景に全画面キャンバスを表示する。縦グラデーション #ECB3AB → #F7CFC7(中間に明るい帯)→ #E8A9A0 をシーンの背景として使用する。
- X軸に沿って横向きに置かれた大きな長楕円形のスイカ:長半径1.38、半径0.98、両端は鈍い樽状、両端に小さなくぼみ、腹部はやや平たく、表面はわずかに不均一。3/4ビュー(Y軸周り約-0.32 rad、傾き0.1 rad)から開始し、カメラFOV 30°、高さの約80%を占めるようにフレーミングする。
- ファーの下の皮模様:淡い緑(#A8D66B)に16本の濃い緑(#1C4D1C)の縞がヘタから花落ち部へと走り、縁は指のようなギザギザ(サイン波の蛇行+バリューノイズ)、さらに下面には淡いクリーム色の「フィールドスポット」を配置する。各毛は自身の根元の色を取るため、ファーを通しても縞がくっきりと残る。
- 一端には、短く乾燥した畝のあるヘタの残片があり、切り口はややドーム状で淡い色。その脇から細い巻きひげが螺旋状に伸びている。
- 左上前方からのディレクショナルライト1灯、ラップディフューズ、毛の接線方向に沿ったKajiya-Kay異方性ハイライト、暗い根元(毛の高さによるオクルージョン)、毛ごとのわずかな明るさのばらつき。

ファー(最重要:くっきり見えること。決してぼやけてはいけない)
- ファーの長さは0.2単位。毛は法線方向に伸びたのち湾曲する:ヘタ側から花落ち部側へと梳かされ、両側面へ垂れ下がる(両端に渦巻きはなし)。さらにわずかな重力がかかる。
- アンダーコート:ボディメッシュの約64枚のインスタンス化されたシェルによるシェルテクスチャリングで、ファーの長さの50%までしか到達しない。UV空間のプロシージャルな毛セル(デフォルトビューで1セルが約3.4デバイスピクセルになるよう密度をスケール)、2種類の毛の集合(長い毛+細い下毛)、先端に向かって房状に集まる毛、解析的なアンチエイリアス付きカバレッジ、アルファブレンディング、シェルは深度を書き込む。表面がエッジオンで見える箇所ではシェルをフェードアウトし、淡いフラグメントを破棄することで、輪郭に点状の縁が現れないようにする。
- ガードヘア:約90,000本の個別のテーパー状でカメラに正対するリボン状ストランド(インスタンス化、各7セグメント)を、まったく同じ湾曲関数に従わせ、最小幅を約0.75 pxとしてシャープに保つ。2回描画する:シェルの前と後(深度テストあり)。これにより、淡いエッジの毛がガードヘアを隠すことはなく、常にくっきりと最前面に位置する。
- 常にデバイスのフルピクセル比(上限2)でレンダリングし、パフォーマンスのために決して下げない。フレームが遅い場合は、まずシェル数を減らし(最小32まで)、次にガードヘア数を減らす。

インタラクション
- ドラッグで自由に回転(トラックボール方式)。フリック後は慣性が働く。ファーは減衰バネを介して回転に遅れて追従し、揺れて戻る。ファーには穏やかなアイドル時のそよ風。入力がない状態が3秒続くと、ゆっくり自動回転する。
- マウスホイール/ピンチでズーム(滑らかなドリー)。ダブルクリックまたは「0」キーでイージング付きアニメーションによりリセット。矢印キーで回転。
- カスタムカーソル:ネイティブのグラブハンドに加え、ポインタを追従する細い暗色の46 pxのリング。ドラッグ中はリングが縮む。ホバーするとカーソル下のファーがそっと分かれ、撫でているように見える。
- prefers-reduced-motionを尊重する(アイドル時の回転なし、そよ風なし)。

UIと堅牢性
- 左下のキャプション:「Fluffy Watermelon」とヒント「Drag to rotate · Scroll to zoom · Double-click to reset」(タッチデバイスでは「Drag to rotate · Pinch to zoom」)。最初のインタラクション後にフェードアウトする。フォント:Google FontsのOnest、システムフォールバック付き。
- 読み込み時にサイズ0のコンテナが発生しないよう防御する:幅/高さを最低1にクランプし、毎フレーム、非有限のカメラ距離や回転状態から復帰させる。
- WebGLコンテキストが失われた場合やシェーダのコンパイルに失敗した場合は、ページ上に小さな注記を表示し、WebGLが利用できない場合はフォールバックメッセージを表示する。

出典

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