You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature idea: feed a shader with an SVG subtree rendered in the same frame (multi-pass in one video) #210
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:
flat renders the terminal + tracker at 3840×2160 to an mp4 (crf 8).
lens reads it with get_synced_video_frame(..).into_image() and binds it as iChannel0.
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.
Activity