Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Milestone history lives in git tags and `docs/superpowers/plans/`. Don't trust a

## Project shape (30-second version)

- **Three-tier model.** Tier 1 is the polished components such as `<LinearGradient>`, which live under `packages/shaders/src/components/` and are imported from the package root. Tier 2 is the TSL primitives in the same package, such as `fractalNoise` and `voronoi`. Tier 3 is recipes: TSL snippets in the docs site.
- **Two-tier model.** Tier 1 is the polished components such as `<LinearGradient>`, which live under `packages/shaders/src/components/` and are imported from the package root. Tier 2 is the TSL primitives in the same package, such as `fractalNoise` and `voronoi`. They are exported because the editor's eject-to-code imports them by name, but they have no doc pages (SHA-136).
- **Two packages.** `@camp-dev/shaders` is everything users import: the Tier 1 components, the React binding (`ShaderScene`, `useShaderMaterial`, and the hooks), and the framework-free engine (primitives, renderer, scheduler, inputs). `@camp-dev/shaders-cli` has one command, `poster`. Inside the package, `src/engine.ts` is the framework-free barrel. `src/react/` and `src/components/` import it rather than the root index, so dependencies run root to components to react to engine and never back. A `no-restricted-imports` block in the root `eslint.config.js`, scoped to `src/{primitives,runtime,inputs}/**` and `src/color.ts`, rejects React and anything under `src/react` or `src/components`. That rule is what keeps the engine extractable if a second framework binding ever becomes real. Two apps sit alongside the packages: `@shaders/docs` is the docs site, and `@shaders/editor` is the node editor from MAT-94. The editor is a React Flow canvas over the same Tier 2 primitives, with an eject-to-code emitter. A permanent parity gate pixel-compares that emitter's output against the live compiler.
- **The editor app is layered by dependency direction**, not by file type. `src/editor/graph/` is the framework-free core, holding the node registry, graph model, param store, live TSL compiler, and code emitter. `src/editor/preset/` handles save, load, undo, and copy-paste, and is also React-free. `src/editor/state/` is the React Flow glue. `canvas/`, `params/`, and `panels/` are UI. Dependencies point one way, toward `graph/`. Siblings import each other as `./x` and everything else as `@/editor/<folder>/<file>`. `vitest.config.ts` has to declare that `@` alias itself, because Vitest doesn't read tsconfig `paths`.
- **Two rendering modes**, with no auto-detection of `@react-three/fiber`. In Mode 1 every Tier 1 component is bare and requires an explicit `<ShaderScene>` wrap, and you compose by stacking children in one scene. In Mode 2 you call `useShaderMaterial` inside your own r3f `<Canvas>`.
Expand Down
1 change: 0 additions & 1 deletion apps/docs-tests/a11y/component-pages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const routes = [
'/components/vignette',
'/components/voronoi',
'/components/wave-lines',
'/recipes',
];

for (const route of routes) {
Expand Down
1 change: 0 additions & 1 deletion apps/docs/content/docs/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ This page is a placeholder. Curated examples — hero sections, section backgrou
In the meantime:

- The [component pages](/components) each include a live demo, a props playground, and the usage snippet to paste into your app.
- The [primitives pages](/primitives) show the lower-level TSL building blocks. If you want to write your own shader, start there.
- The [Shared scenes guide](/guides/shared-scenes) shows how to combine multiple Shaders components inside one `<ShaderScene>`.

If you build something with Shaders, [open a PR on GitHub](https://github.com/campdotdev/shaders) — selected examples will land on this page.
2 changes: 1 addition & 1 deletion apps/docs/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Requirements:

- React 19
- Three.js `^0.170`
- Next.js 15+ if you're using one (Shaders doesn't require Next, but the docs and recipes assume it)
- Next.js 15+ if you're using one (Shaders doesn't require Next, but the docs assume it)

## Render a component

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/reference/shaders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This page lists the engine half of `@camp-dev/shaders`: the TSL primitives, the

## Tier 2 primitives

TSL building blocks for writing shader expressions. Each primitive is documented individually under [/primitives](/primitives) with a live demo and parameter sliders.
TSL building blocks for writing shader expressions, all exported from the package root.

- `colorRamp(t, stops)` — multi-stop color gradient sampled at `t` ∈ [0, 1].
- `simplexNoise(uv, opts?)` — single-octave 2D value noise.
Expand Down
46 changes: 0 additions & 46 deletions apps/docs/src/app/primitives/[slug]/page.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/docs/src/app/primitives/layout.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions apps/docs/src/app/primitives/page.tsx

This file was deleted.

109 changes: 0 additions & 109 deletions apps/docs/src/app/recipes/[slug]/page.tsx

This file was deleted.

Loading
Loading