3d-sky-rays
하는 일
이 스킬은 3D 장면에 보이는 햇살 광선을 추가하는 과정을 안내합니다. 빛이 틈 사이로 들어와야 하는 야외 장면이나 골든 아워 장면을 만드는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓햇빛이 나무나 지붕 가장자리를 통해 광선으로 보여야 할 때.
- ✓골든 아워 건축 장면에 빛줄기가 필요할 때.
- ✓카메라가 움직일 때 빛줄기가 올바르게 움직여야 할 때.
스킬 링크
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-sky-rays/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 3D 공원 장면에서 해 질 녘에 나무 사이로 들어오는 햇살 광선을 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 열린 하늘과 가리는 물체를 나누는 마스크를 만든 뒤, 태양의 위치에서 바깥쪽으로 빛을 번지게 합니다. 광선은 나무나 지붕 같은 실제 장면의 형태에 의해 잘립니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
WebGPU에서도 작동하나요?
스킬은 WebGL 버전을 설명하며, WebGPU 파이프라인에서도 같은 효과를 만들라고 안내합니다.
잎이 왜 단단한 사각형처럼 보일 수 있나요?
마스크가 나뭇잎의 컷아웃과 맞아야 잎이 단단한 블록이 되지 않는다고 스킬이 경고합니다.
태양의 방향은 한 곳에서 설정하나요?
네. 스킬은 하늘, 광선, 조명이 함께 쓰는 하나의 정규화된 방향을 권장합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 7.2k
- 순위
- #13323
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
3d-cloth-material
7.2k에이전트가 Three.js에서 실 짜임, 부드러운 광택, 자연스러운 주름, 단, 솔기를 갖춘 실제 직물처럼 보이는 천을 만들도록 돕습니다.
3d-falling-leaves
7.2k에이전트가 3D 장면에 나뭇잎이 구르고 바람에 흩날리며 카메라 움직임에 따라 재사용되는 낙엽 효과를 추가하도록 돕습니다.
3d-four-seasons
7.2k에이전트가 3D 장면의 나무, 빛, 하늘, 눈을 바꿔 장면을 다시 만들지 않고 봄, 여름, 가을, 겨울을 표현하도록 돕습니다.
3d-high-poly-models
7.2k에이전트가 매끄러운 형태와 자연스러운 모서리를 가진 세밀한 3D 모델을 만들고, 웹에서 잘 돌아가는 가벼운 버전을 준비하도록 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.