Search Unity

  1. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Will 2D Render Pipeline support Renderer Features?

Discussion in '2D Experimental Preview' started by CDF, Sep 19, 2019.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    885
    Hey, just wondering if the experimental 2D pipeline will ever support renderer features?
    I'm switching my 3d project over to the 2d renderer and noticed I can no longer add features to the renderer :(
     
    rboerdijk likes this.
  2. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    303
    Eventually yes. But that's not our current focus.
     
  3. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    33
    +1 for adding support and getting the forward and 2d renderer on-par.
     
    Masea1 and yuanxing_cai like this.
  4. Geoffl

    Geoffl

    Joined:
    Nov 22, 2012
    Posts:
    2
    Is there any ETA on this? This is stopping my team from using a few asset store purchases among other things. Knowing if it will be released in the next few months would let us make an informed decision on whether to let it go, use a different renderer, etc.
     
    rboerdijk and MrPaparoz like this.
  5. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    303
    We don't have a plan to implement Renderer Features for the 2D Renderer in the near future.
     
  6. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    33
    Thank you for your reply, If I may ask, is this because there is nobody available to implement it (any rough idea when someone will? 6months, 1 year? 2 years?), or because there is a technical reason why it would be a bad idea?
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,727
    I suggest using the regular URP pipeline - it's perfectly fine for 2D still... or elaborating why you're interested in renderer features for 2D for potential workaround so advice can be given.

    The renderer features thing is more valuable for complex shaders. If it's 2D it will generally mean you can throw some unlit shaders out there and do the same thing.
     
  8. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    33
    I wanted to use the 2D Pipeline, because Unity showcased that it's possible to make a cool 2D project and it has a few nice features, like 2D lights. So I started using it, expecting development on it to continue, but there are multiple threads where the reaction is "not planning to support it anytime soon" which feels weird. Why showcase all this really nice tech aimed specifically at 2D, and then "abandon" (probably a bit unfair comment) it with replies "not planning support for feature x anytime soon" and "URP is fine - use that" ?

    Specifically in this case, I have an assetpackage rendering water, which requires renderer features to make it work (specifically a renderer-feature that makes sure the water gets rendered in the correct order and can "clip out" an earlier rendered sprite so the water doesn't overwrite it).
    The situation is simular to Geoffl who wants to purchase assets requiring support for it.

    Now my assumption is that the 2D renderer is what Unity intends us to use mid- to long-term for 2D projects. While I understand your advice that there are other options like URP, built-in, or even another engine (Unreal, Godit, ..) my question is about the 2D renderer and while I understand it's experimental (fine) I think it'd be fair to give a rough timeframe where this is going, specifically with official support for missing features like camera stacking and renderer-features.
     
    Last edited: May 3, 2020
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,727
    2D pipeline features would be no slower in URP in my opinion. I think most if not all the features would also work in URP however that's only my personal opinion. A 2D pipeline is unlikely to ever be that compatible with asset store assets unless the author says it is.

    Are you using assets that are designed for 2D pipeline, or could you link the asset you're trying to get to work?


    Anything using surface shaders probably won't work on SRP at all unless specifically stated on the asset. Anything using vert/frag shaders may work with small modifications.
     
  10. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    33
    I'd be fine using 2D lights (+global light) in URP... so when is support for that planned? ;)
    I contacted the Author of the specific asset, and he plans to add a fallback for 2D.

    So, let's try and take a small step towards getting these things supported:

    camerastacking in the 2D renderer:
    \runtime\ScriptableRenderer.cs -> public bool cameraStacking { get; set; } = true; // change false to true

    renderer-features in the 2D renderer:

    \runtime\2D\Renderer2D.cs, function Setup at the end, just before the if-finalblit:
    for (int i = 0; i < rendererFeatures.Count; ++i)
    {
    rendererFeatures.AddRenderPasses(this, ref renderingData);
    }

    \runtime\editor\2d\Renderer2DDataEditor.cs
    using UnityEditor.Rendering.Universal; // at the top
    internal class Renderer2DDataEditor : ScriptableRendererDataEditor // was: Editor
    function OnInspectorGUI add this as the very last thing:
    base.OnInspectorGUI(); // Draw the base UI, contains ScriptableRenderFeatures list


    So with those changes we can add renderer features to the 2D-pipeline and stack camera's in the 2d renderer.

    Additional feedback:
    - The water-package requiring renderer-features now works.
    - Camerastacking (to get a nicely blurred bokeh-background using a camerastack) works.

    What doesn't work:
    - Enabling HDR and stacked post-processing (personally not using it)
    - Sprite masking is broken when using post-processing (artifacts), in both 2D water-packages I tried.
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,727
    So basically the problem is with external assets from asset store? Did the authors say these were designed for any SRP at all? Find that out first or it won't work in URP either.

    If you want assets from the store to work you could ask the asset authors to update their assets.
     
  12. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    33
    ... which I did (as you can read in my earlier post). Both of them work fine in URP, and mostly (but not entirely) in the 2D renderer with the above manual changes.

    ... and in addition I asked the question here when those features are going to be officially supported by Unity (if at all) which would help more people then just me - furthermore making a reasonable effort helping to get support in for these features (see my previous post), also so I can help providing repro-cases for bugs in the future.

    This discussion is being sidetracked by pointing to "Use URP instead" and "Talk to the Authors" and "Check compatibility of the assets" and "you should have checked before you purchased" - which are all besides the point. I'm not blaming anyone or anything.
    My question is simply how serious Unity takes the 2D renderer, seeing the "not planned soon" comments all over the place, in the context of the seemingly minor effort needed to get it (mostly) working with minimal effort in a very generic way. And thus it circles back to the original question "Is there a reason why technically this is a bad idea" and "if not, when is this in the schedule: 6 months, 1 year, 2 years?"
     
    Last edited: May 3, 2020
  13. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    303
    @rboerdijk I hear your concern loud and clear.

    First, to answer your question about how serious Unity is about the 2D Renderer - We have two engineers from the 2D Team working exclusively on the 2D Renderer, supported by other engineering teams from within Unity (e.g. the URP Team and the Mobile Graphics Team). We have also people from Marketing busy making more demos using the 2D Renderer. So, we are seriously serious about the 2D Renderer.

    The reason why some of the nice features you mentioned here have taken a back seat at the moment is we need to first get performance right. Right now the 2D lighting system is not as fast as we want it to be, especially on mobile GPUs. So both @Chris_Chu and myself are focusing on improving the efficiency of the 2D Renderer.

    That said, we did realize there're these 'low-hanging fruits' eagerly sought after by a lot of you. So last month we took a small break from performance and implemented camera stacking for the 2D Renderer (although not hard, it's no one-liner either). Expect it to be available in the next versions of URP (7.4 and 8.2). So that's one item crossed from the low-hanging fruit checklist. Renderer Features is now on top of that list.
     
    Last edited: May 12, 2020
    GliderGuy, Lo-renzo, BTStone and 4 others like this.
  14. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    33
    Thank you, I really appreciate you taking the time to explain, especially clarifying that the "performance improvements" are specifically aimed at the 2d renderer. It's understandable that tasks need to be prioritized, but the key for me (and I guess others) is to know it will be addressed, as opposed to it being on the "never going to happen because ... " list (possibly for good reasons).
    Anyway, there's more then enough other things for me to focus in the meanwhile, so it's perfectly fine to "semi-ignore" some the missing features for now. Looking very much forward to official 2d-stacking support. That will already help a lot, also knowing we can soon post decent bugreports for stacking instead of "I modified the official code like x and now run into issue y" kind of reports.
     
    rustum, Masea1 and yuanxing_cai like this.
  15. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    33
    Noticed the 7.4.1 update and applied it. Stacking is there, and it also works correctly with postprocessing - nice!
    Thanks Cai and whoever else implemented this!
     
    yuanxing_cai likes this.
  16. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    303
    Let me know if you encounter any issue using it.
     
    Last edited: Jun 8, 2020
  17. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    51
    Hey guys, I'm having a bit of confusion with versioning for URP. I'd like to update to 7.4.1 and check out the camera stacking.

    I can't figure out how to update to 7.4.1. Here are screenshots of my Package Manager:





    I don't see any option to update to 7.4.1. Am I missing something? I'm running Unity version 2019.3.7f1. The documentation says 7.4.x requires minimum 2019.3.2f1.
     
    Last edited: Jun 16, 2020
unityunity