-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Adding overlay support for Strobe and Blink Effects #5508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heartbeat overlay is blending with the wrong source buffer.
Line 4139 blends against
SEGMENT.getPixelColor(i), which is this segment’s own buffer, not the already-rendered lower layer the PR is trying to stack over. That means the overlay path will blend with stale/self pixels instead of the effect underneath. This file already shows the distinction inmode_copy_segment(), where global-frame reads usestrip.getPixelColor...and segment-buffer reads usegetPixelColor....Based on learnings: post-commit ee9ac94 the rendering pipeline uses per-segment buffers and per-pixel bus updates.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The effect uses SEGMENT.getPixelColor(i) which is the correct way to retrieve the last pixel(i) painted by the effect.
It is indeed unclear what is the intention here - "blending" with a lower layer pixel, or just to merge a background color into the pixel being painted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@softhack007Thanks — agreed that SEGMENT.getPixelColor(i) is the segment’s current-frame buffer, so it’s correct if the goal is “merge into this segment’s background.”Because the PR description says “allow these effects to be layered on top of other effects,” we should pick one of these two exact behaviors for Heartbeat’s Overlay path (Line 4139):
A) True overlay over lower layers (preferred for stacking semantics)
B) Tint what’s already “underneath” (visual mix with the layer below)
Given the rest of this PR generally avoids clearing the background in overlay mode (instead of sampling), I lean toward option A for consistency and to avoid the last-frame read. If you prefer the “tint underlay” effect, I’ll switch to option B and note the 1‑frame lag in the commit message.
Which behavior would you like for Heartbeat’s Overlay?
🧠 Learnings used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai you seem to use wrong assumptions, let me correct a few things:
See also #5508 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@softhack007Thanks for the clarifications — I stand corrected.Concretely for Heartbeat, a minimal overlay path that respects this looks like:
Why this aligns with your guidance:
If you prefer keeping last-frame self-pixel decay instead of explicit BLACK on the “off” phase, we can switch the off branch to “do nothing” — I chose BLACK to avoid ghosting and keep frame-to-frame state deterministic.
I can update Heartbeat accordingly if that approach works for you.
✏️ Learnings added
🧠 Learnings used
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mic159 as you are the contributor:
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.