Search Unity

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
    Hi! I think it will take from 10 to 20 days for the Asset Store to review and publish the asset. In the meantime, I'll continue my work and if I make a production-ready update - I'll push it as a day one patch or even include it into the asset while it's still in the review process.

    Yes, the URP version is being worked on right now as we speak. It is undergoing some final upgrades to catch up with the HDRP 1.0 version. And it's very likely that the Build-In version will follow soon after URP release.

    Thank you all very much for your support! :)

    Just remember that H-Trace is a screen-space tracer. At least at the current moment. Yes, we have a reflection probe fallback, but still, keep in mind that it's not a full-blown GI solution like Lumen. As I said during the development process, my goal was to provide a screen-space algorithm that is better than other screen-space tracers out there (including the native SSGI), but it doesn't mean that it can compete with baked lighting or Lumen. I'm making a world-space GI fallback that will work in tandem with the current screen-space part and only once it ready it would be fair to make comparisons with full GI systems. I'm really humbled with the positive feedback, but I don't want to create false expectations :)
     
    Gooren, Vincentin, SammmZ and 2 others like this.
  2. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    We already have a modified local copy of HDRP package in our project. I hope the patcher you mention will not overwrite our changes every time we use it :D
    Not a deal breaker, I will just have to make sure that I always apply H-Trace patch first after updating HDRP before I ultimately manually merge all our changes in. I will just have to always be aware of the order :D
     
  3. Blade_Master_2020

    Blade_Master_2020

    Joined:
    Aug 3, 2019
    Posts:
    38
    The "World-space GI fallback" sounds great! but for now I think the H-trace + reflection probe fallback combination is good too, I know it cannot compete with UE5's Lumen, But the indirect soft shadow of H-trace is definitely better than Lumen.
     
    Last edited: Sep 26, 2022
  4. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    The patcher moves the HDRP package to the local directory (unless it's already there, and, I guess, in your case it is) and adds some custom code in a couple of HDRP files. I think it shouldn't affect your own package modifications. Anyway, you can do the manual patching to be 100% sure that everything is under your control. It will take you just a couple of minutes of copy-pasting the code. I guess, you can easily understand what lines of code we are adding just by looking at our patcher file. If not - feel free to DM me and I'll help you :)

    I'll think about adding the instructions for manual patching to the documentation in the future.
     
    Last edited: Sep 26, 2022
    Blade_Master_2020 and Gooren like this.
  5. thwackstudio

    thwackstudio

    Joined:
    Mar 12, 2022
    Posts:
    13
    I am working on a project in urp but I just can't wait and I will probably buy hdrp version as soon as it will be ready to buy. It looks so awesome! :)
     
  6. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    281
    please please any ETA for URP release ?
     
    LapidistCubed likes this.
  7. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    Hello,i'm looking forward to this one.

    is there any playable demo for us to test out its performance and quality?
     
    Spikebor and FlightFight like this.
  8. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Just willing to mention that among many others I'm looking forward to the built-in version!
     
    Meceka, atomicjoe and Ziq-Zaq like this.
  9. cerrec

    cerrec

    Joined:
    Jan 19, 2017
    Posts:
    41
    Same here - the built-in version will be most useful for me.
     
  10. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    44
    Do you know if your solution will be compatible with VFX Graph or not ?
     
    Last edited: Oct 1, 2022
    FlightFight likes this.
  11. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thank you for your kind words! ;)

    Hi! We have an internal demo, but it needs some polishing before the public release. We'll think what we can do about it.

    Got it! We're actually planning to see if we can port it to built-in right after the URP release, so it's on our todo list for sure :)

    I haven't tested it yet and I'm not really familiar with the current VFX system, to be honest. For now I can say that if the native SSGI is compatible, then H-Trace is compatible as well (when patched). There's also a plan to output H-Trace buffers to the Shader Graph system, so you could use it in your custom shaders. Probably I need to take a look at the VFX Graph as well.
     
  12. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi everyone!
    Here's our Discord Server, feel free to join it :)

    It's quite empty at the moment, but when the asset is released it will come in handy. You can use it to report bugs, ask your question and just communicate about everything related to our assets. And there's also a dedicated channel for our development updates.

    This forum thread and Twitter will be also receiving regular updates, so if you prefer to stay here - it's totally okay ;)
     
    Last edited: Oct 16, 2022
  13. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    upload_2022-10-11_16-50-50.png

    H-Trace 1.0 for HDRP is released!
    Here's the Asset Store link


    We are looking forward to your feedback!
    P.S. if you encounter any issue or bug - feel free to report it here or on Discord and we'll try to do our best to fix it.
     
    Last edited: Oct 16, 2022
  14. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Great! Will it work also with 2021.3 LTS? The asset store lists 2022.1+ ...
     
  15. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    The asset store says that because that's the version I was using when I submitted the asset. I tested it on HDRP 11 which goes with the 2021.1.9 version and everything was fine. So I think it's totally okay to use it with 2021.3 LTS. I'll add this info to the description.
     
    atomicjoe and Qleenie like this.
  16. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    44
    Just
    Works very well ! Really amazing this asset!
     
  17. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    I wasn't expecting it to come out so soon, pretty unfortunate timing as I'm not doing well financially atm but I can't wait to get my funds and buy this! :cool:

    Awesome!
     
  18. Thermos

    Thermos

    Joined:
    Feb 23, 2015
    Posts:
    148
    Will URP support be a different Asset?
     
  19. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    633
    BOUGHT and supported! I'm still in disbelief Unity finally got a HIGH quality truly real time global illumination system after so long, even at such an affordable price! Thank you @Passeridae !!
     
  20. Ookoohko

    Ookoohko

    Joined:
    Sep 29, 2009
    Posts:
    103
    Bought the asset!

    Pretty impressive stuff, I have to say :)

    So, what's next on the roadmap? Any plans for better fallback solutions (custom probes? DXR raytracing? something else?) - I want to see someone kicking Lumen's ass, seriously.

    br,
    Sami
     
  21. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thank you all for your support so much! I would not be able to make it without i! :)

    Thanks!

    Thank you! I guess, Unity will have another sale sooner or later. I'll participate if it's possible.

    Yes, it will be released separately. But those who bought the HDRP asset will get an automatic discount for the URP asset.

    Thank you! Much appreciated! ;)

    Thanks! Yes, sure, we will be developing a new fallback system and improving the current screen-space part (Importance Sampling, Ray Binning, VRS, etc.) as well. If you have any ideas on how we can make it better - feel free to share!;)
     
    Thermos, blueivy, jiraphatK and 3 others like this.
  22. Ookoohko

    Ookoohko

    Joined:
    Sep 29, 2009
    Posts:
    103
    In fact, I do have some ideas ;)

    Probably obvious, but screen space stuff solves the "easy" part of the GI (and yours is by far the best implementation I've seen). I've been looking at some of the current solutions for the "hard part", which is gathering the relevant radiation information outside of the screen and storing it into some kind of structure.

    First thing that needs to be done for that is obviously proper ray tracing against the actual scene, organized in an efficient acceleration structure, whether that is a DXR-based hardware implementation, or a custom hierarchy + simplified signed distance field representation of the scene. F.ex Lumen supports both of these (it has a hardware and software mode, which surprisingly is faster but less accurate than the HW mode).

    IMO the tricky thing is not so much shooting the rays, but rather the question on where / how / when do you shoot them, and how do you actually cache and utilize the resulting data.

    For the "where to shoot rays" question there are RESTIR and similar methods, which try to make sure that the rays are shot as efficiently as possible for gathering the lighting information. NVidia has done a great job with this in their latest path tracing implementations. First versions of RESTIR dealt with direct light sampling, but I've seen a few implementations using RESTIR also for the first bounce rays, which would be perfect for this use case.

    For the GI caching - this is where it gets really tricky in my opinion. There are several ways to do it - light probes (either statically placed or dynamic ones like in NVidia's RTXGI probes) and voxel structures being the most obvious ones.

    They do tend to be a bit prone to light bleeding, and not very good with moving objects, though. As long as there's a clever method for dynamically placing the probes and making sure the rays don't hit them thru walls, probes actually work well enough for most cases.

    Other approaches I've seen are f.ex surfels / splatting (EA's SEED engine), neural radiance caching (there's a bunch of papers for that), and some kind of "card-based" cache methods (that f.ex Lumen uses) and of course caching the result in screen space and transforming + denoising it.

    I've been also thinking of simple hacks, such as making the diffuse GI work only on per-vertex accuracy, which would be a perfect way to cache it (and prevent it from bleeding). That would probably work quite nicely if the poly count is at reasonable level.

    There's some info in here, maybe this gives you some directions. There's also a bunch of really cool github projects, such as Kajiya, which I recommend you to check out. Also the new GPU Open project "GI-1.0: A Fast and Scalable Two-level Radiance Caching Scheme for Real-time Global Illumination" looks interesting, but the paper is not out yet.

    https://advances.realtimerendering.com/s2022/index.html
    https://jannovak.info/publications/NRC/index.html
    https://github.com/EmbarkStudios/kajiya
    https://gpuopen.com/learn/publications/
    https://research.nvidia.com/publication/2021-06_restir-gi-path-resampling-real-time-path-tracing

    (Here's a cool video of Kajiya)



    br,
    Sami
     
    Last edited: Oct 12, 2022
  23. cepoimario280135

    cepoimario280135

    Joined:
    Jan 24, 2020
    Posts:
    12
    Looks amazing and will buy as soon as possible , congrats !

    If I can give you a small advice , add (GI or Global Illumination ) in the asset store title.

    I check for GI assets for time to time and yours does not appear in my usual search queries ,fortunately it was in some asset store recommendations.

    Now in regards to the asset it self, what would you says is the performance in comparison TO RTGI (Quality preset at 2 bounce) ?Also are al light types supported?

    Thanks In advance
     
    Last edited: Oct 13, 2022
    PutridEx, Gooren and blueivy like this.
  24. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    I second your good question about the light types, since HDRP offers quite a lot of them :D
     
  25. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Yep, as a kind of combination of the two: I was trying to look around for a comparison between Unity's SSGI and h-trace, but couldn't find any. I think especially for people who haven't been aware of h-trace previously (i.e. haven't followed this thread), the main question is - why should I get this when I could already use SSGI? So it could be worth it to demonstrate it looking better, being more stable/robust and/or more performant when dialled down to match the quality of Unity's SSGI.
     
  26. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thanks for the idea!
    Yeah, I guess I'll add "GI" to the title :)

    About the performance. I work on a laptop with RTX 3060 (Unity 2022 + HDRP 13) and Quality preset with 2 bounces runs very slow for me. Like 5-10 fps. Way below something interactive. Even 1 bounce runs extremely slow in the Quality mode. Performance mode is sort of okay: about 40 fps (full screen), but that's only one true bounce. H-Trace runs at ~60 fps with very high settings. And of course you can tweak these settings to make it even faster or better-looking.

    All light types are supported, because that's how screen-space stuff works: it doesn't need to actually know about light objects in the scene, It just gathers data from the final frame which contains pixels lit by those lights. So it doesn't matter if you're using a directional light, a point light or just an emissive mesh - it's all the same. What matters more is weather any of the lighting is visible in the frame or not.
     
    cepoimario280135 likes this.
  27. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Is this compared to ray traced GI or SSGI? I'd be interested in the GPU costs of H-Trace, how much ms it needs per frame on comparable settings to SSGI.
     
  28. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hmm...you mean make screenshot / video comparisons for the Asset Store? Cause I've already posted some of such comparisons here, in this thread.
     
  29. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    633
    For people asking for comparisons with Unity's SSGI, there was one posted here.
     
  30. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Yes, exactly, for the asset store, perhaps even as one of the first screenshots or videos, because that's probably your best selling point - 'look how much better this is than Unity SSGI'.
     
    atomicjoe likes this.
  31. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    OMG! WE NEED THIS FOR THE BUILT-IN FORWARD RENDERER!

    The HDRP is not compatible with all platforms and is too performance heavy anyway and URP is still not on feature parity with built-in and will never be (as surface shaders will not be supported and will be replaced with some block shader stuff nobody asked for that will not fix anything) and STILL it has worse performance than the built-in forward renderer, no matter what the Unity marketing team want us to think.
    PLEASE! bring this gem to the built-in forward renderer!
     
    Meceka, SammmZ, Stardog and 1 other person like this.
  32. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    If you need 'Real time' GI for URP and built in there is a guy developing that solution with great result also.
    I'd check that out instead of waiting for this one to be ported because it will be longer & harder to do since the current system is designed to work with HDRP's architect.
     
    atomicjoe likes this.
  33. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    633
    Here is the developers answer about built in and URP versions. It is entirely doable.

    Let's not promote other assets in a developers thread please.
     
    Passeridae likes this.
  34. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    We are actually finishing the URP port right now :)
    Yeah, built-in is also coming ;)
     
  35. TyGameHead

    TyGameHead

    Joined:
    Apr 29, 2017
    Posts:
    25
    Can't wait urp is going to look nice :)
     
  36. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    :oops: sorry for my assumption. I read your post about reflection probe fallback and thought it'll take longer. Anyway, it doesnt excuse me from promoting other asset in this thread (even though that was not my intention:(). So I apologized for that.
     
  37. mush555

    mush555

    Joined:
    Feb 4, 2020
    Posts:
    23
    ・One directional light that illuminates the entire scene
    ・Block the front of the Cornell box with a wall

    When the above conditions
    Does H-Trace darken properly inside closed Cornell boxes?
    If it doesn't get dark, do you have any plans to improve it?
    I think the H-Trace looks pretty great already.

    Unity's SSGI did not give good results even with probes in place.
    Even in a windowless room, it didn't get pitch black.
     
    Last edited: Oct 15, 2022
  38. TyGameHead

    TyGameHead

    Joined:
    Apr 29, 2017
    Posts:
    25
    waiting for H-trace Built In and Urp on Vimeo
    Came to a conclusion that when H trace comes to urp and built in I will no longer use hdrp its stressful and pain agony trying to optimize that thing I found a GTAO Ground Truth Ambient occlusion solution for built in since urp has mobile occlusion. Thanks again Passeridae no other ssgi has a much better stable and crisp Gi solution you the top right now and amazing it is better then hdrp ssgi. :):D
     
    atomicjoe likes this.
  39. TyGameHead

    TyGameHead

    Joined:
    Apr 29, 2017
    Posts:
    25
    H trace is great the stressful and pain is unity's HDRP
     
    atomicjoe likes this.
  40. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    So, If I get it right, you want to have a fully enclosed Cornell Box and expect that it will be completely dark inside (as it would be in real life), correct?

    It's okay, no worries ;)

    Thank! We're working on URP right now :)
     
    blueivy likes this.
  41. mush555

    mush555

    Joined:
    Feb 4, 2020
    Posts:
    23
    Yes. That's right.
    Sorry for my poor english.

    ///edit///
    Unity's standard SSGI stayed bright even with the room closed.
    UE's Lumen was able to darken the room correctly.
    (At least it looked more like the real world than Unity)
    This may be a general limitation of SSGI.
    Can H-Trace overcome this limitation in some way?
     
    Last edited: Oct 15, 2022
  42. TyGameHead

    TyGameHead

    Joined:
    Apr 29, 2017
    Posts:
    25
  43. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    So did you port it to built-in yourself?
     
  44. ArnoldCarterWong

    ArnoldCarterWong

    Joined:
    Sep 26, 2017
    Posts:
    31
    It seems Specular Occlusion is not working in forward rendering

    Edited: I have solved it by adding the required codes to ShaderPassForward.hlsl and declared the identifier in ShaderVariablesLightLoop.hlsl
     
    Last edited: Oct 16, 2022
  45. TyGameHead

    TyGameHead

    Joined:
    Apr 29, 2017
    Posts:
    25
    I'm using a different type of GI while I wait for H trace built in version the one using is pretty noisy and light still moves a little but I got say I haven't use built in in a very long time feels smoother for some reason.
     
  46. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    From what we tested, the darkening effect of the H-Trace doesn't work that well, not sure if that is an issue regarding to Custom Pass injection point being after deferred lighting as a post processing effect, as oppose to SSGI which is doing that within the deferred lighting pass (from the frame debugger). Its nice but not very stable, relies too heavily on reflection probes on those dark scenes, causing a lot of artifacts when the light source off screen.
     
  47. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    Is this patched or unpatched version? I tried the patched version and the resulting GI is specular! The dev also posted interactive comparison in discord as well as playeble demo. Worth checking it out.
     
  48. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi! Sorry to hear that. Please, describe in more detail what do you mean by the "darkening effect" and attach some screenshots if possible (you can also DM me if there's something that you can't share publicly)

    The common issue is that sometimes reflections are not taken care of: either the sky reflection is leaking everywhere or the probes baked / set / placed incorrectly. This results in GI being almost invisible because its just overpowered by reflection data.

    That's why we have the "Patch" button witch integrates H-Trace into the pipeline in the same way :)

    This is a natural limitation of all screen-space effects, but it would be interesting to see an example of such scenes, because maybe there's just something broken. Also, can you please describe the artifacts that you see?
     
    Last edited: Oct 16, 2022
  49. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Got it! I'll check it today and post screenshots.

    Sorry for the inconvenience! I'll try to fix it in the next update.

    Yes, I watched both of the videos you posted. I know this SSGI that you're using in them ;)
     
  50. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    I bought it and works really great out of the box! 10/10 lighting, the best I seen in Unity so far and it's actually better than Unity's SSGI.

    I just got my feet wet atm and I can't wait to use it in a proper scene. I'm going to make more tests but this works great in a forest too!

    screen_3840x1818_2022-10-16_18-33-40.jpg
     

    Attached Files: