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.

Official Unity Experimental HDRP DXR

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

  1. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    keeponshading :D good luck with carpaint surfaces hehe ...this is nightmare in GPU.
    Old my render from LW/Kray done by CPU - I did it without any special shader (some Nodes in LW) so it is not physical system but due real 40 bounce lights in Kray and good environment looks still good:
    Audi_front.png Audi_side.png Bugatti_Silver_cam02_PathTracing_0.png Bugatti_Silver_normal_cam01_0.png Bugatti_Silver_normal_cam04__0.png
     
  2. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Was off for a week, what did i miss?
     
    m0nsky likes this.
  3. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    New Official Unity 2021.2 !
     
    chap-unity likes this.
  4. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    m0nsky I got this: first time proper GI quality casted by PhysicalSky (no direct light)!
    DXR_PhysicalSky.PNG

    Recurse effect:
    DXR_recurse.PNG
     
    keeponshading and m0nsky like this.
  5. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    As a unity developer, I am quite aware of what happens on the Unity side :D, I meant is there an issue that was raised that I missed.
     
  6. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    auzaiffe there is one "issue" in new 2021.2 (I am not sure it is only me) - I noticed this also in beta/alpha before official 2021.2 release.
    I get lags in Windows system when Unity dx12 project is open (even when DXR options are off for scene). I checked everything: CPU/GPU in idle standard mode.
    Lags are with windows moving, opening folder, creating files (like txt new file), sometimes huge mouse lag.
     
  7. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    Here test of new DXR Unity (especially new raytracing fall back for reflections) + DLSS.
    Scene is not my build models and also not my surfacing. Notice that I have zero glitches from reflections and perfect GI.
    Physical Sky + Sun +Area Light in window as booster.
     
  8. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Glad the fallback mechanic solves most of the setup issues you have!
     
  9. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    auzaiffe So far two questions:

    1. How about those system lags when I use latest 2021.2 ?

    2. It will be possible to add option that allow user to receive Global Illumination in reflected surfaces? I know that, it will have huge impact for performance but it can be done by something like 1/1, 1/2 , 1/4, 1/8 of resolution. In most cases we will need like 1/8 or 1/16 only for mirror 1/1 or most surfaces: nothing (good idea is to have percentage amount because mirror do not need 100% GI recurse , it can be like 90% ...that amount will not have impact on quality and effect probably). In surface options should be button which activate this (default must be OFF).
     
  10. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    1 - It's probably something on the engine side, I can't help much @chap-unity may be aware of soemthing.

    2- No it is not possible, that is not how RTGI works. We lack a dynamic GI system for the additional bounces for now.
     
    m0nsky likes this.
  11. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    auzaiffe Thanks.
    1. Sent him message.
    2. Yes I understand, that`s complex situation which need a lot implementation in code.
     
  12. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    254
    Fair enough, thanks. I figured this wouldn't fit in the current code structure without becoming too complicated.

    There is this old todo in RaytracingReflections.compute (line 66)



    SSR got a function for SampleGGX_VNDF in October 2020 (PR here). Is there any chance this will be unified with RTR? This could potentially help with low spp fireflies in complex rough surfaces like asphalt.

    And one more thing, I was wondering if there is any room for improvement where RTR blends with RTAO, to get a better match to the path traced result in the highlights.



     
    Last edited: Nov 1, 2021
    newguy123 likes this.
  13. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Path tracing doesn't have any form of AO. You can't compare back and forth if you have ambient occlusion in your signal.

    You can't compare multibounce path tracing to ray traced reflections either.

    RTAO is not used to occlude reflection past a given ray length and there is possible blending that would remotely make any sense for large rays. It is used under a certain ray length threshold to match the SSAO's behavior.

    Again, I am fully aware of what happens in HDRP :D...

    SampleGGX_VNDF does not prevents from that 8 samples loop if that is what you are hoping for.

    If it is for the visual quality difference that you would want this change: It is meh given the limited number of samples and the denoising for a SIGNIFICANTLY higher cost, personnaly I would even remove it from SSR and keep it in path tracing.
     
    keeponshading likes this.
  14. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    254
    I know the difference between path tracing and the current hybrid setup and that they are fundamentally different, but was just wondering if there was a way to improve RTAO so it looks more natural in the highlights. If it isn't possible, that's all fine.

    As for VNDF, I'm not hoping to prevent the 8 samples loop or gain performance. I use VNDF because DLSS over blurs the reflection denoiser, and the only way to prevent this is to lock the max kernel size to 0 or completely disable the denoiser (like in Lego Builders Journey) which means some extra pixels are going to be popping now and then, and since the todo was still open, I thought I'd ask
     
    Last edited: Nov 2, 2021
  15. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    Sorry again from noob question:
    Is somebody can tell me how I should setup glass surface to see glass behind glass? (Like water in glass cube, etc)
    In HDRP Lit BAKE and also DXR.
    Always I had problem with that,,,
     
    Last edited: Nov 3, 2021
  16. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    721
    In HDRP, you cannot have multiple layer of refraction. (i.e if you have a refractive object, you won't see any other transparent through it). This still works fine when your transparent is not refractive.

    However, there's a way if you set your second transparent to render in the before refraction pass. But keep in mind, that will only work correctly in one direction so it's far from perfect solution.
     
  17. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    Is this true for Pathtracing also, or will pathtracing be correct?
     
  18. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    chap-unity yes that's I was thinking, there is some limitation. I think in DXR is better ?
     
  19. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    721
    What I've said is true in HDRP, in rasterization.

    Pathtracing is an entirely different pipeline so this doesn't apply. Transparent should behave the way you'd expect with the pathtracer.

    "Better" depends entirely on what you are trying to accomplish, there is limitations everywhere, even in raytracing. With DXR, the only way to have multiple layers of refractive transparent is by checking recursive rendering on your transparent materials and have a recursive rendering override enabled in a volume.
    However, it has some caveats as well, like overring the smoothness of your material to 1, also not being able to see raytraced effects "through" transparent rendered recursively (RTshadows will default to regular shadow maps.. etc)
     
    Last edited: Nov 3, 2021
  20. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    379
    @auzaiffe

    Could something like probe based RTXGI/DDGI work for additional bounces in this case? I mean the Nvidia's implementation or some variation of a similar system.

    Here is the official Unity implementation but afaik its development is paused at the moment:


    I'm sure @auzaiffe knows this very well but in case anyone is interested in other implementations here is the Metro Exodus Enhanced Edition DDGI implementation explained. The 2019 version uses single bounce while the Enhanced edition from 2021 uses DDGI for additional bounces.



    https://www.4a-games.com.mt/4a-dna/in-depth-technical-dive-into-metro-exodus-pc-enhanced-edition
     
    Last edited: Nov 3, 2021
  21. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    254
    RTGI itself works fine with multiple bounces, there is just no RTGI in the reflections (and the additional bounces)

    Unless you're talking about using probe based GI in the reflections (and additional bounces), this is exactly what's already possible right now, and works well. The only downside is that it requires baking, so it does not work with dynamic objects (for example, the inside of a wheel, or the underside of a car)
     
  22. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    Can anybody help me with proper settings on how to achieve proper emissive properties in HDRP with Raytracing? I set my material as emissive but no matter how bright I make it, it does not glow and does not contribute to the RTGI. I think I saw something a while ago about changing some exposure settings (I'm using fixed exposure and Physical Sun & Sky as my primary light). Would love some help with this, I cannot post screenshots as I'm under NDA but if anybody has any guides or settings they use to get a good result with emissives and raytracing I would appreciate it a lot!

    Also any lights I add to the scene need an extremely (almost unnaturally!) high value before they start emitting light properly.
     
  23. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    https://docs.unity3d.com/Packages/c...ion@13.1/manual/Override-Screen-Space-GI.html

    Have you tried adjusting the clamp value?
     
  24. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    Yeah it doesn't seem to be updating in my scene anymore. I might just delete these volumes and recreate them from scratch. Here's an image, the blue slide has it's emissive turned on with a red color and the value is like 100 EV100. It seems to look correct in the actual preview of the material, but in the scene it just shows as a blue model with some red in the highlights. It's also not bouncing that emissive light to anything else. Thank you for replying, I appreciate any/all help with this as we're crunching to get this stuff done.
     

    Attached Files:

    Last edited: Nov 3, 2021
  25. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Oh "Receive SSR/SSGI" needs to be uncheck if the problem is the GI caster not receiver
     
  26. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    Seems like I fixed it as far as not showing up. I just deleted my volume overrides so its just using the default HDRP settings I adjusted. I still don't see it contributing to RTGI, is there a way to solve that?
     

    Attached Files:

  27. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    Ahhh cool, thanks for the tip! It seems like I got it working! However no matter how bright I set the emissive it doesn't seem to change the amount of GI that it outputs.
     
  28. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    That again is the clamp value, From 0 to 10 you get more contribution, above the result is just not denoisable.
     
    sqallpl likes this.
  29. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    379
    Here's a post from another thread about the new Render functions:

    Do you plan to add raytracing support for the new RenderMesh functions like RenderMeshIndirect or RenderMeshInstanced in the future? I assume that old Draw functions won't be supported at all if we are advised to move to Render functions.

    Thanks.
     
  30. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    Awesome, that definitely helps add to the GI contribution. Are there plans to help reduce the noise even further? I'd say that's my only complaint so far with the RTGI (now that I have my other issue fixed).
     
  31. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    Increase clamp value. If you have clamp value like 1.0 it will be no effect of increasing LEM materials even with value 1000+.
    But I worn you that LEM system generally in Unity (and probably Unreal also) has many limits. Also in CPU rendering this is big problem (this is typical: small LEM - huge problem, big LEM - small problem).
    By increasing Clamp value you will increase noise and errors.
    I suggest use Physical lights.
    This info above is only in case when you want use LEM as light source.
     
  32. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    On the material, try DECREASING exposure weight. At 1, your cam exposure is heavily affecting your material's exposure. On 0, what you set in your material is what you get, as the cam exposure is then ignored.

    However, this method would be cheating to get what you want. The more physical way is adjusting clamp as mentioned by others. You can then maybe try on the material exposure weight of 0.5, which gives you mix of best of both worlds....
     
  33. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Considering there's constantly two separate discussions going on this single megathread, it probably would be a good idea to split realtime DXR and pathtraced DXR into separate threads?

    While it's cool to see everything people do with these techs in one place, it does kinda bloat the thread + afk there's different people working internally on these too so probably would be easier to follow the threads if they were separate topics as well.
     
    Cascho01 likes this.
  34. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    In our case, we'd prefer 1 thread since we use raytracing and pathtracing in the same project
     
  35. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    Thank you all for the helpful info, I appreciate it! I have a few other questions if you don't mind helping me out some more (trust me I DO APPRECIATE IT!)

    How do I get Raytraced Shadows to stop ghosting? I have a character playing an animation but the shadows lag behind the character and start looking really ghosty on the ground. Is there a way to reduce this?

    Also any best practices for reducing noise from the RTGI? It's pretty soft noise with the denoiser but it's noticeable swimming on my character.
     
  36. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    This is what it looks like on the ground below my character, the shadows on the character itself seem to update pretty quick and not ghost?:
     
  37. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    @Curt which Unity and HDRP version you are using? It should be a lot better in current 2021.2 / HDRP 12 version.
     
  38. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    Curt this is no way right now to cut "ghost effect". They (developers) prepare tools for that but I have no more info how it will work and how it will reduce this effect.
    In my opinion also off line render system should have delay for recording frame to video stack in ms.
    For example 500 ms will hold engine recording frame for half of second and it this way "ghosting effect" will be not visible in animation.
     
  39. Curt

    Curt

    Joined:
    Nov 16, 2012
    Posts:
    11
    Oh shoot, we'll have to try 2021.2 and HDRP 12. I believe we're on 2021.1.10f1 right now using HDRP 11
     
  40. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    487
    m0nsky so here is real pipe line test.
    I created system that`s looks almost the same in Bake and DXR (I need both).
    Thanks of new fallback DXR options (for GI and reflection) finally I have correct GI without glitches.
    DXR:
    DXR.PNG

    Old system BAKE:
    BAKE.PNG

    Baking for fallback is not problem - but would be nice to have this as automatic procedures or something which take carry of that - but is better than nothing.
     
    Last edited: Nov 7, 2021
    m0nsky likes this.
  41. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    Why can't I see any reflections in the blue thing? I see the shadows, but no raytraced reflections.
    upload_2021-11-8_17-55-41.png

    Even with metallic and smoothness on full blast, I see 0 reflections. I thought raytraqced reflections are suppose to work without any baking or probes!?!

    If I switch to raymarching, things sort of start to work, but why doesnt it work for raytracing?
    upload_2021-11-8_17-58-32.png
     
  42. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    254
    What shader are you using for the foliage? It could be that the shader you're using is not supported. The "mixed" mode was introduced for this use case.

     
  43. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    Mixed doesnt work. Only Ray Marching works
     
  44. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    This is again with raytracing. I would expect the car reflecxtion to be more crisp. basically the ground to be like a mirror at smoothness and metalic both at 1. Why is it so blurry?!?
    upload_2021-11-8_18-46-23.png
     
  45. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    254
    You have "affect smooth surfaces" enabled with a denoiser radius of 8.
    Also, what do you mean by "doesn't work" ?
     
  46. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    I mean for plant reflections:
    Raytracing = doesnt work
    Raymarching = works, but not great quality
    Mixed = doesnt work
    Probably the shader doesnt support it?

    Ah yes, denoiser radius of 0.25 seems to result in more the "mirror" look that I expect
     
  47. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Pathtracer:
    I have an interieur archviz scene that I´d like to pathtrace, but it seems the windows (facade and inner glass-panes) seems to block some light from outside so that the pathtraced image gets darkened.
    The glass material has alpha to zero.
    When I disable all glass-objects the result is fine:

    upload_2021-11-9_11-28-18.png

    Disabling the glass while pathtracing is no option, I need the reflections...

    Any idea?
     
    keeponshading likes this.
  48. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    can you post your glass settings?

    do you have simple cheated standard glass, or full on translucency glass with IOR on boxed mode and appropriate IOR value?
     
  49. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    On last shot it's darker not only behind glass but also in front of it.
     
  50. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Just simple Standard without any IOR or translucency:

    upload_2021-11-9_13-43-20.png

    What settings do you suggest to get as realistic as possible?
    Any docs or links on this?