feat: parametric shadows (coverage-contour, pixel style, point lights, animated, React/Vue)#72
Merged
Merged
Conversation
…-driven corrections
…tte + progressive)
…e override builder
…xel) in gallery + builder
…ing effect deps + preview path)
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parametric shadows
A lightweight, opt-in shadow path (
shadow.parametric) that replaces a caster's per-polygon/silhouette projection with low-resolution coverage-contour loops — far fewer DOM/SVG vertices, cheaper projection. The exact path stays the default and is unchanged.Quality (rubric-driven)
The approximation is governed by named, measurable rubrics (
bench/shadow-rubric.mjs, parametric-vs-exact pixel diff). Correction terms:fill-rule: nonzero)Features
shadow.definition— detail knob (silhouette points / pixel-grid resolution); per-mesh override viaPolyMeshTransform.shadowDefinition(vanilla),<PolyMesh shadowDefinition>(React),shadow-definition(Vue).shadow.style: "vector" | "pixel"— smooth contour or greedy-meshed voxel blocks (holes free as absent cells).shadow.dragDefinition(vanilla) — progressive refinement: low def during a light drag, debounced full-def refine at rest (laggless; ~100fps on the castle vs 36fps full).shadow.followAnimation(all three) — shadows track a deforming/animated mesh; frozen by default (re-emitting per frame is expensive), opt-in, throttled.Cross-package
The override builder (
buildParametricCasterOverride+isFlatCaster/isConvexCaster) lives in core, so vanilla / React / Vue produce byte-identical loops. Only intentional asymmetry: progressivedragDefinitionis a vanilla scene-orchestration concern (React/Vue do it idiomatically via app state).Website
Gallery + Builder expose Parametric / Shadow def. / Pixel / Animate-shadow controls in the Lighting panel. Gallery defaults to parametric (def 35, vector) with animated shadows on.
Tooling
bench/shadow-rubric.mjs(rubric scorer),bench/shadow-diff.mjs(parametric-vs-exact),bench/shadow-trace.html+ chrome-trace (perf).All tests +
pnpm build+pnpm build:websitegreen; 14/14 rubrics.