Code Monkey home page Code Monkey logo

Comments (5)

bdach avatar bdach commented on June 16, 2024

Use a Box that fills all available space for chroma-keying? Or if you really don't want to, write a custom DrawNode for the root-level container that calls Renderer.Clear?

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?

from osu-framework.

Erinaaaaaaa avatar Erinaaaaaaa commented on June 16, 2024

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:
image

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 DrawNode, so technically I suppose it's already possible to clear to a custom color? I'd generally like an easier way to change just the color, but a framework change might indeed not be needed for that. I'll need to play around with this, but then alpha blending might remain an issue, which would probably need a separate issue/discussion.

from osu-framework.

peppy avatar peppy commented on June 16, 2024

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.

from osu-framework.

smoogipoo avatar smoogipoo commented on June 16, 2024

The first thing I'd check is to see if this works in theory by changing this line:

Clear(new ClearInfo(Color4.Black));

Then, I think the best way is for a custom DrawNode as previously proposed:

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);
    }
}

from osu-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.