sdf-glass
Skill3 starsChanged 30 days agoMITView on GitHub
Make or change Glass (glass/): a solid of clear glass that follows the reader's pointer over a page of words or a Garden drawing, refracting it, and melts from one shape into the next (ring, tetrahedron, octahedron, sphere, rounded cube, capsule), raymarched as signed distance fields in one WebGL2 shader; the pages under it melt into one another as 2D distance fields. Use for a new shape, a glass that reads as plastic or as a flat lens, refraction that tears or swims, a shadow that floats, new words or drawings under the glass, a melt between pages, colours by day or night, or a stage that drops frames, even if the user never says "skill".
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- assemblySkill
- climate-gardenSkill
- glyph-rainSkill
- layered-svgSkill
- monoline-geometricSkill
The file
Files
SDF glass
A solid of glass held over the page. glass/notes.md maps the modules and holds the rules a change must
keep; read it first.
The bar
- It is glass, not a filter. Light enters, bends, crosses the solid and bends again on the way out (index about 1.45): what lies behind is magnified, turned over and softened where the glass is thick. Edges go dark where the light inside cannot get out; the faces catch a soft window of light. No colour of its own, no dispersion: grey glass over paper and ink.
- Shapes melt, and so do pages. One shape becomes the next by easing between their distance fields, swelling a little rounder as it goes; one page becomes the next the same way in two dimensions, words pooling into a drawing and a drawing into words. Never a cross-fade of two pictures.
- It sits on the page. It floats past a sphere's focus, so a sphere shows the words turned over and whole. Its shadow falls down and to the right, soft at the rim and lighter at the core where the glass gathers light, and is never cut by the stage's edge.
- The light is the site's; the colours are Glass's own. Day or night is the reader's choice on delineate's page, kept under its key. Each light has a few quiet pairs of paper and ink, and each turn of the light eases into that light's next pair: the first by day is the site's own paper, and by night the paper is dim, its hue just there, the ink a soft light. The page around the stage wears what the stage does, frame by frame.
- Smooth under the hand. It follows the pointer at the screen's own rate, the raymarching done only near the solid and its shadow, and sleeps out of view.
The task
- A shape: a distance function in
shader.ts, about one unit across, added toSHAPESin the order it melts; keep it within the bound the shader marches. - The glass's feel: the index, absorption, blur and room in
shader.ts; the height, follow, spin and timing inshow.ts. Moving the light means movingFALLwith it. - What lies behind: the lines in
WORDSand the Garden drawings inPICTURES(pages.ts), shown in turn. A drawing needs an outline that reads as a silhouette at a glance;build.tscopies each beside the page.source.tsdraws a page's mask,field.tsmeasures it in a worker, and the shader lays paper and ink on the field. - A pair of colours:
palette.ts, in the light it belongs to. Judge it alone with?tones=<name>, and by night look that the glass still catches light at its edges and its shadow still reads.
Done means
npm run check passes, and on npm run glass (http://localhost:5370/): every shape read alone with
?shape= looks like cut glass, each change melts, the words stay crisp outside the glass and soften only
within it, by day and by night in every pair, over the words and over ?picture; a turn of the light
eases with no seam between the stage and the page around it; words melt into each drawing and back, and
no frame is dropped while the next page is measured; pushed into a corner, the shadow stays
whole. Measure in the browser: every frame the display offers kept while the glass moves. Then tell the user what to look at.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

