-
Notifications
You must be signed in to change notification settings - Fork 422
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
Allow custom clear color for the window background #6205
Comments
Use a I don't see any reason to make any changes to framework to support this. I'm not even sure how "clearing with transparent colour" works or does anything useful at all. It's not like the WM will know that the game has cleared its surface to transparent? |
A transparent clear color allows using the "Allow Transparency" option in OBS' Game Capture to capture a transparent image directly for compositing a stream. An example of an app that already does this is Vtuber avatar tool VSeeFace. In this case, I'm making a telemetry HUD overlay for F1 games (hence the screenshot above) as playing them in VR removes any and all HUD - in fact, the screenshot comes from OBS: The main reason why I'm looking specifically for a transparent clear is to make sure I'm not limited in the colors I can use - the wheel lights (the row of 15 rectangles) has all three primary colors (green, red, and blue in that order), and I'm not entirely sure a chroma key would work all that well, though I haven't tried either. That being said, I didn't consider the option of a custom |
We won't have any official use for this, so I'd recommend implementing yourself. If it's simple enough, we can consider merging the feature. Keep in mind that implementing will have serious cross-platform concerns (ie. it likely won't be usable on mobile) and that may increase implementation complexity. |
The first thing I'd check is to see if this works in theory by changing this line:
Then, I think the best way is for a custom protected override DrawNode CreateDrawNode() => new GameDrawNode(this);
private class GameDrawNode : CompositeDrawableDrawNode
{
public GameDrawNode(CompositeDrawable source)
: base(source)
{
}
protected override void Draw(IRenderer renderer)
{
renderer.Clear(new ClearInfo(Color4.Pink));
base.Draw(renderer);
}
} |
Simplest solution for this would be using additive blending for glow. If you are using |
A feature like this would allow making transparent applications for OBS.
In this specific scenario, a transparent clear color would likely allow for better management of transparency than chroma keying for example.
I tried an implementation a few days ago with just being able to change the clear color to transparent, but then I ran into issues with alpha blending (see the dark blobs below around the green and red lights) - let me know if you'd like me to upload a branch with my changes.
The text was updated successfully, but these errors were encountered: