Skip to content
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

Partial rerendering #2383

Open
szokejokepu opened this issue Aug 23, 2024 · 3 comments
Open

Partial rerendering #2383

szokejokepu opened this issue Aug 23, 2024 · 3 comments
Labels
state: pending not addressed yet

Comments

@szokejokepu
Copy link

szokejokepu commented Aug 23, 2024

Is your feature request related to a problem? Please describe.
I want to build an interface where I have potentially a long render loop for an raw texture image, but most of the rest of the interface is static: buttons, tabs, etc. which never change.

Describe the solution you'd like
I would like to only partially rerender the GUI, only in places where it matters, and not rerender the whole complex static interface at every render loop. Seems to me like a waste of resources.

Describe alternatives you've considered
I guess what I'm describing is similar to a sort of reactive programming, which is used a lot in web html programming like VueJS, ReactJS etc. but I couldn't find a similar pattern in DPG.

Additional context
Here's a program I'm working on for which I'm trying to speed up the processing.
DPG_example

@szokejokepu szokejokepu added the state: pending not addressed yet label Aug 23, 2024
@v-ein
Copy link
Contributor

v-ein commented Aug 23, 2024

but I couldn't find a similar pattern in DPG

Probably because it doesn't work well with the immediate-mode GUI paradigm.

While re-rendering all those buttons is truly a waste of resources, it's often considered an acceptable tradeoff, talking from the ease of development point of view. Also, on modern hardware it's not much resources anyway - at least for your example (I know, it's a poor argument, especially for battery-powered devices; it's a compromise anyway).

In more complex GUIs containing thousands of elements, partial rendering would of course have a more visible effect.

Also, if you're seeking to reduce the CPU load for your app, try adding this on your app init:

dpg.configure_app(wait_for_input=True) 

@szokejokepu
Copy link
Author

Thanks for the tip with the wait_for_input. I'll give it a try, although since I have a manual rendering loop, not the automatic one, I don't think it makes a lot of difference.

To the original problem, thanks for your response. I didn't realize that this is a "feature not a bug" sort of deal, so it will probably not be implemented on principle basis. Fine by me. Feel free to close the feature request if this is the case.

@v-ein
Copy link
Contributor

v-ein commented Aug 26, 2024

Well, actually, something like partial rendering might eventually get added to Dear ImGui and then probably to DPG as well. Take a look at this post, section 6.10, where Omar is talking about per-window refresh rate options:

ocornut/imgui#7892

I'd say it's unlikely to happen soon anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet
Projects
None yet
Development

No branches or pull requests

2 participants