Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question ImGui package renders at weird transparency with HDRP

Discussion in 'High Definition Render Pipeline' started by UiJiaWei, Jun 17, 2020.

  1. UiJiaWei

    UiJiaWei

    Joined:
    Jun 17, 2020
    Posts:
    1
    Hello, I have tried searching for threads that talk about ImGui with HDRP but could not find any that matched my issue. Let me also preface this by saying that I have almost no knowledge of HDRP but I need to get ImGui working with it for a project.

    I am using this package branch that exposes a lot of the Dear ImGui library for Unity (master branch that does not support HDRP here). As the developer of that branch has noted, there are some alpha issues when the UI is injected in "After Post Process" as shown:
    Changing the target color and depth buffer options has had no effect.
    As the developer has also stated, it looks much better when the Injection Point of the Custom Pass Volume is set to "Before Transparent" but then new issues occur such as the UI now having motion blur. It has been days since the last update regarding this issue so I hope that somebody here can help me and by extension, this package.

    Attached is the custom pass script (ImGuiHDRPPass.cs), vertex and fragment shader code (PassesHD.txt, was hlsl, converted to txt for upload), as well as the shader for ImGui when using HDRP (DearImGui-Mesh.shader, under the comment // shader for HD render pipeline).

    The thing that doesn't make sense to me is when I make the ImGuiPassFrag return half4(1, 1, 1, 1), I get a completely white box with no transparency at all. But if I make it return half4(1, 1, 0, 1), I get a semi-transparent yellow box.

    Here is also a link to download the whole project (it's just the default HDRP project with the demo code from ImGui attached to "GameObject") if anybody would like to look at it as a whole (the scene file is imguiHDRP/unityImguiHDRPTest/Assets/Scenes/samplescene.unity). Thank you for any help in advance.

    I'm on Ubuntu 18.04 and Unity's version is 2019.3.11f1 if it helps.
     

    Attached Files:

    vlandemart1 likes this.
  2. vlandemart1

    vlandemart1

    Joined:
    Aug 19, 2021
    Posts:
    2
    Just loaded linked project and opened it in LTS 2020.3.16f1 - no issues with transparency.
    upload_2021-10-10_15-51-49.png