Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Graphics H-Trace: Global Illumination and Occlusion [ RELEASED ]

Discussion in 'Tools In Progress' started by Passeridae, Mar 11, 2022.

  1. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Looks really good! I'm always excited to see new scenes with our GI :) And thanks for attaching the debug screenshot - really helps to understand how the GI works in this particular scene.

    And if you need any help with the settings or a piece of advice on how to set something up - feel free to DM me here or on Discord. I'm always ready to answer any asset-related questions ;)

    Btw, I added a short FAQ to the original post (page 1) and it will be updated in the future.
     
    florianalexandru05 likes this.
  2. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,816
    Thanks, I have to admit that that's not really a good scene to show off H-trace but I can say I tested it in more occluded areas and it works as intended. I'm working on a new asset pack and I'm surely going to use H-trace to make my screenshots and videos. I'll get back with something amazing eventually!

    Thanks for the FAQ, I didn't think about using a probe volume. Can't wait to play with it more.
     
  3. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    Thanks for the response! Well, I meant AO by the darkening effect :) It was as if it was not correctly applying AO in some cases(have some gap between ground and the object that is little above the surface and AO doesn't totally cover that area etc) and leaves ghosting in some others(this second one particularly visible on metallic surfaces, when there is an emissive surface around)

    In terms of the patch, we did the patch, (It causes a little hlsl compile error once and then not again btw), but I am not sure what patch replaces tbh, does it replace the built-in hdrp SSGI even if we enable Unity's SSGI from volume settings?
     
    Last edited: Oct 18, 2022
  4. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hmm. This is interesting, I recently noticed something similar to this description in one of my scenes. It may be a bug in my implementation. I can try to fix it and send the fixed file to you, so you could check how does it work on your end, maybe it will solve the problem.

    Do you mean the AO itself leaves ghosting or the GI effect in general?

    Do you have SSR reflections on these metallic surfaces?

    Did you reimport H-Trace shaders after applying the patch (as suggested in the manual)? If yes and the error is still there, then I would really like to know more about it (what does the error say, when does it appear, what Unity / HDRP version is this, what API is in use, etc.), because it's definitely something that is not supposed to be there.

    Yes! :) As the manual says, H-Trace overrides the native SSGI when enabled (and restores it back when disabled). You can find more info in the manual:
    upload_2022-10-18_15-10-14.png
     
    Last edited: Oct 18, 2022
    MaximKom and merpheus like this.
  5. mush555

    mush555

    Joined:
    Feb 4, 2020
    Posts:
    23
    sky_none_out.JPG sky_hdr_out.JPG sky_none_in.JPG sky_hdr_in.JPG

    I bought the asset and tried it.
    I prepared two patterns of sky (None and HDR),
    and took screenshots outside the room and inside the room (with the door completely closed).

    If the sky is None, the room is completely dark when the door is closed.
    When the sky is HDR or PhysicalSky, closing the door did not darken the room.

    I thought Unity's SSGI had a similar problem, but when RayMiss was set to None,
    the room darkened correctly even if the sky was HDR or PhysicalSky.
    But in this case the Reflection Probe fallback is lost.
    (even when the door is half open and a fallback is required)

    I'm not good at English, so I can't explain well,
    Anyway what I want to do is
    ・I need to use HDR or Physical Sky for the sky
    ・When the room is closed, it should be completely dark (as a result, the Reflection Probe will also be updated to black)
     
    Last edited: Oct 20, 2022
    PutridEx likes this.
  6. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi! Your explanation is super clear, don't worry :)

    So, here's the problem:

    If you don't have any reflection probes then Unity uses the environment reflection (the one that reflects your sky). This reflection is not captured from inside the room and, moreover, not updated to know the current room condition (opened / closed). Unity overlays this environment reflection on top of the H-Trace / SSGI output (or even uses it as a part of the fallback in case of the "Reflection Probes and Sky" option) which leads to the incorrectly lit room.

    To correct this you have to bake a reflection probe that will locally (inside its volume) override the environment reflection. This probe should be placed inside the room and either its volume should be adjusted to match the shape of the room, or the proxy volume should be used instead.

    Now we need to make sure that our probe correctly reflects the current condition of the room (open / closed). For that the probe should be set to "Realtime" (with "Time Slicing" enabled if possible). It would be also a good idea to switch the "Volume Layer Mask" to the layer that is NOT the one with the Sky override (I simply chose "Nothing") to disable the sky visibility for this particular probe. Like in the attached screenshot:

    upload_2022-10-21_1-3-31.png

    Now we can close the room and achieve the complete darkness inside it (without disabling the fallback on this reflection probe):
     
    Last edited: Oct 20, 2022
  7. mush555

    mush555

    Joined:
    Feb 4, 2020
    Posts:
    23
    >Passeridae

    I got perfect results like in your video.
    Unity SSGI shadows are very flat when RayMiss is None.
    H-Trace replaced that part beautifully and realistically.
    Thanks for great assets and support!
     
    blueivy and Passeridae like this.
  8. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    136
    Anybody tried this out as an offline rendering solution in Unity (where fps is not an issue)?

    I’m on the fence whether to continue using Unity HDRP or jump over to Maya (Vray).

    How does this work with water (lake or ocean)?
     
  9. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    IMO you will never get the results you get on Vray from a realtime engine, no matter how good the GI solution is.
    Or maybe in 10 years if everything realtime becomes raytraced, then maybe, but by then Vray will be even better.
    Realtime systems are always a compromise.
     
  10. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    If the FPS is not an issue and you have a ray-tracing capable hardware it would make sense to just use RTX. Or even the built-in path-tracing. The latter is the typical offline renderer that you're probably accustomed to.

    Such things as H-Trace are build with the interactive performance in mind, so a lot of compromises are made to make it work in real-time. Even if the diffuse GI was on par with an offline rendering algorithm then you would still have to deal with reflections, interreflections, refractions, caustics and so on. These areas are covered way better in offline rendering engines (such as VRay, Arnold, Corona, etc.)
     
  11. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Still learning to manage plugins because this is an Injection system in Unity (SSGI like build in DXR/SSGI Unity system)
    But now is clear everything if we talk about settings - is really simple.
    Compared to CPU rendering systems, H-trace has practically the same quality of GI - that amaze me (as a user, beta tester, and developer of CPU systems)
    Interior_DXR_050_.jpg Interior_DXR_046_.jpg Interior_DXR_047_.jpg Interior_DXR_048_.jpg Interior_DXR_049_.jpg
     
    imDanOush, GuitarBro, blueivy and 3 others like this.
  12. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
  13. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    634
  14. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    indeed!
    Impressive stuff!
     
    blueivy likes this.
  15. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    blueivy, atomicjoe ...Thanks!
    Just remember, this is an offline rendering system. Performance is last on the list, and I am not interested in fps.
    Textures are 4k+, objects are very heavy in polygons, and my Node system (shader Graph) is complex.
    For me as a CPU guy, jumping from 30-60 min per render to 3-10 FPS per render is paradise ;) (is totally smooth real-time rendering)
     
    blueivy, atomicjoe and MaximKom like this.
  16. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here is some technical data:
     
    blueivy, MaximKom, atomicjoe and 2 others like this.
  17. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
     
  18. scoty_sun

    scoty_sun

    Joined:
    Oct 31, 2022
    Posts:
    1
    Hi, I Just bought H-Trace today and I have some problem.
    My English is not well, I will try my best to explain clearly,
    please bear with me.
    I open a new project in Unity and choose HDRP Template,
    my Unity version is 2022.1.20f1,first I Import H-Trace ,when Import complete the console show
    an error: Assets\H-Trace\Scripts\HTracePass.cs(844,98): error CS1061: 'CustomPassContext' does not contain a definition for 'cameraMotionVectorsBuffer' and no accessible extension method 'cameraMotionVectorsBuffer' accepting a first argument of type 'CustomPassContext' could be found (are you missing a using directive or an assembly reference?)

    I know it's basic problem, please help, thanks!
     
  19. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi! Thanks for buying the asset and sorry for the troubles!
    Could you please zip this project and send me it in the DM?
    I'll look into this issue and will fix it for you ;)
     
    scoty_sun likes this.
  20. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    scoty_sun likes this.
  21. TheOmnisimush

    TheOmnisimush

    Joined:
    Oct 2, 2017
    Posts:
    4
    Hi, I bought H-Trace and I have problems.
    Can you look into this or tell me what I did wrong?

    Unity Version : 2021.2.10f1
    HDRP Version : 12.1.4

    *The asset store said that it was tested from 2021.1 up to 2022.2.
    So it shouldn't be a problem with my Unity version 2021.2

    PROBLEM 1 :
    So I simply created a new blank HDRP Project,
    then Import H-Trace (without patching HDRP) and open the "Cornell Box" sample scene.
    As you can see in my screenshot, the GI does not appear both in Game window and in Scene window.
    And I get this error :
    Shader error in 'HMipChain': Couldn't open include file 'Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl'. at line 7


    PROBLEM 2 :
    When I chose to Patch HDRP (H-Trace > Patch HDRP Package)
    it worked, and told me to restart the editor.
    So I restart the editor, and the GI appears only in the Scene window, but nothing in the Game Window.
    And I still get the same error.
    What's weirder is the GI kinda flickers whenever I hover my Mouse cursor on the windows.
    https://drive.google.com/file/d/155t2wf7n-c5acJG0TZA99T1ONfkpmclt/view?usp=sharing
     

    Attached Files:

    Last edited: Nov 7, 2022
  22. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi and thank you for buying the asset! :)

    This is interesting, because there were reports of another error in some of 2021.2 versions that would also prevent you from seeing GI in both Game and Scene views, but it's the first time I hear about this error. Are you sure that you get only this one error (at least before patching) and nothing else?

    I downloaded this exact Unity version, created a new project and wasn't able reproduce it...But anyway, I made some changes in the code that might, in theory, fix it. I'll send you the file to replace (check inbox). Let's see if it works.

    About this one. This isn't an actual error, if it was - you would get zero GI like you described in the 1st problem. This error is actually expected after patching and to get rid of it you need to follow this part of the manual:
    upload_2022-11-7_15-21-1.png
    So, clicking on the "HMipChain" shader and then selecting "Reimport" should fix this :)

    This one is due two windows being opened side-by-side. I'm afraid such configuration is not currently supported by H-Trace. I'll look into it and see if I can support it by the next patch.
     
  23. TheOmnisimush

    TheOmnisimush

    Joined:
    Oct 2, 2017
    Posts:
    4
    @Passeridae
    Thank you for the fast reply :)

    First of all, I tried H-Trace in Unity 2022 and it worked fine (both patched and un-patched)
    The problems only happen in Unity 2021.2 (that's the version I'm using, any version 2021 might have the same problems)

    So here's what I tried :

    1) H-Trace (HDRP UN-PATCHED version)
    Using the script you gave me fixed the problem I had. Now GI is correctly rendered
    -> SOLVED

    2) Scene & Game window opened side-by-side
    Thank you for clarifying that H-Trace can only works correctly in one of the windows.
    And I tested that viewing only Scene or Game window DOES show correct GI.
    -> SOLVED (H-trace is not intended to be viewed in both scene & game windows side-by-side)

    3) H-Trace (HDRP PATCHED version)
    This is another problem I faced during testing,
    I told you before that the patch "Worked", it seems like I was wrong.
    The console log didn't give me any errors so I assumed that the patch worked, but it only works in
    InjectionPoint : Before Transparent


    When I switch to
    InjectionPoint : Before Pre Refraction
    (as written in the Docs)
    I also enabled SSGI in the Project Settings & PostProcess volume
    (I sent the video links in DM)

    The GI becomes weird, where the camera gets further from the object, the GI will go black
    but then the Camera gets near the object, GI goes full red.
    My guess is maybe the HDRP scripts in Unity2021 is different from Unity2022 ??
    So the changes the Patch made is not compatible with Unity2021 ??
    I`ll be glad if you can check this for me, thanks.

    PS : Should we deal with this privately in DM?
    Because I don't want to flood this post with random stuffs like this,
    But if you guys think this will benefit the community, then I guess we can continue this in the thread.
     
  24. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thank you for the detailed report! I was able to reproduce and fix this issue. I'm sending you another updated file. Let's see if it works on your end ;)

    Yeah, I always wonder if I should help people through DM to keep this thread organized, but on the other hand it may be useful for other people to see how certain issues get fixed...
     
    Ziq-Zaq likes this.
  25. mikechristiansen2000

    mikechristiansen2000

    Joined:
    Nov 8, 2022
    Posts:
    1
    Hello. Will H-Track render to a video file using Unity Movie Recorder?
    Will it render frames (exr files) using the Image Sequence Recorder?
    Thanks
     
  26. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,816
    I was also having issues with Unity 2020.3 (The version I am using) but Unity 2021.3 worked fine for me, I only need to take snapshots and record videos so using 2021 was fine for me.

    I can confirm that you can take snapshots and record with Unity recorder just fine, that's exactly why I purchased H-Trace. I use image sequences to make my videos as well.
     
    MikeChr likes this.
  27. deepimpact-daisuke

    deepimpact-daisuke

    Joined:
    Dec 13, 2017
    Posts:
    6
    Hi!

    I purchased H-Trace: GI & Occlusion HDRP and installed it in my Untiy 2021.3.0f1 version HDRP project. I have encountered a problem there and would like to discuss how to deal with it.

    When I run the scene after following the steps in the manual for the Patching HDRP Package, I get a nice and beautiful GI with no problems in UnityEditor, but when I run it after building it as a Windows exe, the GI shines too much and the camera When the camera moves, it causes a kind of after glow.

    If you know of a workaround for this problem, could you please let me know?
     

    Attached Files:

  28. TheOmnisimush

    TheOmnisimush

    Joined:
    Oct 2, 2017
    Posts:
    4
    @Passeridae
    I replaced the file you gave me :
    Packages\com.unity.render-pipelines.high-definition@12.1.0\Runtime\Lighting\ScreenSpaceLighting


    And this is finally fixed! THANKS!
    ===================================================
    However, I found another bug, try with these settings :
    InjectionPoint : Before Pre-Refraction
    PostProcessVolume > Full Resolution = unchecked

    ->Then the GI started to look wrong again
    ->See attached files
     

    Attached Files:

  29. deepimpact-daisuke

    deepimpact-daisuke

    Joined:
    Dec 13, 2017
    Posts:
    6
    I posted this issue yesterday and it has been resolved.
    I added CustomVFshader.shader and FinalCompose.shader to the Shader Variant and re-built them, and now the GI effect is working correctly on the built resources!
     
  30. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Yes, indeed, adding these shaders there is necessary. Sorry for the late reply, I'm glad the issue is resolved :)

    Oh, yes, I made a mistake in the file that I sent you. I'm sending a new version. Though, as written in the manual, it's not recommended to enable half-res in SSGI volume.
     
  31. TheOmnisimush

    TheOmnisimush

    Joined:
    Oct 2, 2017
    Posts:
    4
    @Passeridae

    Thank you!
    The file you sent me resolved the problems in Unity 2021.2.10f1.

    For anyone wondering,
    if you have the same problem when using HDRP-patched H-Trace in Unity 2021.2

    This file needs to be replaced :
    Packages\com.unity.render-pipelines.high-definition@12.1.0\Runtime\Lighting\ScreenSpaceLighting


    I wonder if you can include the fixed file, when you release next version of H-Trace asset?

    ============================================
    Passeridae
    By the way, do you plan on releasing H-Trace for "Standard Rendering Pipeline (not URP)" ?
    If you do I'd be happy to purchase it.

    I always prefer to make real-time games in Standard RP,
    because in my opinion, HDRP is too high performance-cost (since it's probably intended for making movies or whatnot)
    and URP has its own problems, such as
    - some post-process effects are unnecessarily slow,
    - the shader-graph node system is difficult to "version-control" since it's a binary file
    thus makes it harder to copy-edit / diff-merge / control the actual Shader codes in Git, etc
    I'd rather write my own CGPROGRAM or HLSL codes.
    etc.
     
    Last edited: Nov 11, 2022
  32. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    302
    IMO, for 2022, HDRP should be your go to pipeline for standard 3d PC/Console game. and it's definitely made for game not movie. Otherwise, there wouldn't be so many compromises like half-res effect and other optimization scheme built in to it.
     
  33. TestifyNow

    TestifyNow

    Joined:
    Feb 9, 2016
    Posts:
    24
    Just came here to say seriously impressed with the quality that is obtainable by this. Only wishing for more performance features for HDRP as FPS went down significantly :D
     
    FlightFight, Passeridae and blueivy like this.
  34. Dalenc

    Dalenc

    Joined:
    Jun 24, 2015
    Posts:
    15
    HI, I bought H-Trace, and I found it incredible, my game looks really beautiful with it activated in the project.

    But I'm having a small problem that I don't know if it's possible to adjust, which is when I have a character with 2 active cameras in the scene, the performance freezes and is super slow.

    If I disable Denoise in H-Trace the performance goes up but with a lot of grain.

    Is there something I can do.
     
  35. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi! I'm afraid we don't support a multi-cameta setup at this moment. However, it's possible that this feature will be added in the next update. Sorry for the inconvenience!

    For the time being, you can disable it for one of your cameras by disabling the custom pass option in the camera frame settings override.
     
  36. Dalenc

    Dalenc

    Joined:
    Jun 24, 2015
    Posts:
    15
    Hi Passeridae, no problem, I ended up removing the cameras and leaving only one in the scene to not consume so much game performance.

    Everything is working great, I'll leave a 5 star review there in the asset store.
     
  37. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thank you! Good reviews help us a lot! :)
     
  38. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    815
    so, I was puzzleed by @Yanus3D video, how is it possible the scene keeps computing SSGI if the light sources are offscreen?!!. Is it that when offscreen, info is baked in proves? if so, proves need to manually be placed or theese are automagically following the camera and autobaking when needed?. I re read the descriptions but I can´t clearly figure out what happnes when light is offscreen, is that the "fallbakc to proves" thing?
     
  39. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    TokyoWarfareProject LEM Light sources are not working when they get offscreen or when culled by geometry in SSGI engine.
    Physical lights are different, because you use a FallBack system based on Reflection Probes and also a direct light effect.
    reflection Probes are used only to support GI engine (they are not used for reflection effect...)
    img_001.png
     
    TokyoWarfareProject likes this.
  40. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    815
    Thank you very much for the info, impresive renders. Is like an offline renderer but in realtime what you've.
     
  41. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    It is amazing (that's why I switched from CPU to GPU after over 25 years of renderings...simply I got tired and frustrated)
    But is one problem: the minimum required for that is Ampere 3090 and recommended Ada 4090...
    Having 4090 you are 20.000+ faster with rendering compared to CPU (with the same quality)
     
  42. santos9991

    santos9991

    Joined:
    Oct 31, 2018
    Posts:
    17
    Hello, I was using H-TRACE in version 2022.b16 and it was working correctly.
    I updated unity to version 2022.2.f1 and it stopped working. I remake the patch process of HDRP and it still doesn't work anymore.
     
  43. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi! Sorry to hear that, we'll check what's going on with this version.
    Just to make sure, you don't see any GI even in the debug mode, right?
     
  44. santos9991

    santos9991

    Joined:
    Oct 31, 2018
    Posts:
    17
    I found the problem.
    By default, the H-Trace Layer is set to Default.
    The objects in my scene are adjusted on another layer.
    I recommend you to set the H-Trace Layer to Everything in the next update.
    Thank you.
     
  45. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Last edited: Mar 9, 2023
  46. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    If we purchase the HDRP version, will we get the built-in render pipeline version for free?
    I only use BiRP and I was waiting for you to release the BiRP version.
     
    TheOmnisimush and sirleto like this.
  47. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi! At the current moment the plan is to release URP and Built-In as separate assets. However, for those who own one of the assets (e.g. HDRP), we plan to provide huge discounts (around 70%) for the other two assets (e.g. URP and Built-In). So the total price of buying all three assets wouldn't be really high. We are also considering making a bundle with all three assets for even a lower price.

    The idea is to allow people buy only what they need without paying for unnecessary pipelines, but at the same time having an opportunity to buy all three (or two) assets at a lower price if necessary. So in your case it would be more practical to wait until the built-in release, I guess :)
     
    SammmZ, Vincentin and Gooren like this.
  48. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Fair enough :)
     
  49. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    I also waiting for the BiRP version (and use every opportunity like this one to point out that BiRP is highly requested).
    But I got the HDRP version a long time ago anyway, just to encourage the dev lol :D
     
  50. TyGameHead

    TyGameHead

    Joined:
    Apr 29, 2017
    Posts:
    27