---
name: threejs-procedural-materials
description: Author production procedural materials in Three.js. Use for simulated paper burning with coupled sheet combustion and pyro fluids, luminescent jellyfish with simulated appendages and layered tissue optics, luminescent butterflies with articulated scale glints and finite wing emitters, hybrid texture-backed PBR soil and moss with procedural displacement and masks, upward-facing model moss accumulation, atlas filtering, specular AA, planet-space fields, terrain wetness, deformable granular sand with mass-coupled grain shading, simulated tearable denim with implicit yarn mechanics, wear-driven failure and frayed fibres, woven cloth with GPU XPBD mechanics and yarn microstructure, simulated fur with interactive grooming and strand shading, lava and emissive surfaces, reflective wave-optical diffraction gratings, air-film-air soap bubbles with Airy interference, raytraced diamond and gem refraction with internal reflection and dispersion, image-space glass transmission with spectral dispersion and volume absorption, deforming softbody jelly materials with XPBD mechanics and refractive caustics, per-instance dissolve, authored PBR identities, derivative normals, and custom direct-light shadow modulation.
title: threejs-procedural-materials
canonical_url: https://skilld.dev/gh/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials
last_updated: 2026-10-23T06:10:44.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.
>
> 141 supporting files sit beside this SKILL.md. When the Skill refers to one, fetch https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/PATH with PATH replaced.
>
> If the user asked to install this Skill, run `npx skilld install scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials`. 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-procedural-materials`, 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-procedural-materials) 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-procedural-materials`. 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-procedural-materials --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/threejs-procedural-materials --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.

# Procedural Materials

Build a material from surface identity and causes. Color, roughness, metalness, normal, transmission, and emission should describe the same surface—not unrelated noise textures.

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.

## Material graph order

```text
stable coordinates
  → structural fields
  → material identity weights
  → causal modifiers
  → filtered microstructure
  → PBR channels
  → lighting/shadow extensions
```

Read [references/procedural-pbr-system.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/procedural-pbr-system.md)
for atlas filtering, specular AA, planetary coordinates,
world-height wetness, per-instance dissolve, and authored PBR response bundles.

Read the
[sculpted gallery frame geometry](../threejs-procedural-geometry/examples/sculpted-gallery-frame/frame-geometry.js)
for walnut, antique-gold, and ebony texture/roughness/metalness/clearcoat
bundles under a grazing-light setup.

Read the
[procedural planet surface](../threejs-procedural-planets/examples/procedural-planet-surface/planet-system.js)
for shared geological, climate, water, biome, roughness, and derivative-normal
causes on a procedural planetary surface.

Read the
[lava flow surface material](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/lava-flow-surface/lava-surface.js)
for raymarched procedural height fields whose normals, rock/lava identity,
emission, glow, embers, fog, and grain are coupled to one material cause stack.

Read the
[raytraced diamond material](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/raytraced-diamond/diamond-material.js)
for a gem whose mesh is its own optical volume: camera-ray entry refraction, a
GPU BVH first-hit loop with bounded total-internal-reflection bounces,
per-channel IOR dispersion, mip-correct environment exit sampling, and live
camera-matrix uniforms.

Read the
[spectral dispersive glass material](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/spectral-dispersive-glass/spectral-glass-material.js)
for a transmissive body solved in image space: a double-sided back-face data
pass with inverted depth, an iterative interior exit search, bounded total
internal reflection, Beer-Lambert absorption over the true path length, and a
per-wavelength Cauchy index recombined through CIE 1931. Its reusable optical
primitives — exact unpolarised Fresnel, Cauchy coefficients, spectral weights,
the rotatable environment probe, and the buffer projection — live in
[glass optics](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/spectral-dispersive-glass/glass-optics.js), and
[references/dielectric-glass-optics.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/dielectric-glass-optics.md)
carries the two-pass contract, buffer format, search bounds, and transmission
diagnostics.

Pick between the two transmissive paths by geometry, not by quality. A closed
faceted gem whose exit facet must be exact even when it faces away from the
camera takes the BVH path. A scanned, assembled, open-sheet, or multi-shell
body takes the image-space path, which tolerates inconsistent winding and
authored normals pointing either way but cannot see a surface outside the
frame.

Read
[references/physical-diffraction-grating.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/physical-diffraction-grating.md)
for the exact embossed-field, CIE/blackbody spectral, phase-grating, Bessel
order-efficiency, coherence-broadening, strip-emitter, additive-layer, stable
object-frame, limitation, and diagnostic contracts.

Read the
[physical diffraction-grating implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/physical-diffraction-grating/physical-diffraction-grating.js)
for a printed substrate plus additive HDR foil response whose star and stripe
masks select local groove angle, pitch, and relief while wavelength alone owns
spectral colour. Its complete optical model is expressed as a pure TSL graph
with `Fn`, `If`, and `Loop`, without embedded native shader source.

Read
[references/thin-film-soap-bubble-system.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/thin-film-soap-bubble-system.md)
for the air-film-air Airy equation, representative RGB spectral bands,
two-membrane blending, bounded secondary reflection, capillary mechanics,
camera-aware inflow, puncture retraction, limits, and diagnostics.

Read the
[thin-film soap bubble system](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/thin-film-soap-bubbles/soap-bubble-system.js)
when soap-film interference must drive the image: it provides wavelength-
dependent aqueous index, front and rear membrane passes, analytic nearby-
bubble reflection, volume-preserving capillary modes, buoyancy and drag,
Taylor-Culick rupture, visible-drop aftermath, and deterministic physics gates.

Read the
[softbody jelly implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/softbody-jelly/softbody-jelly.js)
for a deforming flower-shaped transmissive body whose tetrahedral XPBD state,
smooth optical shell, view-ray thickness, BVH refraction, absorption, receiver
shadow, and finite RGB caustic fields remain coupled.

Read the
[deformable sand implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/deformable-sand/deformable-sand.js)
for a fixed-step granular heightfield whose conservative transport, impact
particles, anisotropic mineral grains, horizon lighting, and optical-depth
shadows share one mass-carrying state.

Read the
[simulated cloth implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/simulated-cloth/simulated-cloth.js)
for an exact plain-weave linen material coupled to a GPU XPBD sheet with yarn
stretch, shear locking, bending, rigid contact, self-collision, and pinching.
The calibrated solver and cloth-map contracts are in
[references/simulated-cloth-system.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/simulated-cloth-system.md).

Read the
[simulated tearable denim implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/simulated-tearable-denim/simulated-tearable-denim.js)
for 3/1 twill, implicit multigrid PCG mechanics, wear-driven yarn failure,
connected grip patches, detached pieces, loose threads and frayed fibres.
Read [references/simulated-tearable-denim.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/simulated-tearable-denim.md)
for its material, solver, topology, filtering and integration contracts.
Choose this example for material loss and yarn failure; choose
`simulated-cloth` for plain-weave XPBD linen without tearing.

Read the
[simulated fur implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/simulated-fur/simulated-fur.js)
for groomed GPU strands, tapered ribbon shading, and an articulated hand whose
capsule contacts comb the strand field. The strand, groom, and interaction
contracts are in
[references/simulated-fur-system.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/simulated-fur-system.md).

Read
[references/softbody-jelly.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/softbody-jelly.md) for the
softbody coordinate contract, neo-Hookean XPBD split, damping and sleep rules,
refractive receiver budget, material constants, limits, and diagnostics.

Read the [simulated paper burning implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/simulated-paper-burning/simulated-paper-burning.js)
for crumpled-sheet mechanics, material-lattice combustion, char fracture,
volumetric flame/smoke and soot-driven receiver illumination. Read
[references/simulated-paper-burning.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/simulated-paper-burning.md)
for its coupled grids, fixed-step order, optical integration and burnout sequence.

Read the [luminescent jellyfish implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/luminescent-jellyfish/luminescent-jellyfish.js)
for bell anatomy, swimming, Verlet appendages, bioluminescent tissue and
depth-ordered underwater transport. Read
[references/luminescent-jellyfish.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/luminescent-jellyfish.md)
for the anatomy, attachment textures, optical layers and integration contracts.

Read the [luminescent butterfly implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/luminescent-butterfly/luminescent-butterfly.js)
for coherent wing masks, scale glints, articulation, perch clearance, finite
wing illumination and lens imaging. Read
[references/luminescent-butterfly.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/luminescent-butterfly.md)
for its wing, emission, lens, integration and swept-geometry contracts.

## Required controls

- real or perceptual texture scale;
- material identity weights;
- roughness range and micro-normal strength;
- the causal fields required by the selected material pattern;
- for a transmissive body, the physical constants that define it — index and
Abbe pair, interior path budget, extinction depth — named rather than buried
inside expressions;
- for a soap film, the exterior and film indices, nanometre thickness range,
  wavelength bands, surface tension, and membrane ordering;
- distance/derivative filtering;
- specular antialiasing;
- channel and mask debug modes.
- emissive-material debug modes when the material owns glow or volumetric
accumulation.

Read [references/hybrid-soil-moss-surface.md](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/references/hybrid-soil-moss-surface.md)
and the
[hybrid soil and moss implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/hybrid-soil-moss-surface/hybrid-soil-moss-surface.js)
for texture-backed soil and moss albedo, AO, roughness, and normal microdetail
combined with procedural mound displacement, moisture, moss coverage/height,
and warped cellular cracks. Do not describe its surface identity as fully
procedurally synthesized. When moss must also settle onto a model, read the
[model moss implementation](https://skilld.dev/api/skills-raw/scottstts/threejs-awesome-graphics-agent-skills/threejs-procedural-materials/examples/hybrid-soil-moss-surface/model-moss-accumulation.js)
for model-locked coverage, upward-face accumulation, displaced thickness, and
shared moss PBR identity.

## Failure conditions

- every PBR channel samples independent noise;
- roughness is a scalar afterthought;
- high-frequency normals survive below one pixel;
- triplanar projection has visible orientation or scale seams;
- atlas padding is ignored under mipmapping;
- custom lighting removes energy conservation without an explicit stylized goal;
- post-processing is used to hide unstable highlights.
- diffraction hue is painted from UV instead of derived from wavelength;
- a groove frame follows the camera or world axes instead of the object;
- a narrowed diffraction lobe loses energy because its density lacks sigma normalization.
- a soap bubble is treated as a solid glass sphere or painted with a rainbow instead of using air-film-air interference;
- a deformed soap membrane retains the undeformed sphere normal;
- a deforming transmissive body updates its render shell, optical BVH, and receiver field from different states;
- a finite caustic receiver lets non-zero data reach its clamped texture edge;
- a softbody solver uses variable integration steps or an uncoupled rest-stress split that injects energy after damping;
- granular displacement, airborne grains, settled-bed shading, and shadow fields advance from different simulation clocks;
- sand grain sparkle is an unfiltered high-frequency lookup that aliases under grazing motion;

## Routing boundary

Use `$threejs-procedural-vfx` for free-standing voxel fire and smoke; choose
`simulated-paper-burning` here when sheet combustion, char failure and fluid
emission must remain coupled. Use `$threejs-water-optics` for an air-side
luminescent river; `luminescent-jellyfish` owns submerged animal tissue and
its surrounding transport.

Use `$threejs-procedural-fields` when the main problem is designing shared
scalar/vector causes. Use `$threejs-procedural-planets` for a complete
orbit-to-close-approach body, not merely its material. Use
`$threejs-parallax-occlusion-mapping` when a height field must own ray-marched
intersection, silhouette coverage, or relief-aware shadows. Use
`$threejs-temporal-surfaces` for view-aligned wet-glass optics and screen-space
history; this skill owns the optical path through a transmissive body itself.
