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

HDRP: UI often shows up in scene view instead of game view and gizmos don't show where ImGui is drawn. #35

Closed
gwenvis opened this issue Mar 26, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@gwenvis
Copy link

gwenvis commented Mar 26, 2022

I don't know if this happens in other pipelines as well - but in HDRP the UI often likes to show up in the scene view and not appear in the game view at all - unless fullscreen.

I'm posting this issue so other people could perhaps look at it - but right now I've remedied this by not using the custom pass volume the guide describes - but by using a component that subscribes to some events the scriptable render pipeline exposes. This seems to work well so far. I will attach the script I use for this in a gist.

https://gist.github.com/stepperman/45cb274e6a224455aaa421eb7a61dbb7

It's pretty untested - but seems to work well so far. It will still for some reason go to the scene view when the game view is maximised and then minimised but I feel this is barely a non-issue. The only gripe I have right now is that the UI renders over the Unity canvas, but for some reason Unity don't expose proper injection points for that unfortunately.

@psydack
Copy link
Owner

psydack commented Mar 27, 2022

Hello there.

Could you share which version this is happening/reproduce?
Could you share some image / video of this happening ?

Thank you very much for sharing the snippet and using UImGui.

@psydack psydack self-assigned this Mar 27, 2022
@psydack psydack added the bug Something isn't working label Mar 27, 2022
@iUltimateLP
Copy link

iUltimateLP commented Aug 4, 2022

Wanted to comment on this, as we're experiencing the same issue. The Gist provided by @stepperman works just fine, although we noticed that it does screw with the alpha channel, making transparent windows way more transparent as they were previously.

Edit: we fixed that by switching the alpha mode to a seperate blend, add this to every pass in Resources/Shaders/DearImGui-Mesh.shader:

Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha

@futurecreep-dev
Copy link

futurecreep-dev commented Jul 26, 2023

(UImGui 4.1.1, HDRP 15.0.6, 2023.1.6f1, Windows DX11, Custom Buffer Format R8G8B8A8 - did not test others)
The custom pass method makes UImGui display in Game view only if Gizmos are enabled; It's always visible in Scene view (while playing).
Even so, I found these other issues:

  • Dynamic resolution makes UImGui rescale (at least visually, probably not technically).
  • It has a smeared look as it is affected by TAA and (at least) bloom (custom pass set After Post Process).
  • In builds UImGui is not visible at all.

Using the gist code instead (custom pass removed) it works and looks as expected, in builds included.
However, I modified the handler so it only runs for the main camera, otherwise UImGui flickers when on demand reflection probes get rendered (I think). It still has occasional 1-frame flickers in Editor but I don't mind for now.

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

4 participants