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

[Bug] shouldRender produces unexpected behavior in 3D visualizer #1856

Open
1 task done
checkraisefold opened this issue Aug 19, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@checkraisefold
Copy link
Contributor

checkraisefold commented Aug 19, 2024

Operating System

Windows

What's the issue you encountered?

The rendering optimization at https://github.com/WerWolv/ImHex/blob/master/main/gui/source/window/window.cpp#L677 causes issues when the 3D visualizer is being rendered and not outside of the ImHex window (where this optimization doesn't apply)

As soon as the draw calls are equivalent to the last frame (working on vec2 vertices), which happens both randomly even while things are still in frame and when moving the camera to an area with nothing on screen (just the black background, so the image is consistently the same), the visualizer freezes. While things are in frame, the occurences are seemingly mostly random - just based off camera position and zoom/orientation.

This isn't ideal for moving 3D viewports; it's fine with ImHex's 2D, but the solution isn't great without extra information we don't have as a result of the visualizer just rendering an image, and us getting the rendered image draw calls.

How can the issue be reproduced?

  1. Open ImHex on latest master
  2. Load any project that makes use of a 3D visualizer
  3. Turn off axes, grid if you'd like - makes it happen more frequently
  4. Move the camera away from whatever model you're looking at and towards the Void of Nothing. You will notice that the visualizer freezes until you hover over a button or make some other change to the ImGui window

ImHex Version

master

ImHex Build Type

  • Nightly or built from sources

Installation type

ninja install

Additional context?

One of few ways I've thought of being able to fix it is just disabling this optimization outright whenever the visualizer is on. At least on my machine, this genuinely has no performance impact since ImHex by itself takes literal nanoseconds to render on account of ImGui being fast and it being 2D only. Those using the 3D visualizer most likely have powerful enough hardware to cause no issues when turning it off, and if it causes lag then they can just close the visualizer window and it will turn right back on.

That's certainly the easiest way. The other, technically better (marginally, and adding a lot of lines of code) way is to split up the rendering and skip the optimization only for the child visualizer window somehow. When it's a separate window by dragging it out of the screen space of ImHex, this is really easy because the logic is completely separate and the ImGui multi-viewport logic handles it for you. When ImGui isn't doing it for you, it's not very simple.

@checkraisefold checkraisefold added the bug Something isn't working label Aug 19, 2024
@paxcut
Copy link
Contributor

paxcut commented Aug 24, 2024

This issue was already reported here and that is the place where i am posting my findings with evidence to back them up. A solution was found that is described there as well. This issue should be closed as a duplicate because both deal with the same underlying problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants