-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Canvas widget #32
Comments
Just gonna drop my two cents here. Rendering a custom widget doesn't make much sense unless you know both the renderer and the widget. This is where low level rendering access becomes important, for example if I'm rendering a virtual scene in my widget I'll probably want to control that via a graphics card. However not all rendering stacks will have a GPU available to them, so it may be hard to present this in a platform agnostic way. Additionally, the tech used to access the GPU may differ from platform to platform. So to create this I'd define the drawing trait in terms of the rendering stack, which is actually really similar to what you've already done with the myriad "Renderer" traits. So I suppose the takeaway of my comment is based around this sentence in the initial comment
That's probably not worth doing, as the means by which a custom widget could be rendered are vast and unknowable from the perspective of iced. |
I started working on a first pass at this. Having problems with the I need some way to update the The only improvement I can think of trying is using Does anyone have any other suggestions? This would probably be a lot easier without the multiple abstraction layers spread across several crates. I only care about supporting Because of these challenges, I'm not comfortable sharing the code. I just don't think it's reviewable in this state. |
The first step here is to create a I think an implementation of this API can be achieved without exposing internal rendering details, like pipelines or shaders. The cool thing about this approach is that we could make the There has been some work done in this direction and it looks promising. I think I'll be able to share something soon! @parasyte Could you describe your use case? Why do you need to create custom pipelines? I believe you would need a different kind of widget than the one described in this issue, at least for now. If you want to render your scene with Iced on top, I believe the way to go for that is to integrate your current |
The specific use case I have in mind is building a tile map editor (like Tiled). The
These reasons (and others; caching, and no support for animations) rules out the |
@parasyte Now that #183 and #193 have landed, I think we should be able to start exploring more powerful solutions to satisfy use cases similar to yours. While #193 only supports basic 2D graphics, I think it should be possible to build a similar widget for advanced graphics (custom shaders, 3D, etc.) by exposing |
@n826vnl8 I think the seeds are planted and an advanced canvas widget can be implemented using the current Because of this, I am moving on to working on other features that may challenge the current design of the library (like #27, #30, and #31) and can help us notice any shortcomings. Thus, no plans yet! That said, I will happily discuss use cases and review any design ideas. Everyone is welcome to join the Zulip server and start a topic there! |
Possibly of interest, I achieved this in KAS via use of a BTW I think iced_wgpu docs are missing the "canvas" feature? |
Hi! I am currently searching for GUI framework for my existing project (RustZX) And However it still missing the core issue which I need - possibility to draw texture on the canvas with given filtering (specifically, nearest neighbor). As I understand, this task is blocker for this to happen. The original task mentions that What steps we should make currently to make this possible @hecrj ? |
Since we already have a 2D |
A widget to draw freely in 2D or 3D. It could be used to draw charts, implement a Paint clone, a CAD application, etc.
As a first approach, we could expose the underlying renderer directly here, and couple this widget with it (
wgpu
for now). Oncewgpu
gets WebGL or WebGPU support, this widget will be able to run on web too. The renderer primitive could be a simple texture that the widget draws to.In the long run, we could expose a renderer-agnostic abstraction to perform the drawing.
The text was updated successfully, but these errors were encountered: