Skip to content

Add chroma key passthrough feature - #427

Open
AJBats wants to merge 1 commit into
praydog:masterfrom
AJBats:passthrough-2d
Open

Add chroma key passthrough feature#427
AJBats wants to merge 1 commit into
praydog:masterfrom
AJBats:passthrough-2d

Conversation

@AJBats

@AJBats AJBats commented Jul 20, 2026

Copy link
Copy Markdown

Chroma key passthrough for 2D Screen Mode

This adds the chroma keying support requested in #278. When enabled, the void around the 2D screen is cleared to a solid key color (magenta by default) instead of black, so Virtual Desktop's chroma key passthrough can replace it with your camera feed. You end up with the game floating in your real room.

Usage

  • Runtime page -> Passthrough -> enable Chroma key void, pick a color if magenta doesn't suit
  • In Virtual Desktop: Streaming tab -> enable passthrough with chroma keying, set the key to the same color.

Here's my messy desk:

image

The above image is with 2D mode in UEVR.

Review notes

I had to rework a few parts of 2D Screen Mode for the passthrough to work, and those parts run even when it's disabled:

  • The screen quads are opaque now instead of alpha blended. Robocop (my dx12 UE5 test game) output zero alpha, and with a magenta void behind them the whole game would tint magenta. Those same games currently render black in 2D mode for the same reason, so opaque seems like the right call either way.
  • The projection layer behind the quad gets cleared instead of copying the blacked out backbuffer (that clear is where the key color goes), and depth isn't submitted anymore since it's just a flat color layer. With the feature off it clears to black, so it looks the same as before.
  • D3D12 allocates the 2D screen textures unconditionally now, like D3D11 does. Before this, toggling 2D mode on mid-session on D3D12 hit null textures.

Current Testing Scope

  • Only Tested on Stray (DX11) and RoboCop: Rogue City (DX12).
  • Currently only tested on Quest3 VD SteamVR + UEVR OpenXR. If we like this PR I can expand my testing and try to make sure it works across more modes.

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