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

Official Unity Experimental HDRP DXR

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

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    I just got started with a new scene, Nvidia's The Attic with Daniel Zeller's Fluffy Grooming Tool. I thought I'd upgrade it to DXR. So much has changed since I last used it. It's in no way perfect, especially regarding DLSS as you can see, but I thought I'd share nontheless the first steps.

    dxr 4.jpg
    dxr 6.jpg
    dxr 7.jpg
    dxr 2.jpg
    dxr 1.jpg

    Also, I might have exaggerated with the dust noise :D
     
  2. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    valarnur and TerraUnity like this.
  3. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    The work is already being done in github, but the pull is still not opened. It's coming though.
     
    Rowlan likes this.
  4. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,271
    @Rowlan @PutridEx Thanks for the input guys, still seems far though...

    Well done, these are some cutting edge stuff (lots of new R&D) which again you did a great job on this.
     
    Rowlan likes this.
  5. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here is buoyancy effect and objects interactions + rain:
     
    TerraUnity, Lex4art and Rowlan like this.
  6. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here flow and fluid system. This developer is genius - making such easy UI and control for "physical water behavior"
    In video I used default flow + my edition of stream water effect to increase effect flow:
     
    TerraUnity and Rowlan like this.
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    I had to try myself, thanks Janusz for your showcase. Made me buy the asset :D

     
  8. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    @Janusz_Biela does your build work? eg in above video there are no textures on the cave walls. Using current Alpha 11. I had to record the Unity Editor and crop the video afterwards.
     
  9. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Rowlan I use only latest Official version.
     
    Rowlan likes this.
  10. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    440
    When will raytracing in HDRP come out of experimental mode?
     
    newguy123 likes this.
  11. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  12. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    I have a question about limitations for decals with raytracing.

    I know that decals are not included in raytracing effects (like they are not visible when calculating reflections, GI etc.) but HDRP 12 documentation says that "Currently, ray tracing in HDRP does not support decals. This means that ray-traced global illumination does not affect decals in your Scene."

    Does it mean that decals that are projected on meshes (which receive raytraced gi, reflections etc.) won't be affected by raytracing effects? Or is it just an error in the documentation?
     
    Last edited: Oct 20, 2021
  13. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    ftejada, phreezie, chap-unity and 3 others like this.
  14. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    Animated is always better :)

     
    ftejada, Gokcan and Ruchir like this.
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    Does anyone have an idea why there's an image delay in the above video? Check out when I'm flying around with the camera. It's like there are remaining overlapping images visible which then fade out once the camera isn't moving.
     
  16. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    263
    What version of HDRP are you using?
    You could try turning off the ray tracing effects one by one to see which one is causing it. I also recommend temporarily turning off physically based depth of field and/or DLSS (in case they are enabled) to see if it changes anything, I've ran into similar issues in the past.
     
  17. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Ditch TAA and use DLSS?
     
  18. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,920
    Yeah sounds like TAA.
     
  19. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,354
    Unity 2021.1.26f1 with HDRP 11. I should probably upgrade to latest when I use raytracing. Using TAA currently. However, here's a video:



    Check out the area of the Terminator plate, ie this one in the video:

    part.jpg

    It reflects / there's some shining through happening and then fades to opaque.
     
  20. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    263
    Experimenting some more with using light probes for the "last bounce" to correctly light RTR/RTGI in the performance mode.







    Edit
    Just tried PR 6103, 6106 and 6107 by slunity which affects the stacklit clear coats. Seems like an improvement.

    Before



    After





     
    Last edited: Oct 27, 2021
  21. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Hi m0nsky
    Can you explain more this:
    "Experimenting some more with using light probes for the "last bounce" to correctly light RTR/RTGI in the performance mode." ?
    About StackLit surface system: yes, this is like Ultimate Quality surfacing system....I use this also for some specific materials.
    About CarPaint: That`s challenge :p ...the most complex surface to simulate....good luck!
     
  22. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Does it hang, or is it just "stuck"

    During the beta I noticed this also. In scene view, I just press and hold left ALT button then the progress bar runs at the bottom. (I geuss you can press and hold any button that doesnt do anything). Seems if nothing happens, thats when it just sits there and doesnt update, but if you press something, it thinks something is happening and then updates.
     
  23. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Sorry I deleted my post overhasty:
    A moving object forced the pathtracer to restart every frame.
     
    Last edited: Oct 27, 2021
  24. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Ah yes. I havent tested that, but according to the docs apparently text objects are not compatible.

    Which is a pity!
    ....because now we have to rely on importing mesh text from Max or doing cam tracking in AE and sticking text in there.....
     
  25. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Sorry again, it wasn´t a TextmeshPro, but a slightly moving object....!
    I changed my post.
     
  26. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    What kind of moving object? Does it deform or does it have vertex animation, or just move position?
    Regular HDRP/Lit shader?
     
  27. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    It was changing position.
    I think pathtracer restarts when scene content changes (scales, rotates, moves,....) which obviously makes sense.
     
  28. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    yes so it will restart each frame. Bit useless for realtime "play" mode. But you can use recorder to offline output per frame and it will wait for each frame to finnish before doing the next frame
     
  29. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi. Could you give some hints how to use these PR´s. Are these already integrated in 10.x.x and 12.x.x?
     
  30. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hey.
    Are they some examples, lessons learned or ist there an more detailed description about switching to DLSS from old TAA available?
    All my HDRP scenes a heavy optimized against old TAA. Only searching some depper infos about it.
     
  31. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Your use case may vary. For me, this is what I found:

    A while back with HDRP10 and I think with 11 also, I had some characters imported from Max and in my app, when they were walking, with TAA there would be very heavy ghosting, asif the characters has a trail behind them.I eventually removed raytracing from the appin the hope it would be better, but that didnt help.

    That however is not my main use. My main use is for offline film rendering with raytracing. Typically we have very fine geometry detail modelled (which in a game environment will probably just be done with textures). But its much faster to model detail for us (and also modify it) and things need to hold up, up close to cam and also far, and our main use case is for offline rendering as I mentioned. TAA fails to clean these details up for us, and this is where DLSS shines. Note I'm purely using DLSS for AA and prevent ghosting from animation, not so much for the screen resolution adjustments and that jazz, which I believe is actually its main function.

    Here's a simple example where TAA fails, but DLSS cleans things up beautifully. All this is modelled and TAA just can't get those vertical details clean and crisp like DLSS can:
    upload_2021-10-28_10-2-36.png

    As for switching to it, its only available in HDRP 12 and up as I believe. You enable it in your HDRP asset, then on your cam you enable dynamic resolution, which in turn shows new options and now just below that on the cam you'll see DLSS. Typically I set mine to optimised custom and the preset Ultra Performance. Doesnt matter what AA you set the cam to then as DLSS will just ignore it and do its own version, which seems better in my tests.
     
    Last edited: Oct 28, 2021
    Cascho01 likes this.
  32. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    @newguy123
    Can you provide a code snippet how to enable/disable "Allow Dynamic Resolution" / DLSS on a camera?

    cam.allowDynamicResolution = myBool; // does not work
     
  33. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I can confirm this as long as the camera is fixed.
    Do you also get these sharp edges when your camera moves?
    I have some problems with that.
     
  34. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @Cascho01 I dont use code to enable/disable it.

    I enable it in my HDRP Pipeline asset:
    upload_2021-10-28_13-54-50.png

    ......and then just enable it on the camera:
    upload_2021-10-28_13-55-34.png
    To disable from camera just untick DLSS
     
    Last edited: Oct 28, 2021
  35. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @Cascho01 yes it works fine on moving camera

    here's a quick screen grab with a frame with motion blur where the cam spins around the house:
    upload_2021-10-28_13-58-42.png
     
    m0nsky likes this.
  36. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    263
    Sure. I have done a lot of experimenting and comparing to the path traced result, I don't know what's the best option when it comes to quality/performance yet, but here are my results.

    By default, everything in your ray traced reflections will be "flat", rasterized, no global illumination.



    However, this is what the path traced result looks like.



    You can configure the ray tracing fallback hierarchy to set the last bounce to "None", for pure real time ray traced games, this will allow environments to be truly black when there are no lights present. Adding lights will correctly light up the environment in the reflections using direct lighting, it will work well in most situations where baked lighting is not an option.



    However, you can also configure the fallback hierarchy to use baked data (reflection probes and sky) for the last bounce to achieve more realistic ray traced reflections.



    So, we can now set up light probes in our environment.



    And then bake the result.



    The baked lighting will show up in our ray traced reflections.



    We can also set up reflection probes.



    Which will also improve our ray traced reflections.



    I think it would be great if there would be an option to configure the last bounce to be ray traced.



    It would be more costly, but now that LOD support, DLSS, CPU & DX12 optimizations have landed, it is not unrealistic to have a smaller (full) ray traced visualizations running at 200 fps on a current-gen GPU, so the headroom should be there, especially in 30/60 fps automotive & archviz.

    We already have options like "recursive rendering" which come at extra cost, and I'm willing to bet, having the option to trade the cost of recursive rendering for ray traced global illumination in the last bounce of our reflections (even shaded at 1/2 or 1/4 resolution) will have a lot more visual impact in the average situation.

    Aside from the increase in visual quality, it will greatly improve the artist workflow, eliminate baking times, decrease project size and solve situations where the current set up would break. Not to mention the current light probe + reflection probe setup comes at a frametime cost too, which is then no longer needed.

    It is pretty complicated because they are open pull requests, you need to merge them locally to work. They are still under review and are currently not scheduled for an official release, and not sure if they will at all. I guess it depends on which is more physically correct, but by not ray tracing the base layer it will always be an approximation after all.
     
    Last edited: Oct 29, 2021
  37. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Thanks! m0nsky .....yes, great idea and solution!
    I will check it - new official Unity on my desk - new Unity version looks great :cool:
     
  38. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    This I wanted always point as my thoughts (recursive rendering as missing part in Unity):
    World is not only gaming, FPP games. MOBA, etc....also big business is here where I am: Architectural Visualization.
    We do not pay attention for FPS we are interested in only Quality.

    This project (terrace under the most expensive Hotel on the Word Burj Al-Arab) is from me and my friends from 3D department of my company where I work. It was done by us a few years ago, build in Finland where from was shipped to Dubai and combine into whole piece there.
    Burj Al-Arab Hotel Terrace
    https://www.scandinavian-architects.com/zh/sigge-architects-turku/project/burj-al-arab-terrace


    b7fdf731094e40f9a3dba4c5b6b2638b.8945f03a.jpg
     
    m0nsky, Lex4art and Ruchir like this.
  39. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Nice renderings, but any Unity-Realtime-Presentation of this to see?
     
  40. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    This was like 6-7 years ago (Lightwave 3D/Kray)...I do not remember exactly ;) and the picture above is no ours ...is just example what I talk about.
    Btw Unity usage as commercial : pipe line is almost ready (also DXR very well developed) so we must use commercial Unity subscription to use it in commercial field. Right now I just testing Unity as free software because I do not use yet it in commercial products only testing.
    Bur for sure we will use at least 2-3 commercial subscriptions in near future.
     
  41. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248

    Fully agree with what you said and your findings. Right now (using the basic 12.1 HDRP, not the PR's you mentioned) I'm struggling with excactly this. For windows, looking from the outside in, enabling recursive makes the reflections look great, but does not do so well for the interior (while viewed from the outside) as you loose all GI for the interior.

    Switching off recursive makes the interior look much better, but then the reflections dont look great
     
  42. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    newguy123 I think "issue" with reflections , especially with mirrors in DXR will be "fixed" when we get something like recurse reflection rendering. I know this will kill performance as hell but always you can disable this option and always people like me will Enable it whatever performance costs.
    m0nsky mentioned that would be done by 1/2 or 1/4 resolution factor - that's good idea and also we can have like Activation button for this in Surface options (you do not need this on all surfaces!)
     
    newguy123 and Lex4art like this.
  43. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    There's no importance sampling for sky or things like that currently right?

    For example my scene is lit only with a directional light, coming from the side of the solid wall. IE, the sun is not shining into the windows. However, the GI does not look right. To fix this, is the only way to add fake lights outside the windows shining in?!?
    upload_2021-10-29_15-25-27.png

    Here's my current GI settings:
    upload_2021-10-29_15-28-46.png
     
  44. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    It's like its picking up the sky environment color, where in fact in this situation it should not bleed the sky color at all

    Here's another example. Its reflection the "sky", through the floor somehow, That's clearly not correct!
    upload_2021-10-29_15-43-40.png


    when in fact the door frame and handles are actually black:
    upload_2021-10-29_15-44-39.png

    Anoby have any ideas what is wrong here?
     
  45. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    263
    By enabling the additional properties on the ray traced global illumination / reflections volume components you should be able to correctly configure the fallback for your use case. These options should be available in 2021.2 / 2022.1.

     
  46. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    ah it was that setting:
    upload_2021-10-29_15-50-10.png

    setting it to 0 seems to fix things
     
  47. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Ah brilliant, thanks for that. Wish they can just have that setting enabled by default!!!
    I didnt even know it was there!
     
  48. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    771
    Maybe, I'm misunderstanding what you want but does having an option for "raytracing" as last bounce would be similar as just adding more bounces? Or do you just want infinite raytracing bounces?
     
  49. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    263
    I'm talking about ray traced lighting instead of a baked lighting for the last bounce. I think something comparable to low resolution RTGI will be enough to make them convincing and work well in every situation.
     
  50. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Thanks for the detailed last bounce explanation. Very helpful.

    Would be nice if you could give me a message when the PR stuff becomes available.
    I thought is it a fresnel problem form the shadergraph carpaint.
    I also need maximum realism in the carpaint. Your description showed me whats really wrong.

    Your result here

    A2IFZkS.jpg

    is absolut what i am looking for.
    It has an very important effect on reading correctly concave and convex exterior surfaces like

    bmw-BM-Berlin-PARIS-jpg.jpg
     
    Last edited: Oct 29, 2021
    newguy123 likes this.