Search Unity

Current 2D Renderer's missing core features

Discussion in '2D Experimental Preview' started by castor76, Dec 17, 2020.

  1. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    I am going to nag once more here, because it has been so long and nothing from the list below has been addressed even with 2020.2f1 release.

    1. Emissive Channel - This is MUST have for any 2D or 3D rendering pipeline. I am not sure why this was not implemented the first time, because no rendering pipeline is practically usable without one.

    2. Opaque Texture ( GrabPass ) [ Done, _CameraSortingTexture ]

    3. Soft Shadow

    4. Renderer Features, is an another must have feature. [Maybe on URP 12]

    5. Updatable ShadowCaster2D runtime sprite silhouette and ShadowCaster2D Falloff Distance.

    6. Tilemap ShadowCaster2D support.

    7. Directional Light support. [Maybe on URP 12]

    8. Ability to write directly to the buffers, such as Normal, Light.

    Now, I know that the 2D renderer team is working on the "optimization" but we have no idea how far that has come to and when we will be able to get our hands on that and move on to the critically missing features?

    Share the roadmap, dates, anything! Please!
     
    Last edited: Jul 19, 2021
  2. MrPaparoz

    MrPaparoz

    Joined:
    Apr 14, 2018
    Posts:
    155
    EDIT: OP updated post with my entry.
     
    Last edited: Dec 17, 2020
    castor76 likes this.
  3. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Updated !
     
  4. Encon21

    Encon21

    Joined:
    Nov 27, 2018
    Posts:
    3
    Just adding my support here. Falloff distance in particular is absolutely necessary for every use case I can think of; without it there doesn't seem to be any viable way to use dynamic lighting in an open world top-down game. Soft shadows and tilemap shadow casters would definitely be appreciated as well.

    As it is right now we have no way to actually test the aesthetic we're going for with our game. It'd be nice to be able to periodically check our assets (which are all currently being drawn) with the dynamic lighting & shadows that we're planning to use and make sure it all looks exactly the way we want it to, but right now we just have to guess and hope everything comes together properly when these features eventually make their way in.
     
    GliderGuy and MrPaparoz like this.
  5. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    I dont mind a bit of waiting, if it is necessary. But waiting without knowing what is to come is dreadful.
     
  6. Kandy_Man

    Kandy_Man

    Joined:
    Mar 8, 2014
    Posts:
    49
    Also throwing my support in for this feature. It’s the last thing I need from the 2D renderer. Even just an eta would be very welcome
     
  7. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    When you have no idea when/or what is going to happen to the critical core feature that you are betting your life on, it is very fearful feeling.

    The thing is, ok so it is partially my fault to gone with the experimental feature, but when 2Drenderer came out, (when was it... I even forgot it now,... May 2016 ???), it "looked" promising and the update seemed like it will be followed swiftly.

    But instead, I think years has passed and we still have no idea when/what... if any? Why is there no detailed roadmap, dates etc shared to the community?
     
    Last edited: Dec 19, 2020
    GliderGuy likes this.
  8. AzureMasters

    AzureMasters

    Joined:
    Dec 2, 2016
    Posts:
    3
    I've been checking for updates on this subject daily since there's no better way to know about. I love 2D Renderer, it's probably my favorite feature on unity and currently the main reason for me to use it, but I just wish they'd share some detailed info about what they're focusing on, there's so many features missing right now
     
    GliderGuy likes this.
  9. GliderGuy

    GliderGuy

    Joined:
    Dec 14, 2018
    Posts:
    197
    I also support a roadmap. :p
    (but I feel like I shouldn't have to. Roadmaps are kinda common courtesy these days... Why we still do not have one is beyond me).
     
  10. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    829
    I'd like VFX Graph support for 2D renderer. That said, the focus on optimization / solidifying current features for 2D generally seems appropriate to me since it's only been the past handful of releases that fixes important to me (batching / culling) have been implemented. Exposing more for the scripting API (get/set secondary textures, lower-level tilemap API) are more current issues for me b/c I've already gone with baked shadows and carefully tuned pseudo emission. A public roadmap for 2D features sounds like a great idea.
     
    pahe, MrPaparoz and GliderGuy like this.
  11. ThundThund

    ThundThund

    Joined:
    Feb 7, 2017
    Posts:
    240
    My 2 cents:

    1-Ability to choose which ShadowCasters are affected by which lights (https://forum.unity.com/threads/abi...re-affected-by-which-lights-by-layer.1029523/)
    2-Blend mode in Sprite-Lit shaders in ShaderGraph (https://forum.unity.com/threads/blend-mode-in-sprite-lit-shaders-in-shadergraph.1028935/)
    3-Read lights texture in ShaderGraph (https://forum.unity.com/threads/read-lights-texture-in-shadergraph.1028149/)
    4-Target Sorting Layers as an asset (https://forum.unity.com/threads/2d-lights-proposal-target-sorting-layers-as-an-asset.1024630/)
    5-Custom postprocesing
    6-Sprite masks that use alpha gradients instead of just cut-off

    My total support for the Emissive colors, I would put that as the first and main priority.
    Regarding tilemap shadow casters, I shared my solution for now: https://forum.unity.com/threads/script-for-generating-shadowcaster2ds-for-tilemaps.906767/
     
    GliderGuy and MrPaparoz like this.
  12. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    I agree.

    Emissive channel is pretty basic and fundamental feature that should have been implemented even before the shadow... Beats me why that was not implemented tilll now.. I was pretty shocked to find out.
     
    EvOne likes this.
  13. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    501
    Well, there is the product board. Why this isn't more prominent is what I don't understand.

    https://portal.productboard.com/unity/1-unity-graphics/tabs/9-visual-effect-graph

    You can vote there how important a feature is. Not sure though if that has any impact on the priority though ;)
     
  14. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Well.. there still seems to be nothing about 2d renderer...
     
  15. GliderGuy

    GliderGuy

    Joined:
    Dec 14, 2018
    Posts:
    197
    Yep! But we don't have one for 2D URP. :(

    It feels like Unity doesn't want us knowing about the Product Boards... Maybe because it makes them feel responsible when the most critical / asked-for features take a year to implement? (I'm looking at you, point-light shadows). :rolleyes:
     
    pahe likes this.
  16. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    501
    Well, it's a bit hidden. So for example, for us the VFX Graph needs to be supported, so when you tab to VFX Graph, you can see an entry there:

    2021-01-07 17_15_05-Visual Effect Graph - Unity Graphics _ Product Roadmap – Mozilla Firefox.png

    But, yes, it would be *very useful* to have a separate tab for the 2D Renderer @officials!
     
    GliderGuy likes this.
  17. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Recent Unity blog says that 2drenderer wants to be default mode for 2d work flow.. it is a pretty predominant statement. But it lacks all the exposure, roadmaps, plans shared to the public. Even the recent blog post and all the videos about 2drenderer at Unite sessions are about old stuff, it does not mention anything on what is coming, when they will land, what are they working on exactly. It is not enough to just say, we are working on 2drenderer ... then one day just boom.. here. Devs needs to be able to plan around core features.. it is not like 2drenderer has been just released.. it has been years.. years!
     
  18. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    501
    Agree! It's pretty annoying and frustrating to even not know what features are actually supported before you start. If we had known that the 2D Renderer doesn't support VFX Graph (and GPU particles with it), then we would have implemented our own 2D lighting, which seems also to be stuck in development (maybe it isn't but how should we know?).

    Would love to hear official comments on this. Maybe @rustum or @Chris_Chu ?
     
    GliderGuy and castor76 like this.
  19. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Indeed, that was the one of other thing that I didn't know and caught me off guard.
     
  20. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    I'm going to try to answer some of these. Any questions I ask anyone/everyone who wants to answer can.

    1. I totally agree. This is something we wanted to do, but just has not made it yet.

    2. The opaque texture behavior normally captures the frame buffer after the opaque objects have been rendered. Because Sprites are transparent, I have added something called _CameraSortingLayerTexture for URP 11. It allows the user to capture the rendering of the back most layer to a specified layer into a render texture.

    3. What is your expectation on this, do you just want softness on the edges (like PCF) or are you thinking accurate soft shadows? Also what sort of device are you expecting soft shadows to run on?

    4. What are some specific examples you would like do with renderer features that you can't currently do?

    5. What will you use falloff distance for. Do you have some screenshots for a game uses falloff distance similarly?

    6. This has been a big issue. Hopefully, we can have something in for URP 12 for this.

    We are experimental and still missing some feature compatibility with some systems. For VFX graph specifically, the 2D team has done some of the work needed for compatibility, and the VFX graph team is working on the remaining changes.

    I know everyone wants more transparency into what is happening, but I can't give out a roadmap at the moment. I can say, as I have before, that we are working toward becoming the standard renderer for 2D. I know that seems to mean to some people that we need more features, but it actually means we need to make sure that we better support existing features and packages, have good stability, and performance.

    Also if there was a way to work around some of these issues yourself, by using shadergraph, or renderer features, etc, would this be an acceptable temporary solution.
     
    florianhanke, pahe, JoNax97 and 2 others like this.
  21. MrPaparoz

    MrPaparoz

    Joined:
    Apr 14, 2018
    Posts:
    155
    Thanks for your time first of all.

    3- What I work on is a true top-down game with randomized Day-Night times when scene is loaded. I'd like to simulate shadows somewhat feasible to some extent. This also goes for question 5. I'm targeting PC and Mac, don't care about mobile tbh.

    4- Because of the perspective (Top-Down) some objects like Characters will go under some other objects. I'd like to render them directly with Renderer Features. I'm not so deep into project right now, so I'm not sure possible must-have features on rendering yet.

    You're probably aware of this, but still here is a somewhat relatable graphics: https://www.gamasutra.com/blogs/Svy..._Keeper_How_the_graphics_effects_are_made.php
     
    Chris_Chu and GliderGuy like this.
  22. elZach

    elZach

    Joined:
    Apr 23, 2017
    Posts:
    41
    @Chris_Chu has there been any consideration to expose a setter function for the shapePath of Freeform lights?
     
  23. Encon21

    Encon21

    Joined:
    Nov 27, 2018
    Posts:
    3
    For my own use case I'd just be looking for soft edges; fully accurate shadows wouldn't be necessary. I'm developing exclusively for PC at the moment, and wouldn't expect dynamic shadows to have the same level of support/performance on mobile devices if I ended up working on mobile games in the future.


    Similar to MrPaparoz I'm working on a top-down game; specifically an open world RPG with slightly higher resolution sprites, so I'd also be looking at implementing a day/night cycle where having ambient/sun shadows would go a long way in bringing the game's aesthetic together.

    More importantly though, having a player walking with a torch and a nearby pot casting an infinite shadow would look pretty absurd. Having only tall objects like trees cast shadows while smaller objects like the pot cast nothing at all would just make the game feel disjointed instead. That leaves the alternative of not using dynamic shadows at all, instead just drawing shaped shadows into the sprites and leaving it at that. Of course, the aesthetic/immersion of the game takes a huge hit by doing this; dark areas that require the player to use a torch are no longer possible, for example. Either the torch doesn't cast shadows, resulting in most of the hand-drawn shadows facing the wrong direction, or the game just doesn't have shadows at all to avoid that issue, making the world feel too flat and lifeless.

    Ultimately what I'd love to see is a way to influence the falloff distance with both the shadow caster and the light source. A torch held by the player would cast a longer shadow than the sun or a lightpost, for example. One way to do this would be with height inputs - if the light source has a lower height than the object, the shadow is infinite, otherwise the falloff distance decreases depending on how much higher the light source is. A potentially simpler option would be having a modifier for falloff distance on the light source; for example if the shadow caster has a falloff distance of 10 units and the light has a modifier of 0.5, it casts a 5 unit shadow.

    With that being said, as much as I would love to see one of those two implementations (or something similarly flexible), even just having falloff distance on the shadow caster would be enough to start with. Without that, the current 2D lighting system is essentially unusable for open world top-down games that need dynamic lighting/shadows.


    Thank you for taking the time to respond to these concerns, by the way!
     
    oakus, GliderGuy and MrPaparoz like this.
  24. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    @Chris_Chu , cna you elaborate a bit more on urp11 opaque texture? Is this already in 2021 beta? How do we go about properly setting it up and use it?
     
    pahe and GliderGuy like this.
  25. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    I don't think its available yet. But it is setup in the 2D Renderer Data.

    upload_2021-1-13_13-55-35.png


    You select a layer from the bound drop down

    upload_2021-1-13_13-56-27.png

    and it will render all the layers up to and including the layer selected into a render texture accessible from a shader or shadergraph.
     

    Attached Files:

    GliderGuy likes this.
  26. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    501
    Totally understandable and I want to emphasize that I'm *very* happy about working with the experimental stuff!

    I would be fine with temporary solutions. I have worked with the ECS package from the very beginning, so I had a lot of workarounds for many things (and still have) :D That's totally fine for me, as long as I can get some help how to workaround things.
    So would be the best approach when facing problems to create a thread and get help here?
     
    GliderGuy likes this.
  27. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    608
    I'm new here in the 2D renderer forum, looking through all the posts. It seems directional lighting was mulled over at some point, this would be really handy for 2d sidescrollers with a constant strong light source (Sun, moon etc) that needs to be at an angle for Normal mapped sprites. Can it be added to the wishlist?
     
    Last edited: Jan 14, 2021
    GliderGuy likes this.
  28. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    I have added Directional light support to the list. The Temple demo has sort of like this going on with polygonal light. But it seems a bit fiddly and not really a proper directional light neither. The mentioned Global light with direction seems to be the best way to go forward, but still not sure how that will affect the shadow though.
     
    GliderGuy likes this.
  29. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    Thanks for creating this list. I'm going to see if we can schedule at least some of the low hanging fruit.
     
  30. ThundThund

    ThundThund

    Joined:
    Feb 7, 2017
    Posts:
    240
    Cool! I guess this would allow us to make a kind of image distortion FX (like a blast), similar to postprocessing.
     
  31. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    Camera Sorting Layers Texture is available in the latest beta.

    If anyone tries it out, I'd appreciate any feedback on it.
     
    Lo-renzo likes this.
  32. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Umm.. is this camera sorting layer texture is the previous grabpass opaque texture stuff?

    If so, how do we define the name of the texture?
     
    Last edited: Feb 1, 2021
  33. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    You don't define the name of the texture. The texture's name is _CameraSortingLayerTexture.
     
  34. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Oh, I see, so I can only have one of it. I thought it can be defined per sorting layer. Got it.
     
  35. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    I am wondering what will happen to the following set up :

    upload_2021-2-1_12-35-2.png

    I have sorting layer set up like above with SortingLayerTexture set to Default.

    But I have another camera that renders only ReflectionCast onto separate rendertexture to be used on my main camera render pass. My main camera only renders from Default onwards because they have game object layer setting also set similar to above and used to mask the rendering.

    In the case like this, how does sortinglayertexture render? Does _CameraSortingLayerTexture renders per camera?
    If so having more than one camera and doing rendertexture operation will mess up with _CameraSortingLayerTexture?

    Both my main camera and reflection camera is set to Base.
     
  36. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    It does rendering per camera, and would only do the copy to _CameraSortingLayerTexture after the selected layer is rendered.

    In your example, which layer do you want to use the _CameraSortingLayerTexture? Also what are you trying to do with it?
     
  37. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    I am simulating 2d reflection by rendering reflection sprites onto the separate rendertexture. It has dedicated camera rendering a particular gameobject layer only before main camera is being renderered.

    The main camera does not render reflection sorting layer because all reflection sprites are under reflection game object layer and the main camera has masked out that layer. So I guess the performance impact should be not too bad in my case, but still, it would be nicer if there is option in the camera to toggle off the usage of _CameraSortingLayerTexture so that it is more flexiable. there may be the case where the rendertexture rendering camera's sorting layer could be above the layer used by _CameraSortingLayerTexture leading to unnecessary draw overheads.
     
  38. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    @Chris_Chu ,

    I am worried that if I have multiple cameras and if some of them only writes to the rendertexture with selected layer mask only, then _CameraSortingLayerTexture be messed up because of such setup. Don't you think the _CameraSortingLayerTexture should be enabled for only opted-in cameras? This will solve unnecessary performance issue for the cameras that does not need _CameraSortingLayerTexture to happen.
     
  39. ThundThund

    ThundThund

    Joined:
    Feb 7, 2017
    Posts:
    240
    Hi @castor76 , can you please add the Blending modes to the list of missing features? There are some basic and typical FX that are not currently possible (fire, lens flare, etc.) or may be possible but with less quality (classic alpha blending does not produce the same result, obviously).
     
  40. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    What do you mean by blend mode? How exactly do you think this feature should be implemented?
     
  41. ThundThund

    ThundThund

    Joined:
    Feb 7, 2017
    Posts:
    240
    The same way it is done with normal URP Lit shaders


    The result you obtain when blending with Additive mode is not the same as what you get using Alpha, obviously.
     
    Last edited: Feb 18, 2021
  42. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Isnt this already available?
     
  43. ThundThund

    ThundThund

    Joined:
    Feb 7, 2017
    Posts:
    240
    It's not available for Sprite-Lit and Sprite-Unlit. Only for Lit shaders.
     
  44. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    This is a good point. I'll add this to our backlog.
     
  45. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    I'll add this to the backlog as well.
     
    esco1979 and ThundThund like this.
  46. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    198
    Sorry @castor76, I clearly didn't think things through when I replied to your post last time. I realized this is something we can already do. You just need to make different 2d renderer data assets and assign them per camera.

    upload_2021-2-24_11-28-36.png
     
  47. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
  48. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Renderer Features, when? :(

    I tried to add normal URP renderer and add renderfeature, but it doesn't seem to work....

    -- Ok, so after recreating the renderer again, it seems to work for normal URP pipeline. Not sure why previous one didn't work..
     
    Last edited: Mar 6, 2021
  49. esco1979

    esco1979

    Joined:
    Mar 18, 2014
    Posts:
    125


    I totally second this one. It's a very basic 2D feature that should have been available day one and not having it is hugely detrimental to any retro 2d projects (like mine). :'(
     
  50. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,215
    Development of 2Drenderer is.... so painfully slow..T.T
     
    dr4, AzureMasters, pahe and 2 others like this.
unityunity