Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Official Unity Experimental HDRP DXR

Discussion in 'HDRP Ray Tracing' started by SebLagarde, Apr 4, 2019.

  1. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
  2. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Unfortunately, it won't make it for this version.
     
  3. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    But does it work on raytracing?

    I'm starting to lean more towards UE to be honest. For offline renders, it has everything you need built in, and it just works. No fiddling needed. No 20 different 3rd party plugins needed, that stop working each time Unity does an update, then takes 5 versions to be compatible again.
     
    keeponshading likes this.
  5. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    I stick with Unity because it is very well developed if we talk about DXR. Also, GUI is very friendly - reminds me Lightwave system. I think you do not need anything (third part plugins) to do offline renders in Arch department. I wait only for Terrain support and by this whole system will be complete. I do not need more ;)
     
    chap-unity likes this.
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Yep, that may be true for a small interior residential archviz scene, but wait till you need to do a large scale exterior archviz animation...
     
  7. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    I did already big interiors (still as tests, no commercial) - no problems at all..you can give me whatever.
    I am about to finish the whole system for interiors after 2 years of digging (yes my company has a very difficult pipeline, quite unique and really complex - that's why took so long)
    I start soon Exterior system - so soon you will see new renders from me :cool:
    I know many things are better in Unreal (or I am wrong?) but I like Unity GUI and system and that's for me means a lot.
    Remember that I use Lightwave 3D for 25 years - because I like it, more: I love it. You can call me a dinosaur (not so many people use Lightwave 3D) but The Power is from Skill not from software ;)
     
  8. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,668
    good to see a Lightwave user
     
  9. phreezie

    phreezie

    Joined:
    Oct 3, 2019
    Posts:
    119
    Did a test with ray-traced reflections and it turned out pretty well!

     
  10. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    New 2022.2.0b2 Entries since 2022.2.0b1
    Features
    • HDRP: Added Ray Tracing Terrain support for HDRP.

    Wooohooo!
     
  11. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    however, it is not yet reflected in the Roadmap:confused:
     
  12. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    It's a nice addition indeed but keep in mind that it's only the terrain itself that is supported, no trees, no vegetations :/
     
    JansM and Lex4art like this.
  13. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Ah that sucks. We typically dont use terrain at all. All our "terrain" is just imported FBX meshes and we scatter/spawn our grass/trees/plants over the meshes.

    Is there an ETA of when we can expect things like trees/grass to be fully supported by raytracing/pathtracing and instancing thousands of them? (or indirect instancing, whatever)
    I'm talking about blowing in the wind, not just static trees/grass

    Also, I'm talking about offline rendering for film...
     
  14. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    No ETA.. Sadly, it's a complicated problem so it will take some time.

    Indeed, Vertex animation is part of why that problem is complex and it's crucial to having proper support for trees and foliage.
     
    newguy123 likes this.
  15. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    I got some new ideas on how to avoid some limitations in DXR and also I switched to Quality GI (it`s lower my fps performance by 20-40%, but GI quality is better)
    Interior_DXR_006_.png Interior_DXR_003_.png Interior_DXR_005_.png Interior_DXR_007_.png
     
  16. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Which are you referring to, and how did you avoid/solve it?
     
    chap-unity likes this.
  17. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here is the list:
    - correct position of Reflection Probes (fallback for reflection/GI)
    - two Area Lights (inside Interiors and outside) One has the normal quality (4/12) and is small like 1x1 m, the second one, is big with min samples (1) with max blur samples. This makes a better effect than Physical Sky light (I keep also it just to fill light for the exterior part (terrace)
    - Indirect boost for reflection and Diffuse (x2)
    - Quality GI with one sample (and of course one bounce - not with Ampere 3090 - too slow GPU)
    - My Nodes Surface System
    - not using Translucency (DXR SSS is much better and offers the same speed)
    - some tweaks in HDRP settings (smaller amount of cells for Area Lights, etc)
     
    chap-unity likes this.
  18. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    After over 2 years I finally finished my Interior system in DXR!
    That was an incredible journey with new features (GPU system render) for me as CPU offline render guy (using Lightwave for almost 30 years since appearing on Amiga computer - v4.0 LW).
    Right now I feel like in home with Unity (similar to Lightwave) and this will allow me to improve/invent new ideas without focusing on unknown fields. I prepare mysel f now for the Exterior system (I think I will be ready next spring 2023...maybe)
    Here are some final renders from my test Interior (DXR system, 5-20 fps in UHD):
    Interior_DXR_001_.png Interior_DXR_005_.png Interior_DXR_009_.png Interior_DXR_010_.png Interior_DXR_011_.png
     
    LeonhardP, sqallpl, INedelcu and 4 others like this.
  19. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    #2
    Interior_DXR_013_.png Interior_DXR_014_.png Interior_DXR_015_.png Interior_DXR_016_.png Interior_DXR_017_.png
     
    dnach and PutridEx like this.
  20. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    #3
    Interior_DXR_019_.png Interior_DXR_021_.png Interior_DXR_025_.png Interior_DXR_026_.png Interior_DXR_018_.png
     
    dnach likes this.
  21. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    #4
    Interior_DXR_030_.png Interior_DXR_032_.png Interior_DXR_033_.png Interior_DXR_034_.png Interior_DXR_027_.png
     
    dnach likes this.
  22. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Nice set of images in your last 4 posts. Would be great to see a comparison with these side by side with their pathtraced counter parts
     
  23. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    newguy123 is not big difference. Of course is better looking but not that much, also I will render animation so I stick with DXR.
     
  24. Mehrdad995

    Mehrdad995

    Joined:
    Jul 17, 2013
    Posts:
    46
    My quick non-clean fix was to move the corresponding folder from "Library/PackageCache" to "Packages" as unity was expecting it at the wrong path.
     
  25. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Hi!
    3 weeks ago I switched to H-Trace engine, and this is the last scene done in Native Unity DXR (I did not switch this scene to H-trace). I made a decision to test in an Extreme way Unity DXR SSGI (and I really meant extreme) Maybe later will show this test when it is finished. The scene contains a huge amount of polygons, surfaces, and physical lights (I had to increase the number of raytracing shadows up to 256 in HDRP).
    Meanwhile, 2 days ago I upgraded my GPU from 3090 to 4090.
    If you think about 3090 ...FORGET!
    4090 is like moving from car to jet. Everything is much better, including power consumption. This card even not get sweat!
    before:
    img_001.png

    3090_4090.jpg

    20221118_162127.jpg

    After:
    20221118_171231.jpg
     
    Lex4art likes this.
  26. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here is the test in heavy scene:


    And one screenshot from GPU-z when use test extreme scene
    img_002.png
     
  27. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    4090 at least 50% faster with RT - decent increase. I hoped for something more radical, but it seems that is it and this is the best money can buy. AMDs multi-chip 7xxx GPUs, unfortunately, didn't feels like really multi-chip - only some kind of memory multi-chips were used, GPU die still in one huge piece and RT performance still 2-3 times lower than Nvidia...
     
  28. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Lex4art Increase is between 70-120 % depending on the scene and from GPU setup (I use Afterburner and no OC). But the best part is Power Consumption and Silence (watch screenshot from GPU-z). 4 nm lithography is really efficient.
    The Power Consumption is between 70-150 Watts only with the default GPU run in Unity with heavy DXR scene.
    Here, check the chart Ada Performance and Tensor/RT Cores + 16K+ CUDA:
    1663687645_screenshot_(405).jpg
     
    blueivy likes this.
  29. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    If your 4090 can't use more than 70-150 watt then you're most likely bottlenecking somewhere. Also, H-Trace is a screen space effect.
     
  30. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Both are correct/incorrect ...actually Three things:
    - bottleneck CPU (Dual Xeon 40HT 2.6 Ghz) for single thread application ...this is crap I do not think so this is a problem
    - this scene above is Unity DXR (no H-Trace)
    - PCI-E 3.0 (1-3% speed less)

    GPU load above is 100%
    This scene above with 3090 was really run as hell (Had to use Afterburner to reduce Power not to boil the case)

    I have to see GPU-z under the Enemies demo.

    For me: this card is simply really good. Remember also this is 4 nm lithography - that's very, Very efficient with energy GPU compared to previous Ampere gen.
    So far I could overrun this GPU at all over this example.
     
    Last edited: Nov 22, 2022
  31. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Alright. I thought it was h-trace because the video starts with a big h-trace logo and it says you used h-trace in the description.
    That xeon is definitely a problem. :D
     
  32. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi everyone!!!
    I'm playing a bit with Unity 2023 HDRP and raytracing and I'm very confused.

    I'm trying to make a room dark because there's no sunlight coming in...
    But I can't get it. The ambient lighting of PBS always stays as you can see in the following video:


    I have touched all the parameters of "SSGI" but I can not eliminate this annoying problem. I also have a reflection probe updating in real time... but it doesn't do anything either.

    I'm confused. I have tried to follow this guide: https://forum.unity.com/threads/hdr...acing-lighting-troubleshooting-guide.1248550/
    and other Unity videos like this
    .
    But I don't know how to solve these problems.

    Is Unity not able to handle this type of scenario without having to change all kinds of settings in the PBS, intensity of directionalLight, or patching settings with "Indirect Lighting Controller or Exposure"?

    How can I handle this type of situation? Any info, help, etc??

    Cheers
     
  33. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    This is because the lighting inside your reflections is not ray traced. You need to use baked lighting & reflection probes for the lighting inside your reflections, or switch to the path tracer.

    Ray tracing this recursively in real time is very heavy and creates complex problems when it comes to denoising.
     
  34. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Nope. :D
    I checked "double" Enemies with other specifications (much better CPU when we talk about frequency) Same resolution, and the same setting.
    My Max GPU Mother Board Draw Power: 200-270 Watt.
    This guy uses a much better CPU than me:



    In the first video, I have around 10-15% more frames/sec (sic!)
    In the second video, I have around 5-10% fewer frames/sec...but this is a monster CPU

    No bottleneck.

    This GPU card is simply good:
    https://www.zotac.com/product/graphics_card/zotac-gaming-geforce-rtx-4090-amp-extreme-airo
     
    Last edited: Nov 22, 2022
  35. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here is my test Panorama from Unity and H-Trace. My private free project.
    I updated (and reminded after 2 years break) Pano2VR5 to Pano2VR6 for some new features which appeared in the last upgrades.
    Do not watch some mistakes in features or object replacements because those are new for me and I did not learn altogether this time when I combined Panorama.
    img_001.png
    Panorama

    You can run it on mobile phones also.
     
    Rowlan, m0nsky and olavrv like this.
  36. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Nice work!
     
  37. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Volumetric fog with ray tracing (voxel-based?) gives very sweet effect for some areas/lighting conditions (scroll to 4:12 for example)... hope something like that will be possibly with ray tracing (e.g. for emissive materials to lit volumetric fog/particles)... someday... XD
     
    Last edited: Jan 14, 2023
    blueivy likes this.
  38. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Doesn't have anything to do with voxels in particular, it's just that the voxel version decided to implement it and the RTX one did not. RTX (or DXR for that matter) can do it a lot faster (and more accurate, because no leaking)

    If you were to do this in HDRP, you would need some light sampling strategy and at least 1 extra ray. Zyanidelab recently wrote a nice article about participating media for anyone who's willing to give this a go.

    Here's some stuff I've been working on recently.

    I wanted to create stereo reprojection and hybrid shadowrays for HDRP DXR. I did not have any experience with screen space techniques so I decided to study these in late 2022. I built Crytek's 2007 sphere kernel SSAO, then surface normal oriented hemisphere SSAO and then ray marched SSAO.



    With this knowledge it was time to go back to HDRP DXR.



    VR stereo reprojection for RTGI. Only the red tinted pixels on the right eye are ray traced, the others are re-used from the left eye. This actually reconstructs the view space position on the left eye and then rejects based on a defined depth + normal heuristic. Since diffuse is independent of the view vector it's pretty reliable for re-using samples. (except in theory some minimal bilinear blur)

    I want to do the same for RTR, but it is a little difficult in the default HDRP DXR setup due to the way the rendering is fragmented and what kind of sample distribution is expected by the BSDF (because moving the camera changes the sample distribution, because it is view vector dependent).



    Hybrid shadow rays. For as long as the ray is on the screen, it will march the depth buffer, when the ray leaves the screen, it will start DXR TraceRay on the position where the screen space ray stopped. Green tinted samples found a hit in screen space.

    Edit
    I just finished stereo reprojection for RTR. It stochastically rejects samples based on NdotV & roughness.

    I have also experimented with re-weighing the samples based on both sampling domains (because the specular lobe moves) but it will give no benefits in a single frame.


    No reprojection


    Reprojecting both diffuse + specular

    RaytracingIndirectDiffuseEvaluation
    Stereo reprojection disabled : 9.4 ms
    Stereo reprojection enabled : 5.1 ms

    RaytracingReflectionEvaluation
    Stereo reprojection disabled : 9.7 ms
    Stereo reprojection enabled : 7.1 ms

    I'll soon see if I can strip down the right eye pass a little more, and if there are any benefits when it comes to using a "center eye". I also want to explore using a different slope for the lobe approximation, just like how the balance/power heuristic works in MIS.


    Specular rejection mask
     
    Last edited: Jan 18, 2023
  39. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    m0nsky
    Question about the annoying Limit with Maximum Lights per Cell
    screen_ (1).png

    How I can increase this limit?
     
  40. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Personally I don't use rasterized lights so I haven't needed it. The only thing I can recommend is to inspect the light cluster debug mode (which you can read about here) and then change your camera cluster range to see if scales the size of the cells to something that better fits your use case.
     
  41. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    m0nsky Yes I know but this does not help when a lot of lights are in a small space. I was thinking maybe some deep settings, somewhere. Pity that the limit cannot be overridden.
     
  42. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    I can override the limit and create a project with a custom HDRP package for you, but I can not guarantee it will work. You will have to test it yourself. :D



    Just tell me which Unity version you prefer and I will get it ready tomorrow.
     
    PhoenixAdvanced and impheris like this.
  43. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
  44. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Here you go, this one has a limit of 128 lights per cell. o_O
     
  45. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Thanks! Work!
    Will test it soon with a real scene.
    It is difficult to do it? I mean to change HDRP asset, for example, if want to do it in an older version? or how I can activate it in the older Unity version?
     
  46. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    No, it's pretty easy if you have some experience with modifying packages. Sideload your HDRP package (clone from Library/PackageCache to Packages folder), navigate to Runtime/Lighting/Lightloop/Lightloop.cs and change k_MaxLightsPerClusterCell (line 289) to your new maximum value. I have not checked anything related to allocations/buffers so I don't know how high you can go before you run into trouble.
     
  47. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Thanks!
    There is no need to go high because in extreme situations I feel like 4-8 slots are missing.
    So 24 is at the edge and I think 30-34 will be enough.
     
  48. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,668
    Sr, you are a very good sr... :cool:
     
  49. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    m0nsky
    Works like charm!
    34 slots is enough for me ;)
     
  50. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    m0nsky Silly question:
    How I can EXCLUDE LEM object from GI in Path Tracing? ...so I see exposure (for example outside background for Interior) but it does not participate in Global Illumination.