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. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Unity Experimental HDRP DXR

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

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Try material type: translucent
    Refraction Model: Box, with ior of 1.5 or so and color maybe 230,230,230

    That should make the glass look better, however I'm not sure if that will do anything to solve your additional noise in pathtracing... do a quick test and let us know.

    You may need to adjust cam exposure, which in turn will make the outside brighter also and look more realistic
     
  2. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Thanks for helping.
    My problem is not additional noise it´s dark pathtraced image (because of light blocked?).
    When I enable refraction on my material I get this "frame" that reflects only the sky:

    upload_2021-11-9_14-46-39.png

    I can set the screen offset of that frame with a Screen Space Refraction override but it´s simply wrong.
    I have no probes, everything is raytraced.
    Pretty sure there´s something missing in my hdrp-settings....
     
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    The image gets darker but also additional noise. Depedning on your needs, you need to light and expose properly, just like they would do it in real life. In real life if a photographer does realty images, he has various infill lights, and also take various exposures and then combines it in PS to blend the outside and inside better. Having a shot like that, looking from inside, towards the windows, you're never going to get a S*** that is properly exposed for bgoth inside and outside at the same time, without some cheating. I'd suggest expose for inside, which will likely blow out your outside, then either just dial it back a bit, or adjust your glass refraction, or cheat the sky exposure.

    you need screen space refraction and set the number to 0.001 to get rid of that frame
     
  4. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Cascho01 here is hint for you:
    In architecture rendering glass ALWAYS should be used with Unseen flags.
    In theory glass has no influence for Global Illumination so you must exclude it from GI and shadows - that's is more secure for Photons and generally for rendering. This is standard and common procedures everywhere in renderings.
    This is very simple:
    when you have windows glass in interior you have to exclude this object/layer:
    - Unseen by Radiosity
    - All Self flags
    - all cast and receive

    It looks that (in fact this is GUI from Lightwave but idea is universal and standard everywhere):
    Unseen.JPG

    I would like have this "easy flags" in Unity because now, all flags are spread everywhere.

    Also second "problem" in renderings is missing information in Global Illumination when we render Interiors.
    This is typical and to prevent this all professional renders engines has Light Portals. We do not have it in Unity at all...maybe in future. To prevent this problem partly, you must put physical light (not LEM...Unity is not ready for that) into windows to "boost" amount and quality photons inside of interior.
    NEVER use Interior lighting without booster or Light Portals!
     
  5. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here you have info how LP works (light source: Physical Sky+Sun):

    Without Light Portals
    K3_.png

    With:
    K3_LP.png

    Light Portals can be also boosted. In this case above Multiply value is 1.0 but usually LP must be boosted like 5.0 - 10.0 to increase brightness inside room.
    Here is example with LP and boost 5.0:
    room.png

    I traditional way is simple impossible to get this quality of GI and correct brightness inside.
     
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    I'm having a raytraced reflections cut-off issue and I cant figure it out.

    On alpha of 128, the reflection works fine:
    upload_2021-11-10_14-12-1.png

    If I go any lower, then reflections are ignored and it just shows the sky as reflection:
    upload_2021-11-10_14-12-46.png

    Doesnt matter if I used mixed, raytracing or raymarching
    upload_2021-11-10_14-15-24.png

    On the other hand, it may be a refraction cutoff and not reflection cut off, but still, cant figure it out
     
  7. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Same thing here... ?
     
    Last edited: Nov 10, 2021
  8. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Hmm, I know about lightportals from VRay.
    I´not sure if it´s a good idea to manually place AreaLights in front of the window.
    This will conflict with the skylight color etc.....
     
  9. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Yes that`s correct, if we talk about colors coming from Physical Sky mixed with LEM or Area Light....
    This is call Studio Lighting System and is used widely by everybody (studio rendering has nothing to do with realistic light and is common in architecture).
    Many people even simple disable Physical Sky + Sun and use only Area Light in windows + Fake Sun with very soft shadow Area Light. That`s also common.

    Personally I use LightPortals as best solution available today.
    Also I warn not to use only Physical Sky+Sun for interiors - that's the worst solution which you can choose.
     
  10. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    So you suggest arealights in front of the windows also in Unity?
    Will check it out ...
     
    Last edited: Nov 10, 2021
  11. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    ...you have no better alternative right now in Unity...
     
  12. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    Have you tried adjusting your light cluster settings - might not fix, but has helped in the past for me
     

    Attached Files:

    Last edited: Nov 12, 2021
  13. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    So I upgraded my Unity version and HDRP version and I'm still getting Raytraced Shadow artifacts, particularly ghosting but also some weird glitchy looking stuff. Is there any way to fix this or reduce this?: Unity 2021.2.2f1 with HDRP 12.1.1

     
  14. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Have you tried to increase the maximum depth in the pathtracer override ?
    The idea is that when the ray have to pass through a glass, it counts as a bounce, so you get less bounce for the rest of the GI, increasing this to the max might help recover a bit a lighting intensity there.
     
    Cascho01 likes this.
  15. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Simply didn´t know that passing through a surface counts as a bounce.
    Increasing the max depth helps, thank you.
     
    chap-unity likes this.
  16. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Another question:
    I don´t get reflections on glass behind another glass surface:

    upload_2021-11-16_10-53-27.png
     
  17. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Yep, maybe the wording could be better here, but a bounce is basically the ray passing through an interface, so if your glass pane is a squashed down cube, that's basically two bounces (one to enter the glass, and one to exit).
    What we could do here in the future, is decouple the bouces for reflection and refraction. (for example have a setting for max refraction bounce different than the max reflection bouce etc..) or even have a way higher max bounce limit by default once some optimization are done.

    In your last problem (reflections missing on the second glass), I wonder if it's just the same issue since there's an additional glass pane to go through, is your max depth at 10 already ?
     
  18. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Sorry, the upper shots are not pathtraced. So where would I set the max depth?
     
  19. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    If your glass are both refractive (refraction model set to anything other than None), then it's just that the second glass is not "rendered" because we can't* stack multiple layer of refractive transparents in HDRP so that's why you don't see any reflection. It's not that you don't see reflections, it's that you don't see the glass at all !

    edit: indeed replaced "can" with "can't"
     
    Last edited: Nov 16, 2021
  20. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @chap-unity do you have a typo here? Did you mean to say "we CAN'T stack"?
     
    chap-unity likes this.
  21. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @chap-unity Is that something that will be improved in the future, or best bet if you want that sort of thing is to use pathtracing instead of raytracing?
     
  22. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    AFAIK, it won't change in rasterization in the future. If you want to stack multiple layers of refractive transparents for now, there's 3 ways out of the box in HDRP:
    1. In rasterization, you can set your second transparent (the furthest) in the Rendering pass "Before Refraction" in the surface options of its material. That way, it will exist in the color pyramid when the second refraction happens. However, this doesn't work if your camera can rotate around the transparents since you would need to change which one gets rendered "before refraction", so it has its limitations.
    2. Check recursive rendering in both your transparents, and add a recursive rendering override (only available in raytracing). It also has its limitations since it's expensive and has been made for some specific use case. Check documentation for more info.
    3. Use pathtracer.
     
  23. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Yes I tried recursive already but it works best for smaller irregular shapes. Its not realy suitable for window glass, especially if you have various panes in front of each other. GI seems to get messed up in refraction
     
  24. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Three of them are bad :p ...but I understand this is not easy to do, so better than nothing :)

    Actually....transparency and background GI light sources (Sky, color, HDRi) are two big challenges right now in DXR.
     
    chap-unity likes this.
  25. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I have refraction model on my glass to "none" but still when I have glass B behind glass A with SSR enabled the glass B is not rendered - as you described.
    In other words, when SSR is enabled transparent is not rendered behind transparent.
     
    Last edited: Nov 18, 2021
  26. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Yep, it's a limitation of transparents receiving SSR.
    As soon as your first transparent object glass receives SSR , it has to write its depth and you won't be able to see any other transparent through it (even if they're not refractive or in the before refraction pass)
     
  27. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Thanks for explaining.
    It´s a pity because it´s a hughe drawback (at least for archviz / interieurviz).

    By the way, recursive rendering completely solves this, but then I get heavy TAA "ghosting" (right word?) for objects behind the glass. See smeary trees on the left side: Any way to solve/reduce this?
     

    Attached Files:

    Last edited: Nov 19, 2021
    PutridEx and newguy123 like this.
  28. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    hehe of course it is. Sometimes I "miss" my CPU rendering ;)
     
  29. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    WIP of my rain implementation for Buildmark:

    Technical details here (VFX Graph + tricky cameras setup).
     
    chap-unity, m0nsky, PutridEx and 3 others like this.
  30. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257






     
    Last edited: Nov 21, 2021
    chap-unity, auzaiffe, Yanus3D and 4 others like this.
  31. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Those are pathtraced I take it @m0nsky ?
     
  32. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Ray traced (RTGI performance, RTR quality 2 bounces)
     
  33. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    which HDRP version @m0nsky ?

    ..and what AA are you using?

    I'm not getting anything near that quality (with all my RT settings on quality)

    Your lighting and exposure also seem pretty good
     
  34. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    HDRP is current master (13.1.2), using only DLSS @ 66.64% resolution scale, auto exposure.
     
  35. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Does Furioos GPUs not support DLSS?
    Will Furioos provide better GPUs someday?
     
  36. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Playing around with lightlayers:
    Is it possible that SSR reflections do not support lightlayers?

    Example:
    I have a light that affects lightlayer1 only.
    But in reflections all geometry is affected by this light, also geometry which rendering layer mask is different.
     
  37. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257


    Some real time recorded video, this is running on my local HDRP fork which has some extra tweaks.

    - Two pass RTAO denoiser
    - Visible normal sampling
    - No RTR clamping
    - RTR denoiser max kernel size 0
    - Converting some remaining _ScreenSize to _PostProcessScreenSize

    It's a little choppy because I'm not using my custom RTAS here, this is using the one from master (cullinstances API), but there seems to be an issue with inconsistent DXR/DX12 performance. I'll reproduce this in a sample project so I can submit a bug report.

    Edit
    Seems like upping the clamp value to 100-200 (10 is default max) has the least reflection intensity loss in the dark, after that you get diminishing returns (as seen in the video)
     
    Last edited: Nov 26, 2021
  38. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Impressive and a breathtaking video. Loved the music :)
     
    keeponshading likes this.
  39. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @m0nsky

    1) "No RTR clamping" - I'm very interested in this. How may I implement that in 12.1 with 2021.2?

    2) The other points you mention, no idea what those are.

    3) In your video, there's some very heavy ghosting going on here. What is the cause of that?
    upload_2021-11-24_17-32-56.png
     
    keeponshading likes this.
  40. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    High clamping values (or no clamping) can result in issues like excessive noise and fireflies, but I think it works really nice in some situations (reflections in darker areas). If you know how to load packages from a local directory, look at the finalColor clamping logic in RaytracingReflections.raytrace

    About the ghosting, I just did some testing with this to be sure. It's not related to ray tracing, denoisers or DLSS but actually a problem with physically based depth of field. I just noticed this PR was opened 2 hours ago that could help.

    Edit
    Ok, I checked HDRenderPipeline.PostProcess.cs, physically based dof actually reads the TAA params from your camera. So even if you are using DLSS without TAA, set your TAA fallback to "high" and enable speed rejection, this will fix the ghosting with physically based dof when using DLSS.
     
    Last edited: Nov 24, 2021
    PutridEx, Lex4art and newguy123 like this.
  41. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Been toying around with the Archviz asset that was in the lightning sale.

    av04.jpg
    av07.jpg
    av01.jpg
    av06.jpg
     
    m0nsky, sqallpl, Lex4art and 3 others like this.
  42. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
  43. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    DLSS. No idea what that might cause. Using 2022.1.0a15.
     
  44. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Rowlan this scene is good start for playing with DXR. Of course you understand that this Bake system is useless for commercial purposes but as starter is really good idea.
    For AA solution you have two choices right now:
    - DLSS - which is not so perfect but much better than standard AA Unity solution
    - SSAA SunFall plugin - best solution, prefect AA!

    Apparently SunFall must be updated for new official Unity (so also Alpha/Beta) due some script errors. I got info from Discord that new, updated version is upcoming.
    Also SSA SunFall has one advantage: due his procedures (inside GPU?, rescaling similar to DLSS, Full Screen AA?) you get less noise - so you can reduce amount of samples for Physical Light and GI!...in other way: more fps.
     
    PutridEx and Rowlan like this.
  45. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Thanks, I gotta check that out. By the way, do you have any idea why this kind of noise appears once I enable AO?

    n.jpg
     
  46. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Rowlan I am not sure you use DXR...if yes, then you must be careful with some custom surfaces.
    Best idea to investigate problems is disable object one by one to see which one create problem.
    I suspect too big Normal Map value from one of surface. I have this scene and most surfaces uses Mask Map , that also can produce some errors for DXR. I have not enough info from you what you use: original scene bake or total DXR or half DXR half bake (for example bake scene with DXR reflection)
     
  47. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Oh, I'm total noob. I just set everything from bake to realtime ... I'll try again with bake and re-bake it all. Thanks!
     
  48. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    What I do is basically:

    * create new HDRP scene
    * convert to DXR scene
    * fix all the points that the HDRP Wizard complains about
    * open the ArchViz scene
    * add a new global volume, add AO and activate raytracing

    This is the result:

    noise.jpg
     
    Ruchir likes this.
  49. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    1) Switch off all volumes that import with that scene.
    2) Leave on your own volume and also add:
    - screen space global illumination (enable raytracing in here)
    - screen space reflection (enable raytracing in here)
    - exposure and adjust as needed
    3) for all lights enable raytraced shadows on the light itself
    4a) on your cam enable TAA and set it to high
    OR
    4b) ensure your HDRP asset has DLSS installed and enabled, then on your cam enable dynamic res and enable dlss

    Then show us a screenshot again....(in game view, not scene view)
     
  50. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    chap-unity
    I am not sure is new bug in actual official latest Unity 2021.2.3f1 or two-three versions back.
    I never had so many crashes when I imported object into Unity and this is connected with creating UV LightMap for Bake.
    As you know I use LWImporter (Lightwave integrated system in Unity) so at first I was thinking maybe something is wrong with plugin (Last update of this plugin was over one year ago) But after many hours I realized that can be something wrong with Unity UV mapper creator.
    Situation is ok when I import object just for DXR purposes (no need UV LightMap for Bake) Plugin for Lightwave in Unity contain of course option to create UV LightMap and if I do not use it everything works perfect.
    So to be sure I exported object to OBJ format and...I start getting crash also when making UV LightMap.


    Here is OBJ format. Can somebody confirm is something wrong with this official Unity version?
    Of course "bug" can exist since unknow time maybe like since 1-2 months (because I starting making some new pipe lines for BAKE I return for while to this system and I started getting crash)
    img_002.jpeg

    I know that object has practically only quads (but this should be doesn't matter for Unity...also I have crash when I triangulate all quads...)
     

    Attached Files: