Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

DOTS animation skin matrices not aligned with renderer

Discussion in 'DOTS Animation' started by snacktime, Jun 25, 2020.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Posting this here since the animation team seems to monitor this instead of the DOTS forum.

    Upgraded from 0.3.0-preview 7 to 0.5.1-preview1 and rendering was offset from where it was previously. By what looks like the offset of the root bone from the rig parent. With the render bounds being off by that amount also. Seems like it's effecting the skinning rotations a bit also.
     
  2. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Forgot to mention we are remapping also. So maybe that is just silently failing? We are using the RigRemapQuery with the code from the samples repo which has been working fine up until the upgrade.

    I compared the rendering to a mecanim animator playing the same animation and ya it's way off from what it should be. Sort of suspect remapping now just because I can't think of what else it could possibly be.
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Ok so it seems like 0.5.1-preview1 might be broken and maybe even sort of intentionally. The release notes talk about stuff that is only in entities 0.12 from what I can tell and the source has ifdefs for 0.12. And the issue here seems to be bad parenting on the Hybrid renderer side, like it was just intentionally not updated but will be in entities 0.12. Parenting renderers to the rig root entity and fixing up the renderbounds does seem to fix things. Although impossible to know if that is the intended solution.
     
  4. Jebtor

    Jebtor

    Unity Technologies

    Joined:
    Apr 18, 2018
    Posts:
    113
    Hey, we are currently working on address the offset and render bounds issues properly across animation and hybrid renderer. The problem arises from the way entities are parented in conversion. With the current public versions you should be able to resolve the issues by attaching the SkinnedMeshRenderers to the rig root. Out of curiosity what version of hybrid renderer & SRP are you using?
     
  5. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356

    Ya that's what I did. In addition you need to transform the RenderBounds by the inverse of the rig root LocalToWorld.

    HDRP 9.x preview-13. Using Hybrid Renderer V2.
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Btw while you guys are making changes couple of things that would be helpful.

    One is make HR conversion systems public. Currently no way to disable those.

    Another is AttachToPrimaryEntityForSingleMaterial should be configurable per renderer type. Ideally it should read from an authoring component of some type I think. We modified it to do that and changed Convert to take an additional bool.
     
  7. Jebtor

    Jebtor

    Unity Technologies

    Joined:
    Apr 18, 2018
    Posts:
    113
    Just to be sure we addressed this too. You are talking about applying this transformation to center of the AABB in the RenderBounds? This should also be solved by using the localBounds from the SkinnedMeshRenderer instead of the Mesh.bounds during conversion.

    Thanks for the feedback. I will discuss it with the team and see what I can do :)
     
  8. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Ya I was talking about AABB.Transform, SMR localBounds I didn't even remember was a thing so ya that's the correct approach. Just updated our code to it.