Skip to content

Add customizable dark and light colors to Threshold - #162

Merged
git-chad merged 25 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-threshold-colors
Oct 1, 2026
Merged

git-chad merged 25 commits into
git-chad/shader-lab-v3-planfrom
git-chad/v3-threshold-colors

Conversation

@git-chad

Copy link
Copy Markdown
Collaborator

Threshold now exposes Dark Color and Light Color, so designers can replace the fixed black/white output with a two-color palette. Defaults and missing-field fallbacks stay black/white. Softness blends the chosen colors; inversion swaps their region assignments while threshold boundaries and noise stay unchanged.

The editor and runtime recolor inside the existing shader pass using two uniforms. No extra pass, render target or source sample is added. Existing alpha and layer-opacity behavior is preserved. Reference 01 (Lovedance red/blue) was reviewed alongside actual blue/pink and blue/red photo renders.

Validation:

  • bun run check passes with the existing three lint warnings.
  • 44 new editor/runtime GPU cases cover palette mapping, legacy black/white, soft/hard boundaries, noise, inversion, opacity, source alpha and changing decoded video frames.
  • Actual hydration/history, runtime config export, old-project defaults and saved/reopened PNG parity pass.
  • Real browser color controls, undo/redo and downloaded .lab reimport pass (bun tests/composition/threshold-colors-ui.mjs).
  • bun run test:composition passes the complete regression suite. The group hydration fixture now explicitly includes the new black/white defaults; dedicated legacy tests verify missing fields.
  • MCP reference generation unchanged.

Stacks onto #161 (git-chad/v3-cell-paint), ultimately integration #150. No merge into main until V3 is complete. User visual acceptance pending; focused test.

@vercel

vercel Bot commented Sep 17, 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 7:05am UTC

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule violations identified.

Summary

This PR adds customizable dark and light colors to the Threshold effect while retaining legacy black-and-white defaults.

  • Adds matching color uniforms and linear interpolation to the editor and React SDK renderers.
  • Adds editor parameter definitions with backward-compatible defaults.
  • Extends GPU, persistence, runtime parity, video, alpha, and browser UI coverage.
  • Documents the feature, visual validation status, and manual QA workflow.

Reviews (1) · Last reviewed commit: "Add customizable dark and light colors t..."

…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.
@git-chad
git-chad force-pushed the git-chad/v3-cell-paint branch from 164cec7 to 73107b7 Compare October 1, 2026 07:04
@git-chad
git-chad force-pushed the git-chad/v3-threshold-colors branch from 76a920f to 76efc85 Compare October 1, 2026 07:04
@git-chad
git-chad changed the base branch from git-chad/v3-cell-paint to git-chad/shader-lab-v3-plan October 1, 2026 15:12
@git-chad
git-chad merged commit 76efc85 into git-chad/shader-lab-v3-plan Oct 1, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 76efc85b 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