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. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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:
    1,321
    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 :(
     
    MikProduktions and rboerdijk like this.
  2. yuanxing_cai

    yuanxing_cai

    Unity Technologies

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

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    96
    +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:
    6
    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:
    335
    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:
    96
    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

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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:
    96
    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

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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:
    96
    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

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    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:
    96
    ... 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
    elZach likes this.
  13. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    @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
  14. rboerdijk

    rboerdijk

    Joined:
    Aug 4, 2018
    Posts:
    96
    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:
    96
    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:
    335
    Let me know if you encounter any issue using it.
     
    Last edited: Jun 8, 2020
  17. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    206
    Edit: Old post, but I believe the issue with this was that Package Manager now has an advanced section where you have to check a box to "Enable Preview Packages".

    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: Dec 20, 2020
  18. gavriktonio

    gavriktonio

    Joined:
    Nov 24, 2015
    Posts:
    2
    Hi, @yuanxing_cai , any news on when can Render Features in the 2D Renderer will be available? Essentially, I want to render certain objects in the scene pixelated. I have an old complicated setup at the moment with a separate render texture and some custom shaders, but passing on the depth texture in such a way seems impossible, and there are other limitations that I encountered.

    I was looking into replacing the system, when I found Custom Rendering Features. That's exactly the tool I was looking for! But it's not in the 2d renderer :(

    I have tried using camera stacking with a combination of a 2D Renderer, and a separate normal forward renderer to at least get it going without the pixelized objects getting lit yet, but the _cameraOpaqueTexture seems to get lost between the two. So there's really no way to get around it without having render features for now

    Edit: For now I've set up a separate camera rendering to a quad, that then gets lit, though needless to say it's not the best way to do it, and I can still only have all those objects on a single quad
     
    Last edited: Nov 7, 2020
    MrPaparoz, Stab and rboerdijk like this.
  19. DonFaddoul

    DonFaddoul

    Joined:
    Feb 2, 2020
    Posts:
    6
    Great, really looking forward to the Render Features in 2D! Any idea when we can expect it? Thanks :)
     
  20. mahu

    mahu

    Joined:
    Apr 6, 2014
    Posts:
    8
    Also looking forward to this
     
  21. joan_stark

    joan_stark

    Joined:
    Jul 24, 2018
    Posts:
    55
    I'm also looking forward to this :I
     
  22. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    190
    Hi all! Thanks for your continued interest in seeing Renderer Features working with the 2D Renderer.
    It's been especially useful to hear the outcomes that you are hoping to achieve. Thank you @gavriktonio @rboerdijk!

    Please share more concrete examples with us. It is super useful in helping us support these outcomes in the best possible way.

    What are you planning to make with Renderer Features @DonFaddoul, @mahu and @joan_stark?

    Looking forward to hearing the details! :)
     
    NotaNaN likes this.
  23. joan_stark

    joan_stark

    Joined:
    Jul 24, 2018
    Posts:
    55
    Trying to make fog of war. It already works with forward renderer and renderer features.
    But I can't use it in 2d renderer.
     
  24. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    190
    Hi @joan_stark. It would be great if you could share more details about the expected behaviour of the fog of war along with any visual references of the visual outcomes.
     
  25. kameleon79

    kameleon79

    Joined:
    Apr 10, 2018
    Posts:
    3
    Im also looking for renderer Features beeing implemented for the 2d renderer.
    I need to reproduce this (see attached image)
    To render a Layer as a mask for another Layer.

    Is there any other way to do it without the renderer feature.
    Or is the Renderer feature is going to be available soon for 2d renderer ?
    Thanks
     

    Attached Files:

  26. kameleon79

    kameleon79

    Joined:
    Apr 10, 2018
    Posts:
    3
    While it's officially implemented, I did follow this workaround and it worked!!! : https://github.com/InitialPrefabs/UGUIDots/issues/44
     
  27. kameleon79

    kameleon79

    Joined:
    Apr 10, 2018
    Posts:
    3
    @rustum
    With the Renderer Feature workaround working,
    I'm still missing the Layer Filtering in order to apply correctly the Renderer Feature.
     

    Attached Files:

  28. Kandy_Man

    Kandy_Man

    Joined:
    Mar 8, 2014
    Posts:
    67
    I'm making a 2D turn based RPG and currently to do screen transitions I am using a really horrible method of stretching a sprite in front of the camera that is transparent most of the time, then using a shader graph to do the transition using a noise texture. It'd be great to apply this shader instead directly to the camera rather than a sprite. It's my assumption a Renderer Feature would be the best way of doing this(?) but obviously can't in the 2D renderer, so any ETA on this would be much appreciated.
     
  29. Tony_Max

    Tony_Max

    Joined:
    Feb 7, 2017
    Posts:
    355
    In my 2D game i have walls and characters. I want my characters render with some other texture when they ocluded by wall as in this article. Author sas that there is a way to do it without renderer feature by using sprite masks or somehow write to stencil buffer directly from shader. I would very happy to read any advices.
     
  30. Hugo-Bille

    Hugo-Bille

    Joined:
    Jul 6, 2012
    Posts:
    6
    I'm also interested in Renderer Features for the 2D pipeline. Working on converting an existing project from Standard RP to URP. I need the 2D URP because I have some visual effects that require the new Camera Sorting Layer Texture feature (to scramble the background but not the foreground), but I also need to retain my custom post-processing effects and those now require rendering features to work since PPv2 is no longer supported. There are workarounds like splitting the scenes into a foreground layer and a background layer and rendering them separately (in regular URP), but that's really complicated for a project that already has hundreds of scenes (and a mounting shortage of layers).

    Looking forward to trying the workaround in kameleon79's link!
     
    Last edited: Mar 29, 2021
  31. Idanro

    Idanro

    Joined:
    Oct 2, 2018
    Posts:
    1
    I was looking to implementing a custom 1-bit render pass using the 2D pipeline and found this old post. It's a shame this is still impossible. Looking forward to it!
     
  32. xiao-xxl

    xiao-xxl

    Joined:
    Nov 16, 2018
    Posts:
    48
    Is there any progress ?
     
  33. Omar_Sadek

    Omar_Sadek

    Joined:
    Nov 23, 2018
    Posts:
    3
    Still waiting
     
  34. msfredb7

    msfredb7

    Joined:
    Nov 1, 2012
    Posts:
    173
    Please refrain from these types of comments. It's not like the engineers will work twice as fast knowing you are waiting.
     
    MousePods, Ted_Wikman and rustum like this.
  35. zfh2773

    zfh2773

    Joined:
    Nov 16, 2019
    Posts:
    27
    I will use the full screen shader to make transitions and special effects for 2D games. Can I do it without 2D Renderer Features?
     
  36. zfh2773

    zfh2773

    Joined:
    Nov 16, 2019
    Posts:
    27
    I will use the full screen shader to make transitions and special effects for 2D games. Can I do it without 2D Renderer Features?
    Similar to this.
    https://assetstore.unity.com/packag...ers-2d-layered-post-processing-shaders-195806
     
  37. zfh2773

    zfh2773

    Joined:
    Nov 16, 2019
    Posts:
    27
    Sorry, I found that Unity 2021.2 beta has a 2D renderer function.
     
  38. MikProduktions

    MikProduktions

    Joined:
    Jun 18, 2021
    Posts:
    1
    I have a 2D Platformer with the 2D URP render Pipeline, and i bought some glitch effect assets and I would like to apply them to my cam but can’t.
    The developer said that it doesn’t work cuz the 2D Renderpipeline doesn’t have render features.
    And he said if it got render features it would work.
     
  39. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,520
  40. Dark_Seth

    Dark_Seth

    Joined:
    May 28, 2014
    Posts:
    140
    Wonder IF that is possible to do per Layer Mask. Currently is it just a full screen blur. Would love to be able to just put an Item on a layer and blur that
     
  41. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,520
    You could accomplish that with a second camera which targets a layer and has a camera-specific blur renderer feature. Then you can output that camera via a RenderTexture to some full-screen quad.
     
  42. Dark_Seth

    Dark_Seth

    Joined:
    May 28, 2014
    Posts:
    140
    That doesn't seem efficient. Forward Renderer you can do per object that is on a layer. Seems 2D Render Feature lacks that.