Search Unity

URP deferred

Discussion in 'Universal Render Pipeline' started by laurentlavigne, Jul 15, 2020.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    I've spent a few hours changing the lighting model of built-in lighting model, it was hum... interesting.
    So I have one request for the URP deferred, to lower the level of hum... interestingness:

    make the changing of lighting model EASY

    what this means practically:
    wrap lambert should be no more than 4 nodes away: ndotl (yep should be a node so we don't have to redo it 20 million times, since it's used all the time), 0.5, mult and add

    also, make multi pass composite possible so we can have inverse hull outlines.
     
    LooperVFX and Bordeaux_Fox like this.
  2. unity_C_YXw9ksuUraKw

    unity_C_YXw9ksuUraKw

    Joined:
    Mar 29, 2020
    Posts:
    1
    hi, in which version you managed to use the deferred mode in URP?
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    the lighting model change was done in built-in, URP team is releasing deferred any-time-now™
     
  4. Thermos

    Thermos

    Joined:
    Feb 23, 2015
    Posts:
    148
    How about the performance? I tried the deferred rendering in URP 9.0 with Unity 2020.2, seems every point light cause 3 extra non-batched draw call(Stencil Volume Pass + Lit Pass + Simple Lit Pass), not a big deal for PC, I did not see any framerate drops inside editor, but it's a little bit scary...so I switch back to forward renderer...
     
  5. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    So they are implementing deferred as it was 10 years ago, using stencil-based geometry draw calls instead of tiled/froxel compute-based shading. Why? Any GPU that doesn't support compute shaders in 2020 is also very likely not capable of running 10+ referred rendered lights at an acceptable performance.
     
  6. Thermos

    Thermos

    Joined:
    Feb 23, 2015
    Posts:
    148
    Hope that's only a very basic implementation in 9.0, because I saw tile depth pass in 10.0.
     
    laurentlavigne likes this.
  7. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    That's reassuring. DeferredLights.cs is all about tiled lighting. Also nice to see many #if UNITY_SWITCH around the code, it means the team is actually testing their stuff on device or something. Oh, and seems they are trying to use burst inside SRPs now, so there is hope. For projects starting next year, but still.
     
    laurentlavigne likes this.
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    Nice. I'll take a look at v10
     
  9. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    how do you install v10?
    I get
    Z:\__TESTS\Graphics\com.unity.render-pipelines.universal\Editor\ShaderGUI\ParticleGUI.cs(319,106): error CS1061: 'ParticleSystemRenderer' does not contain a definition for 'supportsMeshInstancing' and no accessible extension method 'supportsMeshInstancing' accepting a first argument of type 'ParticleSystemRenderer' could be found (are you missing a using directive or an assembly reference?)
    in 2020.1 and 2020.2
     
  10. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    48
    The currently latest URP version in the Graphics repository requires at least 2020.2a17. Which version are you on?
     
  11. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
  12. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    48
    Try checking out 10.0.0-preview.14. That should work with a18 :)
     
  13. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    700
    Wait, URP gets a Deferred renderer?

    NOOOOOO... all the shaders just get more complicated now, I thought the main idea of URP was it being forward renderers all the way down.
     
  14. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    They want to replace built-in, and built-in has deferred, so...
     
  15. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
  16. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    700
    Ok. I thought built-in was split into HDRP and URP, but ok. I think they should make a Deferred variant of URP though.
     
  17. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    That was the original idea with LWRP and HDRP. But when Unity realized expecting their user base to write their own render pipelines was infeasible, LWRP became URP and its goals changed: it now has to do everything built-in did, plus do it faster, better and scaling all the way from low end mobile to next-gen consoles (this will take a while).

    HDRP's role in this scenario is uncertain, since the only features it will have over URP when it's all said and done are volumetric lighting and ray tracing.
     
    LooperVFX likes this.
  18. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    48
    There is no URP 14, they are both URP 10. I verified that those versions work together before replying to you, so it sounds like something is wrong in your setup. It looks like you have different versions of Core RP Library, Shader Graph, and Universal RP, which won't work. When using local packages, all the dependencies of the local package must also be manually set up as local packages. So in this case, you have to also setup com.unity.render-pipelines.core and com.unity.shadergraph as local packages from the same repository.

    URP deferred is on the way :)
     
    andywatts likes this.
  19. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    that's what I'm doing, what's the github url of a repo that works for you in a18?
     
  20. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    48
  21. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    HDRP will still have more features than URP out of the box.
    Just count all the different Material types and shaders: Ansitropy, Iridescence, Translucent, Subsurface Scattering, Clear Coat, Hair, Eye, Refraction, Distortion. There is nothing on URP roadmap that indicates these features will come to URP Lit.
    In addition, the new Realtime GI may only come for HDRP exclusive because on URP roadmap, Realtime GI is marked as "Under Consideration". Same thing for light proxy volumes.
     
    MP-ul likes this.
  22. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    Is funny how Unity 5 is still alive in urp =)) it never changed in 6 versions of unity5 and it will never change for alot more years to come from what i can tell.
     
  23. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    Yes each module has a different version when I add them from the same repo, and one of the repo I've tried is this one:
    I might be doing it wrong so here are the steps:
    in package manager click on the +/from disk then open the urp folder and double click on the .json file
    do the same thing on the core and the shader graph folders
     
  24. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    urp v10.0.0-preview 26 is in
    where is deferred pipeline asset?
     
    Opeth001 likes this.
  25. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    yea I'm a bit confused, I thought deferred was promised for 2020.2, has that been changed?
     
  26. Shaunyowns

    Shaunyowns

    Joined:
    Nov 4, 2019
    Posts:
    328
    I can ask the team to get a definitive answer for you @Anisoft, I hope this helps!
     
    charleshendry likes this.
  27. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    Yeah thanks that'd be great to find out.

    I've been modifying the standard pipeline for my own needs but I feel being able to use deferred in urp would help make some things a bit easier, especially with some custom lighting stuff that HDRP doesn't easily support (it has has a lot of features I dont exactly need)
     
  28. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    Hi @Shaunyowns ,

    any answer from your team on promised deferred rendering for 2020.2 ?

    thx
     
  29. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    I wouldn't rush them, pressure to perform's on the team.
     
    charleshendry likes this.
  30. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    anything new about the Deferred Renderer ??
     
  31. kaychang

    kaychang

    Unity Technologies

    Joined:
    Jan 11, 2017
    Posts:
    7
    It is currently in the SRP master branch, but the UI has been disabled because still undergoing more testing.
     
  32. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    So what exactly does this say about its release?
     
  33. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Any news about URP deferred?
     
    wx3labs and f1chris like this.
  34. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    No, better stick with old built-in graphics if you can!
     
  35. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
    I thought URP was getting volumetric light .. right ?
     
  36. Oxeren

    Oxeren

    Joined:
    Aug 14, 2013
    Posts:
    121
    It is marked as planned on the roadmap.
     
  37. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Somewhere between 2021 and the heat death of the universe.
     
  38. sinaari

    sinaari

    Joined:
    Jan 28, 2019
    Posts:
    47
    So what about deferred renderer? Is it coming anywhere soon?

    Why Unity team always has such problems in communicating? They literally almost never follow any discussion.
     
  39. leslviv

    leslviv

    Joined:
    Jun 22, 2019
    Posts:
    32
    Any updates here, or estimates? 8 lights is not enough :)

    It is in progress according to the URP Roadmap, as well as the point light shadows which already works in 2021 beta, but I do not know how to enable Deferred Renderer. There must be a way.
     
    Gekigengar likes this.
  40. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    There should be more options between a hard 8 lights limit and full blown deferred rendering.
     
    Gekigengar and leslviv like this.
  41. leslviv

    leslviv

    Joined:
    Jun 22, 2019
    Posts:
    32
    Right. I get down from 132 FPS (2 lights) to 128 FPS (8 lights) in my scene.
    I have plenty of space for more lights.
    The limit should be entirely up to us.
     
    PutridEx and Gekigengar like this.
  42. Oxeren

    Oxeren

    Joined:
    Aug 14, 2013
    Posts:
    121
    Keep in mind that 8 light limit is not per scene, but per object. If your objects are not too big and each is lit by 8 or less lights at any single moment than you can totally use more lights in your scene.
    Also, light limit in forward rendering is not some (totally) arbitrary number, each additional light adds instructions to lit shaders.
     
    leslviv, JesOb and NotaNaN like this.
  43. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    There are different ways to render lights in forward rendering which don't involve bloating the shaders. We could have at least the option to multipass (so 8 lights per pass), but there is also tiled forward lighting and clustered forward lighting, which can actually outperform deferred depending on the scene and target hardware. For something called "universal", it should have more options.
     
    Ruslank100, Gekigengar, MP-ul and 2 others like this.
  44. leslviv

    leslviv

    Joined:
    Jun 22, 2019
    Posts:
    32
    Sure, but that's including terrain as an object. It is a problem for me. 16 would probably be enough, but 8 is ridiculous.
     
  45. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    The per-object lighting is terrible for large objects like terrain because it doesn't matter if the lights are large or small: every visible pixel of the terrain will calculate all visible lights, regardless if said pixel is outside their radius because the entire system was designed to be friendly to GLES 2.0 mobile GPUs by avoiding more complex features like branching and SBOs.

    The problem is that devices which only support GLES 2.0 are often too slow to handle more than one per pixel light anyway, so you have a system that runs sub-optimally on every platform.
     
    april_4_short, Ruslank100 and MP-ul like this.
  46. leslviv

    leslviv

    Joined:
    Jun 22, 2019
    Posts:
    32
    Any updates please? I'm more than happy to use an unstable version.
     
    Foxaphantsum, JesOb and sinaari like this.
  47. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    8 light per object? Are we back to the PS2 era?
     
    MilenaRocha and leslviv like this.
  48. Bosozuki

    Bosozuki

    Joined:
    Dec 19, 2013
    Posts:
    63
    Unreal engine light limit Unreal engine has a hard limit of 4...

    I hope with the new URP deferred renderer and the new urp debuger there will be an option to detected overlapping lights. We go through a lot of effort to make sure we have no more than two real time non moving lights (directional and some other light - generally spot light ) and one real time moving lights affect any given object in the scene at a time.

    Aside from that the urp forward render combined with point light shadows is actually pretty fast. It will be interesting to compare performance between the forward and deferred.
     
    NotaNaN and JesOb like this.
  49. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    That's for stationary lights, which are the Unreal equivalent of Unity's mixed mode lights (shadows are baked, but the light itself isn't). And that's not per object, it's per pixel, so you can have hundreds affecting the same object as long as no more than four overlap at once. Finally, excess lights revert to dynamic shadows, they don't just stop rendering altogether like on URP.

    The URP lights behave more like old fixed function OpenGL lights.
     
  50. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    Still no word on this?
     
    MilenaRocha likes this.