Repository navigation
feat(effects): the recording's surface in the effect contract - #1213
Closed
EtienneLescot wants to merge 1 commit into
Closed
EtienneLescot wants to merge 1 commit into
EtienneLescot wants to merge 1 commit into
Conversation
fx_to_footage and fx_from_footage map between output uv and the recording's own plane through the warp the compositor draws it with: bilinear under a fixed angle, the corners' homography under the real 3D camera. ctx.footage_aspect gives round distances on that plane. The effect picks its space; the contract does not decide for it.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6 tasks done
Collaborator
Author
EtienneLescot
added a commit
that referenced
this pull request
Oct 14, 2026
Same two lines as the Windows and Linux passes (#1213): the footage quad and its aspect, so fx_to_footage works under Metal too.
EtienneLescot
added a commit
that referenced
this pull request
Oct 14, 2026
… the footage plane Two things from the review of integration/shader-effects (#1213 and the review fix) that the Metal pass did not have yet. - The compiled-effect cache never evicts an effect the current scene shows (shader_fx::eviction_victim), as on Windows and Linux: set_scene installs the scene before it starts the compiles. - The Windows GPU test of fx_to_footage and fx_from_footage, ported to the Metal device: the footage plane maps back to what the compositor drew, flat, under a fixed angle (bilinear) and under the real camera (homography). It also checks their MSL translation.
EtienneLescot
added a commit
that referenced
this pull request
Oct 14, 2026
Same two lines as the Windows and Linux passes (#1213): the footage quad and its aspect, so fx_to_footage works under Metal too.
EtienneLescot
added a commit
that referenced
this pull request
Oct 14, 2026
… the footage plane Two things from the review of integration/shader-effects (#1213 and the review fix) that the Metal pass did not have yet. - The compiled-effect cache never evicts an effect the current scene shows (shader_fx::eviction_victim), as on Windows and Linux: set_scene installs the scene before it starts the compiles. - The Windows GPU test of fx_to_footage and fx_from_footage, ported to the Metal device: the footage plane maps back to what the compositor drew, flat, under a fixed angle (bilinear) and under the real camera (homography). It also checks their MSL translation.
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.
Summary
An effect can now work on the recording's own surface, not only in output uv. Under the 3D camera, a wave computed in output uv draws circles on the picture while the recording is tilted under it. The context only gave the recording's bounding box, so no effect could follow the plane.
What the contract gains
fx_to_footage(uv): the point of the recording's surface under a pixel, (0,0) at its top-left and (1,1) at its bottom-right, extended past its edges. Far outside 0..1 where no point of the surface lands.fx_from_footage(p): the way back, to sampleframe().ctx.footage_aspect: the recording's width over height, for round distances on it.ctx.footage_cornersandctx.footage_warp, which the two functions read.Same warp as the drawing. The functions are the WGSL mirror of
quad_inverse/quad_forwardinshaders.hlsl: bilinear under a fixed angle, the corners' homography under the real camera. The corners come fromFrameGeometry::footage_quad, already shared by the backends.Agnostic. The contract offers the two spaces and decides nothing. The resource, the tool description and the spec say what each space is; the effect picks. The ripple example of the MCP resource now uses the surface, as an example of use.
The fields are appended to
FxContext(192 bytes), so contract 1 keeps its meaning.For #1206 (macOS). Its
FxFrameInputsneeds the same two lines as Windows and Linux:footage: g.footage_quad(..)andfootage_aspect: g.footage_aspect(..).Related issue
None.
Type of change
Release impact
Desktop impact
Screenshots / video
A water drop computed on the surface, under the orbit camera, exported through
openscreen mcp. The video is in the session, not attached here.Testing
the_footage_plane_maps_back_to_what_the_compositor_drew: flat, fixedleftangle (bilinear) andorbit(homography), at 1080p. It is checked against two mutants: one that breaks the bilinear inverse and one that forces bilinear under the camera. Both fail it.cargo test -p openscreen-compositor --lib -- shader_fx footage_plane: 21 passed.npx vitest --run electron/mcp/effects-contract.test.ts electron/ai-edition: 438 passed.npx tsc --noEmit, Biome on the touched files.🤖 Generated with Claude Code