Repository navigation
Conversation
Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Leaves later captures drawn on the wrapper canvas. vfx.capture() uses it for hide: false. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
createCapture() builds the VFXCapture handle: a stable texture, the per-frame rect, update() and dispose(). Not wired into VFX yet. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Adds the hic and snapshot drivers to createCapture(), and resize() for snapshots that go stale on a window resize. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Captures an element as a shared EffectTexture without drawing it. A texture from another VFX instance now throws when it is drawn. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
A texture such as capture.texture reaches effects through ctx.uniforms. The shader path ignores it with one warning. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Minimap (hide: false, rect), HiddenSource (hide: true, post effect) and Sources (image, video, canvas). Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
… the still copy is gone - A snapshot update() during one in flight queues one more, so later DOM changes are captured. - With hide: false, capture() waits one frame so the still copy with duplicate ids is removed before it resolves. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
Skill, html-in-canvas notes, the custom effects page, doc comments and a changeset. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
The stories no longer turn scroll padding off, and the skill shows the rect math instead of calling it a limit. Refs #266 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
|
🚀 Cloudflare Pages preview — fb41f9e This branch URL stays the same across pushes. Latest deploy: https://1a37c417.vfx-js.pages.dev |
- Checked texture uniforms once in Program.uploadUniforms instead of at 9 call sites; removed shader-uniform.ts - Shared one premultiplied texture helper for captures and live textures; dropped setters for default wrap/filter - Let the player dispose captures on destroy; VFX now tracks captured elements in a Set Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Shader path: a null uniform passes through again instead of throwing and stopping the render loop (regression from the texture filter). - capture() rejects an HTML element with 0 width or height, which would never paint, and a video that fails to load. - vfx.destroy() aborts a pending capture and restores the element. - hide applies only once the first capture is in. - add and capture exclude each other on one element when both would set its opacity. - texture.update() reports failures instead of leaving an unhandled rejection. - Snapshot rect size matches the captured (ceiled) size. Refs #266 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HvSd5aqZjujqpkwJtpxSVf
This branch has not been deployed
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.
Closes #266.
Summary
vfx.capture(el, opts)captures an element as a texture without drawing it, so any effect of the same VFX instance can read it.The spec and the plan are in
docs/tasks/capture/.What it does
<img>(uploaded once),<video>and<canvas>(every frame), and any HTML: html-in-canvas when supported, or one DOM snapshot as fallback.hide.false(default) keeps the element visible; with html-in-canvas the wrapper canvas keeps showing the latest capture.truehides it; it keeps its layout and stays interactive.texture. A stableEffectTexture, premultiplied likectx.src. Afterdispose()it samples as transparent and warns once.rect. Viewport CSS px.x/yare measured once per rendered frame;width/heightare the size when the current texture was captured, so the texture is not stretched for a frame after a resize.uniforms.VFXUniformValuegainsEffectTexture, socapture.texturereaches effects throughctx.uniforms.Rules
capture()rejects for an element thataddHTMLor a transition wraps (or is wrapping), andaddHTMLrejects for a captured element.shader, a texture uniform is ignored with one warning. Shader-path support waits for Shader path: make element shaders premultiplied alpha #271.uniforms, since those are fixed in theVFXconstructor. Set the capture on the effect afterawait vfx.capture().capture()resolves to a handle that leaves the element alone and samples as transparent.Differences from the issue
rectis not a pure "rect at capture time": a viewport rect goes stale on scroll, and scrolling does not re-capture. Position follows the frame, size follows the texture.uniformsacceptscapture.textureonly, not theVFXCaptureobject.capture()of the same element rejects instead of returning the same handle, so no ref counting is needed.Changes
capture.ts(new): one driver per source kind, the handle, and the per-frame tick. Dependencies are injected, so it is tested without WebGL.html-in-canvas.ts:keepDrawnonsetupCapture, forhide: false.vfx-player.ts/vfx.ts:addCapture,VFX.capture, tick inrender(), re-snapshot on window resize, conflict checks, cleanup indestroy().effect-host.ts: the cross-instance check.gl/program.ts:uploadUniformsskips texture handles on the shader path, with one warning.Capture/Minimap,Capture/HiddenSource,Capture/Sources.docs/html-in-canvas.md, the custom effects page, doc comments, changeset.Testing
pnpm run build,pnpm run lint,pnpm testandpnpm --filter docs testpass (core: 516 tests).dispose()restores the DOM.hide: false, a resize shows no blank frame and the still copy is gone whencapture()resolves.ResizeObserver,paint, so effects see a re-capture from the next frame.Not covered
content="drawable") was not available for the browser checks.VFXPlayerwiring (tick, resize, destroy order) has no unit tests; it is covered by the browser checks only.