3d-sky-rays
Was er macht
Dieser Skill führt den Agenten beim Hinzufügen sichtbarer Lichtstrahlen zu einer 3D-Szene. Er richtet sich an Entwickler, die Außen- oder Goldene-Stunde-Szenen bauen, in denen Licht durch Lücken fallen soll.
Wann du ihn nutzt
- ✓Wenn Sonnenlicht als Strahlen durch Bäume oder Dachkanten sichtbar sein soll.
- ✓Wenn eine goldene Architekturszene Lichtstrahlen braucht.
- ✓Wenn sich die Lichtstrahlen richtig bewegen sollen, wenn sich die Kamera bewegt.
Link zum Skill
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-sky-rays/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Füge in meiner 3D-Parkszene bei Sonnenuntergang Sonnenstrahlen hinzu, die durch die Bäume scheinen.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent baut eine Maske aus offenem Himmel gegenüber blockierenden Objekten und verwischt das Licht von der Sonnenposition nach außen. Die Strahlen werden von echten Szenenformen wie Bäumen und Dächern geschnitten.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
3D Sky Rays
Make the light appear to travel through gaps in the scene. Roof edges and foliage should shape the shafts as the camera moves.
Fit the existing renderer
Inspect the renderer version, render targets, alpha usage, depth path, tone mapping, and post-processing order. Keep the existing WebGL or WebGPU backend. The shader recipe below describes a WebGL screen-space effect; implement the equivalent in the project's node/render pipeline when using WebGPU.
Use one normalized world-space direction pointing toward the sun for the sky, ray source, and directional lighting. If the art direction deliberately offsets the visible sun from the lighting sun, document and control that offset in one place.
Build an occlusion-aware ray pass
- Render scene color in linear HDR. Obtain a mask identifying open sky: white for sky, black for opaque occluders. Match foliage alpha cutouts and vertex motion in the mask pass so leaves do not become solid rectangles.
- A dedicated sky mask is the portable default. Reusing scene alpha is an optimization only when every preceding pass preserves its meaning: sky alpha 0, opaque geometry alpha 1. Transparent glass, particles, canvas compositing, and AO can break that convention; inspect the mask directly.
- Project a point along the sun direction from the camera. Reject a source behind the camera before using projected coordinates. Convert NDC to UV with
uv = ndc.xy * 0.5 + 0.5; account for the pipeline's texture orientation. - For each ray-buffer pixel, march toward the sun UV. Sample sky visibility multiplied by sky brightness above an HDR threshold. Accumulate decaying samples and divide by the sum of weights so sample-count changes do not change exposure.
- Reject UVs outside the mask texture. Fade the effect as the sun moves far off-screen; clamping samples to the edge creates bright bands. A small overscan margin is useful for a sun just outside the frame.
- Composite the ray color additively into linear scene color before the final tone-map/output transform. Preserve the input alpha if later passes need it.
Core accumulation, expressed as pseudocode:
step = (pixelUV - sunUV) * density / sampleCount
sampleUV = pixelUV - step * jitter
sum = 0; weightSum = 0; weight = 1
repeat sampleCount times:
sampleUV -= step
if sampleUV is inside the texture:
energy = max(luminance(scene(sampleUV)) - threshold, 0)
sum += min(energy, energyCap) * skyMask(sampleUV) * weight
weightSum += weight
weight *= decay
rays = sum / max(weightSum, epsilon)
Use aspect-correct distance from the source for radial falloff. Keep any angular variation broad and subtle; the scene occlusion should provide most of the structure. On opaque foreground surfaces, attenuate the screen-space overlay strongly so wood and stone retain contrast. This is an artistic approximation, not a substitute for depth-integrated volumetric scattering.
Tune appearance before cost
Start with a low sun, warm neutral tint, visible gaps, and restrained intensity. View from behind a roofline and through a canopy. Whiteout usually means excessive intensity or a bad mask, not insufficient bloom.
Use roughly 24–48 samples and a half-resolution ray buffer as a starting experiment; increase only when visible banding warrants it. Seijaku's reference uses 72 samples, which is a reference choice rather than a required quality floor. Smooth noise jitter can reduce bands, but animated jitter can shimmer; use stable noise for still or reduced-motion views unless temporal accumulation is available.
Skip the pass when its contribution is zero. Resize its buffers with the drawing buffer, dispose replaced targets, and measure its incremental GPU/frame cost with rays enabled and disabled. Avoid synchronous GPU readback in the render loop.
Verify
- Roofs and leaf silhouettes visibly interrupt shafts; no rectangular foliage halos.
- Turning away from the sun removes the effect without a mirrored source or flash.
- Entering an interior preserves surface contrast; unrelated emissive objects do not become suns.
- Camera orbit, portrait resize, dusk, and a static reduced-motion frame remain stable.
- Desktop and mobile checks include shader errors, frame time, and the actual ray-buffer size.
Reference
Read REFERENCES.md for the source and renderer documentation. In Seijaku, inspect GodRayShader, makePost, and the projected-source update. Its alpha-mask conven
Häufige Fragen
Funktioniert das mit WebGPU?
Der Skill beschreibt eine WebGL-Version und sagt, die Entsprechung in einer WebGPU-Pipeline zu bauen.
Warum könnten Blätter wie feste Rechtecke wirken?
Der Skill warnt, dass die Maske zu den Blattausschnitten passen muss, damit Blätter nicht zu festen Blöcken werden.
Wird die Sonnenrichtung an einer Stelle festgelegt?
Ja. Der Skill empfiehlt eine einzige normalisierte Richtung, die Himmel, Strahlen und Beleuchtung gemeinsam nutzen.
Details
Originalbeschreibung des Autors
Add sun shafts and crepuscular rays to a Three.js or equivalent 3D scene, using scene occlusion, a projected sun position, controlled foreground spill, and scalable post-processing. Use for rays of light from the sky, sunlight through trees or roofs, and golden-hour architectural scenes.
repo: MengTo/Skills
Beliebtheit
- GitHub-Sterne
- 7.2k
- Platz im Ranking
- #13323
- Lizenz
- MIT
- Aktualisiert
- 1.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
3d-cloth-material
7.2kHilft deinem Agenten, realistisch gewebten Stoff in Three.js zu bauen, mit Fadengewebe, weichem Schimmer, natürlichen Falten, Säumen und Nähten.
3d-falling-leaves
7.2kHilft deinem Agenten, realistisch fallende Blätter in eine 3D-Szene einzubauen, die taumeln, vom Wind treiben und sich wiederverwenden, wenn sich die Kamera bewegt.
3d-four-seasons
7.2kHilft deinem Agenten, Frühling, Sommer, Herbst und Winter in eine 3D-Szene einzubauen. Laub, Licht, Himmel und Schnee wechseln, ohne die Szene neu zu bauen.
3d-high-poly-models
7.2kHilft deinem Agenten, detaillierte 3D-Modelle mit glatten Formen und glaubwürdigen Kanten zu bauen und danach leichtere Versionen vorzubereiten, die im Web gut laufen.
Ähnliche Skills
angular-developer
280kHilft deinem Agenten bei Angular-Code und gibt Tipps zur Projektstruktur. Nützlich für neue Projekte, einzelne Code-Teile sowie Performance und Barrierefreiheit.
frontend-a11y
280kHilft deinem Agenten, Weboberflächen für alle zugänglich zu machen. Sorgt dafür, dass Websites und Apps gut mit Screenreadern und Tastaturnavigation funktionieren.
frontend-patterns
280kLässt deinen Agenten moderne Muster in der Frontend-Entwicklung anwenden. Optimiert Performance, verwaltet State und folgt Best Practices für React und Next.js.