3d-falling-leaves
Fungsinya
Skill ini memandu agent membuat daun berguguran dalam scene web 3D. Cocok untuk pengembang yang ingin suasana musim gugur atau hutan dalam pengalaman Three.js.
Kapan dipakai
- ✓Saat Anda ingin daun musim gugur melayang di scene 3D.
- ✓Saat dedaunan dalam scene 3D perlu gerakan yang alami.
- ✓Saat daun terlihat datar atau selalu menghadap kamera, bukan berputar.
Link skill
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-falling-leaves/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Tambahkan beberapa ratus daun musim gugur yang berguguran ke scene taman 3D saya, yang bergerak dan berputar secara alami.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent membuat daun dari bentuk sederhana yang berputar melalui permukaan dan tepinya, lalu memberi setiap daun gerakan yang stabil dari nilai acak tetap. Daun yang keluar dari pandangan akan digunakan kembali.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
3D Falling Leaves
Make individual leaves turn through face, edge, and back while drifting through the scene. The visible edge-on moment is essential to the effect.
Build one convincing leaf
Use a two-sided quad or lightly bent mesh with a recognizable leaf silhouette, stem, and restrained vein detail. Camera-facing point sprites cannot turn edge-on. Begin with one slow leaf before increasing the count.
Give the back a slightly paler, less saturated appearance and orient its lighting normal correctly. For a custom shader, gl_FrontFacing can distinguish front/back; do not flip normals twice if the engine's material already handles double-sided lighting. Keep light transmission subtle and linked to the scene sun rather than using an unconditionally glowing leaf.
Use a padded texture atlas for multiple silhouettes. Extend edge colors into transparent texels and keep padding through mip levels to prevent dark rims and atlas bleed. Treat a color atlas as sRGB; treat an atlas encoding masks or material channels as data. Seijaku's procedural atlas encodes channels and is not an ordinary leaf photograph.
Couple tumble and drift
Assign persistent seeded values per leaf: position seed, scale, phase, tumble rate, roll rate, fall speed, lateral slip, and palette variation. Never generate new random values every frame.
The lateral velocity should follow the tumble, so a leaf slips fastest when edge-on. For angular speed omega bounded away from zero:
const angle = phase + omega * time;
const sideOffset = -(slip / omega) * Math.cos(angle);
// d(sideOffset)/dt = slip * sin(angle)
Apply that offset along the leaf's chosen horizontal direction. Use a separate slow roll and tilt; all leaves should not share one rhythm. Add a common wind field with small per-leaf response variation. Integrate changing wind over bounded simulation steps, or use a closed-form field; never catch up an entire hidden-tab interval with an unbounded loop.
Instance and recycle
Use an InstancedMesh with reusable CPU scratch objects for moderate counts, or instanced attributes and shader animation for larger fields. Upload seeded attributes once; update time, wind, season amount, and camera anchor uniforms. Refresh instance matrices/bounds correctly when using the CPU path. See InstancedMesh.
Center the recycling volume ahead of the camera along its horizontal viewing direction. Retain a fallback horizontal direction when looking nearly straight up or down. Preserve existing world positions as the camera moves; move the spawn/wrap boundaries rather than parenting all live leaves to the camera.
Wrap outside the visible central volume. Fade near boundaries with 1.0 - smoothstep(inner, outer, distance), where inner < outer; reversed GLSL smoothstep edges are undefined. Hide reset events beyond the fog, near the volume top, or behind a soft boundary fade. Seed each fall cycle for variation without frame-to-frame jitter.
Start with a sparse field and tighten its visible volume before increasing the count. Distinguish capacity, active count, and leaves actually visible. Use a few near leaves, a readable middle layer, and smaller distant leaves. Keep the closest leaves from covering the camera as giant blurred shapes.
Integrate with the world
- Depth-test against architecture and ground. Exclude covered interior volumes or provide roof/terrain collision proxies; depth testing alone does not prevent leaves falling inside rooms.
- For crisp silhouettes, alpha testing with depth writes is a useful default. MSAA alpha-to-coverage can soften edges only when the actual target is multisampled. A custom shader must implement its alpha rejection; material settings alone do not insert arbitrary custom shader logic.
- If alpha blending is needed, handle depth writes and sorting deliberately. Instances are not individually depth-sorted by default.
- Match leaf cutouts and wind deformation in any shadow or occlusion pass. Disable leaf shadow casting when its cost or artifacts outweigh its visual contribution.
- Let seasonal state control palette and active density; do not allocate a new leaf system per season.
Verify
Watch one leaf complete a tumble and a full fall cycle. Confirm its face/back differ, its edge thins, and its reset is hidden. Walk sideways, turn around, look up, enter a room, and resume after hiding the tab. Check the field at narrow and wide viewports, throu
Pertanyaan umum
Apakah ini juga berlaku untuk overlay 2D?
Tidak. Skill ini khusus untuk daun 3D. Skill terpisah menangani overlay canvas 2D.
Mengapa daun perlu berputar sampai tampak dari sisi tipisnya?
Skill ini menyebut momen daun berputar hingga tampak dari sisi tipis sangat penting agar efeknya terlihat nyata.
Apakah setiap daun bisa terlihat berbeda?
Bisa. Setiap daun mendapat ukuran, waktu, kecepatan jatuh, dan variasi warna sendiri.
Detail
Deskripsi asli dari pembuat
Build recognizable falling leaves in world space using instanced geometry, independent tumble, coupled sideways drift, shared wind, scene occlusion, and camera-aware recycling. Use for 3D autumn leaves or drifting foliage in Three.js and similar scenes; use falling-leaves for a 2D canvas overlay.
repo: MengTo/Skills
Popularitas
- Bintang GitHub
- 7.2k
- Peringkat
- #13314
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- …
Skill lain dari repositori ini
3d-cloth-material
7.2kMembantu agent Anda membuat kain tenun yang realistis di Three.js, dengan anyaman benang, kilau lembut, lipatan alami, kelim, dan jahitan.
3d-four-seasons
7.2kMembantu agent Anda menambahkan tampilan musim semi, panas, gugur, dan dingin ke scene 3D, dengan mengubah dedaunan, cahaya, langit, dan salju tanpa membangun ulang scene.
3d-high-poly-models
7.2kMembantu agent Anda membangun model 3D yang detail dengan bentuk halus dan tepi yang meyakinkan, lalu menyiapkan versi lebih ringan yang berjalan baik di web.
3d-high-resolution-textures
7.2kMembantu agent Anda membuat material 3D yang tajam dan realistis untuk tampilan dari dekat, tanpa membuat file terlalu besar sehingga lambat dimuat.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.