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

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    +1 for an 2019.3 backport.
     
  2. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Is it possible to copy elements from the original DXR London meeting room, to another project? I want to use those birds in my non DXR project
     
  3. Weidz_

    Weidz_

    Joined:
    Feb 15, 2018
    Posts:
    41
    I don't have the project around but if your non DXR projcet is in HDRP yes you should be able
     
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    2020.1.0a15 and latest hdrp/staging from github now supports skinned mesh rendering for DXR:


    but it still doesn't support vertex offsetting by shader:


    Is the vertex manipulation by shaders / shader graph something that Unity will eventually support? I can see this becoming a real issue with any game that has nonstatic foliage or if you need to do animation via shaders for DOTS etc.
     
    Last edited: Dec 7, 2019
  5. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    keeponshading likes this.
  6. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    State of that art game like the latest modern warfare don't support either, I think that's a problem with raytracing in general, you basically "duplicate" the mesh into a BVH structure, so when you do shader on your raster path, it doesn't affect the representation in the raytracing part ... It's also a problem with bilinear sampling I think too ... So don't expect unity move on that unless the entire industry find a soluction.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Newer drivers for nvidia do enable accelerated dynamic structures, or rather greatly improve performance in that area.
     
    Lars-Steenhoff likes this.
  8. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Entire industry will not go for DXR anyway, only tiny fraction of it. And since UE4 can do this on next version too, it's increasing the odds that we'll see games with this kind of functionality in the future.

    Just because currently existing games are limited on what they can do with DXR doesn't mean future games should stay the same :)
     
    Last edited: Dec 8, 2019
  9. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    It's not a dxr problem, it's a hardware acceleration (hwrt) problem.

    Also I didn't meant the future won't happen, I'm saying that's the hurdle they have to go over, and they are collectively working on it. like I said, when collectively they find a solution, it will ripple down everywhere. I doubt unity will be on the forefront, they will implement whatever comes to their shore like they are doing with DDGI.

    And like I said much much earlier, hwrt will be supplemented by all sort of technique anyway. Everyone will have a franken sandwich implementation.
     
  10. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    The thing with using game engines is though is that users don't have to solve these hard problems. I don't personally need to know any of the details how it's done, all I need to know if it can be done and if it's going to be done in the engine I'm using for my project. Speculating the state of industry doesn't really help on getting that info at all as we already know others have solved this in some way (so we know it can be done).

    I'd assume this is something Unity will try to solve but I'd still want to get response from the staff about it: is it being worked at or postponed for the time being etc?
     
  11. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Well I got you the answer, and provided context as to why this answer is the way it is. You tried to argue back.

    I merely provided information so you have the right set of expectation, I dunno. Also it's not speculation, it's in all the talks, tutorial and articles.
     
    wetcircuit likes this.
  12. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You did not and you just keep trying to make some arguments here for reasons I don't understand, it's not helping and is just turning this topic into noise. All I wanted to know if Unity is working on this or not.
     
    LooperVFX likes this.
  13. Weidz_

    Weidz_

    Joined:
    Feb 15, 2018
    Posts:
    41
    Is anyone working on a fix for the GI bounce problem ?
    What was the latest version it was working ?
     
  14. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Some info in this thread and specifically this post about driver versions: #9
     
    Weidz_ likes this.
  15. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Updated post, using HDRP/staging of today (dec 11), at commit 6e26857

    [1] Reflection exposure has a lot of issues, a pull request (#5269) with exposure fixes was merged but introduced the following issues:

    Directional light



    No lights, incorrect exposure on reflection in the mirror



    Area light, incorrect reflection exposure



    No lights, again, somehow the reflection isn't pitch black



    [2] Having more than one RT area light does not work, only seems to casts shadows

    1 Area light (shown as a sphere in the scene)



    2 Area lights (shown as spheres in the scene)



    [2] Setting reflection bounces to 2 or higher shows reflections inverted, introduces a lot of artifacts/glitching

    This has now been fixed. The issue persists after wiping the /library/ but is resolved upon creating a new project. (all other issues were also tested in a new project)

    [3] Setting GI bounces to 2 or higher breaks the entire project

    Can also confirm this is now fixed in PR (#5306)

    [4] Standalone builds don't render anything at all

    Editor



    Standalone (Windows) build




    I modified my HDRaytracingManager.cs in the 7.1.5 package to create the best of both worlds, stable DXR with skinned mesh renderer support from this PR. (https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/5107)



    I created a temporary gist for people who use DXR + skinned mesh renderers (compatible with Unity 2020.1.0a15 + HDRP 7.1.5) and currently don't have anything stable to work with. https://gist.github.com/m0nsky/5a0af16b4f70b5a95b5bfeff1272ac5d



    I also noticed a lot of ghosting has been introduced again, especially on GI. I've thought about modifying my 7.1.5 setup to replace the denoisers with nohistory denoisers like we manually used to do a few weeks ago but I'm kind of hoping we can get all of these things fixed in 7.1.7 so my local HDRP branch doesn't get too much out of sync.

     
    Last edited: Dec 11, 2019
  16. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    +1 here, 7.1.6 is no go (at least with unity 2019.3.1f). High hopes for 7.1.7 with official release of Unity 2019.3 :)

    Works fine for me even with 10-15 lux of brightness for directional light. Maybe it's caused by disabled option "Reflect sky" in Screen space reflections override properties?

    Also fine here (no glitches even with 31 reflection bounces), but I have all kinds of glitches and bugs with ray tracing if I didn't delete old settings profiles for Sky and Fog volume and global volume from previous HDRP versions. Also delete all light sources and setup new ones just for sure.

    This one caused by default limit for 2 area lights, can be tweaked up to 128 here:
    Area lights limits.png

    At least six of them can work simultaneously, but they are very heavy on fps...
     
    Last edited: Dec 10, 2019
  17. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Are you talking about 7.1.6? Because you shouldn't be able to test these situations in 7.1.6 at all, because reflections are currently not working with these sunlight setups. There is a PR to fix this issue, but it has not been merged yet. (https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/5269)
     
    Last edited: Dec 11, 2019
  18. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    I'm on 7.1.5 - ray traced reflections are like that:
    Reflections and sky.jpg
    Fog is not present in ray traced reflections so sky looks darker than it should but overall seems fine (all looks dim here - didn't tweak exposure for the sake of clean test).

    Upd: on the screenshot there is 1100 lux, not 11000. But I re-tested this and there is no visual difference.
     
    Last edited: Dec 10, 2019
  19. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    Yeah exactly, none of these issues are present on 7.1.5
     
    Last edited: Dec 11, 2019
    Lex4art likes this.
  20. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Oh, you're mentioned that all those bugs are not in 7.1.5 and I somehow didn't read this in your initial post ... sorry -__-" (it's a common thing for me it seems).
     
  21. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I noticed that DXR support for skinned mesh rendering was backported to release/7.1.x on github. It doesn't seem to do anything atm on 2019.3 versions we've got but Unity could still land the needed changes to future 2019.3 releases I suppose. Either that or it's an oversight, here's hoping for the former :)
     
    keeponshading likes this.
  22. Weidz_

    Weidz_

    Joined:
    Feb 15, 2018
    Posts:
    41
    A pull request just appeared on the github; including :
    • Fixing crash when bounce count is > 1 for ray traced indirect
    • Fixing exposure for path tracing
    • Fixing denoising not working for reflections in tier1
    • Correcting artifacts in the diffuse denoiser (ao and gi)
     
    Lex4art likes this.
  23. Weidz_

    Weidz_

    Joined:
    Feb 15, 2018
    Posts:
    41
    Has been merged on the "release/2019.3" branch as "HDRP 7.2.0"

    Also, I made the endless hallway from Disney's Phantom Mansion, combining one-way mirror and *infinite* reflections


     
    OCASM, vb2s360, jeremedia and 2 others like this.
  24. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Does anyone has an solution for avoiding an crash when an HDRP + DXR build is started in an resolution who is too high.
    All my scenarios are directly crashing when you open them on an Monitor Resolution from
    3840 x 2160 (nativ).
    When i decrease to
    2560 x 1440 everything is fine.

    I am in
    2019.3.0f3 HDRP , 7.1.6

    I am also searching an monitor selector on start.
    Default scenes are starting on monitor 0.

    Would be cool to select the monitor before the scene starts like in the standard monitor and resolution dialog before Unity 2019.3.x.
     
  25. jeremedia

    jeremedia

    Joined:
    Apr 21, 2015
    Posts:
    63
    Does anyone know the/a HDRP/DXR method to reset the temporal history? PostProcessing V2 has a publicly accessible "ResetHistory" method, whereas the V3 method is in an internal class. It's absolutely essential when cutting between cameras, not sure how this could be overlooked?
     
  26. Weidz_

    Weidz_

    Joined:
    Feb 15, 2018
    Posts:
    41
    More an hack than anything but you can shake your mouse a little to make the camera render some more frames and gradualy reset the history
     
  27. GeneralLee_

    GeneralLee_

    Joined:
    Dec 16, 2019
    Posts:
    4
    Is Raytracing not supported in a standalone build? It works in the editor but not in the standalone build. I wanted to debug my application with Nvidia Nsight, but if DXR is not included in the standalone I wont get far...
    I wanted to build my own DXR effect in a custom pass, but it doesnt seem to work. I assume my AS is messed up and Nsight lets you view your AS.

    Edit: It would also be nice if the RequestAccelerationStructure function inside the RaytracingManager would be public instead of internal.
     
    Last edited: Dec 19, 2019
  28. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    HDRP 7.1.5's raytracing definitely works in standalone builds. HDRP 7.1.6+ RT reflections are broken in builds but your post made it sound like you are not using HDRP.
     
  29. GeneralLee_

    GeneralLee_

    Joined:
    Dec 16, 2019
    Posts:
    4
    Then I dont understand why is looks like this in the editor:


    And the build looks like this:


    The (noisy) ambient occlusion is gone and so is the cube... Any ideas?
     
  30. tinytower

    tinytower

    Joined:
    Nov 25, 2018
    Posts:
    1
    I click on the link to download but it says "page not found"
     
  31. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Would be nice if DXR bake extensions would be available in HDRP + DXR + Shadergraph.

    Here a nice working prototyp.
    ArmorPaintDXR can bake raytraced ao, cavity, bent normals, thickness, lightmap, curvature and dilate pass

    They would be really useful in the HDRP pipeline to.

    https://twitter.com/luboslenco/status/1206928563389313024?s=20

    Here the code...
    e.g
    DXR bake Bent Normal
    https://github.com/armory3d/armorpaint/commit/db550e611a67936eec075051c486c8cb4423f7bf

    DXR bake Thickness
    https://github.com/armory3d/armorpaint/commit/ba2211ca94f461fbdeced8f40d2b2f6da6b88149

    more here
    https://github.com/armory3d/armorpa...r=f4f2cc077b1d055e3fd7a6fe585656447dd79919+34
     
  32. sinaari

    sinaari

    Joined:
    Jan 28, 2019
    Posts:
    46
    Could someone pease tell what is the current way to create a 64bit build with RTX support in Unity 2019.3.0f4 ?

    Simply building an application creates one that does not use raytracing which is evident by looking at the reflections.
     
    Last edited: Dec 26, 2019
  33. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You need to use HDRP 7.1.5 or older. DXR reflections just flood the player logs with errors on any version newer than that. Same happens on github versions from master and hdrp/staging when used with 2020.1 alphas too. This has been broken for a long time now so I do hope Unity does fix this before 2019.3 releases...
     
  34. sinaari

    sinaari

    Joined:
    Jan 28, 2019
    Posts:
    46
    Wow, thanks, did not know that. Unity gives us another hard punch, it's easy. Yes, with 7.1.6 I was getting a lot of errors on a 64bit build and nothing was working. But the 32bit build seems to run without errors, it just does not have raytracing, all reflections are non-raytraced.

    And I can't use 7.1.5 because on it the build crashes because of the custom pass shaders that I am using (it's a known error that had been fixed in 7.1.6).

    What was the procedure for creating a raytracing-enabled build with 7.1.5 and before? It looks like if I just build the application in 64bit mode the raytracing simply works. Can you confirm that, no additional steps or command line arguments needed?

    I hope Unity does have plans to make raytracing work indeed.
     
  35. andrzej_

    andrzej_

    Joined:
    Dec 2, 2016
    Posts:
    81
    When using path tracing I get really strong ghosting in editor. It just becomes completely unworkable (no refresh at all. ) When I switch to play mode it works fine. Any idea if this is hardware related? Once it's working in play mode I have no issues with performance (getting even 100-200 fps on the scene provided by Kejiro)
     
  36. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    How to get raytraced reflections on transparent objects?
     
  37. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Here are official docs about setting this feature to work. Or a screenshot in this post.
     
    keeponshading and Bordeaux_Fox like this.
  38. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Thanks, but enabling Raytracing Tier 2 and Path Tracing crashes the Unity editor. :(
    As soon as I enable Path Tracing in the Volume, my scene geometry disappears and the scene becomes very dark. Then Unity freezes and even my Task Manager freezes.
    Reflections on transparent objects work but Unity also crashes at random intervals. Sometimes after a few minutes, even when I do nothing. I was leaving my PC for a short break in the kitchen and when I returned, Unity was closed and I had a nice little crash reporter window on my desktop ...
    I don't know what happened in Unity, but there must be some strange sort of memory leak when it only crashes after a few minutes of initalization?
    Is a RTX 2060 too weak for that? I encountered 100% spikes for my RTX in the task manager.
    And I just have an empty modell of a small empty apartment (no furnitures, no doors, etc. just walls, floor and ceiling). Only testting reflections on one small window glass.
    I have two GPUs, a Intel UHD Graphics 630 and a RTX 2060.

    Is there anyone here who can run their demo scene without crashes with Tier 2 enabled?
    I really wondering because I see screenshots of far more complex scenes in this forum.
     
    Last edited: Dec 30, 2019
  39. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    For what it's worth, I filed an issue report for this, case #1208354: DXR reflections throw NRE's in player
     
  40. laurent-h

    laurent-h

    Joined:
    Sep 29, 2016
    Posts:
    78
    Hi, I don't think Vertex manipulation in shaders will affect ray tracing in 2020.1. Skinning and blend shapes are the focus, including better handling with the denoiser.

    I hope you'll find most of the exposure issues with ray traced reflections fixed in 7.1.7
    If not please let us know.
    We know the path tracer still has issues with exposure in 7.1.7
     
    Lex4art and rz_0lento like this.
  41. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Reflections on transparent objects show up in editor but not in standalone build. I'm using HDRP 7.1.7.
    Has anyone else this problem?
     
    Last edited: Jan 1, 2020
  42. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You actually get DXR reflections to render using 7.1.7 on standalone if it's not transparent object? For me having DXR reflections enabled on anything newer than 7.1.5 just results in black screen in build and logs spammed with null ref errors for raytracing.
     
  43. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I checked. No reflections work any longer in the standalone build, both opaque and transparent materials. I use HDRP 7.1.7. But I also tried to downgrade to 7.1.6. Also no reflections in the build.
    In the editor, my windows and mirrors show nice reflections, but in the play mode, they all gone. I also noticed, when the splash sceen fades out and my scene fades in, I see for a small moment everything with DXR GI, and then all DXR effects disappearing. So I guess DXR is complety broken in the newest updates.

    Btw. I think reflections on transparent objects were just added with 7.1.6.
     

    Attached Files:

    Last edited: Jan 2, 2020
  44. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Lex4art likes this.
  45. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
  46. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Yes. The screenshot was made from the build.
     
  47. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    What are your hardware specs?
    What is your game setup?
    DXR rendering gets disabled for me after a second my scene has loaded.
    I have a RTX 2060 with the latest Nvidia Studio driver and I also tried HDRP 7.1.7.
     
  48. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Some help needed with scripting & DXR: it seems in build DXR always set to Tier2, no matter that I've set in HDRenderPipelineAsset and my performance is 2x lower because of that. Is there a way to force DXR Tier1 in build at runtime via script? I'm not a programmer (but as a "logic user" I can tweak simple scripts) - can't find any manual or reference about how this can be done. Halp, please! )
     
  49. jeremedia

    jeremedia

    Joined:
    Apr 21, 2015
    Posts:
    63
    Laurenth, is there an "official" way to reset/clear the DXR temporal buffers? For instance, when you cut to another camera with Cinemachine you need to reset the buffers. A workaround is to adjust the camera FOV, but threre really needs to be an API for this critical image-quality problem. Clearly wrong occlusion/shading fading away over multiple frames is just lame.
     
    Weidz_ likes this.
  50. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    68
    Recently worked on a new test, focusing on raytrace shadows and reflections. Also adding in some fog and so on.

    Not everything is working perfectly, but with the right mix of lights I can get pretty solid results with 7.1.5

    Turning specular reflections off helped, as it stopped them from showing through pillars and so on.



     
    Gametyme, auzaiffe, newguy123 and 3 others like this.