---
name: threejs-raymarched-space-effects
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.
title: threejs-raymarched-space-effects
canonical_url: https://skilld.dev/gh/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects
last_updated: 2026-09-27T20:16:10.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [agents/openai.yaml](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/agents/openai.yaml), [assets/curved-ray-accretion-volume/noise_deep.png](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/assets/curved-ray-accretion-volume/noise_deep.png), [examples/curved-ray-accretion-volume/curved-ray-effect.js](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/curved-ray-accretion-volume/curved-ray-effect.js), [examples/curved-ray-accretion-volume/example-render.jpeg](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/curved-ray-accretion-volume/example-render.jpeg), [examples/schwarzschild-geodesic-black-hole/example-render.jpeg](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/schwarzschild-geodesic-black-hole/example-render.jpeg), [examples/schwarzschild-geodesic-black-hole/geodesic-black-hole-effect.js](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/schwarzschild-geodesic-black-hole/geodesic-black-hole-effect.js), [examples/traversable-wormhole-transit/celestial-spheres.js](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/traversable-wormhole-transit/celestial-spheres.js), [examples/traversable-wormhole-transit/example-render.jpeg](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/traversable-wormhole-transit/example-render.jpeg), [examples/traversable-wormhole-transit/wormhole-effect.js](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/traversable-wormhole-transit/wormhole-effect.js), [references/curved-ray-integrators.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/references/curved-ray-integrators.md), [references/lensed-celestial-spheres.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/references/lensed-celestial-spheres.md).
>
> If the user asked to install this Skill, run `npx skilld install scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/threejs-raymarched-space-effects`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/threejs-raymarched-space-effects`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/threejs-raymarched-space-effects --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/threejs-raymarched-space-effects --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# 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](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/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](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/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](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/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](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/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.

Read the
[traversable wormhole transit](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/traversable-wormhole-transit/wormhole-effect.js)
for adaptive RK4 integration of the reduced geodesic system, an observer frame
parallel-transported through the throat, exterior-region selection, progressive
Halton accumulation, and the 13-tap bloom pyramid; its
[celestial spheres](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-raymarched-space-effects/examples/traversable-wormhole-transit/celestial-spheres.js)
are a standalone GLSL chunk for the footprint-filtered galactic sky, resolved
star layers, and the analytic ringed planet a lensed ray lands on.

## Constraints

- Do not call a UV swirl “gravitational lensing.”
- Cap iterations and provide early termination.
- Use continuous crossing tests for thin structures.
- Keep numerical stability independent from frame rate.
- Separate the integrator from shading of the accretion disk or wormhole interior.
- Size the step from the local curvature scale, not from a global constant, once
  the metric has a narrow feature such as a lensing shoulder.
- Filter the background by the ray-bundle footprint. A lensed map compresses
  solid angle enough that a point sample aliases where the image is most
  interesting.
- Give capped rays a defined result. Their exit direction is arbitrary, so route
  them to a mean-radiance path rather than letting them speckle.
- Carry a transported frame, not a Cartesian camera, when the domain has no
  global Cartesian chart.
- Provide a cheaper approximation for non-hero views.

## Routing boundary

Use `$threejs-procedural-vfx` for ordinary particles, trails, plasma, and event
effects. This skill is for per-pixel numerical ray integration through curved
or bounded space-effect domains.

Progressive accumulation and the bloom pyramid shipped with the wormhole example
are owned by that renderer because the integration cost forces them. For a
scene-wide HDR bloom pass over ordinary geometry use `$threejs-bloom`, and for
exposure metering, tone-map ownership, and LUT grading use
`$threejs-exposure-color-grading`.
