-
Notifications
You must be signed in to change notification settings - Fork 5
[WIP] add imgui controls for define macros #46
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
base: main
Are you sure you want to change the base?
Conversation
|
little demo video to show the poc working from cli: imgui_demo.mp4 |
|
This is super cool! |
|
I get the error |
|
Hey @ShnitzelKiller can you try out the Otherwise downgrading imgui-bundle might do it. |
|
Installing |
| front_view = rp.texture_front.create_view() | ||
| front_ref = rp.main._imgui_backend.register_texture(front_view) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, came cross here from pygfx/wgpu-py#729 (comment).
It’s generally better not to create and register new texture views every frame in the render loop. Instead, a global texture view should be registered and used during initialization, or a imgui.TextureRef can be registered and created only at the first time the GUI is rendered.
If it’s absolutely necessary to create and register new texture views each frame in the render loop, you must manually call the newly added unregister method in pygfx/wgpu-py#749 to release the old texture view resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cheers for the heads up,
the render target for the buffer passes is switching back and forth between two textures(maybe I should also keep both views...) so I will likely have to register both of them during initialization and figure out a way to select the correct one in the gui function or swap them around after the draw function too. Sorta is a little against the "intermediate mode" concept.
I will have a think since this whole branch needs a better pattern anyway, why too many if self._imgui
Very WIP, so the branch is messy. Mentioned in #8
I threw this together at the airport just now after thinking about it for the past week.
Currently works with the example provided but theoretically should work with all single pass shaders.
Only float and int dtypes and only glsl just now. Also missing common code.
Based on the imgui example in wgpu, but I can already think of a bunch of ways to make it fit better with the existing structures.
most likely todos:
buffer_a.valueon_closeevent?)const float name 1.23too?#define- do we support any patterns there?