Skip to content

V3: Glass layer (reeded, hammered, pyramid, hex, frosted) - #183

Merged
git-chad merged 98 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-glass
Oct 1, 2026
Merged

git-chad merged 98 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-glass

Conversation

@git-chad

Copy link
Copy Markdown
Collaborator

Stacked on #182. Part of the V3 stack (parent #150); nothing merges to main until the plan is complete.

Why

The user called Fluted Glass "terrible" and shared real textured-glass photos as the target (references 26 to 30).

What

A new Glass layer (Distort) replaces Fluted Glass in the add-layer menu. Fluted Glass stays registered for saved projects.

  • Pattern: Reeded (Round or Sharp profile), Hammered (with Irregularity), Pyramid, Hex, or Frosted. Controls: Cell Size, Angle.
  • Every cell is a lens. Refraction runs from magnification through focus to a flipped mini image, like real glass.
  • Behind the Glass: Distance blurs the scene through the shared blur pyramid, either uniformly or from the depth map, so things touching the glass stay sharp (the fern in reference 29).
  • Surface: thin rims lit on the side facing the light, pixel-width grooves, Frost (slope noise plus a subtle crinkle), Dispersion, Tint.
  • Styles: Reeded (default), Frosted Reeded, Hammered, Pyramid, Hex, Frosted.
  • It runs in the transform role.

The pyramid moved into renderer/blur-pyramid.ts, shared by Blur and Glass. Blur's 83 checks pass unchanged.

Review

The first render looked like plastic: shaded cylinders, glittery frost, bubble-wrap cells. Reducing the surface to thin rims and grooves, making hammered cells shallow facets, and softening the frost brought it close to references 26 to 30. A depth study keeps near forms sharp and sliced while far forms melt behind the flutes.

Tests

bun run check passes, and the full bun run test:composition suite passes. glass.mjs adds 97 checks:

  • Every pattern with everything off is the identity.
  • Round flutes flip a ramp inside each flute; sharp prisms split it.
  • Distance blurs; Depth keeps near things sharp and far things soft.
  • Edges darken the grooves, and highlights light the rims.
  • Hammered, pyramid and hex cells refract.
  • Dispersion, frost and tint.
  • Editor/runtime parity, history, duplication, save/reopen, shader export and runtime pixel parity.

If Glass reports a failure, the test runner now fails after writing its renders.

Manual check: tests/composition/GLASS-MANUAL-QA.md.

Open

  • The user's visual acceptance and tuning (Reeded refraction may want to be stronger for the fern's offset slices).
  • No real thickness, caustics or reflections.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
shader-lab Ready Ready Preview Oct 1, 2026 2:04pm UTC

@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The PR should not merge until Glass dispersion preserves coverage correctly for transparent and cutout inputs; the zero-blur pyramid cost is a secondary optimization.

Summary

This PR introduces the Glass transform layer across the editor and runtime, adds reeded, hammered, pyramid, hex, and frosted rendering, extracts the shared blur pyramid, and adds composition and manual QA coverage.

  • Registers Glass in layer creation, persistence, rendering, export, and package runtime paths.
  • Adds styles and controls for refraction, depth-dependent blur, surface lighting, dispersion, frost, and tint.
  • Preserves the existing Blur implementation through the shared pyramid abstraction.

Reviews (1) · Last reviewed commit: "Add a Glass layer on a shared blur pyram..."

Comment thread src/renderer/glass-pass.ts Outdated
Comment thread src/renderer/glass-pass.ts Outdated
…roup failures

Media load callbacks now ignore replaced or removed passes and pending loads are cleared on disposal. Strict-mode pass failures are reported once at the originating pass instead of at every group boundary.
Publishing now drops every descendant of a hidden group and clears the
parentId of any retained layer (the audio source) whose parent was removed,
so the published scene passes hierarchy validation on reopen.
Cap the neighbor row and column search to two cells each side so the
worst-case cellAt count per fragment is 25 instead of unbounded in the
packed minimum-size, maximum-stroke configuration. Mirrored in the
runtime package.
…e on buttons

Clear the active paint layer when the layer stops being paintable (selection,
mode, visibility or lock change) so Paint never resumes without Edit Paint.
Only preventDefault on Space for non-interactive targets so focused buttons
and links still activate.
…fect

Add DotGridPass to the editor and SDK inner-effect factories and to the SDK inner-effect allowlist.
Seed is now part of ErosionStyleValues, so changing it flips the style to Custom and applying a style restores its seed.
…note

Relief now outputs the sampled source alpha (editor and runtime) instead of forcing 1. The preset note is deduplicated and states that Height From and Amount are not part of a style.
Divide the ray and core light by its coverage before blending with the
source so glow over transparent or translucent pixels is not darkened by
being treated as premultiplied. Applied to the runtime mirror too.
…ansforms

Allow shared hard edges for polygons when rotation step and jitter are zero.
Derive extended outlines from the outermost band's offset and rotation via a
shared bandLocal helper, in both the app and runtime copies.
… duplicate test

- Extend the gaussian pyramid to 10 levels so radii up to 400 document pixels keep increasing (app and SDK copies)
- Add a oneOf visibility condition and gate Focus, Focus Range and Center to the modes that read them
- Make the duplicate independence test change a real parameter
Add Mask Feather parameter definition for brush masks so the timeline shows the user-facing label. Update the manual QA Limits paragraph to match the Feather and keyframe contract.
Derive output alpha from the red, green and blue samples so displaced
fringes survive at transparent edges. Skip the blur pyramid when distance
and frost are both zero, in the app and runtime copies.
@git-chad
git-chad force-pushed the git-chad/v3-brush-feather branch from 2a3f6b0 to bf01183 Compare October 1, 2026 14:03
@git-chad
git-chad changed the base branch from git-chad/v3-brush-feather to git-chad/shader-lab-v3-plan October 1, 2026 15:14
@git-chad
git-chad merged commit 9b10887 into git-chad/shader-lab-v3-plan Oct 1, 2026
4 of 5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 9b108871 Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant