Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Upgrade to preview 29 and Unity 2019 - Meshes no longer visible

Discussion in 'Entity Component System' started by sSaltyDog, Mar 17, 2019.

  1. sSaltyDog

    sSaltyDog

    Joined:
    Mar 4, 2017
    Posts:
    37
    After upgrading to Unity 2019.2.0a8 from 2018.3 my project worked fine.
    However, upgrading to Entities preview 29 caused my procedurally generated meshes to be invisible, as far as I can tell.

    I also reset packages due an error that I couldn't resolve after upgrading to Entities preview 29:
    The type or namespace name 'AABB' could not be found (are you missing a using directive or an assembly reference?)

    There's a thread about this below:
    (https://forum.unity.com/threads/error-in-unity-mathematics-extensions-after-upgrading-to-p26.639694/)

    Here's what I've tried:
    • Sanity checked mesh vertex counts and positions, normals and mesh entity positions
    Meshes are being generated correctly - the meshes seem to exist but not get rendered.
    • Tested my shadergraph shader on a primitive cube and tested a default shader on my procedural mesh.
    My shader works on the cube and the default shader still does not result in my procedurally generated meshes being visible.
    • Created a Lightweight RP template and copying my assets folder into it.
    After the necessary package updates, the project behaves in the same way, everything fine except no visible meshes.
    • Numerous iterations of fresh repo clones, upgrades to Unity and package upgrades/re-installs.

    I was looking for hybrid renderer documentation as I figured that might help, but I can't find it, anyone know if it exists?

    Has anyone experienced an issue like this? I've I feel like I'm missing something simple and I'm hoping for some troubleshooting suggestions.


    Here's my manifest.json

    Code (CSharp):
    1.  
    2. {
    3. "dependencies": {
    4. "com.unity.2d.sprite": "1.0.0",
    5. "com.unity.2d.tilemap": "1.0.0",
    6. "com.unity.ads": "2.0.8",
    7. "com.unity.analytics": "3.2.2",
    8. "com.unity.collab-proxy": "1.2.16",
    9. "com.unity.entities": "0.0.12-preview.29",
    10. "com.unity.package-manager-ui": "2.2.0",
    11. "com.unity.purchasing": "2.0.6",
    12. "com.unity.render-pipelines.lightweight": "5.2.3",
    13. "com.unity.rendering.hybrid": "0.0.1-preview.9",
    14. "com.unity.shadergraph": "5.2.3",
    15. "com.unity.textmeshpro": "1.3.0",
    16. "com.unity.timeline": "1.0.0",
    17. "com.unity.modules.ai": "1.0.0",
    18. "com.unity.modules.androidjni": "1.0.0",
    19. "com.unity.modules.animation": "1.0.0",
    20. ... ...
    21.  
    The issue was also present before I installed the lightweight shader pipeline (I am using a shadergraph vertex shader).
     
  2. sSaltyDog

    sSaltyDog

    Joined:
    Mar 4, 2017
    Posts:
    37
    Quick update: Downgrading to Entities preview 24 and hybrid renderer preview 4 (and making all the code changes to switch back to the old API) causes meshes to show again as normal.

    I did this incrementally through preview 29, 8, 7 alongside the corresponding hybrid renderer downgrades and preview 26 didn't compile, so it's either preview 26 or 27 onwards that gets the error.

    I'm pretty much at a loose end with this one. Hoping I can work it out as I want to overhaul my system update orders and the new ECS updates seem to make some changes in that area.
     
    Last edited: Mar 17, 2019
    mkracik likes this.
  3. learc83

    learc83

    Joined:
    Feb 28, 2018
    Posts:
    41
    Do your entities with meshes have LocalToWorld components? For entities that you manually create (not using the conversion utility), you have to add LocalToWorld or they won't render.
     
    mkracik and sSaltyDog like this.
  4. sSaltyDog

    sSaltyDog

    Joined:
    Mar 4, 2017
    Posts:
    37
    Thanks! I just started poking around the entity debugger and I guess I just got the hang of entity debugging :)



    That's the 'RenderMeshSystemV2' archetype. I added ChunkWorldRenderBounds, LocalToWorld and WorldRenderBounds initially but yes actually only LocalToWorld is necessary.

    Thanks again, adding LocalToWorld to my mesh entity archetype fixed the issue.
     
    learc83 likes this.
  5. mkracik

    mkracik

    Joined:
    Aug 5, 2018
    Posts:
    17
    I had the same problem, I was able to troubleshoot it using Entity Debugger. RenderMeshSystemV2 expects entities with component LocalToWorld, it looks like in preview 24 EndFrameTransformSystem was adding LocalToWorld to entities with Position or Rotation or Scale but it no longer happens in preview 26 and up. After I added LocalToWorld to all my archetypes which I wanted to render, I was able to upgrade to preview 29 and everything renders properly.
     
    sSaltyDog likes this.
  6. Kreuzkuemmelll

    Kreuzkuemmelll

    Joined:
    Feb 14, 2018
    Posts:
    7
    LocalToWorld seems to be deprecated. Has anything replaced it or is it just taken care of behind the scenes? My objects still are not rendering. Could someone point me in the right direction? Thanks!
     
  7. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,655
    Did you read whole this thread? This is described all what you should do for fix.
    It’s not deprecated and never was. Transform system not adds it automatically anymore. You should do it by yourself, or by new conversion workflow. For rendering you should install Renderer.Hybrid package.