Skip to content
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

feat: ✨ Add chroma key support; make passthrough settings real time #2662

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zmerp
Copy link
Member

@zmerp zmerp commented Jan 25, 2025

No description provided.

@zmerp zmerp requested a review from shinyquagsire23 January 25, 2025 17:40
@zmerp zmerp marked this pull request as draft January 25, 2025 17:44
@shinyquagsire23
Copy link
Contributor

shinyquagsire23 commented Jan 25, 2025

So, looking at the settings I've already got a few critiques:

  • Default HSV should be #107C10 imo (120deg, 0.871 saturation, 0.486 value), having the green be more dull gives the thresholds more head/foot room to measure distances from, whereas neon green is at the top of the HSV cylinder and can only go downward (and that's also what I use with this SteamVR environment, which I'd highly recommend testing against bc it also gives you a nice way to test semiopacity on the dash).
    • Yes I know most flight simulators and VRChat environments use neon keyed stuff, and they're wrong and they should feel bad about it
  • For visionOS what I found works well is having a plain distance min/max threshold instead of per-component distances, especially for semitransparency, with defaults set at [0.35, 0.7] min/max for good-ish semitransparency on that environment. That way the desaturated grays on semitransparency get as much treatment as AA edges and other greens. Though I think technically my hue distances might be borked since 0.0 hue should be 0.0 distance from 1.0 hue, but idk.
    • Ex: If the distance between a pixel and the chroma color is 0.35 or lower, the alpha should be 0.0, if the distance is 0.525 the alpha should be 0.5, if the distance is 0.7 or greater the alpha should be 1.0
  • For some reason I was only able to key out the green on that environment by setting the hue to like 200-something degrees and messing with the feathering? It's totally nonsensical for some reason.
  • IMO the chroma key color should just be inputted as an sRGB hex code or at least dual-inputtable with one (ideally with something in the UI that shows the color selected).

Edit: Just realized the feathering is basically just my distance thing, but the distances being centered around 1.0 doesn't make a ton of sense, esp considering the visionOS defaults are [0.35, 0.7], so both very low

#[schema(strings(display_name = "Hue range"), suffix = "°")]
#[schema(flag = "real-time")]
#[schema(gui(slider(min = 0.0, max = 360.0, step = 1.0)))]
pub hue_range_deg: f32,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh this being in degrees doesn't make a ton of sense? I can see the logic of weighting each of the components in a distance function mayyybe, but the default should be 1.0 weight and should be conveyed as a 0~2 weighting, everything made way more sense when I set this value to 180deg

@zmerp zmerp requested a review from shinyquagsire23 January 31, 2025 13:17
@zmerp zmerp marked this pull request as ready for review January 31, 2025 13:58
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