Feature idea: feed a shader with an SVG subtree rendered in the same frame (multi-pass in one video)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- api, computer-graphics
Research direction
The proposal sketches a svgr! subtree passed to a shader via ShaderUniforms::layer, so the API surface and the offscreen rendering path are the places to look. Nothing in the payload names an existing file, so first confirm with the maintainer whether the feature is wanted and where the layer binding should live. Done means an agreed API and a design for the Skia GPU path with a CPU fallback, not a finished patch.
Written by the indexing model from the issue text.
Description
Motivation
I recreated @mnowakdesign's tracking-HUD look (the same one you posted) with a camera that films the screen: perspective tilt, depth of field focused on the tracked glyph, LED grid, bloom, chromatic aberration, per-scene palette, all in one SkSL pass.
The shader needs the flat screen as its input, so today it takes two fframes projects:
flatrenders the terminal + tracker at 3840×2160 to an mp4 (crf 8).lensreads it withget_synced_video_frame(..).into_image()and binds it asiChannel0.
That works (thanks for the video-frames-in-shaders support), but it costs a 4K h264 round trip per frame (disk, decode, compression artefacts under 3× magnification), two binaries, and a shared crate just so both passes agree on the timeline.
Idea
Let a shader take an SVG subtree of the same frame as a child image, rendered offscreen first:
let screen = fframes::svgr!(<g>{terminal}{tracker}</g>);
let layer = self.lens.draw(&frame, ShaderUniforms::new()
.layer("iChannel0", screen, 3840, 2160) // rendered offscreen, bound as `uniform shader`
.float("uZoom", zoom));
fframes::svgr!(<image href={layer.href()} width="1920" height="1080" />)
On Skia this could stay on the GPU: draw the subtree into an offscreen surface and bind its image snapshot as the child shader, with no CPU readback. On the CPU backend it could fall back to rasterizing the subtree. Is this something you'd want in fframes? I can help with the API, an example or tests.
Example (C)
The project is at https://github.com/mrsarac/ff-tracking (MIT): 6 s, 12 scenes, a two-pass render plus a synthesized sound track (~40 s end to end on an M3 Pro). If it's useful, I can contribute a trimmed version as examples/screen-camera, now as a two-pass example or later as the single-pass demo of the feature above. Video: https://x.com/0xsarac/status/2108515856544317489
- Dominant language
- Rust
- Stars
- 3.3k
- Forks
- 118
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 16
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dmtrKovalenko/fframes
-
Frame::second_to_frame truncates f32 product, causing periodic off-by-one framesPossibly taken @ShamanicArts claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dmtrKovalenko/fframes#296 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
dmtrKovalenko/fframes#280 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
dmtrKovalenko/fframes#277 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
dmtrKovalenko/fframes#273 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
dmtrKovalenko/fframes#260 · 1 comment ·
Maintainers usually reply within 1 day
All issues in dmtrKovalenko/fframes
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
autofixer: follow-up triage: bug triage: classified triage: correctness triage: has-reproducer
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
tursodatabase/turso#13221 ·
Maintainers usually reply within 1 day
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Possibly taken @flyingrobots claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flyingrobots/edict#457 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day