-
Notifications
You must be signed in to change notification settings - Fork 120
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
Feature Request: Masonry: Surface/Texture widget #395
Comments
Something like the canvas element in web browsers? |
yes, something like canvas, I'm also interested in this feature. For example to create a video player, we'd need a widget that we can draw anything on (in this case pixels of the video), or a widget where we can draw some 3D scene with wgpu, etc |
Conceptually, this isn't too difficult, because Vello does support using images.
Another note:
So yes, this widget could be used to support a video player. However, the "correct" way to create a video player is to connect with the compositor (see #xilem>Compositor). Overall, I'd encourage contributions towards this direction, but I can't prioritise working on this myself. |
Same. The concept is interesting, but it's going to be pretty low on the priority list this year. Next year may be different. |
I assume that this also applies to drawing any custom scene with vello? Eg. if I want to draw a chart |
You can do so with a custom widget, eg any type implementing the Widget trait. Basically you choose what to paint in your (Yes, there talks of limiting custom widgets, but people were a lot more opposed to the idea than I assumed.) Directly using wgpu APIs is another beast, though. I haven't sketched up a design, but I think it would require us to hook into the compositor and handle composition layers; there would be many good reasons to do that (performance, power efficiency, the embedded video use-case), but it's not on our immediate roadmap. |
Raph mentioned two-way interoperability with bevy in his RustLab Vello talk. My goal is to make a Xilem app that can embed various small bevy applets for 3D features. I'm curious if using the compositor would still be the best practice for embedding a bevy scene? Also, Iced has a widget that exposes a wgpu texture called shader (example). |
Probably. Other options are:
Interesting. I'll look into it. |
I don't see why you have to go from one extreme to directly using the compositor? I really don't understand the aversion to passing the wgpu The main challenge here is scheduling when your Bevy widget gets control, as well as exposing the right APIs on the Vello side for using wgpu textures in a render. |
Sure. I'm unfamiliar with GPU rendering, so I might just be overestimating how hard this is to do. |
This is related to linebender/xilem#395 See also [#gpu > vello adding wgpu texture buffers to scene](https://xi.zulipchat.com/#narrow/stream/197075-gpu/topic/vello.20adding.20wgpu.20texture.20buffers.20to.20scene) This is a targeted hack working within our current API.
As for the |
I’d like to be able to directly draw to a surface or texture within Masonry using wgpu APIs. Masonry would control the visibility, location, size, etc. of the view and allow me to implement a widget which is in charge of rendering to it via wgpu APIs.
The text was updated successfully, but these errors were encountered: