Repository navigation
cluster-render: an optional edge for a host's picture - #227
Merged
Merged
Conversation
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>
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.
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 (withhosted_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"):
hosttakes 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 distancedfrom the rect) andedge_blur(sigma of the blur along the row).hostfields are.host_edge 1, so a client sendsedge_*only to a service that draws them (an older service ignores unknown fields anyway).Renderer:
Clients: both the C++ and the Node client send the five fields, and only when
edge_toporedge_bottomis set. The Node client keeps the hello's flag ashostEdge.Tests
make test: 1674 checks pass (1667 on main).hostagain without the fields removes the edge.edge_toporedge_bottom; a refusal is reported.🤖 Generated with Claude Code