# Threejs Raymarched Space Effects

Build raymarched space phenomena in Three.js.

- Repository: https://github.com/scottstts/Threejs-Awesome-Graphics-Agent-Skills (956 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-22
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-raymarched-space-effects -g -a claude-code -y`
Codex: `npx skills add scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-raymarched-space-effects -g -a codex -y`
Cursor: `npx skills add scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-raymarched-space-effects -g -a cursor -y`
Gemini CLI: `npx skills add scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-raymarched-space-effects -g -a gemini-cli -y`

## Description

Build raymarched space phenomena in Three.js. Use for black-hole lensing, accretion disks, wormhole throat transits, curved-ray and null-geodesic integration, lensed celestial spheres, procedural star fields and galactic skies, relativistic-looking distortion, bounded volumetric structures, and GPU effects that need controlled numerical integration.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Raymarched Space Effects

Treat these effects as numerical renderers with explicit integration state. The visual character depends on coordinate choice, step policy, and how rays interact with emissive structures.

This skill contains exemplary examples and assets beyond descriptive guidance,
they're worth studying, referencing, or even copying. Use them sufficiently
when relevant and do NOT blindly skip them.

## Workflow

1. Define the effect-space transform and camera ray.
2. Choose a physical, physically inspired, or purely artistic bending model.
3. Bound the integration domain.
4. Track ray position, direction, throughput, and accumulated radiance.
5. Detect crossings with disks, shells, throats, or event boundaries.
6. Sample the background only after integration terminates, filtered by the
   ray-bundle footprint rather than point sampled.
7. Add diagnostics for trajectory, step count, and termination reason.

Read [references/curved-ray-integrators.md](references/curved-ray-integrators.md)
for the two wormhole throat models, observer transport through a throat, the
artistic curved-ray accretion integrator, disk composition, and implementation
defects.

Read
[references/lensed-celestial-spheres.md](references/lensed-celestial-spheres.md)
for footprint-filtered skies, flux-conserving star point spreads, dust
extinction, bright sources under display clipping, progressive accumulation,
and the bloom kernel a compact source needs.

Read the
[curved-ray accretion volume](examples/curved-ray-accretion-volume/curved-ray-effect.js)
for the inverse-square steering loop, thin disk density, front-to-back
accumulation, deterministic star environment, and integrator diagnostics.

Read the
[Schwarzschild geodesic black-hole effect](examples/schwarzschild-geodesic-black-hole/geodesic-black-hole-effect.js)
for RK2 null-geodesic integration, interpolated equatorial disk crossings,
Doppler/redshift disk emission, lensed procedural deep field, and HDR bloom
composition.

The rest: https://github.com/scottstts/Threejs-Awesome-Graphics-Agent-Skills/blob/HEAD/skills/threejs-raymarched-space-effects/SKILL.md
