Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

URP and Hybrid Renderer

Discussion in 'Graphics for ECS' started by iPickle, Feb 2, 2020.

  1. iPickle

    iPickle

    Joined:
    Oct 21, 2013
    Posts:
    46
    Hi everyone,

    I am working on a project for a couple of days, and I was using ECS and URP
    In the editor, everything works as expected, I could create a sub-scene, and instantiate entities and everything shows up great, so I though I was OK.

    Now, a couple of days in, I tried to build the project, and I realize nothing is rendering!
    After about a day of testing, this is the result (from a new project, with hybrid renderer, and urp setup, using default materials and meshes)

    Objects that are not converted to entities, render ok
    Objects that are converted in the main scene, render in the origin of the scene, and never moves
    Objects that are placed in a subscene, never render
    Objects that are instantiated, never render

    I looked in the package manager to see if I was missing something, I was Unity Windows Platform, and I thought maybe this is what I'm missing, but when I try to install it, it says that Unity Platforms cant find the right version of the serialization and properties packages, and older versions cause other errors

    * Using Unity 2019.3.0f6

    Anyone have any idea?

    Thanks!
     
  2. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    are you using the Hybred Renderer ?
    the Hybred Renderer is currently only supporting the HDRP. (sadly)
    the Unity Team said they wil begin to work on URP + Hybred Renderer from the middle of 2020.
    the only why to work with ECS + URP is to create your own hybred renderer based on Graphics.DrawMeshInstanced***() or use packages like this one.
    Good luck :)
     
    iPickle likes this.
  3. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    Joachim recently said that work has already started on URP and the hybrid tenderer, and that it’s progressing well.
     
    nicolasgramlich likes this.
  4. iPickle

    iPickle

    Joined:
    Oct 21, 2013
    Posts:
    46
    Thanks!
    I used it with HDRP before, and I just assumed since it worked, that URP should be fine.
    And Editor was presenting it ok, so I never verified it :(

    I guess I`ll move back from DOTS for this project
     
  5. Richay

    Richay

    Joined:
    Aug 5, 2013
    Posts:
    115
    I'm using the latest Entities + Hybrid Renderer with URP, and everything renders as expected, for both the initial scene objects and instantiated prefabs (I'm not using subscenes). I'm not doing anything special or crazy with materials or suchlike. The process maybe isn't yet properly supported, but I can confirm that it works absolutely fine for me.
     
    transat likes this.
  6. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,217
    It works if you don't use instanced properties. Instanced property support for URP also landed in the master branch on GitHub a few days ago, so support is coming pretty soon.
     
    transat and Sarkahn like this.
  7. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    i had a lot of unexpected errors with URP + Hybred Renderer 0.2+
    the Current Hybred Renderer + URP are not working for OpenGles3.1 and Vulkan, plus mixing them is very unstable for mobile.
    the same apk can have different bugs depending on the device. more details here.
    i really hope they find a solution for it very soon.

    i think the best way for the moment is to create your own Hybred Renderer using the Graphics.DrawMeshInstanced or Graphics.DrawMeshInstancedIndirect depending on your needs. you can take a look at the Hybred Renderer 0.1 which was based on this API too and maybe get a more customized culling logic for your game, which can give you a better performance. in my case i used the fact that my game is a TOP-DOWN style so it's easier to cull huge number of entities by grouping them into regions...
     
  8. iPickle

    iPickle

    Joined:
    Oct 21, 2013
    Posts:
    46
    Thanks guys!

    Also on build?
    Can you share your build settings, and project manifest?
     
  9. Richay

    Richay

    Joined:
    Aug 5, 2013
    Posts:
    115
    Yep, both editor and Windows builds. There's absolutely nothing special in my project. I've literally used the defaults for all rendering options.

    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.2d.sprite": "1.0.0",
    4.     "com.unity.addressables": "1.6.0",
    5.     "com.unity.burst": "1.2.2",
    6.     "com.unity.cinemachine": "2.5.0",
    7.     "com.unity.collections": "0.5.1-preview.11",
    8.     "com.unity.dots.editor": "0.3.0-preview",
    9.     "com.unity.entities": "0.5.1-preview.11",
    10.     "com.unity.ext.nunit": "1.0.0",
    11.     "com.unity.inputsystem": "1.0.0-preview.4",
    12.     "com.unity.physics": "0.2.5-preview.1",
    13.     "com.unity.platforms": "0.1.8-preview.1",
    14.     "com.unity.platforms.windows": "0.1.7-preview.4",
    15.     "com.unity.probuilder": "4.2.3",
    16.     "com.unity.progrids": "3.0.3-preview.4",
    17.     "com.unity.render-pipelines.core": "7.1.8",
    18.     "com.unity.render-pipelines.universal": "7.1.8",
    19.     "com.unity.rendering.hybrid": "0.3.3-preview.11",
    20.     "com.unity.searcher": "4.0.9",
    21.     "com.unity.settings-manager": "1.0.1",
    22.     "com.unity.shadergraph": "7.1.8",
    23.     "com.unity.test-framework": "1.1.9",
    24.     "com.unity.test-framework.performance": "2.0.6-preview",
    25.     "com.unity.textmeshpro": "2.1.0-preview.4",
    26.     "com.unity.timeline": "1.2.11",
    27.     "com.unity.ugui": "1.0.0",
    28.     "com.unity.ui.builder": "0.10.1-preview",
    29.     "nuget.mono-cecil": "0.1.6-preview",
    30.     "com.unity.modules.ai": "1.0.0",
    31.     "com.unity.modules.androidjni": "1.0.0",
    32.     "com.unity.modules.animation": "1.0.0",
    33.     "com.unity.modules.assetbundle": "1.0.0",
    34.     "com.unity.modules.audio": "1.0.0",
    35.     "com.unity.modules.cloth": "1.0.0",
    36.     "com.unity.modules.director": "1.0.0",
    37.     "com.unity.modules.imageconversion": "1.0.0",
    38.     "com.unity.modules.imgui": "1.0.0",
    39.     "com.unity.modules.jsonserialize": "1.0.0",
    40.     "com.unity.modules.particlesystem": "1.0.0",
    41.     "com.unity.modules.physics": "1.0.0",
    42.     "com.unity.modules.physics2d": "1.0.0",
    43.     "com.unity.modules.screencapture": "1.0.0",
    44.     "com.unity.modules.terrain": "1.0.0",
    45.     "com.unity.modules.terrainphysics": "1.0.0",
    46.     "com.unity.modules.tilemap": "1.0.0",
    47.     "com.unity.modules.ui": "1.0.0",
    48.     "com.unity.modules.uielements": "1.0.0",
    49.     "com.unity.modules.umbra": "1.0.0",
    50.     "com.unity.modules.unityanalytics": "1.0.0",
    51.     "com.unity.modules.unitywebrequest": "1.0.0",
    52.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    53.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    54.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    55.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    56.     "com.unity.modules.vehicles": "1.0.0",
    57.     "com.unity.modules.video": "1.0.0",
    58.     "com.unity.modules.vr": "1.0.0",
    59.     "com.unity.modules.wind": "1.0.0",
    60.     "com.unity.modules.xr": "1.0.0"
    61.   }
    62. }
     
  10. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    can you debug the graphic api used by your build ?
     
  11. Richay

    Richay

    Joined:
    Aug 5, 2013
    Posts:
    115
    I'm not sure what you mean, as I'm not doing any manual drawing. My process was: Install URP. Install hybrid renderer. Create a child object with a mesh which uses a URP/Lit material (with GPU instancing). That's it.
     
  12. MartynLeeper

    MartynLeeper

    Joined:
    Apr 29, 2013
    Posts:
    5
    Is there a roadmap somewhere which shows estimates for when systems are expected to be finished? The UE4 team have a public trello board which gives everyone an idea of what things are being worked on.
     
  13. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    MartynLeeper likes this.
  14. SebastianAaltonen

    SebastianAaltonen

    Unity Technologies

    Joined:
    Feb 21, 2020
    Posts:
    112
    Next DOTS package will include the first experimental version of Hybrid V2. This is the first DOTS renderer that has official URP support. This package will also include rewritten hybrid renderer landing page document describing how to setup shaders and materials correctly to hybrid renderer.
     
    MasoInar, Zoey_O, Richay and 13 others like this.
  15. MartynLeeper

    MartynLeeper

    Joined:
    Apr 29, 2013
    Posts:
    5
    Thanks for the link!

    Really looking forward to checking this out! Is there any rough eta for when this might be released?
     
    Zoey_O, Opeth001 and charleshendry like this.
  16. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    @SebastianAaltonen just reporting a bug.
    the Hybred Renderer V2 is not working, i tested it using the Unity 2020.1.0b1.
    i added the ENABLE_HYBRID_RENDERER_V2, when i close the SubScene all entities are created but nothing is rendered and by removing the defined symbol all entities are rendered by the old HybredRenderer.
    this is reproducible even with an empty project and using simple Cubes.
     
  17. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    HRv2 require SRP 9.0.0-preview, maybe it can be problem if you not cloned it from SRP repo under hybrid-instancing2 branch
     
    Opeth001 likes this.
  18. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    yes maybe it's the problem,

    this is what i did:
    1) i downloaded the full project from Github.

    2) i copied com.unity.render-pipelines.core, com.unity.render-pipelines.universal, com.unity.shadergraph, com.unity.testframework.graphics in the Packages Folder.

    3) i modified the manifest.json :

    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.collab-proxy": "1.3.7",
    4.     "com.unity.collections": "0.7.0-preview.2",
    5.     "com.unity.entities": "0.8.0-preview.8",
    6.     "com.unity.formats.fbx": "2.0.3-preview.3",
    7.     "com.unity.ide.visualstudio": "2.0.0",
    8.     "com.unity.ide.vscode": "1.1.4",
    9.     "com.unity.physics": "0.3.0-preview.1",
    10.     "com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core",
    11.     "com.unity.render-pipelines.universal": "file:../../../com.unity.render-pipelines.universal",
    12.     "com.unity.rendering.hybrid": "0.4.0-preview.8",
    13.     "com.unity.shadergraph": "file:../../../com.unity.shadergraph",
    14.     "com.unity.test-framework": "1.1.11",
    15.     "com.unity.testframework.graphics": "file:../../../com.unity.testframework.graphics",
    16.     "com.unity.textmeshpro": "3.0.0-preview.1",
    17.     "com.unity.timeline": "1.2.12",
    18.     "com.unity.modules.ai": "1.0.0",
    19.     "com.unity.modules.androidjni": "1.0.0",
    20.     "com.unity.modules.animation": "1.0.0",
    21.     "com.unity.modules.assetbundle": "1.0.0",
    22.     "com.unity.modules.audio": "1.0.0",
    23.     "com.unity.modules.cloth": "1.0.0",
    24.     "com.unity.modules.director": "1.0.0",
    25.     "com.unity.modules.imageconversion": "1.0.0",
    26.     "com.unity.modules.imgui": "1.0.0",
    27.     "com.unity.modules.jsonserialize": "1.0.0",
    28.     "com.unity.modules.particlesystem": "1.0.0",
    29.     "com.unity.modules.physics": "1.0.0",
    30.     "com.unity.modules.physics2d": "1.0.0",
    31.     "com.unity.modules.screencapture": "1.0.0",
    32.     "com.unity.modules.terrain": "1.0.0",
    33.     "com.unity.modules.terrainphysics": "1.0.0",
    34.     "com.unity.modules.tilemap": "1.0.0",
    35.     "com.unity.modules.ui": "1.0.0",
    36.     "com.unity.modules.uielements": "1.0.0",
    37.     "com.unity.modules.umbra": "1.0.0",
    38.     "com.unity.modules.unityanalytics": "1.0.0",
    39.     "com.unity.modules.unitywebrequest": "1.0.0",
    40.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    41.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    42.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    43.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    44.     "com.unity.modules.vehicles": "1.0.0",
    45.     "com.unity.modules.video": "1.0.0",
    46.     "com.unity.modules.wind": "1.0.0"
    47.   }
    48. }
    49.  
    Did I do something wrong ?
     
    charleshendry likes this.
  19. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    From which branch?
    Also important note: HRv2 require Unity 2020.1.b03 or newer (not released yet) https://forum.unity.com/threads/hybrid-rendered-v2-dependency-urp-9-0-0-missing.846421/#post-5590225

    IMPORTANT: Unity 2020.1.0b3 is a hard requirement for Hybrid Renderer V2. Visuals will be completely broken if you test with earlier version (such as 2020.1.0a25).
    https://forum.unity.com/threads/hybrid-rendered-v2-dependency-urp-9-0-0-missing.846421/#post-5590234
     
    Opeth001 likes this.
  20. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    i downloaded the whole Github repo from Clone or Download Button then added the neede packages.


    i think this is the problem XD.
    i have the latest Unity beta version (Unity 2020.1.0b1), how people is testing it if it's not released yet ?

    btw the Hybred Renderer Documentation says:
    Sample projects are using Hybrid Renderer V2 and require Unity 2020.1.a025 or later and SRP 9.0.0-preview package.
    im lost!
     
  21. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    You should check out specific branch - hybrid-instancing2 for samples, but it can be changed already
     
    Opeth001 likes this.