mcpbeat Sign in

Threejs Spectral Ocean Agent Skill

Build large procedural oceans in Three.js from directional wave spectra. Use for WebGPU/TSL FFT oceans, multi-cascade wavelength bands, hybrid FFT plus Gerstner clear-water oceans, 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.

120k tokens
context cost
the whole folder, loaded on every use
35
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
527
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/scottstts/Threejs-Awesome-Graphics-Agent-Skills --skill threejs-spectral-ocean

The instruction itself

4 sections, as written by the author

Spectral Ocean

Treat an ocean as a sampled stochastic wave field with explicit frequency-space ownership. Do not approximate this target with a pile of Gerstner waves, scrolling normal maps, or unrelated foam noise.

Build order

  • Define the sea-state spectrum and deterministic Gaussian seed.
  • Partition wavelengths into disjoint cascades.
  • Validate the inverse FFT independently with analytic inputs.
  • Generate and conjugate-pack the initial spectrum.
  • Evolve packed displacement and derivative fields in frequency space.
  • Inverse-transform every packed field with explicit inter-step barriers.
  • Assemble displacement, derivatives, and persistent Jacobian foam maps.
  • Shade from summed cascade displacement and derivatives.
  • 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 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

hybrid clear-water ocean material

when the target needs FFT displacement with authored long swell, clear shallow

refraction, animated sand-bed caustics, Beer-Lambert color, shared sky

reflection, side-aware above/below surface normals, GGX sun highlights, and

foam diagnostics.

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.

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.

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.

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take scottstts/threejs-spectral-ocean from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.