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

Official Unity Experimental HDRP DXR

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

  1. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    Is there plans for RT Caustics and RT HDRI sampling?
     
  2. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    I doubt that caustic will be in real time...this is incredible complex effect even for CPU rendering. I know, that you saw this effect in Unreal but, this is fake effect, nothing to do with physics and DXR. Probably caustic in Unity will be implemented only in Path Tracing system but there is no even sign about that if we talk about developing schedule.

    HDRi sampling (importance) I think is on the way.

    That's Is what I know so far....
     
  3. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    Have you seen this? (1:18:00)

    And this is example of RT caustics in realtime scene https://www.artstation.com/artwork/klDWKy
     
    valarnur likes this.
  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    the good stuff start at around 1H18min for those that want to skip ahead.....
     
  5. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Yep that's the "Fake". It is not pure Caustic and you can forget to use it in games.
    Actually this is approximately Final Gathering Photon Mapping (or very poor amount of Path Tracing Photons) mixed with some sort of code to interpolate received very little information (Caustic need enormous amount of photons).
    This has nothing to do with real caustic which you can use in games or rendering. It looks on video great but you must understand that using it with many light sources and more bounce lights + complex object will give you "Power Point" slide speed.
    Here you have example of real caustics done by our Kray Render Engine....and to get this effect we needed develop new Core (v3) for over 7 years. Amount of shooting photons:
    - GI (Photon Mapping + QMC sampling) 2.000.000
    - Caustic photons 20.000.000
    - 40 real bounce lights
    Times render Dual Xeon 40HT - around 1 min.
    K3_00000.png

    To do something that on GPU should be much, much faster....but find me that GENIUS who will do it by GPU ;)

    Anyway this video above you can consider as curiosity in my opinion has no value for offline render at all , maybe for sort of games....
     
    PutridEx likes this.
  6. OnlyVR

    OnlyVR

    Joined:
    Oct 5, 2015
    Posts:
    55
    Not real time, but pretty fast GPU Photon Tracing:
     
  7. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Yes very strong Interpolated. probably in interiors with Global Illumination (like 10-20 bounce lights) will be impossible to get clear in 5-20 min....For that situation is needed VCM:
    https://cgg.mff.cuni.cz/~jaroslav/papers/2012-vcm/

    We do not have yet this in Kraytracing.
     
    LooperVFX likes this.
  8. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Using path tracing, only two of my meshes are showing up (there's around 7 or so).
    They're all using the same exact material, and all are cubes extended to create a room.
    Any ideas?

    Also just started using raytraced GI and honestly my experience wasn't good --
    there was a lot of noise in the corners when moving the player, and I thought it would handle sky lighting but it didn't -- not really sure how to deal with sky light when creating a scene that has an interior and exterior. The sky light gets all in the interior rooms, I thought it would be occluded and have a falloff based on it's entrance.
     
  9. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    PutridEx please find information (few topics above) what I wrote about Interiors and background light sources.
     
    PutridEx likes this.
  10. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Here I answer my self:
    After hundreds of hours I am almost sure that Unity again has problem with creating UV map Light.
    Tested old version 2020 Unity and works like charm but up to 2021.2.5f1 minus few versions back looks for me like bug in Unity....
     
  11. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Maybe this is caused by this bug/feature. As discussed there you can remove fog to get rid of lighting in reflections.

    For diffuse surfaces that unexpected lighting comes from default skybox reflection probe being reflected on diffuse materials where smoothness of material is lower than covered by ray traced reflections - so dirty solution is to set realtime reflections params "Minimum smoothness"/"Smoothness fade start" both to to zero, good for ArchViz but this is bit too costly for gaming. Before Unity 2022.1a16 I was able to use old hack with pure black reflection probe that affects whole level (and "Visual Environment" param "Ambient mode" set to "Static") - it will suppress bright default skybox refleciton probe. In Unity 2022.1a16 this hack is not working anymore...
     
    Last edited: Dec 5, 2021
    PutridEx likes this.
  12. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Lex4art I use now this (works perfect and very accurate - first time I get proper level of GI and reflection)
    img_001.jpeg

    But of course this is not perfect solution.
    Needs a bit work: basic Bake + reflection probes....everything in very low quality, few sec baking.
    You get proper reflected surfaces in other reflected surfaces.
     
  13. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    My problem is that I can't bake any light/reflection probes because of purely dynamic & editable environment / lighting in Buildmark so those new ray termination modes are not covering my purely dynamic needs. Fog that appears in reflections and starts glowing in darkness can be fixed with little coding, presumably - grab current auto-exposure value and adjust fog accordingly, so when darker the environment than more exposure and less fog there will be to mess things up in the dark; will try to do this soon. But i can't fix diffuse surfaces receiving bright default reflection probe or something - hope somebody in Unity will have a look on that aspect of mentioned bugreport -_-'.

    Upd: in 2022.1b1 black reflection probe works again on diffuse, phew ).
     
    Last edited: Dec 11, 2021
    keeponshading likes this.
  14. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    ...ah yes only static rendering....
     
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,295
    dxr 9.jpg
    dxr 3.jpg
    dxr 5.jpg
    dxr 10.jpg
     
    Last edited: Dec 11, 2021
  16. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    I still think most of this could be solved with proper raytraced reflection probes.

    Are there plans for this?
     
  17. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257




    Edit
    Soft light

     
    Last edited: Feb 18, 2022
  18. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    Bro that's looking amazing
     
  19. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    m0nsky good looking carpaint!
     
  20. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Trying to create dynamic snow with VFX Graph and while it has a lot of problems to be solved I've noticed that it can look very nice with "Mixed" mode for RTGI/RTR, when VFX particles included into ray tracing:
    Buildmark v2021.2 beta 9 _ 16-12-2021 23.jpg Buildmark v2021.2 beta 9 _ 16-12-2021 29.jpg Buildmark v2021.2 beta 9 _ 16-12-2021 20.jpg Buildmark v2021.2 beta 9 _ 16-12-2021 22.jpg Buildmark v2021.2 beta 9 _ 16-12-2021 18.jpg
     
  21. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Finally we got update of Sunfall SSAA (definitely I prefer SSAA):

    DLSS
    img_001_DLSS.jpg

    SSAA
    img_001_SSAA.jpg
     
    Rowlan likes this.
  22. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    sqallpl and m0nsky like this.
  23. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Looking good @auzaiffe

    Something I've wanted to ask, do you think it could be worth it to port the sky importance sampling functionality to ray traced reflections?

    I was playing with it in path tracing, and it really did some magic @ low samples per pixel there.







    I've tried porting it to ray traced reflections (quality mode) for the past two days, but I'm having a hard time getting the weights/pdfs right since there is no existing light sampling.
     
    Last edited: Jan 11, 2022
    newguy123 likes this.
  24. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    m0nsky for me personally raytraced reflection is less important, it has low impact right now (personally I do not use it because it very bad now)
    What I would like to have:
    - blurred raytraced reflection
    - transparency issues fixed (multi layers transparency surfaces)
    - I am not fan of HDRi at all. Itself HDRI is very bad idea (a lot problems with them)
    - More focus on Physical Sky + Sun with better sampling
    - even better: LightPortals developing or at least something close to LP.
    Those are major issues in Unity (actually everywhere when is in use GPU system)
    I know those things are very difficult to solve but if I lose 20%-40% of render speed, still is winner solution.
     
  25. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    If you're using path tracing, yes, but this doesn't apply to pc gaming/console/realtime visualizations/vr.

    What do you mean by blurred ray traced reflection? If you simply want them blurred, you can make the denoiser affect smooth surfaces and turn up the denoiser radius.
     
    Last edited: Jan 13, 2022
  26. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Sorry: Raytraced Reflection blur not supported by the smoothness.
     
  27. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Hmmm I do not follow....there is way to blur reflection in Raytracing Mode?
     
  28. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    This is new SunFall SSAA plugin update. Looks like DLSS right now is completely unprofitable to use.
    Also using SSAA I can reduce quality of Physical Lights (less samples and less denoiser power) and by this I can get more performance than DLSS, also more quality (no artefacts). I will do more tests, this was only check up.

    DLSS
    DLSS.png

    SSAA
    SSAA.png
     
  29. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    We must be looking at different things then because to me, from your screenshots, the DLSS version looks better. Look at the AA on the curtains in SSAA vs the DLSS version
     
  30. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    newguy123 differences are barely noticeable for me.
    Real test I will do later, because with SSAA I can reduce strongly Quality of Physical Lights (denoise lvl and samples)
    and instead Performance DXR I want use Quality Performance (right now is Performance which is awkward for me).
    Also Quality in low resolution screen like Half HD and FullHD is better with SSAA - that's normal...DLSS is not magic tool because with lower resolution is much less information to process in rescaling algorithm.
     
  31. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    I spent a while using importance sampling for the environment sky (hdri). However, since the fallback layer can use both sky and reflection probes, I thought it would be better to importance sample the whole fallback layer, so we can reduce variance indoors, too.

    The main goal is to reduce variance, less variance (bright spots) means less noise. We can either direct more rays towards those bright areas and calculate the correct probability distribution, or blur our sky/reflection probes to get rid of the bright spots, but we will lose details and sharp reflections. We can clamp all bright areas, but that's a lot of lost energy, especially when working with multiple bounces.

    I decided to use the surface roughness for adaptive sampling the fallback layer mip level (both sky and probes), so we can have both sharp and and noise-free rough reflections without extra traversal cost. Mip level is selected by specifying a "roughness step size", for example 0.20 roughness per mip level. It samples the previous and the next level and will blend these based on it's distance between them. Roughness steps are calibrated to the path tracer by default, and there's an option for mip offset since I don't need mip 0 for RTGI.


    Roughness based fallback mip sampling disabled, 1 sample per pixel


    Roughness based fallback mip sampling enabled, 1 sample per pixel

    Here are some examples of metal materials. Because my game is ray traced in VR, I'm pretty much limited to 1 sample per pixel. Metals are always hard to get right at 1spp.


    Roughness based fallback mip sampling disabled, 1 sample per pixel

    Roughness based fallback mip sampling enabled, 1 sample per pixel

    Edit
    Found a little rounding error, updated the screenshots
     
    Last edited: Feb 18, 2022
  32. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    I'll be improving the Ray Tracing effects integration with APV as it can significantly improve the visual quality if you have APV set up on your scene
     
    LooperVFX likes this.
  33. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    errrr, APV?
    Whats that?
     
  34. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    jeremedia likes this.
  35. unity_8p6oRXXqiWbRTQ

    unity_8p6oRXXqiWbRTQ

    Joined:
    Dec 20, 2018
    Posts:
    22
    Does anybody now if Unity will support Decals for DXR in the Future? Couldnt find any info for that.
     
  36. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Decal support for DXR requires major design changes in HDRP, i'd say in the short future no, but eventually yes. The only way to get decals for now is through the Mixed Tracing mide.
     
    unity_8p6oRXXqiWbRTQ likes this.
  37. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    223
    Hi @auzaiffe any progress on DXR 1.1 and RayQueries from Compute Shaders support in Unity? The 2022.1 is already in late beta.
    Thanks!
     
  38. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    A little follow up to my previous post. Did a few sampling changes to improve the result, one of them is support for multiple bounces in the adaptive mip code.

    Here's some 1 sample per pixel fun, 3 bounces, no denoising:


    1600px


    1600px


    1600px

     
    Last edited: Feb 18, 2022
    rz_0lento, LooperVFX, Seven27 and 6 others like this.
  39. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    m0nsky I would like to test it soon :rolleyes:
     
  40. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    This is only for ray tracing unfortunately. It's also a bit difficult to get the code over to you, since my local HDRP fork contains all kinds of (potentially unwanted) changes, and you'd need to be able to work with custom packages.

    I noticed on github that the official HDRP team has completed work on path tracing sky sampling + path tracing denoising (NVIDIA Optix / Intel Open Image Denoiser), so the next release (I guess 2022.2?) will be great for your use case, way better than ray tracing with approximations.

    For a while now I've been thinking of ways to make ray traced reflections match my ray traced environment better. It's not possible to do a full global illumination pass inside the reflections because it is too heavy. Even though ambient occlusion is kind of the enemy of a physically correct renderer, I still use it in my real time ray tracing projects to mask certain limitations. So I thought to myself, why not just trace a very cheap (skip closest hit shader, etc) ambient occlusion ray inside the ray traced reflections for rays that are reflecting geometry, to reflect what is happening in the scene?

    I'm very happy with the results, especially for single bounce ray traced reflections (see screenshots below)


    Ray traced reflection occlusion disabled (1600px)


    Ray traced reflection occlusion enabled (1600px)

    Edit 1



    Edit 2
    Because I still wasn't satisfied, and because I wanted to see how slow it would really be, I decided to add support for ray traced global illumination inside the ray traced reflections. The diffuse correctly goes through the LightLoop and I've added two modes, performance and quality. Performance mode uses all the tricks I've learned in the past few days. The quality mode is the real deal, the "end game" so to speak, no tricks. It is painfully slow and not suitable for real time use. The video below is running the performance mode, with both ambient occlusion and reflection occlusion disabled, they are no longer needed.



    Edit 3
    Removed other videos because they are a little outdated now.
     
    Last edited: Feb 18, 2022
    rz_0lento, sendspace, Yanus3D and 4 others like this.
  41. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Ray traced reflection occlusion enabled Looks very promised!
    Denoiser for PT can be jackpot for still images!
    For animation of course best is interpolated system.
     
  42. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937

    Hi. Great Work. How stabil ist your methode for a fast moving dragon or fast driven car exterior and interior? Cannot really wrap my head around this.

    I did a HDRP DXR fork of the great P424 Project here.
    https://github.com/PERRINN/project-424-unity/issues/70

    When you hit Q you geht an automated high Speed drive and exterior and interior Kameras on Keys 1 to 4.

    Would be great to understand your method on this use case. RT AO, RT reflections, RT shadows and RT GI are already enabled.
    In special on the glossy and diffuse spheres i placed in the interior.
     
    Last edited: Feb 20, 2022
  43. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Characters/vehicles are complex. My effects are built on top of RTR, but if you're running into issues with noise/ghosting, always imagine the following. You can only pick two.



    - Don't use the RTGI denoiser if your scene contains characters/vehicles. RTGI can only do motion rejection for the receiver. (so it can only reject pixels on the car, not under/behind the car!)

    - If you really have to use the RTGI denoiser, you will also lose small details like shadows under the tires (even at the smallest radius), you can gain some back by using some very short ray length RTAO (but then don't use the RTAO denoiser, because you will again lose details and introduce ghosting)

    - Don't use the RTR denoiser, it does not play well with DLSS (even at 0 radius), and usually is more noisy than the raw input signal.

    - Experiment with different DLSS versions, here is a comparison video:



    Here is the RTGI denoiser on a moving object. The object writes motion vectors and motion rejection is enabled in the RTGI denoiser.



     
    Last edited: Feb 21, 2022
  44. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    Thanks for info!
    btw
    In near future like 4-8 years, those problems will disappear by itself (faster GPU cards ;) more features from GPU units)
     
  45. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Thanks. I will try all these next days.
    The DLSS variants look great and stabil.

    Also thanks for the DXRTriangleOfPain.

    Unser the car i plan to use high res baked tex in decal projektor who blends out when car looses ground. But decals seem to be a problem too.
     
  46. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    For me It has to disappear in 2 to 4 months.)
     
    Last edited: Feb 21, 2022
    Yanus3D and newguy123 like this.
  47. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
  48. Yanus3D

    Yanus3D

    Joined:
    May 6, 2019
    Posts:
    490
    auzaiffe thanks! That great technical injection for us! For me as Interior designer you clarify a lot from this topic ;)
     
  49. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    has anyone managed to get this working in the alpha?

    upload_2022-4-6_14-44-2.png

    I can't seem to find the denoising package anywhere to activate (and click "fix" seems to do nothing)
     
    fuzzy3d likes this.
  50. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    That's sort of a placeholder. Its not actually in the alpha yet. Coming soon though...
     
    Yanus3D and Mark_29 like this.