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. Dismiss Notice

Official Unity Experimental HDRP DXR

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

  1. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    Here are renders with SunFall SSAA. I got like 5 fps/sec. Looks like very slow but I use 2 bounce lights GI (one bounce light is too bad for interiors):
    SSAA_20210708_22575168_1080p.jpg SSAA_20210708_22580555_1080p.jpg SSAA_20210708_22581737_1080p.jpg SSAA_20210708_22584864_1080p.jpg SSAA_20210708_23000327_1080p.jpg
     
    keeponshading and m0nsky like this.
  2. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    I managed with one bounce light and diffuse x2 so I got like 15 fps. Anyway SunFall SSAA allow me put much less samples from Physical Lights (boost speed) so I start make this scene finally. Keep fingers ! :cool:
     
  3. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Hello!

    I just pushed an update to the ray tracing sample repository, feel free to grab it and play around with the scenes (the repository got renamed). The link is now
    https://github.com/Unity-Technologies/HDRPRayTracingScenes

    Two new scenes have been added to a total of 3 (with different lighting setups).
    Appartement.png

    Cathedral.png

    SmallOffice.png
     
  4. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    auzaiffe as always is too complicate for me to run it. Can you just simple pack whole folder project ? When I try run it it shows me Unity 2022....so is downgrade so is broken....
     
  5. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935

    Thanks for the test projects.
    Always good to have such scenes.

    Because this is all pretty static here an HDRP Raytracing clone of the 424 project.)

    under
    git clone -b HDRP_Drive_Test https://github.com/sasa42/project-424-unity.git

    you can find an HDRP Raytracing fork of the 424 project.



    scene: 424 Test Track One Scene HDRP.unity

    In the Common settings profile (screenshot)



    you can enable/disable raytracing in the

    • Screenspace Global Illumination
    • Screen Space Reflection
    • Ambient Occlusion
    volume overides.

    Main purpose was to test raytraced car (self) reflections and interaction with the track en movement.
    Also to test TAA, DOF and Motion Blur during fast camera and car movements.

    Materials are mostly untouched. (auto-converted from BuiltIn RP)

    (Original BuiltIn RP https://github.com/PERRINN/project-424-unity)

    Hit play.
    Unmute Audio in Game Window.

    Drive : W/A/S/D (toggle Q Key first)
    Cameras: F1/F2/F3/F4/F5 with mouse interaction (zoom and rotation)

    Key: Q - toogle replay mode / self drive mode


    Would be nice if you could have an eye on such high dynamic use cases too.
    Or simply add it to your raytracing test and improvement scenarios.)
     
    Last edited: Jul 10, 2021
    PutridEx and sendspace like this.
  6. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    some PostProcessing tweaks.
    Pretty happy what RT GI and RT Reflections can do with an Directional Light and an IBL.

    rt_001.JPG

    rt_002.JPG

    rt_003.JPG

    rt_004.JPG

    When someone has some tips for more stable raytraced gi and higher quality raytraced reflections during 350 km/h drive. Add it.)
     
    Last edited: Jul 14, 2021
    newguy123 likes this.
  7. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    253
    I'm currently running into an issue with the RTGI quality mode.
    Outdoor areas are lit by an HDRI, and indoor areas are lit by emissive meshes, which has been working perfectly using RTGI in performance mode. I'm at the point where I want more samples per pixel so I decided to switch RTGI to quality mode.

    The problem is that, even at 1 sample per pixel, all indoor areas become lit in a very odd way even if there is no light source in the room, making everything look unrealistic/breaking immersion. I've submitted a bug report for this issue (Case 1350590)


    The conference room (Credits to Anat Grynberg and Greg Ward), lit only by the emissive box in RTGI "Performance" mode, behaving as expected


    The exact same scene, in RTGI "Quality" mode


    The conference room with no light sources inside the room, in RTGI "Performance" mode, behaving as expected


    The exact same scene, no light sources, in RTGI "Quality" mode


    The same scene, in RTGI "Quality" mode

    I've tried playing with the number of bounces, black ambient probe, baking/deleting reflection probes, lights and trying some open PR's that could impact the issue, but nothing seems to work.
     
    Last edited: Jul 14, 2021
    PutridEx, sendspace and keeponshading like this.
  8. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    Almost finished my Interior (SunFall AA solution):
    image_079_0000.jpg image_080_0000.jpg image_081_0000.jpg image_082_0000.jpg image_083_0000.jpg
     
    jcarpay, Rowlan and Lex4art like this.
  9. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    #2
    image_089_0000.jpg image_084_0000.jpg image_086_0000.jpg image_087_0000.jpg image_088_0000.jpg
     
    Elecman and Rowlan like this.
  10. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    #3
    image_090_0000.jpg image_091_0000.jpg
     
    Elecman and Rowlan like this.
  11. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    I have just did a quick test on a scene I was trying out for character animation with RTX. I can't recreate your issue so not sure what is going on.

    If it helps - I created a new "clean" project using the newest alpha

    The first attached image below is performance, and second image is quality.

    If a new project doesn't work, are you able to share the scene and I can take a look to help trouble shoot?

    PS I am using the newest beta (no reflection probe, no static sky lighting in environment tab, no baked probes )
     

    Attached Files:

    Last edited: Jul 16, 2021
    m0nsky likes this.
  12. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    253
    Try assigning a HDRI sky (I'm using this one) in your Sky and Fog volume.
     
  13. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    Yeah I am getting the same issue with the HDRI sky after trying it. The gradient sky and default procedural sky are a bit better (outwith reflections) for similar exposure settings. But yeah, it there seems to be a problem with HDRI exposure values and bounced GI.
     
    m0nsky likes this.
  14. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    Some 4K renders:
    image_093_0000.jpg image_094_0000.jpg image_095_0000.jpg image_096_0000.jpg image_097_0000.jpg
     
    sqallpl likes this.
  15. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
  16. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255

    I'll make releases for the unity versions
     
  17. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
  18. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    I finished my Interior pipe line by this Interior example. Time go to Exteriors!
    image_107_0000.jpg image_108_0000.jpg image_109_0000.jpg image_111_0000.jpg image_112_0000.jpg
     
    Elecman, PutridEx and INedelcu like this.
  19. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    #2
    image_113_0000.jpg image_114_0000.jpg image_115_0000.jpg image_116_0000.jpg image_117_0000.jpg
     
    INedelcu likes this.
  20. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    #3
    image_118_0000.jpg image_119_0000.jpg image_120_0000.jpg image_121_0000.jpg image_122_0000.jpg
     
    INedelcu likes this.
  21. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    #4
    image_123_0000.jpg image_124_0000.jpg image_125_0000.jpg image_126_0000.jpg image_127_0000.jpg
     
    Elecman and INedelcu like this.
  22. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    #5
    image_128_0000.jpg image_129_0000.jpg image_130_0000.jpg image_131_0000.jpg image_132_0000.jpg
     
    Elecman likes this.
  23. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    I've created releases for 2021.1 and 2021.2 (hdrp 11 and 12). You can download the zips straight away and open them with the right unity version.

    https://github.com/Unity-Technologies/HDRPRayTracingScenes/releases
     
    sendspace, m0nsky and newguy123 like this.
  24. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
  25. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    Wonder if anyone can can help here (or the devs) ? - in case I am missing a setting.

    I am currently trialling the viability of using RTX with character animation. So going through the motions of trying to get some clean renders with the recorder and RT.

    Typically for character animation, it is sometimes desirable that character specific lights do not affect the background GI. However it seems I cannot exclude the bounce light from the character lights whilst using RTX (only the direct).

    To illustrate the point see the test scene (see attached - Please ignore the quality of the lighting and materials, its just to illustrate the point). Please note, I have setup light layers to affect only the character.

    In an ideal world, when using light layers, my expectation should be that of the left hand side of the 2nd image. However, what renders is what is on the right, which includes the bounced GI and I have no option to exclude it from the GI

    My questions is - is it possible to exclude bounce light from character key and fill lights from the background GI whilst using RTX lights and shadows? And if not just now, would it be possible in the future?
     

    Attached Files:

    Last edited: Jul 20, 2021
  26. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    Hi Mark_29 I would like also, to have "easy Unseen flags" in Unity like I have in Lightwave. Simple is one button which exclude object from three different behavior:
    - Unseen by Camera - object is not visible in Camera but still participate in Ray-tracing and GI.
    - Unseen By Rays - object is visible but do not participate in Ray-Tracing (reflection), GI is working (your case)
    - Unseen By Radiosity - object is visible but do not participate in GI

    Self Shadow/Cast Shadow/Receive Shadow

    Those are fundamental flags for rendering and using combinations of those flags you can create all desire behaviors.
    Many of those flags works in Unity but is a bit messy solution for it.
    That solution should be for each surface available or whole object.
    Capture.PNG
     
    newguy123 likes this.
  27. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    Keep crossed fingers for my first off-line exterior!
    Work in Progress:
    Capture.PNG
    Some photos references:
    niko-architect-house-in-the-landscape-moscow-designboom-4-gigapixel.png niko-architect-house-in-the-landscape-moscow-designboom-5-gigapixel.png 077fd487966761.5e32ff49129aa.jpg niko-architect-house-in-the-landscape-moscow-designboom-2-gigapixel.png
     
    Last edited: Jul 22, 2021
    sqallpl likes this.
  28. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,234
    Hmmm I cant see your progress image, only the reference images...
    upload_2021-7-23_9-58-10.png
     
  29. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    newguy123 there is not yet renders. Work in progress.......
     
  30. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Btw, any news on this one? Very actual improvement...
     
  31. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    253
    This was merged 23 days ago, check out the PR here.
     
    Lex4art likes this.
  32. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    wat @m0nsky said
    The PR for the RTGI denoiser was merged couple days ago aswell
     
    m0nsky and Lex4art like this.
  33. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,234
    will that be in the upcoming 2021.2.0b6?
     
  34. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    253
    @auzaiffe Something I wanted to add, I noticed that locking the maxKernelSize to 1 in the HDReflectionDenoiser works really well in cases where the denoiser radius of 1 (current lower limit) is too big for DRS and tends to "over blur". So far it seems like an improvement when testing this in VR, while still providing a denoised output. Would it be possible to somehow make the denoiser scale this low through GUI?

    Also, did you see this post? (Not expecting you to dig into it right away since your todo list must be huge :D)
     
    Last edited: Jul 27, 2021
  35. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Nah I didn't see the post. Yes my list is quite full unfortunately.

    I am trusting you on this one, If you've blacked the ambient probe and tried with reflection probes maybe there is indeed an issue I reassigned the bug to myself, i'll look into it when I have a moment.
     
    m0nsky likes this.
  36. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    934
    None of my custom shaders seem to work with raytracing. Why is this? The docs say terrain isn't supported, but my tree and water shaders don't work either.
     
  37. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    Wolfos:
    - terrain is not support by raytracing yet.
    - also if you use Amplify shaders.
    - shadows from plugins which populate foliage doesn't have support from Screen Space Shadow.
    Generally, Exteriors system are in "brute force" work: manual job :(
     
  38. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    934
    The one that is most important to me right now is my water shader, which uses shader graph. If I get that working I can at least have some ray traced reflections.
     
  39. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
  40. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    934
    Yes, I've seen that. I wasn't surprised by the terrain but I don't see why the others don't work. Especially the water shader.
     
  41. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Current limitations are listed here:
    https://docs.unity3d.com/Packages/c.../Ray-Tracing-Getting-Started.html#limitations

    Basically vertex offsetting by traditional shaders is not supported by Unity raytracing nor is tessellation so SG route for any kind of vertex animation is immediately ruled out.

    Only ways to do any kind of animation with current raytracing implementation are:
    - use Alembic animation
    - use skinned meshes and animate them
    - modify actual mesh data through Unity's Mesh API (either via cpu or on gpu through compute shaders). Example for latter here https://github.com/keijiro/NoiseBall6
     
  42. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    934
    Oof those are quite a few limitations but I think I might be able to work around them. Thanks.
     
  43. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    777
    So i've been doing some experimenting and I think so far the only thing I don't like is the way HDRI sky works.

    This becomes a problem when using pure raytracing, no baked lighting or light probes.

    It's too over powering for an important visual feature. Unless i'm using it wrong.

    upload_2021-7-31_4-24-50.png

    With HDRI Sky all this nice global illumination gets massively drowned out in an interior scene. So much so I'm better off using Screen Space GI it looks about the same lol. (also please bring that to URP)

    upload_2021-7-31_4-25-43.png

    It's too broad and too overpowering, and just doesn't make sense. Like it's practically a single reflection probe applied to the whole scene.

    And i can understand this is supposed to be sort of a fall back for the roughness threshold, but man it just kills everything with FLAT and BRIGHT.

    But what's worse, is turning it off for a specific location disables the sky entirely so you can't even work around it.

    So if you want to tune it going from an internal scene, to an outside scene you might have an entirely black sky before you step outside. It's absurd and the opposite of what the benefits of raytracing is supposed to be. Which allowing dynamically changing light, getting away from static bakes.

    i think if this is something you want to do or need to do. You need a better solution maybe using low res path traced reflection probes then automatically applying that to the location like a reflection probe would.

    At least in that scenario you wouldn't get what's basically a single reflection probe across the entire scene.

    At the VERY least though, allowing the sky rendering to be independent of the lighting would allow some trickery to this solution.

    EDIT: On another note, Ambient Occlusion does not take enough influence from indirect light. I dunno how to explain it.

    Medium RTAO

    upload_2021-7-31_5-44-17.png

    High RTAO
    upload_2021-7-31_5-44-53.png

    It kinda seems like the best setting is 1 ray length and 1 sample
    upload_2021-7-31_5-51-56.png
     
    Last edited: Jul 31, 2021
    PutridEx likes this.
  44. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    483
    sacb0y one think from me: do not use HDRi or another GI background light source for lighting interiors in GPU engines. This is reserved for CPU system renderings (it is very complex solution and doing it by GPU is almost impossible). You need very sophisticated GI engine and Light Portals or .......switch to pure Path Tracing and wait forever (!)

    Personally I never used HDRi as light source because this is the worst solution for rendering. Best idea is to to use Physical Sky or gradient background . If you have very good GI engine, Physicals Sky can be only one light source in scene (this is really, really complex solution). You need for that incredible good code and LightPortals.
    Here you have example from our KrayTracing Engine when I used ONLY Physical Sky+ Sun:
    room_00000.png
    This is done by Photon Mapping + QMC sampling in K3 Engine developed over 15 years. In GPU this is right now impossible.

    Solution for you in GPU (I use it) is to use Area Lights everywhere when possible. Do not use LEM light sources (Luminosity Emission Materials) as light sources also.
     
    hippocoder likes this.
  45. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    777
    So I experimented, and I feel like i get better more consistent results using an inverted sphere with an emissive material on it. Using pure raytracing rooms look like rooms, open air looks like open air...

    Inverted sphere
    upload_2021-7-31_6-14-21.png

    HDRI Sky (At default values for the demo scene)
    upload_2021-7-31_6-18-16.png

    Path Tracing with HDRI Sky
    upload_2021-7-31_6-19-3.png
    Path Tracing with Inverted Sphere
    upload_2021-7-31_6-19-46.png

    Outside with inverted sphere
    upload_2021-7-31_6-21-16.png

    HDRI Sky (which looks ok, but it fills in the walls with sky which is weird, and the distant room is too bright...)

    And while it's darker this reflection seems more accurate.

    Lights on the walls actually visible, this is even a problem in the baked+rt scene. Also not having to manage the HDRI Sky effect making thie plant room area look too dark.


    And ofcourse the internal scene looks good in one swoop, no adjustment or trickery.

    Now i can't speak to performance yet, but it's doesn't seem worse to me so far. I had to adjust settings to get the rays tho.

    The below values actually work the same with 500 ray length

    EDIT: Oh also that reflection bounce count is unnessecary, I had a weird visual glitch and turns out it was cause that material had RT turned off. My bad. 1 or 2 is fine.

    EDIT2: I also recommend setting the clamp value for global illumination to max 10, cause it seems that is not the default value like I thought and it's definitely needed if you want expected lighting results from emissive objects.

     
    Last edited: Aug 1, 2021
    m0nsky likes this.
  46. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    777
    You mean these?

    upload_2021-7-31_6-38-50.png

    I couldn't get these to work with raytracing at all.

    EDIT: Image that didn't load in last post for some reason of the more realistic reflection.
    upload_2021-7-31_6-44-40.png
     
  47. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    253
    I just tried the same trick, replacing the HDRI sky with a big inverted sphere, and this indeed solves the RTGI issues I was having and does exactly what you'd normally expect from the HDRI sky.





    However, this isn't really a solution that can be used in production because of the maximum ray length this trick requires for RTGI/RTR to reach the emissive sky dome.
     
    sacb0y likes this.
  48. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    777
    Also why does Auto exposure appear to pulsate under certain conditions, is this just an editor thing? I have a hard time understanding how auto exposure works. It seems to affect the way the raytracing works rather than how it just looks.



    Direct link cause it won't load
     
  49. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    777
    Agreed! it's not an ideal solution. Perhaps you could get away with similar tricks depending on the location.

    I do not know the performance implications of the much longer ray length.

    A proper skybox solution is definitely needed for scale. And one does not seem to exist currently.
     
    newguy123 likes this.
  50. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    410
    Unity doesnt have raytraced HDRI yet so it work like rasterized HDRI filling all the space without proper occlusion