Pular para o conteúdo
Skillpedia
Sites e telas (frontend)7,2 mil · #13314

3d-falling-leaves

O que ela faz

Esta skill orienta o agente a criar folhas caindo em uma cena web 3D. Ela serve para desenvolvedores que querem um clima de outono ou de floresta em uma experiência com Three.js.

Quando usar

  • ✓Quando você quer folhas de outono derivando por uma cena 3D.
  • ✓Quando a folhagem de uma cena 3D precisa de um movimento natural.
  • ✓Quando as folhas parecem chapadas ou sempre voltadas para a câmera, em vez de girarem.

Link da skill

https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-falling-leaves/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-falling-leaves/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Acrescente algumas centenas de folhas de outono caindo ao meu cenário 3D de parque, que derivem e girem naturalmente.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente cria folhas a partir de formas simples que giram em torno de suas faces e bordas, e dá a cada uma um movimento constante a partir de valores aleatórios fixos. As folhas que saem da tela são reaproveitadas.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Perguntas frequentes

Ela também funciona para uma sobreposição 2D?

Não. Esta skill é para folhas 3D. Uma skill separada cuida de sobreposições 2D em canvas.

Por que as folhas precisam girar até ficar de perfil?

A skill diz que o momento em que a folha fica de perfil é essencial para que o efeito pareça real.

As folhas podem ser diferentes entre si?

Sim. Cada folha recebe seu próprio tamanho, tempo, velocidade de queda e variação de cor.

Detalhes

Descrição original do autor

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

Popularidade

Estrelas no GitHub
7,2 mil
Posição no ranking
#13314
Licença
MIT
Atualizada em
01/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas