Search Unity

Official Deprecating Legacy 3.x/4.x Rendering

Discussion in 'General Graphics' started by quixotic, Feb 4, 2019.

  1. quixotic

    quixotic

    Administrator

    Joined:
    Nov 7, 2013
    Posts:
    122
    A couple years ago with the release of Unity 5.0, we marked the Vertex Lit and previous Deferred as Legacy. During the 2019 cycle we would like to remove both of these from the engine. Meaning, if you are using either of these you would need to stay on 2018 LTS (which will be supported for the next 2 years) or a previous version of Unity.

    A lot of effort has gone into improving the built-in render pipelines, and additionally with 2018.1 we introduced Scriptable Render Pipelines making rendering in Unity even more extendable.

    At this point we believe there is no compelling reason for a user to be on a 2019 version of Unity and still using the legacy rendering paths. If you're currently using the Legacy Deferred or Legacy Vertex Lit and cannot upgrade to another rendering path because of technical limitations, please reply to this thread and let us know what's blocking you.
     
    AcidArrow and hippocoder like this.
  2. BakeMyCake

    BakeMyCake

    Joined:
    May 8, 2017
    Posts:
    175
    What would be the suggested best performing replacement for vertex lit? Forward with shadows turned off?
     
  3. quixotic

    quixotic

    Administrator

    Joined:
    Nov 7, 2013
    Posts:
    122

    Forward with shadows off is a good option.

    You might also check out our lightweight render pipeline (which is out of preview with 2019.1), where quality of lights are configured in the asset. The main light (sun or brightest directional) will always be per-pixel but additional lights can be chosen to 1) not render, 2) per-pixel 3) per-vertex
     
    phil_lira, protopop and hippocoder like this.
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Vertex Lit basically always had the hit of the first forward pass anyway so you should see virtually no difference by going with forward + vertex lit shaders (which is what Unity generated for you anyway).

    (@quixotic - thumbs up from me - I don't see a compelling reason to keep legacy stuff around when it is also still accessible with older versions and of no real use for new versions).

    To facilitate the change though, I recommend posting viable alternatives clearly in this thread to alleviate fears as it's pretty easy for a mob to form if nuances like that are skipped.
     
  5. quixotic

    quixotic

    Administrator

    Joined:
    Nov 7, 2013
    Posts:
    122
    @hippocoder This guide while a bit behind (HDRP has VR support with 2019.1) is a good starting point for choosing a render pipeline, in helpful flowchart form (in the choosing a render pipeline section)!

    (Broadly saying: "if you used x you should use y" is hard because it is so project dependent. I've only heard of two studios that were recently using legacy deferred and neither need to upgrade those projects, one is doing HDRP for their new project, and the other is writing a custom SRP.)
     
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks :) looks like it's time to nuke it - I doubt the legacy light-only deferred path is worth a damn, in fact I'm surprised it doesn't just break even perf wise or even has worse performance. I actually thought Aras removed this and vert AGES ago - about 2 years ago?

    (I'm already on HDRP and have no plans to move, just adding value for new readers if I can).
     
    quixotic likes this.
  7. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Isn’t this the same behaviour in built in pipeline for lights? We can set lights as per pixel (important), per vertex (not important) or off, and the main light is per pixel . What’s the benefit of using lwp here?

    Also, is the built in render pipeline in danger of disappearing? I’m thinking ahead to see if I will someday have to rewrite all my assets or hope my bought assets are rewritten to be compatible with custom render pipelines if these replace a single built in pipeline.
     
    SomeGuy22 likes this.
  8. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    It took quite some time to deprecate legacy. I think built-in will probably stay until 2030.1 no less.

    Or not. Well it's definately a long time stay, until those SRP's are in experimental / not bug free. Which may take a lot of time to polish. Not to mention a ton of assets that aren't compatible to them.


    As for the actual topic, I've used a deferred legacy previously until I've fixed issue with terrain shader.

    https://forum.unity.com/threads/sol...ferred-rendering-path-default-terrain.513867/

    But after tweaking shader source a bit, I've transitioned to the actual deferred built-in.
    It never came to the bug report stage (cause I'm lazy), it might be worth looking into though.
     
  9. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    The light importance in lwrp only controls how we prioritize/sort them. In the asset you choose the amount of additional lights to render and if they should be per-pixel or per-vertex. They are all shaded with a single render pass meaning less drawcall and less overdraw.

    While in built-in you choose the amount of per-pixel lights only. If you have enabled lights in the scene, up to 4 can be shaded per-vertex and there's no way to force disable this unless you disable the lights in the scene. The main light + vertex lights are shaded in one pass and each other light is shaded by rendering the objects again and adding light contribution to final image.
     
    protopop likes this.
  10. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    I'm talking about forward rendering as this currently the only one lwrp supports. We will add a deferred rendered later this year.
     
    protopop likes this.
  11. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    what is the reason to choose between the built-in forward and LWRP? I thought LWRP was the future.
     
  12. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Cool. Will you add deferred to the LWRP? Or will it be a new Deferred SRP?
     
  13. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Ive read that in some cases LWRP is slower than the built in pipeline on mobile - googling LWRP performance should bring up a few threads - and there are some things missing like support for ambient light in the TerrainLit shader. For me i'm happy to stay on built in because of its wide compatibility and battle-tested-ness, but i cant use shadergraph or things that are not compatible with the built in pipeline - although there are similar assets like Amplify Shader Editor that work with built in so that mitigates it. But i am using deferred so maybe LWRP is faster when it compares to vertex-lit built in?
     
  14. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    My question is more about, should we invest on the LWRP assuming that the built in forward will be deprecated or should we just choose between the two? SRP batcher is a strong argument to stay with LWRP tho.
     
  15. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    These kind of features should have been deprecated long ago.
     
  16. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    We have been using [Legacy] Deferred Lighting in a custom lighting pipeline for 'average' standalone systems (from b4 PBR) - it enabled replacing the prepass lighting shader with a wrap-lighting version and we needed deferred for AO/post-process/multiple-lights and could not use baked lighting. Customised standard forward path is close (used on mobile) but limited on light/post-process options. (No PBR materials as optimised for speed from before PBR came in and no reflection probes

    I am guessing in future the Scriptable Render Pipeline will allow the same for us.
    Wrap lighting has been a useful hack to achieve better forward and deferred lighting with limited light sources (1 main light) and no baked lights (as scenes built at runtime) but Unity has nothing built in - a PBR material with
     
    Last edited: Jul 17, 2019
  17. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Why do major changes or drop features during a 20xx cycle.
    It's like with the major prefab [nested] change in 2018 which suddenly causes lots of assets to have issues or become legacy until support added.

    Could you not drop or change major features at the beginning of a new year's cycle whenever possible?
     
  18. quixotic

    quixotic

    Administrator

    Joined:
    Nov 7, 2013
    Posts:
    122
    Our original goal was to remove this with 2019.2. Our general goal in graphics is to remove during .1 or .2 but other considerations can push us around. For this, we missed the cutoff date for then and 19.3 - it's lower priority for us to remove this then some of the other work we've been focused on. It will likely be removed for 2020.1. For this feature all data we have points to this being used by less than a percent of our users.
     
    richardkettlewell likes this.
  19. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    867
    Please remove having 4 render paths is too much.
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    do not remove anything you do not know how people may use it. e.g. lit particles in legacy refer to vertex lit. unity's vertex lighting is a pretty powerful feature.

    stop doing bullshit!
     
    Last edited: Aug 7, 2019
  21. andrea_i

    andrea_i

    Joined:
    Nov 18, 2012
    Posts:
    32
    @quixotic a kind reminder that the new render pipelines do not offer a simplified shader writing api and shader graph does not support drawIndirect yet.
    I know these features are down the road but I'm surprised you guys got to talk deprecation when the new pipelines are still not up to speed on custom shaders. Many of us relying on compute shaders to generate custom per-vertex data are really struggling to keep up right now : /
     
  22. quixotic

    quixotic

    Administrator

    Joined:
    Nov 7, 2013
    Posts:
    122
    We are not talking about removing the built-in render pipeline. We're only talking deprecation for the legacy vertex lit and legacy deferred paths which have been marked as legacy for several years. Currently there are 5 pipelines in Unity these 2 legacy, the build-in (which has forward and deferred so 2 systems but we treat it as one), HDRP, and URP. We're talking about going from 5 to 3.

    We're not talking about the built-in render pipeline which is currently used by the majority of projects. We are moving in the direction of SRPs becoming default and built-in someday going away - however, it will be a data driven decision based on adoption and reaching feature parity. It won't be a move we make lightly.
     
    Last edited: Mar 17, 2020