Skip to content

Reimplement Saturation visualizer as a shader pass - #162

Merged
RoboDoig merged 8 commits into
visualizer-refactor-stagingfrom
shader-pass
Aug 27, 2026
Merged

Reimplement Saturation visualizer as a shader pass#162
RoboDoig merged 8 commits into
visualizer-refactor-stagingfrom
shader-pass

Conversation

@RoboDoig

Copy link
Copy Markdown
Collaborator

This PR addresses comments in #139 and aims to remove camera preview visualization latency by replacing the CV saturation preview with a shader pass similar to what was implemented before the refactor.

The shader used is exactly the same but is now done in a new operator SaturationShaderPass that is inserted after StoreImage in the ImGui pipeline. This allows the shader pass to follow the same architecture as the rest of the Bonsai.ImGui operators and removes the need to use a visualizer mapping in construction of the full ImGui visualization.

For now, SaturationShaderPass is responsible only for this particular shader, but the structure here could probably be extended to allow generic 'one-shot' shader passes to be added to images in the ImGui pipeline.

Note that I was not able to test this on a camera with acquisition rate >200Hz. At this rate I did not see any latency but can;t be sure it won't exist for higher frame rates. I did notice that the image rotation (which is done in CV) could sometimes introduce transient delays but could not confirm this was the culprit vs. data throughput on the machine I'm using for testing. We can rethink the rotation approach if this continues to cause issues.

@RoboDoig
RoboDoig requested a review from micahwoodard August 26, 2026 15:33
@RoboDoig RoboDoig mentioned this pull request Aug 26, 2026
@micahwoodard

Copy link
Copy Markdown
Collaborator

@RoboDoig tested on rig and this fixed the latency described in #139

@RoboDoig
RoboDoig merged commit 1f7823b into visualizer-refactor-staging Aug 27, 2026
@RoboDoig
RoboDoig deleted the shader-pass branch August 27, 2026 09:17
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.

2 participants