Search Unity

[Hybrid Renderer] Entity Conversion Breaks "Mixed" Meshes?!

Discussion in 'Graphics for ECS' started by nicolasgramlich, Mar 23, 2020.

  1. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Hey everyone,

    I'm facing an issue with the Hybrid Renderer and/or the Entity Conversion process. Some meshes seem to render just find with URP itself, but break when going through the entity conversion and get rendered with the Hybrid Renderer. The easiest is to probably just watch what happens:



    I also attached the project that causes this weird behavior.

    {
    "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.ads": "3.4.4",
    "com.unity.analytics": "3.4.0",
    "com.unity.burst": "1.3.0-preview.7",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.device-simulator": "2.1.0-preview",
    "com.unity.dots.editor": "0.4.0-preview",
    "com.unity.entities": "0.8.0-preview.8",
    "com.unity.ide.rider": "2.0.1",
    "com.unity.ide.vscode": "1.1.4",
    "com.unity.inputsystem": "1.0.0-preview.6",
    "com.unity.jobs": "0.2.7-preview.11",
    "com.unity.performance.profile-analyzer": "0.6.0-preview.1",
    "com.unity.physics": "0.3.0-preview.1",
    "com.unity.polybrush": "1.0.1",
    "com.unity.probuilder": "4.2.3",
    "com.unity.progrids": "3.0.3-preview.5",
    "com.unity.render-pipelines.universal": "7.3.1",
    "com.unity.rendering.hybrid": "0.4.0-preview.8",
    "com.unity.test-framework": "1.1.11",
    "com.unity.test-framework.performance": "2.0.7-preview",
    "com.unity.textmeshpro": "2.0.1",
    "com.unity.timeline": "1.2.12",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }

    Scene:
    upload_2020-3-23_12-14-54.png
    Game (Running):
    upload_2020-3-23_12-15-20.png
    The mesh:
    upload_2020-3-23_12-15-38.png

    Anyone has an idea what's going on and/or how to fix it?

    Thanks,
    Nicolas
     

    Attached Files:

    Last edited: Mar 24, 2020
  2. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    The exact same issue happens with HDRP, so it's not a URP issue. (Note: I didn't bother to fix the texture issue :rolleyes:)
    upload_2020-3-23_14-30-3.png
     
    Last edited: Mar 23, 2020
  3. SebastianAaltonen

    SebastianAaltonen

    Unity Technologies

    Joined:
    Feb 21, 2020
    Posts:
    112
    You have a skinned mesh. You need DOTS animation package to support skinning in DOTS. I don't know much about this package myself. However the package owner said that it requires some extra setup compared to traditional Unity skinning. We definitely should have better documentation to describe the required DOTS packages for each feature.
     
    starikcetin and optimise like this.
  4. Jebtor

    Jebtor

    Unity Technologies

    Joined:
    Apr 18, 2018
    Posts:
    115
    Hey, as Sebastian mentioned you need to use Dots.Animation to create a working setup for SkinnedMeshRenderers in the current state of things. The Dots.Animation Samples are a good starting point to understand what is required to get things working.

    In particular to get SkinnedMeshRenderers to convert properly you need to setup a SkinMesh component on the same GameObject. Furthermore, the material used by the SkinnedMeshRenderer needs to be setup for skinning. This requires a ShaderGraph. The graph used in the samples can be found in Assets/Shaders. Lastly, you need to check "enable GPU instancing" on the material itself. Olivier provides some illustrations on this in his first reply in this thread.

    My apologies for the involved setup. We are actively working on improving this.
     
    thelebaron likes this.
  5. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @Jebtor. Does URP mobile support is coming to Dots.Animation anytime soon?
     
  6. SebastianAaltonen

    SebastianAaltonen

    Unity Technologies

    Joined:
    Feb 21, 2020
    Posts:
    112
    Hybrid URP support needs Unity 2020.1. Seems that you are using Hybrid URP in 2019.3. This is not officially supported and has lots of random issues.
     
    nicolasgramlich likes this.
  7. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Thanks for the responses! I'll just file it under "weird behavior because it's not officially supported yet" :)

    Fwiw on this issue though, I'm was not even trying to get the animation working. It was just confusing that it worked for some skinned meshes (as in they render properly in place without the animations), and some others go crazy and end up with weird rotations.

    I'm actively experimenting with the animation package separately with great success (given the early state of the package):
    https://github.com/Unity-Technologies/Unity.Animation.Samples/issues/1#issuecomment-581769560

    Can't wait for it all to come together :)

    I'm looking forward to the GPU instancing for the animations and the HybridRendererV2 with great excitement :)

    Again, thanks for all the amazing work!