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. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    Ah interesting. I'll give that a go.
     
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    You might be missing somethign else. And I might have had to turn emissive values up to stupidly high amounts, I dont recall and this stuff isnt really an area I am hugely familiar with.
     
  3. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    Yes, it appears you really need to crank it high to get it doing anything, which I think is what threw me, but it is working. Good to know!
     
  4. sendspace

    sendspace

    Joined:
    Jul 24, 2016
    Posts:
    40
    Hey all.
    it would be great if u guys sharing project files of the pics u guys post here. it can be alot usefull for dxr noob like me.
     
  5. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    So I have now managed to get emmissive working, and did a little test scene to see how it was with moving sources and occlusion and so on.

     
  6. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    35
    I finally got Raytracing to work on my machine.. it was the latest GTX 2018ti driver update that did it.
    The RTGI and RTAO looks really gorgeous.
    upload_2019-9-6_12-10-8.png
    There is some lagging and ghosting when I move around with denoising on.
    But I can't get area lights and directional lights to work with raytracing shadows on..
    the shadows doesn't show when I check the raytrace shadows. is this normal? (btw, I'm using the demo dxr with sponza project). Look below.. all area light shadows and directional lights are gone.
    upload_2019-9-6_12-12-10.png
    and I still get this error.. :(
    upload_2019-9-6_12-12-58.png
     
  7. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Just pushed latest HDRP/staging to this as there's been quite many DXR fixes there after I assembled the test project. Didn't change the project itself, so it's still setup for Tier 2 raytracing.

    Edit: Added another branch for Tier1 along with faster shadow denoiser (denoiser hack from Unity discord channel): https://github.com/0lento/Unity_DXR_Test/tree/tier1. Do note that you'll get additional error for _CookieTextures not set at compute shader on this. It's coming from deferred updates that are enabled on Tier 1 components now.
     
    Last edited: Sep 6, 2019
  8. unity_RuwGDfd2lVx01A

    unity_RuwGDfd2lVx01A

    Joined:
    Oct 25, 2017
    Posts:
    23
    Does terrain contribute to raytracing in the latest HDRP/staging?
     
  9. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Terrain is unsupported atm according to Unity dev.
     
  10. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I do feel like the HDRP Changelog missed out when it came to listing all the DXR-related progress.

    All I really see so far is:

    6.0.0
    • Added code to future support of DXR (not enabled)
    • Added support for Quarter Res Raytraced Reflections (not enabled)
    6.7.0
    • Screen Space Directional Shadow under a define option. Activated for ray tracing
    • Fixed shader warnings related to raytracing and TEXTURE2D_X
    7.0.0
    • Added DXR verification in HDRPWizard

    7.11
    • Raytracing ShaderGraph node for HDRP shaders
    • Add draft of minimal interactive path tracing (experimental) based on DXR API - Support only 4 area light, lit and unlit shader (non-shadergraph)
    Hopefully its clear what I mean. For example things first mentioned in 6.0.0 but not enabled then, were working and enabled by 7.0.0/7.0.1 and never really got a proper mention. I also feel that a whole bunch of improvements/fixes/refactoring happened between 7.0.1 and 7.11 and they dont really get a mention, in contrast to a couple of other brand new features that do.
     
    OCASM and Lex4art like this.
  11. CGBull

    CGBull

    Joined:
    Feb 12, 2017
    Posts:
    82
    Does have any plan to support custom instance data for AccelerationStructure?
     
  12. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  13. unity_RuwGDfd2lVx01A

    unity_RuwGDfd2lVx01A

    Joined:
    Oct 25, 2017
    Posts:
    23
    In my testing, these things are completely unsupported by ray-tracing currently (HDRP 7.1.1):
    • Skinned meshes and animated characters
    • Video textures regardless of material property
    • Terrains and any trees or details
    • Unlit materials
    • Transparent reflections
    • And probably some other stuff I'm forgetting
    All in all, I like ray-tracing, but it has a LONG way to go before it can even feasibly be used in anything other than an archvis tech-demo. I know that's to be expected from a feature in the pre-alpha stage, but I'm saying this to temper expectations of people using it.
     
    OCASM likes this.
  14. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Well, transparent surfaces with reflections and refraction are working if "Recursive rendering" was added in post-processing volume settings (it's not saves properly, though - each editor restart requires manual adding of this property to the volume settings, again and again (I did a bug report about this (Case 1182515)):
    Refractive transparency 1.jpg Refractive transparency 2.jpg Refractive transparency 3.jpg
    With ray tracing depth equal to 1 this sphere looks like a pearl :).

    Terrains - they're ignored by ray tracing, but placing some simple proxy mesh under terrain surface will give you GI/reflections somewhat close to expected from original terrain. Maybe it's possible to quickly export terrain as a FBX and use this mesh with same terrain texture as a proxy for ray tracing.

    Foliage - something interesting possible with proxy meshes, experimenting ...
     
    Last edited: Sep 7, 2019
    OCASM likes this.
  15. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You can also add DOTS rendering to the nonsupported list :)

    I tried raytracing with HDRP and ECS Hybrid Rendering and objects rendered through hybrid renderer do not work at all on DXR on my end.
     
  16. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    Which Unity Version is working for you atm (with 7.1.1) ?

    Edit:
    Thanks rizu, it is working with 2019.3.0b2
     
    Last edited: Sep 7, 2019
  17. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Just curious ... far in the future when this is feature complete, and we want to provide users with a setting to toggle this feature on/off ... will the same lights with the same settings play nice with ray tracing being turned on and off, or will this require us to create two different lighting sets?

    I'm coming at this with no knowledge what-so-ever, so if this should be obvious, sorry! I'm hoping dxr lights will basically match HDRP's physically based lighting and be as simple as "turn on dxr!", but provide GI, better shadows, reflections, etc ... but I'm sort of expecting it to work wildly different.
     
  18. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Unity are still fiddling with 7.1.1 on github, in recent days it was set to require beta 3, but thats now been changed to beta 4. I'm not really prepared to wait, so I've been mucking around with that. It does delay when we will all be 'on the same page' when we talk on this thread about 7.11 though.
     
  19. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    I made a scene, using the 7.1.1 version and 2019.3.0b2 beta.

    This is simply an HDRI sky, with a direct light to give some definition. The orb then has an emissive ball inside (which doesn't really do anything) and then some Area lights with raytrace shadows.

    Raytrace GI, Reflections, AO. A bit of bloom, colour correction and DoF.

     
  20. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    35
    Nice video. thanks for sharing.

    I'm still not getting raytraced shadows.. I get this error and have no idea on how to get rid of it.

    Please fix all the compilation errors for Ray Tracing Shader "RaytracingShadow"!

    I can only get shadowmap shadows and when I turn on raytraced shadows, the shadow desapears.

    upload_2019-9-11_12-3-43.png

    I don't think Im getting ray traced reflections either.
     
  21. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    I had a bunch of problems like that. I had to take one of the projects posted previously and then started to add my own content.

    This should be the project I downloaded, which worked great straight off:

    https://github.com/0lento/Unity_DXR_Test

    Directional lights work perfectly. However I do see shadows sometimes don't turn on correctly when using rectangle lights. In my test scene I had to flip some lights on and off at the start of play to get them showing, but then they worked great.
     
  22. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    This suggests you didn't modify the hdrp config package file define for raytracing.
     
  23. OCASM

    OCASM

    Joined:
    Jan 12, 2011
    Posts:
    328
  24. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    35
    If you mean changing (0) to (1) on the hls file, I already did that..


    upload_2019-9-12_14-57-19.png

    as you can see I DO get raytraced GI and and raytraded AO.

    upload_2019-9-12_16-27-57.png

    I just don't get the raytraced shadows and keep getting that error. btw, I am using wordpad to modify the hls file from (0) to (1).
     
    Last edited: Sep 12, 2019
  25. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    35
  26. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Is that screenshot from the file on your library/packagecache or did you move it to packages folder? If it's still in packgecache, I'd doublecheck the value and see that Unity didn't overwrite it back to 0 again. Also some of the raytracing feats did work in past without that define unless I remember wrong.

    If everything is fine on that file, you could always just wipe the shader cache from library / whole library and try again.
     
  27. zhethier

    zhethier

    Joined:
    Sep 12, 2019
    Posts:
    1
    I have the same problem. I downloaded the "Unity-Experimental-DXR.7z" and unzip it to "D:\UDXR\Unity-Experimental-DXR" folder. When running unity.exe from this folder I only got 2D and 3D template.

    How can I get the DXR template?
     
  28. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    I used this project in 2019.3 beta:

    https://github.com/0lento/Unity_DXR_Test
     
  29. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    Hello everyone. I made a super simple path-tracer using DXR in Unity. If some graphics programmer wants to start experimenting with DXR and doesn't know where to start, then this could help you. It is using Unity's default renderer and it is only few hundred lines of code. It shows how to use the undocumented API and how to write a simple raytracing shader(s).
    It is pretty useless in itself but it could help somebody get started since there is no documentation or tutorials. You can find it on GitHub.



    Also, does anybody from Unity frequent this forum? Is there any point in giving feedback for DXR implementation in Unity (unrelated to HDRP)? Or is there a better place?
     
    Gametyme, SKoptev, sendspace and 3 others like this.
  30. iriguchi

    iriguchi

    Joined:
    Feb 1, 2016
    Posts:
    46
    FYI
    I got the DXR in Unity 2019.3.0b2 and b3 with HDRP 7.1.1 from GitHub.
    Quadro RTX 5000.

    DXR supported version of Windows 10 is 1809.
    But I think it is not accurate......
    I do windows update to the latest.
    DXR works fine.

    I spent a lot of time on......
    Thanks
     
  31. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    Did another scene. This was to see how Subsurface Scattering played with GI/reflections etc

     
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You can also feedback here: https://forum.unity.com/forums/high-definition-render-pipeline.386/

    But I think for DXR this is probably the best thread. Sometimes @SebLagarde and other friends need a
    bonjour amical.
     
  33. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    Thanks. I don't know if unity even wants feedback for experimental API. or bug reports for experimental API. I'm sure they know about lot of these issues and there's a chance the API will change anyway...
    I guess I'll put together a list of issues I ran across and post it here.
     
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    They always do want feedback, and will lock threads they no longer want feedback on.

    It's wanted and welcome to report and also comment on any issues with API because it's better to say it twice than never.
     
    Michal_ likes this.
  35. ArnoldCarterWong

    ArnoldCarterWong

    Joined:
    Sep 26, 2017
    Posts:
    31
    GI and AO seems to work, but reflection is black at all........I am in 2019.3.0b3
     
  36. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Reflection issue has been solved in github and 7.1.1 already by this PR: https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4383 You can't use 7.1.1 on b3 as is as there's small API difference that requires upcoming b4. For git users, you can revert this commit to be able to run these on b3: https://github.com/Unity-Technologi...mmit/31740c9eab8b4f0b5bbd9eca15f9bb9514f86336
     
    Ehredt likes this.
  37. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69


    Made a new scene, this time playing around with lighting and colour. I love the way reflections can be tweaked and how the image responds. There's a big ol' emissive box at the top to create the main light which is visible in reflections.

    The performance is a bit harder hit here, which is likely due to the fact that everything is reflective.

    Moving version here:
     
    Rowlan, Elecman, petersx and 3 others like this.
  38. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    I wonder what it would look like without DXR ?
     
  39. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  40. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
  41. OnlyVR

    OnlyVR

    Joined:
    Oct 5, 2015
    Posts:
    55
  42. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    Maybe it's just been too long of a day, but I can't seem to find the "Ray Tracing" toggle in the frame settings of the camera in 2019.3.0b3, even though everything else is set up correctly and Realtime Ray Tracing is enabled in the HDRP Asset. I'll try it tomorrow with 2019.3.0b1 since that seems to have worked for someone else and report back.
     
  43. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    171
    I found rectangle light shadows only works when I use Deferred Only mode.
     
  44. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
  45. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    I have two questions:

    1. What's the plan for controlling if DXR is enabled for end user (eg. a game that offers DXR as an option that could be turned on/off in the graphic settings).

    I assume that it should be controlled by the Volume settings or frame settings on cameras?

    2. Is it possible to run standalone player that uses DXR HDRP asset on DX11 (Windows 7) by keeping the DX11 on the API list as a secondary option? Off course DXR wouldn't work on DX11 but I'm asking if it can use DX11 as a backup and ignore DXR.

    Some other things like separate Volume profiles would be required in this case but it's still easier and faster than maitaining two separate builds for DX11 and DX12.

    Thanks
     
    Last edited: Sep 23, 2019
  46. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    can you please share the project files??
     
  47. Willchenyang

    Willchenyang

    Joined:
    Jul 20, 2018
    Posts:
    14
    I have two 2080 GPU. Is it using both GPU or is there a setting somewhere?
     
  48. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    35

    I found this comment on a different forum but dont know what to do.. can someone please please dicifer this?

    “BRDF.hlsl
    ImageBasedLighting.hlsl

    there are non-ascii character in those hlsl files.
    some guy had copy & paste it from technical papers as comments.

    you can find that using below regex:
    [^ -~]
    I just found it in BRDF.hlsl and ImageBasedLighting.hlsl.

    1. figure out non-ascii characters then delete it from hlsl files
    2. delete "Library" directory
    3. open project again
    I'm not sure why older windows can work correctly.
    anyway, my project was fixed using this method.”

    where are those two files located? n how do I fix them?
     
  49. wenzy

    wenzy

    Joined:
    Nov 17, 2015
    Posts:
    44
    Doe unity 2019.3.0b not support compute shader yet?

    it shows this information

    d3d12: generating mipmaps for array textures is not yet supported.
     
  50. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I've always seen that mesage, but I dont see what it has to do with compute shader support.

    I know that compute shaders in general do work with Unity in DX12 mode because I have used some of my own just fine, with no special steps required. What I have not done at all is go through every aspect of the HDRP system using DX12 to see if there are any areas that dont work properly.