Search Unity

Are Unity Subscenes and LWRP Compatible ?

Discussion in 'Entity Component System' started by Opeth001, Jul 27, 2019.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Hello Everyone,
    im making a game with 3 other Friends, im working as a developer and im trying to find time as much as i can to develop this game. but currently im blocked in a unity Bug (Weird Bug) from 3 days now, i tried everything but i think this one need to be fixed by Unity.

    * im not using probuilder.
    * im not referencing any Mesh within my scene.
    * this bug is present in all Unity Versions i tried : Unity 2019.1.10f1 ,11,12, also Unity 2019.2.0b10.
    * i also tried different versions of the LWRP.

    it seems like Unity subscenes is not Compatible with the LWRP.

    That's what the game looks like in:

    Editor: (after Restarting Unity it starts to behave exactly like the OnePlus2 )
    Gif Link : https://media.giphy.com/media/cmTZjJdM83VmLGJbq0/giphy.gif


    OnePlus 2:
    Gif Link : https://media.giphy.com/media/VcwGi6xj6I1KvKrP3Z/giphy.gif


    Samsung S8 :
    Gif Link : https://media.giphy.com/media/Swxyfn8hnSNwCeJiN0/giphy.gif



    any suggestion will be much appreciated!
     
    Last edited: Jul 27, 2019
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    We recently tested 5.16.1 of LWRP with 19.1 for Unity on iOS for our Physics samples and it worked fine.

    But we currently doing most of our own testing in HDRP not in LWRP on dots.

    I think you should file a bug with the project folder.
     
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    i used the exact same version but nothing changes, did you tested with subscenes too ?
     
  4. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    i just tested Again, Without LWRP everything is working perfectly, but when i change the project to LWRP again (without changing anything else) everything go crazy.
    so this means the problem is related to LWRP.
     
  5. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Please file a bug with a project folder where this reproduces. Post case number here as well please.
     
  6. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    i attached the project as a compressed file: Case 1172922
     
  7. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    @Joachim_Ante
    sorry it's been more than a month now, me and my team are still waiting for a response, it's critical for us to know which RP we are going to use.
    pls Anything New ?
     
  8. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    This is what happens to me with LWRP / Universal RP in 2019.3 with the most current LWRP/URP update.
    https://i.imgur.com/m0m9i6Y.gifv

    The first vehicle is just a normal model, the second one has an entity conversion script on it and is the one used in the video above.
    https://i.imgur.com/sHpyCLl.gifv

    Then here is what happens in 2019.2 with LWRP when I tried to use lit shaders on moving things. It crashes Unity after about 20-30 seconds of that.
    https://i.imgur.com/hw1dIMR.gifv

    I am not using subscenes at all, it just happens either way. LWRP seems to work ok in 2019.2 as long as I use an unlit shader, which I don't really like, but I am just making do until it is fixed. 2019.3 I can't use at all, unfortunately.
     
    Last edited: Sep 4, 2019
    Opeth001 likes this.
  9. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    260
    I'm using LWRP in 2019.2 with no problems whatsoever, but I haven't started using subscenes yet. I mean lit, simple lit, and unlit shaders all work fine. Meshes rendered with the hybrid renderer look fine. Animated meshes (using traditional animator and a hybrid approach) work perfectly fine.

    Have you tried doing a reimport all on your project?
     
  10. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I have, I started a new project even. I have an incident opened and uploaded my project to Unity, they said they have not been able to reproduce it on their end, so hopefully that helps.
     
  11. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    260
    Hopefully, as the ECS packages move towards production readiness, they'll sort it out.
     
  12. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    they answered me yesterday saying that they were able to reproduce the bug.
    so it's a bug from their part and they will fix it ^_^.
     
    FixItFelix and desertGhost_ like this.
  13. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Good deal, hopefully it is related to my other issue with the mesh exploding all over the screen and they can fix that, too. There are some things in 2019.3 that could really benefit me and I simply cannot use it without it crashing until they fix it.
     
  14. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117

    @Joachim_Ante
    i found out that the problem is not happening when i disable the SRP Batcher Option within the PipelineAsset.
    i hope it will help you Resolve it.
     
    MostHated likes this.
  15. FixItFelix

    FixItFelix

    Joined:
    Mar 27, 2017
    Posts:
    54
    This is really crazy how long it takes to take care of such a critical bug.
    @Joachim_Ante: In the past, I see often presentations only on ios and as you wrote you are testing stuff on ios. Please consider testing on android more frequently as well. The main market share is still android. It does not help if I can develop nicely and reliable for ios only.
     
    Opeth001 likes this.
  16. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Case 1172922 closed, Bug still present since "29/07/2019" and nothing new.
    That's Awesome!
     
    Last edited: Nov 16, 2019
  17. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Is it present in URP?
     
  18. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Unfortunately yes :(
     
  19. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    @tertle
    if you are looking to reproduce the bug, jus put few objects in a subscene and enable the SRP batcher.

    in the editor it needs few restarts to appear, but for mobile devices just build a player and you will have it.
    if you re looking for any project with the bug in it, just send me a PM ill give you a link to download a Sample.
     
  20. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Not really, was just curious. I knew the SRP batcher had issues with the hybrid renderer just didn't know if they were still around.
     
  21. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I should break out that project I was working on that was getting rainbows and see if it's still going on as well. Seems awfully... strange for them to close it without confirming with you on your own ticket.
     
  22. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    Case can be closed and bug fixed in internal package, which will be published later.
     
    Opeth001 likes this.
  23. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    I really hope they will publish a fix soon.
     
  24. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    260
    My assumption is that they probably fixed it in the next release... Fingers crossed.
     
    Opeth001 likes this.
  25. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,659
    So sorry about this! The bug has been closed because it's a duplicate of another issue:

    https://issuetracker.unity3d.com/is...ering-on-entities-when-srp-batcher-is-enabled

    Usually when we close a bug as a duplicate, we send you a message letting you know what's going on and giving you a link to the new issue so you can keep an eye on it. I've asked our QA team to look into why that didn't happen in this case.

    I asked the rendering team about the bug, and actually, you were right in your initial post - the URP (previously known as LWRP) is not supported by Hybrid yet. For the time being the team is focused entirely on making HDRP + Hybrid work well; they're planning to look at URP after that, hopefully in the middle of next year.

    More detail: what's really missing is that Hybrid does not set a lot of the shader constants that are used by the URP. As a result, those shader constants are left as uninitialised values when using Hybrid. The fact that the issues go away when you disable the SRP Batcher is a coincidence; the SRP batcher itself is very definitely supported (it's used/tested heavily by the team with HDRP).
     
    Ryiah, Prodigga, optimise and 4 others like this.
  26. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Thank you for your answer ^_^

    sorry for this question and you certainly have your reasons that i ignore,
    but why the Unity Team is focusing on fixing the HDRP, when the URP which is the new Default RP is not working correctly?


    100% of times when i disable the SRP Batcher it get fixed and by enabling it again everything go crazy.
    [EDIT]
    i remember i also had to select the GLES2 as the main graphic API in order to work again.
     
    Last edited: Nov 17, 2019
    pm007, FixItFelix and kingstone426 like this.
  27. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369

    How can I promote Unity in my enterprise with this king of decision :/
    DOTS 1.0 will come with 2020.1 without support for URP which is THE pipeline promote hardly by unity for new project ...
    So we have to choose between rendering ( URP, shadergraph, etc) and DOTS, hard and sad choice :(
     
    Sarkahn, pm007 and Opeth001 like this.
  28. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Hybrid doesn't really work that well with anything yet due to things getting out of sync with entities and SRP releases and one having APIs that other doesn't support, tons of feats not working with it etc. It makes sense to focus on one part first and then do the other thing, instead of trying to solve everything at once. As a game developer you must know this already.

    Also lets not mix things, DOTS core going out of preview next year or so is not the same as whole DOTS ecosystem being usable and production ready then, that's also not what Unity has been promoting either (just take a peek at their "3-year-plan"). It only means that they feel that the actual entities, jobs and burst themselves will be usable in production then but it doesn't mean rest of the DOTS framework is done by that (this is why they focus so heavily on conversion workflow so they can actually let people use it before rest of the systems are done for DOTS).
     
    elcionap and optimise like this.
  29. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Indeed, you are right, from memory I thought it was part of DOTS 1.0 package.

    After checking the roadmap video, indeed hybrid rendering is not mention at all !
    They speak of conversion workflow preview, release of DOTS 1.0 and others thing but nothing from hybrid renderer ( or I missed something ?).
    If a dev can give us a roadmap on what it is planned like it has been with the roadmap video that will great.
     
  30. mkracik

    mkracik

    Joined:
    Aug 5, 2018
    Posts:
    17
    As I understand it, SRP Batcher is in native C++ code but URP and Hybrid Renderer's source code (C# and shaders) is available and can be cloned into our project and modified. Can we do some temporary workaround while waiting for middle of 2020?
     
  31. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    260
    I think you could create a local hybrid renderer package in the project packages folder move the hybrid renderer package into your assets folder to make it a local package (don't keep it in both packages and assets of your project). Then you could modify the hybrid renderer to properly work with URP (I would only modify the hybrid renderer if possible).

    Edit: Thanks for the correction :)

     
    Last edited: Nov 20, 2019
  32. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You shouldnt move it to Assets -folder to make it local, local packages should go to projects packages folder (and if you have local package there, it overrides the one possibly set in the manifest).

    There used to be an option on the package manager at some point in moving things automatically to this folder but they removed it at some point, I don't know if it's returned or not.

    How I do this myself is that I put package I want first to manifest.json, then load the project, then navigate to library/packagecache and move the package from there to projects packages folder to make it a local copy and edit there if needed.
     
    florianhanke and mkracik like this.
  33. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @superpig, is that possible to build a new team to solve URP + Hybrid problem? I really want to use awesome URP + Hybrid feature as soon as possible.
     
  34. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,659
    If only 'build a new team' was that easy :) We are hiring a lot of people, but such things do not happen overnight. If you know someone that you think could help us make awesome stuff more quickly then please do encourage them to get in touch... (And this does not only refer to people who could work on Hybrid + URP directly - there's also a lot of opportunities for someone to help indirectly).
     
    optimise, mkracik and Opeth001 like this.
  35. FixItFelix

    FixItFelix

    Joined:
    Mar 27, 2017
    Posts:
    54
  36. ekakiya

    ekakiya

    Joined:
    Jul 25, 2011
    Posts:
    79
    Current workaround is, make the Shaders instancing options as "nolightprobe nolodfade", don't use "assumeuniformscaling" and "renderlayer".
    It makes the shader can take the UnityInstancing_PerDraw ConstantBuffer from the hybrid renderer correctly.

    ..It worked for my original SRP with hybrid renderer, at least.
     
    Last edited: Nov 27, 2019
    mkracik likes this.
  37. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    can you please explain how you changed the Shaders instancing options as "nolightprobe nolodfade" in built-in URP shaders like SimpleLit ?
    i cant find this option.
     
  38. Sarkahn

    Sarkahn

    Joined:
    Jan 9, 2013
    Posts:
    440
    I'd also appreciate a little more clarity if possible.

    I tried to set it up like you described but I couldn't seem to get it to work. I copied the urp unlit shader, added #pragma instancing_options for nolightprobe and nolodfade, and I added a constant buffer with the name of my property. I then have my entity set up with the hybrid renderer and my material but it doesnt seem to receive my property data from the component.
     
    Opeth001 likes this.
  39. ekakiya

    ekakiya

    Joined:
    Jul 25, 2011
    Posts:
    79
    1. Copy a material-shader of URP(like SimpleLit.shader or from shaderGraph) and rename.
    2. The shader code has multi pass, and each shader-pass has the line "#pragma multi_compile_instancing". Behind that, add the line "#pragma instancing_options nolightprobe nolodfade”.

    You need more customize to support the per-instance user defined material params with Entities 0.2.
    The shader code generated by shader graph ( HDRP lit with per-instance material param)can be the sample.
    1. It defines UNITY_DOTS_INSTANCING_ENABLED by defined(UNITY_SUPPORT_INSTANCING) && defined(INSTANCING_ON), right after the "#pragma multi_compile_instancing".
    2. With that flag, per instance params array and names are defined like "UNITY_ACCESS_INSTANCED_PROP(unity_Builtins0, _MyParam_Array)".
    3. Those params names are replaced from constant buffer(UnityPerMaterial) with "float4 _MyParam_dummy;", I think this also needs to support SRP batcher.
     
    Last edited: Dec 12, 2019
    mkracik likes this.