Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

Unity Experimental HDRP DXR

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

  1. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    Weidz_ Forget use pure Path Tracing until developer make some improvements.
    Suggest two steps:
    1. Use PT with denoiser
    2. Start with something simple at the beginning, here exported to obj models:

    SSAA_20200625_02272331_1080p.jpg

    First you must play with lights and settings in basic scenes.
    Two Hints: do not use any environment lights like HDRi or Physical Sky. Only Area Lights in Windows. Always train and setup light in override mode (white color) after that do surfacing.
    DXR is not ready yet for GI environmental system.
     

    Attached Files:

    sendspace likes this.
  2. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    Sorry for off topic but I have to show you masterpiece of our K3 Engine Code. Photon Mapping with QMC sampling and our new update with LightPortals. Light source only Physical light.
    K3_.png
    K3_LP.png

    This is important to get it in UNITY.
     
  3. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    144
    And what the difference between this and pathtracing?
     
  4. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    First phase is interpolated: Photon Mapping
    Second phase is brute force sampling.
    This method (when engine is good) create almost same GI quality as Path Tracing but much faster - like 10-30 times.
     
  5. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,490
    pb1.jpg
    pb2.jpg
    Converted watacaractr's Tom & Jerry table with Visual Pinball Engine for Unity to Unity DXR.
     
    jeremedia, OCASM, SKoptev and 4 others like this.
  6. Bzuco

    Bzuco

    Joined:
    Sep 6, 2015
    Posts:
    55
    Hi, what is the magic combination of unity and hdrp versions?
    I tried latest 2019 LTS and 2020.1, both with verified HDRP versions, but immediately after I enable raytracing on GI in inspector, unity crash. The DXR wizard shows me everything green and fixed. I also have not luck with github 2019.3.6 cloned project.
    Same result in unreal engine(4.25.3 and 4.24.3), after enabling raytracing, editor crash during startup procedure.
    win10 LTSC(1809), rtx 2060s, latest nvidia driver
     
  7. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    432
    try 1 or 2 versions back for your GPU driver perhaps....
     
  8. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    130
    Hey i'm trying to understand why the color picker's color in Unity is so off compared to other applications

    They all have the same color value (r:1, g:0.306, b:0) but Unity sticks out like a sore thumb

    I'm coming across this issue as we're trying find a workflow in bringing our models from 3DSmax 2020 to Unity, but the color representation difference between Unity and Max (as well as all other 3D apps) is pretty stark.

    Is this a bug/oversight? Is there a workaround? A recommended workflow? Are my sRGB settings off somewhere?

    (I did notice that if i open a HDR color picker that the colors are accurate to every other 3D application, but that's not an option on most standard materials)

    Unity:
    upload_2020-8-7_12-33-17.png

    Blender:
    upload_2020-8-7_12-31-19.png

    Unreal:


    Substance:
     
  9. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    726

    You are using incorrect values for Unity. RGB 0-1 isn't linear, in Unity all those value input options return regular sRGB values. In Blender Painter and UE4 they have that set to linear. If you want correct values use the Hex code. In your UE4 Screenshot, you can see it shows both Linear and sRGB Hex values. Use the sRGB one and it should look the same. Blender also uses the sRGB Hex

    This is using the sRGB Hex Value from your UE4 Screenshot -If you switch to Hex in Blender you will also get the same code used in Unity.
    upload_2020-8-7_15-47-1.png
    upload_2020-8-7_15-49-46.png
     
    Ofx360 likes this.
  10. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    130
    Thank you so much. I was really trying to understand it.

    Do you think it'd be better for Unity to adopt the seemingly DDC standard?

    Because even their HDR color picker is linear
     
  11. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    726

    Having the option to switch/input both would be nice. Or at least make the RGB 0-1 mode linear and the others can stay as they are.
     
  12. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    keeponshading likes this.
  13. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    Hmmm2x - did another test of "Master" HDRP branch from GitHub (now it's 10.1.0 preview 2) - it's still won't run out of the box (at least on Unity 2020.19a), but I've commented 3 problematic lines (line number 818, 819 and 946 in HDRenderPipeline.cs file) and it's running now, HDRP wizard is available in Unity editor menu.

    Next testing step - on the default sample HDRP scene with construction stuff this HDRP still blowing up exposure/had jagged shadows/shading mad flickering... I was like "meh, still not working" but following some desperate intuition call I've removed that construction projector light and ... all works fine, no more exposure blow-ups and shading blocky artifacts/flickering.
    Updated my main project on 10.1.0 preview 2 HDRP DXR - works fine at first glance, new features to test!
    WEEEE! )

    Upd: now spotlights with cookie texture can cast ray-traced shadows... cool. Pointlights (omnidirectional) can do that too! But you need to create a spotlight first, assign cookie texture and only after that change it to pointlight - and cookie texture + ray traced shadows still will be working oO, even if you simply create a pointlight it won't allow you to assign cookie texture to it...

    Upd2: ray traced ambient occlusion sometimes goes mad (making black screen), but overall feels good to work with )

    Upd3: Project builds normally.
     
    Last edited: Aug 9, 2020
    keeponshading and sendspace like this.
  14. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    574
    Great list.
    So how it fits into this logic?
    • Unity 2019.1 is compatible with SRP version 5.x
    • Unity 2019.2 is compatible with SRP version 6.x
    • Unity 2019.3 is compatible with SRP version 7.x
    • Unity 2020.1 is compatible with SRP version 8.x

    Unity 2020.3 LTS or Unity 2021.1?
    Or is it 2020.2 because it seems SRP version 9.x is skiped?
     
    Last edited: Aug 9, 2020
  15. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    144
    SRP 10 is compatible with 2020.2 and will be released in a few weeks when 2020.2 beta is out.
     
    keeponshading and sendspace like this.
  16. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    keeponshading likes this.
  17. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    574
  18. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    64
    It's still broken, I've done the construction light trick a couple of times in the past two months but the problems will come back.

    The other issue (over exposure) seems to happen because RTGI and RTR are both fighting with PreExposure in the global constant buffer and overwriting each other.
     
    Last edited: Aug 9, 2020
    Lex4art likes this.
  19. sendspace

    sendspace

    Joined:
    Jul 24, 2016
    Posts:
    39
    the latest hdrp 10 p2 by Lex4art works fine so far under unity 2020.2 a18.
     
    Lex4art likes this.
  20. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    16
    Hello, i cant get raytraced reflections to work on a lit transparent material (through Screen Space Reflection). It works fine with opaque but ooks deactivated with transparent type. Is it expected ? Is there something special to set ? Thanks.
    Unity 2020.1.1
    HDRP 8.2
     
  21. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    This feature not present in HDRP 8.2, wait for 10.x version.
     
  22. Mark_J18

    Mark_J18

    Joined:
    Aug 11, 2014
    Posts:
    47
    Anyone having trouble getting RTX global illumination working in 2020.20a21? Seems to have no affect at all for me with HDRP 10

    ---- Edit - Worked it out (and in case anyone else is updating to this version) - for some reason on upgrade I had to manually turn on Screen Space Global illumination in the HDRP default settings although it was on before and was also turned on in the HDRP quality settings
     
    Last edited: Aug 21, 2020
  23. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    How you get HDRP 10.x ? This is not release yet....
     
  24. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    2,542
    You can just download it through github, there are no guarantees of it working/stability though.
     
  25. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    1,779
    10.0.0-preview.26 is in package manager if you enable preview packages. preview.26 is one month old now though so if you need something newer, you have to go to github.
     
  26. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    thanks!
     
  27. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    I think I will wait...I get huge amount of script errors.....
     
  28. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    Thanks Mark!...now 10.x is working. Will test it.....
     
    m0nsky likes this.
  29. Mark_J18

    Mark_J18

    Joined:
    Aug 11, 2014
    Posts:
    47
    No worries!
     
  30. passeridaepc

    passeridaepc

    Joined:
    Jun 16, 2019
    Posts:
    59
    Hi! If there's anyone here who uses 2020.2 + HDRP 10, how is the general DX12 performance doing? Is it any better than it was in 2020.1 + HDRP 9?
     
  31. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    76
    Take that with a grain of salt, I'd say it's slightly better than 2020.1, but not at all substantial.
    Efforts are still being done to make it better, but it's still not on par with what DX11 is offering performance wise, so just by switching to dx12 you can still expect a drop in frame rate.
     
  32. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    64
    Is there any ETA for getting global illumination & reflections back in working state when using performance mode? (issue tracker link)

    Currently I've checked out at a commit from May 18 (last working version), and I've been cherry picking and manually merging commits one by one to create a bit of a frankenstein v10.x package without the global constant buffer.
     
    Last edited: Aug 28, 2020
    GliderGuy and Lex4art like this.
  33. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    + 1 here, I have plans to release my first Steam early access game-project and it's based on the ray-tracing - in the middle/late of September there will be a very, very sweet spot to catch Nvidia 3xxxx series hype ... it will be good to know if 10.x will be there in it's alpha, but usable-in-general shape (enough for me, my own project in exactly same state now) or should I rely on old 8.2.x with it's own set of problems (like 4K and up resolutions bottleneck (4K runs 10-15 times slower than full HD, while expected performance drop is only 4 times; while HDRP 10.x.x goes just fine with 4K +)).

    Upd: 4K bottleneck seems to be solved since I've checked out it last time - HDRP 8.2.0 and latest Unity 2020.1.3f1 runs just fine in high resolution )
     
    Last edited: Aug 30, 2020
    GliderGuy likes this.
  34. Mark_J18

    Mark_J18

    Joined:
    Aug 11, 2014
    Posts:
    47
    +1 here too - I was just assuming I was doing something wrong with performance mode as everything was dark (GI) and seemed to be only direct light

    Am also curious as to whether unity will integrate the recorder any better with RTX and path tracer. noise for higher quality renders
    For example allow the user to add some form of "delay/ allow frame to render X seconds" in the recorder which will allow either a path tracing frame to complete or likewise allow the noise in RTX GI, reflection or AO to resolve - This is mainly for animation projects (i.e. non game)
     
    Last edited: Aug 28, 2020
    newguy123 likes this.
  35. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
  36. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    432
    Looking cool.

    Can you briefly explain why we would need PIDI reflection with DXR please. I thought the whole point of DXR among other things was raytraced reflections.
     
    fuzzy3d likes this.
  37. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    newguy123
    DXR system is not using GI solution in reflection surfaces yet. To avoid this "problem" you have two choices:
    - bake (with very low quality scene) and still object in pure mirrors looks not so good
    - use PIDI reflection which is render/caster system and shows exactly in mirror same GI quality.
    These above is only solution for pure mirror surfaces like big mirrors in room or bathrooms.
    Generally always you must bake at least walls to get proper reflection on surfaces in DXR system. Bake doesn't need to be high quality. I use low-quality with very low settings samples and high blur (like 10-30 sec whole BAKE). You do this only once.
     
  38. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    432
    So even with PIDI, you do a quick lowres bake anyway?

    Could you tell us more about the settings, like maybe give a screenshot?
    How do you bake GI for only walls and nothing else?
     
  39. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    Well, HDRP has "Planar reflection probes" (just a planar reflection, rendering scene twice) - they're do reflect ray-tracing effects, so there is no need for paid assets for mirror floor/walls ...
     
    newguy123 likes this.
  40. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    ...problematic , but you can test by yourself in DXR to see it (Planar reflection probes).
     
  41. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    You're right - they're not working properly (at least with HDRP 10.x), seems that PIDI is a really only one working solution here...
     
  42. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    Yes, and works great with standard HDRP bake scenes also.....
     
    Lex4art likes this.
  43. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    This is 2 hour long stream about ray-tracing improvements in Unreal Engine 4 (and, very likely, it's how it will work in UE5). Can't say this makes me happy - feels like Unreal team gave up on true ray tracing (it has very slow performance in general and on top of that it has extremely poor denoiser compare to Unity's implementation) - so, they dropped hard way and and started implementing tricky and sparse hand-placed light-probe/screen space based systems to make it work fast and low-end RTX/foliage friendly (and ray-traced reflections still didn't reflect GI even with all those hacks). Some cool things to watch - 01:17:33 - are caustics, plus DLSS 2.x implementation (really actual thing for Unity, 3x + boost is very welcome; this alone can make crude Unreal's DXR implementation outpace Unity's one - with DLSS they can trow 4x more ray tracing samples to mask poor denoiser work and that's it).

    Btw, using latest alpha version of HDRP (10.1.0-preview.20) I've managed to get it stable under certain conditions:
    1)GI should be using "Quality" preset. If it was switched to "Performance" preset - better set it back to "Quality" and restart Editor.
    2)There must be no reflection probes in the scene.
    With all those it's runs just fine, whole day spend without problems. Here is a test video from my Buildmark project with that - a benchmark scene with super rough camera work:
     
    Last edited: Sep 9, 2020
    newguy123 and fuzzy3d like this.
  44. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    432
    Wow @Lex4art that is looking awesome! Love it!
    Only thing bugging me is the flickering of stuff through glass.

    Also, before the sun is animated, like at the opening shot before it moves into the "arena" type area, the shadows seem to be having some kind of slight wave like movement, almost like the entire scene is under water or something.
    When you enter the arena and the sun is animated (and the camera moves more), the wavy like movements of the shadows is not present or at least with everything else going on, you dont notice it
     
  45. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    If we talk about Unreal: I tried 3 times this software to get into...all attempts fail. Total mess software, unfriendly GUI. I do not recommended.

    Also I have one friend who use now Unreal 1,5 year (comparing to my 6 months) ...his skill is good but he.....bounce in one place: He can not achieve High Quality renders (he works in same filed like me in design interior)...his skill stops on "game quality level".... Also he do not use pure DXR system in Unreal because...is very bad.
     
    Last edited: Sep 9, 2020
    Ruchir likes this.
  46. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    Yeah, this is how denoiser works on ray traced GI and shadows. I guess in the end I will use shadows without denoiser (but more samples) to cover this insane smudge effect (also I've noticed that on top of GI it's worth using ray traced AO with small radius and denoiser disabled - so, only GI has denoiser. AO also helps outline small details that was smoothed out by GI denosier).
     
    newguy123 likes this.
  47. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    432
    I thought denoiser works across the board. How do you get it to only affect certain things?
     
  48. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    Just tweak it in volume override settings - it's optional for each ray tracing effect.

    Upd: oh, direct light shadows denoiser settings are in direct light properties, not in volume override...
     
    Last edited: Sep 9, 2020
    newguy123 likes this.
  49. Janusz_Biela

    Janusz_Biela

    Joined:
    May 6, 2019
    Posts:
    143
    btw denoiser. I found nice trick:
    - for lights like IES or Area Light lamps I use only one sample is higher denoiser value: like 1/10 becasue you do not need sharp and accurate shadows from those light sources
    - for Area Light in windows I use opposite: more sample and less denoiser value like 10/2 - need more accurate and quality shadow.

    This allowed me to increase FPS like....twice! :p
     
  50. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    64
    Really cool stuff, your benchmark is looking great.
    Like newguy123 also pointed out, you can see the denoised shadows "waving" when the camera moves. I'm also running into this issue myself.

    I'm pretty sure this issue got introduced in PR #951
     
    Lex4art likes this.
unityunity