ai21.net
言語

和風神社の情景比較

和風神社の情景比較 — 1

プロンプト

Build a single-file interactive WebGL diorama (one index.html, no build step) with Three.js r160 loaded via an import map from https://cdn.jsdelivr.net/, plus OrbitControls and BufferGeometryUtils (mergeVertices, mergeGeometries) from three/examples/jsm. Everything is procedural — no external models or textures.

CONCEPT
"Torii at High Tide": a miniature Japanese shrine island inspired by Itsukushima, inside a 10×10 block of clear water with rounded edges (vertical corner radius ~0.6, top edge radius ~0.26), on a thin sand-colored base slab, on a warm washi-paper background with a soft floor shadow that fades out with distance (so long dusk shadows never streak across the page).

TERRAIN (heightfield ~400×400, clipped to the rounded block, with a boundary "skirt" so the cross-section shows through the water)
- Work in a local frame facing the camera (u = across, v = toward the viewer).
- A forested dome-shaped hill at the back (~2.4 high), a low sandy shrine terrace at its foot, then a wide, gently sloping tidal flat in front (from ~-0.06 down to ~-0.46), dropping to ~-1.0 at the front and sides.
- Two rocky granite headlands framing the bay, each with 1–2 leaning bonsai-style pines (segmented trunks + flattened canopy pads).
- A flattened clearing on the hill flank for the pagoda.
- Terrain shader: granite rock on steep slopes (speckled, darker wet band just above the waterline, algae-dark below it), sand with a wet line, darker wet intertidal sand below the high-tide mark, moss/grass on the hill and in patches on the terrace, snow on upward-facing surfaces in winter, procedural animated caustics under water. CPU-baked horizon AO per vertex plus canopy-cover darkening.

ARCHITECTURE (merge everything into one vertex-colored mesh + one emissive "glow" mesh; write a small Builder that adds boxes/cylinders/spheres/custom geometry with a color and a transform, then mergeGeometries)
- Ryōbu-style torii standing in the bay on the axis of the shrine (~1.9 tall): vermilion tapered main pillars with black base sheaths, four supporting sode-bashira legs with black caps and two connecting beams each, nuki tie beam, central strut with a dark plaque, shimaki, and a curved kasagi (extruded shape with upturned ends) with a black top layer. Pillars must end inside the shimaki, not poke through the kasagi.
- Shrine on stilts over the tidal flat: plank deck (with plank-gap strips and dark edge beams) on a grid of wooden stilts reaching the seabed; a main hall and a smaller front hall (white walls, vermilion posts and tie beams, shoji-style front panels = glow panels behind a thin dark lattice), a lower front stage with vermilion railings, and two roofed vermilion corridors on stilts running sideways then back to the shore.
- Roofs: a hip-roof generator with a concave profile and lifted eave corners (top surface dark cypress-bark brown, warm wood underside, pale fascia trim, black ridge cap).
- A five-storey pagoda on the hill clearing: stone plinth, white walls with vermilion posts, bracket layer, flared roofs decreasing in size, bronze finial with rings.
- Stone tōrō lanterns on the terrace and on the stage (hexagonal base, post, firebox with emissive windows, small roof, jewel).

VEGETATION
- ~4–5k canopy blobs (InstancedMesh of icospheres with vertex-noise displacement + fragment bump), clustered 2–4 per tree, per-instance AO from neighbour occlusion, brighter tops.
- Four kinds via an instance attribute: broadleaf, cherry, maple, pine (flattened pads). Cherries cluster lower on the hill and as 5 feature trees with visible trunks on the terrace; pines dominate the summit and the headlands.
- Colors come from per-kind dark/light palette uniforms that the JS blends across seasons.

SEASONS (cyclic 0..4 = spring, summer, autumn, winter; animated transition from a dock button)
- Spring: pink sakura, falling petals. Summer: lush green, no particles. Autumn: red maples, orange/yellow broadleaf, falling maple leaves. Winter: bare-ish brown deciduous blobs shrunk ~38%, snow on canopy tops, roofs, decks, rocks and ground; snowfall that melts instantly on the water.

WATER (realistic, not jelly)
- Pipeline: opaque scene → MSAA HalfFloat target with DepthTexture; copy to a second target, then draw the water with a custom ShaderMaterial doing a manual depth test; then floating particles; final fullscreen pass with ACES tone mapping, sRGB, subtle tilt-shift. Transparent canvas over the CSS background.
- Color from real thickness: reconstruct the depth behind each water pixel, Beer–Lambert absorption toward a deep scatter color derived from the user's water color (pale over the flats, blue in the deep; side walls get extra path length so they read as a water volume).
- Screen-space refraction, Fresnel sky reflection, sun glints from fine animated detail normals.
- Screen-space reflections (~26 ray-march steps against the depth buffer, fewer on mobile) so the torii, shrine and lit lanterns reflect in the water.
- Ripples: GPU wave equation on a 256×256 HalfFloat ping-pong target, fixed 60 Hz steps, land-mask texture so waves reflect off the shore. Cursor movement injects capsule drops along its path; a click makes a splash.
- Shore foam only where the terrain is near the water level AND gently sloped (no white outlines around cliffs, stilts or the torii pillars); foam band width scaled by slope; broken by noise.
- Tide: a dock toggle animates between high tide (0) and low tide (-0.55): the water block's rim moves and its sides stretch; at low tide the whole flat is exposed and the torii stands on wet sand.

PARTICLES (petals / leaves / snow, ~700 instanced quads, CPU-simulated)
- Spawn from cherry blobs (spring), deciduous blobs (autumn) or the sky (winter); flutter while falling; a gusting wind blows from the island toward the bay so they reach the water.
- Landing: on water they become floating (vertex shader lifts them by the same ripple + wave height as the water), drift slowly, get pushed by the cursor's movement and blown away by click splashes, strand when the tide drops, re-float when it rises; on land they rest and fade.
- Shapes drawn in the fragment shader: notched petal, five-lobed maple leaf, soft snow disc. Manual depth test against the scene depth.

KOI
- 7 koi (lathe body + forked fan tail + pectoral fins, merged), InstancedMesh with a swimming sway in the vertex shader and procedural patterns per type (kohaku, sanke, showa, ogon, plain orange). They wander, steer away from shallow water and the block walls, and flee the cursor and splashes. Rendered under the water so they are refracted and tinted.

TIME OF DAY (slider, shown as a clock from 11:00 to ~19:10)
- Sun elevation, color and intensity, hemisphere colors, and the water's sky reflection shift from noon to golden hour; towards dusk the shoji panels and lanterns glow (emissive) and three warm point lights light the shrine, the stage and the torii.

UI (editorial, minimal, English)
Brand "shiosai°" with a small torii mark, headline "A gate that / stands in the sea.", eyebrow "Shrine and tide, in miniature", a vertical caption "A study of tide and seasons", a location label "Shrine Cove · 34°16′ N · 132°19′ E", a floating pill dock (reset, season cycle with the current season name, High tide / Low tide toggle, Tune, fullscreen), hints and an adaptive FPS + "Season · time" readout in the footer, a glassy settings panel (season, time of day, falling petals; water color, tide level, wave height, ripple strength, clarity, caustics; sun azimuth, tilt-shift), and a "How it's made" card. Vermilion accent, light and dark themes via CSS tokens, responsive to 390 px (panel becomes a bottom sheet), prefers-reduced-motion respected, adaptive pixel ratio and a lighter mode for touch devices. Intro: the water fills the block while the camera eases in.

日本語訳

単一ファイルのインタラクティブな WebGL ジオラマを作成してください(index.html 1 枚、ビルド工程なし)。Three.js r160 を https://cdn.jsdelivr.net/ から import map 経由で読み込み、さらに three/examples/jsm の OrbitControls と BufferGeometryUtils(mergeVertices、mergeGeometries)を使います。すべてプロシージャルに生成し、外部のモデルやテクスチャは使わないでください。

コンセプト
"Torii at High Tide":厳島に着想を得た日本の神社のミニチュア島。10×10 の透明な水のブロック(角は丸く、縦の角の半径 ~0.6、上端の半径 ~0.26)の内側にあり、薄い砂色のベーススラブの上に、そして温かみのある和紙の背景の上に載っています。床の柔らかな影は距離とともに薄れます(夕暮れの長い影がページを横切って筋にならないように)。

地形(ハイトフィールド ~400×400。角丸のブロックでクリップし、境界に「スカート」を付けて断面が水を通して見えるようにする)
- カメラに正対するローカル座標系で作業します(u = 横方向、v = 手前方向)。
- 奥に森に覆われたドーム状の丘(高さ ~2.4)、そのふもとに低い砂の神社テラス、手前には広く緩やかに傾斜する干潟(~-0.06 から ~-0.46 まで)があり、手前と側面では ~-1.0 まで落ち込みます。
- 湾を縁取る 2 つの岩がちな花崗岩の岬。それぞれに 1–2 本の傾いた盆栽風の松(節状の幹+平らに広がる樹冠パッド)。
- 五重塔を置くため、丘の側面を平らにした空地。
- 地形シェーダー:急斜面は花崗岩(斑点状、喫水線のすぐ上に暗い濡れ帯、その下は藻で暗い)、砂は濡れ線付き、満潮線より下は暗く濡れた潮間帯の砂、丘とテラスのあちこちには苔/草、冬は上向きの面に雪、水中にはプロシージャルで動くコースティクス。頂点ごとに CPU で焼き込んだ地平線 AO と、樹冠被覆による暗さ。

建築(すべてを 1 つの頂点カラーメッシュ+1 つの発光「グロー」メッシュに結合する。色とトランスフォームを渡してボックス/シリンダー/球/カスタムジオメトリを追加する小さな Builder を書き、最後に mergeGeometries で結合する)
- 湾の中、神社の軸線上に立つ両部式の鳥居(高さ ~1.9):黒い基部の鞘を付けた朱色のテーパー主柱、黒い笠石と各 2 本の連結梁を備えた 4 本の袖柱、貫の結び梁、暗い扁額を付けた中央の束、島木、そして上端を反らせた押し出し形状に黒い上層を重ねた反り笠木。柱は島木の中で終わるようにし、笠木を突き抜けないこと。
- 干潟の上に柱を立てた神社:海底まで届く木の束柱のグリッド上の板張りデッキ(板の隙間の帯と暗い縁梁付き)、本殿と小さな前殿(白壁、朱色の柱と結び梁、障子風の前面パネル=細い暗い格子の奥の光るパネル)、朱色の手すりを付けた低い前舞台、そして横方向へ伸びてから岸へ戻る 2 つの屋根付き朱色の回廊。
- 屋根:凹曲面と跳ね上がった軒の隅を持つ寄棟屋根ジェネレーター(上面は暗い檜皮色、下面は温かみのある木、淡い鼻隠しの縁、黒い棟の冠)。
- 丘の空地に建つ五重塔:石の基壇、朱色の柱が入った白壁、組物の層、上へ行くほど小さくなる反り返った屋根、環を付けた青銅の相輪。
- テラスと舞台の上の石灯籠(六角形の基台、竿、発光する窓を付けた火袋、小さな屋根、宝珠)。

植生
- 約 4–5k の樹冠ブロブ(頂点ノイズ変位+フラグメントバンプを加えたアイコスフィアの InstancedMesh)。1 本の木につき 2–4 個をまとめ、隣接する遮蔽からインスタンスごとの AO を計算し、上部を明るくします。
- インスタンス属性で 4 種類:広葉樹、桜、楓、松(平らなパッド)。桜は丘の低い位置にまとまり、テラスには目に見える幹を持つ 5 本の特徴的な木として。松は山頂と岬を占めます。
- 色は種類ごとの明暗パレットユニフォームから取り、JS が季節に応じてブレンドします。

季節(0..4 の循環 = 春、夏、秋、冬。ドックのボタンでアニメーション遷移)
- 春:桃色の桜、舞い散る花びら。夏:青々とした緑、パーティクルなし。秋:赤い楓、橙/黄の広葉樹、舞い落ちる楓の葉。冬:ほぼ裸の茶色い落葉樹のブロブを約 38% 縮小、樹冠の上面、屋根、デッキ、岩、地面に雪。雪は水面に落ちると即座に溶けます。

水(リアルに。ゼリー状にしない)
- パイプライン:不透明シーン → DepthTexture 付きの MSAA HalfFloat ターゲット。2 つ目のターゲットにコピーし、手動の深度テストを行うカスタム ShaderMaterial で水を描画。続いて浮遊パーティクル、最後に ACES トーンマッピング、sRGB、控えめなチルトシフトを掛けたフルスクリーンパス。CSS 背景の上に透明キャンバス。
- 実際の厚みから色を決める:水の各ピクセルの背後の深度を再構成し、ユーザーの水の色から導いた深い散乱色に向かって Beer–Lambert 吸収を適用(浅瀬では淡く、深みでは青。側壁は光路長が増えるので水の体積として見える)。
- スクリーンスペース屈折、フレネルによる空の反射、細かく動くディテールノーマルによる太陽のきらめき。
- スクリーンスペース反射(深度バッファに対して ~26 ステップのレイマーチ、モバイルではより少なく)で、鳥居、神社、灯籠の明かりが水面に映り込みます。
- 波紋:256×256 の HalfFloat ピンポンターゲット上で GPU の波動方程式を 60 Hz の固定ステップで解き、陸マスクテクスチャで波が岸から反射するようにします。カーソルの移動はその軌跡に沿ってカプセル状の水滴を注ぎ、クリックで水しぶきが上がります。
- 汀の泡は、地形が水面に近く、かつ傾斜が緩やかな場所だけに発生(崖、束柱、鳥居の柱の周りに白い輪郭を出さない)。泡の帯幅は傾斜でスケールし、ノイズで途切れさせます。
- 潮:ドックのトグルで満潮(0)と干潮(-0.55)の間をアニメーション。水ブロックの縁が動き、側面が伸びます。干潮時には干潟全体が露出し、鳥居は濡れた砂の上に立ちます。

パーティクル(花びら/葉/雪、約 700 個のインスタンス化クワッド、CPU シミュレーション)
- 桜のブロブ(春)、落葉樹のブロブ(秋)、または空(冬)から発生し、落下しながらひらひらと揺れます。突風が島から湾へ吹くので、水まで届きます。
- 着地:水面では浮遊状態になり(頂点シェーダーが水と同じ波紋+波高で持ち上げる)、ゆっくり流れ、カーソルの動きに押され、クリックの水しぶきで吹き飛ばされ、潮が引くと取り残され、満ちると再び浮きます。陸では静止してフェードアウトします。
- 形状はフラグメントシェーダーで描画:切れ込みのある花びら、五裂の楓の葉、柔らかな雪の円盤。シーン深度に対して手動の深度テスト。

鯉
- 7 匹の鯉(旋盤体+分岐した扇状の尾+胸びれを結合)、頂点シェーダーで泳ぎの揺らぎを持つ InstancedMesh、種類ごとのプロシージャルな模様(紅白、三色、昭和、黄金、無地の橙)。彼らはさまよい、浅瀬とブロックの壁を避けて進路を変え、カーソルと水しぶきから逃げます。水の下に描画されるので、屈折して色が付きます。

時間帯(スライダー、11:00 から ~19:10 までの時計として表示)
- 太陽の高度、色、強度、半球の色、水の空反射が正午からゴールデンアワーへと移り変わります。夕暮れにかけて障子パネルと灯籠が発光し、3 つの温かいポイントライトが神社、舞台、鳥居を照らします。

UI(エディトリアルでミニマル、英語)
ブランド "shiosai°" と小さな鳥居のマーク、見出し "A gate that / stands in the sea."、アイブロー "Shrine and tide, in miniature"、縦書きのキャプション "A study of tide and seasons"、場所ラベル "Shrine Cove · 34°16′ N · 132°19′ E"、浮かぶピル型ドック(リセット、現在の季節名付きの季節サイクル、High tide / Low tide トグル、Tune、フルスクリーン)、ヒント、フッターの適応型 FPS+"Season · time" 表示、ガラス風の設定パネル(季節、時間帯、舞い散る花びら、水の色、潮位、波高、波紋の強さ、透明度、コースティクス、太陽の方位角、チルトシフト)、そして "How it's made" カード。朱色のアクセント、CSS トークンによるライト/ダークテーマ、390 px までレスポンシブ(パネルはボトムシートになる)、prefers-reduced-motion を尊重、適応型ピクセル比、タッチデバイス向けの軽量モード。イントロ:カメラがゆっくり寄る間に水がブロックを満たします。

出典

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