Skip to content

cluster-render: an optional edge for a host's picture - #227

Merged
IterioDev merged 3 commits into
mainfrom
cluster-render-host-edge
Nov 19, 2026
Merged

IterioDev merged 3 commits into
mainfrom
cluster-render-host-edge

Conversation

@IterioDev

Copy link
Copy Markdown
Collaborator

Why

A scene that hosts another target (host, #173) may show the hosted picture inside a shape that is taller than the picture's rect. That happens when the picture is scaled down to fit the shape's width only (with hosted_vpp_scale, a crop that keeps more of the map): the shape then has empty bands above and below the picture. The scene cannot fill them, because it never sees the hosted picture's pixels; the producer draws it as its own layer under the scene.

This PR adds a generic, opt-in edge for a host: the service extends the hosted picture's own top and bottom rows past its rect, blurred and darkened, so the shape looks filled without any extra decode or upload.

Design

Protocol (PROTOCOL.md "Hosting another target"):

  • host takes five new optional fields: edge_top, edge_bottom (px drawn above / below the rect, held inside the scene's target), edge_fade (px over which the picture's own rows fade into the edge), edge_dim (darkening: max(1/4, 1 - d / edge_dim) with the distance d from the rect) and edge_blur (sigma of the blur along the row).
  • Without the fields nothing changes; the renderer traces exactly as before.
  • Out-of-range values are refused, as other host fields are.
  • The hello says host_edge 1, so a client sends edge_* only to a service that draws them (an older service ignores unknown fields anyway).
  • The status names a host's edge.

Renderer:

  • Two quads per edge kind over the hosted video (its order + 2). They sample what the video's atlas or packed quad samples: the rows 2 px in from the top and the bottom, stretched over the edge, nine taps along the row.
  • They are shown, ordered and faded with the video, so a host hiding or moving the picture takes the edge with it.
  • The two effects are compiled at the first edge asked for. If compiling fails, the host is refused and no edge is drawn.

Clients: both the C++ and the Node client send the five fields, and only when edge_top or edge_bottom is set. The Node client keeps the hello's flag as hostEdge.

Tests

  • make test: 1674 checks pass (1667 on main).
  • service_test: an edge gives two quads over the producer's video with the expected rects and uniforms, held inside the panel; out-of-range values are refused; sending host again without the fields removes the edge.
  • client_test.js: the five fields are sent only with edge_top or edge_bottom; a refusal is reported.
  • The new shaders pass glslangValidator.
  • Not run here: the check against the head unit's own RAMSES library (needs Docker). Not yet tried on a car.

🤖 Generated with Claude Code

IterioDev and others added 3 commits November 19, 2026 16:42
A scene that hosts another target may show it in a shape taller than the
picture's rect (a picture scaled to the shape's width only). host now takes
edge_top, edge_bottom, edge_fade, edge_dim and edge_blur: the service draws
the rows 2 px in from the top and the bottom of each video another client
draws inside the host's rect on past it (held within the target), blurred
along the row (nine taps, sigma edge_blur), darkened with the distance to
max(1/4, 1 - d / edge_dim), the picture's own rows fading into them over
edge_fade px. Two quads a kind over the video (its order + 2), sampling
what its atlas or packed quad samples, shown, ordered and faded with it.
The two effects are compiled at the first edge asked for; refused, no edge
is drawn. Without the fields nothing changes (the renderer traces as
before). The status names a host's edge. Both clients send the fields.

Tests: service_test (an edge: two quads over the producer's video, their
rects and uniforms, held within the panel; out of range refused; none
again without it), client_test.js (the five fields sent only with
edge_top or edge_bottom; a refusal).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
host_edge 1 in the hello, as always_packed: a client sends edge_* only to a
service that draws them (an older one ignores the fields). The Node client
keeps it as hostEdge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@IterioDev
IterioDev merged commit f153f4c into main Nov 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant