Threejs Spectral Ocean logo

Threejs Spectral Ocean

Community
scottstts
threejs-spectral-ocean

Build large procedural oceans and coast transitions in Three.js. Use for WebGPU/TSL FFT oceans, multi-cascade wavelength bands, coastal breakers, finite-volume shallow-water beach waves, signed-distance coastlines, shallow-water swash films, wet-sand transitions, rock-impact spray, stylized above/below surface optics, permanently submerged Snell-window views, total internal reflection, forward-refracted structures through an interface, pixel-footprint spectral LOD, aquatic perspective, caustic god rays, choppy displacement, spectral derivatives, Jacobian whitecaps, windrow and temporal foam, analytic sky reflection, underwater absorption, crest scatter, and GPU validation.

Overview

Publisherscottstts
RepositoryThreejs-Awesome-Graphics-Agent-Skills
Skill namethreejs-spectral-ocean
Stars
894
Forks
98
Bundled files
58
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 58 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by scottstts on GitHub. Read the source before you install it.

Installation

Install the Threejs Spectral Ocean AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/scottstts/Threejs-Awesome-Graphics-Agent-Skills/tree/main/skills/threejs-spectral-ocean
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/scottstts/Threejs-Awesome-Graphics-Agent-Skills.git /tmp/Threejs-Awesome-Graphics-Agent-Skills
mkdir -p .claude/skills
cp -r /tmp/Threejs-Awesome-Graphics-Agent-Skills/skills/threejs-spectral-ocean .claude/skills/threejs-spectral-ocean
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Threejs Spectral Ocean in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Threejs Spectral Ocean on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Threejs Spectral Ocean is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Spectral Ocean

Choose the representation that owns the requested view. Open-water sea states use explicit frequency-space ownership. A beach-level breaker view uses a coupled band-limited wave field, coast representation, swash state, foam history, and sand response. Do not reduce either target to scrolling normal maps or unrelated foam noise.

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.

Spectral build order

  1. Define the sea-state spectrum and deterministic Gaussian seed.
  2. Partition wavelengths into disjoint cascades.
  3. Validate the inverse FFT independently with analytic inputs.
  4. Generate and conjugate-pack the initial spectrum.
  5. Evolve packed displacement and derivative fields in frequency space.
  6. Inverse-transform every packed field with explicit inter-step barriers.
  7. Assemble displacement, derivatives, and persistent Jacobian foam maps.
  8. Shade from summed cascade displacement and derivatives.
  9. Add sub-grid detail only below the resolved simulation bands.
  10. Expose spectrum, height, slopes, Jacobian, and foam-history diagnostics.

Read references/spectral-cascade-ocean-system.md before implementing or auditing a spectral ocean.

Read references/coastal-breaker-and-swash-ocean.md before implementing or auditing the water-to-wet-sand transition of a coastal breaker system.

Read the spectral cascade ocean system and its adjacent spectrum, FFT, material, and detail modules for the cascade, FFT, derivative, Jacobian, foam-history, and shading contracts. Its WebGL2 fragment-FFT backend is an explicit compatibility tier; preserve the production WebGPU/TSL architecture described in the reference when the target supports it.

Read the stylized above/below ocean material when the target needs a stylized FFT ocean that can be inspected from both above and below the surface: height-gradient water color, sun-path glints, crest scatter, Jacobian foam, water-tinted seafloor caustics, and an underwater Beer-Lambert composite driven by scene depth.

Read the submerged Snell ocean system when the camera must remain underwater beneath a WebGPU spectral surface: it provides exact water-to-air Fresnel with a derivative-filtered critical-angle mask, total internal reflection against a physically bright upwelling underside, an energy-conserving transmitted-sun lobe, forward projection of above-water structures into the window, shared HDR sky radiance, aquatic extinction and in-scatter, footprint-faded differential-area caustics, full-resolution god rays, suspended particulates, and the final HDR grade.

Read the coastal breaker ocean system when the defining view sits at the waterline: it provides deterministic band-limited gravity and capillary fields, a signed-distance mainland and island coast, coast-normal shallow-water swash chains, persistent breaker and film foam, camera-following warped geometry, wet-sand optics, and shared sky radiance.

Read the ocean beach waves implementation when the beach is owned by a positivity-preserving finite-volume solver: it provides a rocky coastal grid, reconstructed water and wet-sand fields, advected foam, shallow-film optics, reflected and refracted sky radiance, and impact-triggered spray.

Spectral non-negotiable gates

  • Require a power-of-two grid and a passing FFT impulse/frequency test.
  • Keep cascade wavenumber intervals disjoint.
  • Derive normals from transformed derivatives, not a detached normal texture.
  • Detect breaking from the horizontal-displacement Jacobian.
  • Persist foam in simulation state; do not infer all foam anew per frame.
  • Submit FFT stages with the synchronization required by the active backend.
  • Share sun and sky parameters between the visible sky and ocean reflection.
  • Transport opposite-medium structures by FORWARD projection: rasterize their own vertices at their refracted screen positions. On an open interface, never trace a water pixel backward to a source screen position, and never gate transported radiance on whether a direction's vanishing point lands on screen. (A bounded pool seen only from air can still use the screen-space offset in $threejs-water-optics; an ocean whose camera changes medium cannot.)
  • Bracket a water-side crossing solve by the critical angle (tan θc ≈ 1.1346 times the ray's own distance from the interface), not by the camera-to-source span.
  • Scale spectral LOD by PIXEL FOOTPRINT — distance² · pixelAngle / heightGap — and apply it to vertex displacement, derivatives, and every band that rides them. Fade each band to its own mean when the band is an albedo or radiance term.
  • Filter the critical-angle domain test over about one output pixel; never filter the interface normal itself to stabilize what is transported through it.
  • Gate the entire optical side from one camera-medium state; do not choose above/below behavior per triangle.
  • Terminate distant underwater sightlines with a safely submerged terrain rim; do not mask an empty seabed/ocean horizon with a view-aligned scattering layer.
  • Keep a deterministic seed and fixed-camera capture for comparisons.

Coastal breaker gates

  • Keep coastline SDF, arclength tables, ribbon geometry, and swash columns in one coast contract; do not derive unstable column ordering from SDF gradients.
  • Hand offshore wave level into the coast-normal conserved-volume chain; a linear spring chain does not uniquely recover a flat free surface.
  • Persist both world-space breaker foam and coast-parameterized film foam.
  • Blend water, wet sand, and dry sand by the actual water column, not a detached shoreline decal.
  • Derive water normals from the same gravity/capillary fields that displace the surface, and derivative-filter sand normal detail at grazing distance.
  • Share sky radiance and sun direction between the visible surround and ocean reflection.
  • Keep the orbit camera above the terrain and use a fixed waterline camera for comparisons.

Route elsewhere

  • Use $threejs-water-optics for bounded water, screen-space refraction, depth thickness, shoreline absorption, and analytic wave surfaces. Its screen-space refraction is valid there because the camera stays in air and the volume is bounded; it is not a substitute for this skill's forward projection across an open interface.
  • Add $threejs-procedural-vfx only when crest spray or interaction splashes are required.
  • Add $threejs-visual-validation for cross-seed, temporal, and GPU evidence.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Threejs Spectral Ocean AI skill do?

Build large procedural oceans and coast transitions in Three.js. Use for WebGPU/TSL FFT oceans, multi-cascade wavelength bands, coastal breakers, finite-volume shallow-water beach waves, signed-distance coastlines, shallow-water swash films, wet-sand transitions, rock-impact spray, stylized above/below surface optics, permanently submerged Snell-window views, total internal reflection, forward-refracted structures through an interface, pixel-footprint spectral LOD, aquatic perspective, caustic god rays, choppy displacement, spectral derivatives, Jacobian whitecaps, windrow and temporal foam...

Why use Threejs Spectral Ocean on TypingMind?

Because you install it once and use it with any model. Threejs Spectral Ocean is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Threejs Spectral Ocean in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/scottstts/Threejs-Awesome-Graphics-Agent-Skills/tree/main/skills/threejs-spectral-ocean. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Threejs Spectral Ocean?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Threejs Spectral Ocean?

As many as you like. As long as a model supports skills, you can use Threejs Spectral Ocean with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Threejs Spectral Ocean AI skill free?

Yes. It is published on GitHub by scottstts under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇