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

Animation Documentation

Discussion in 'DOTS Animation' started by JakHussain, Jan 30, 2020.

  1. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    I'm messing around with the DOTS sample and I'm finding it pretty difficult to get a grasp of what's really going on with animation without any documentation to speak of. At least with the net code I have something to refer to.

    Is there any ETA on when any basic manuals are going to be written for the animation package?

    Also, I think choosing to name the package as simply "Animation" is a pretty poor choice since it doesn't convey that it's for DOTS only and I expect this would confuse a lot of people once it's visible in the package manager by default.
     
    Mikael-H likes this.
  2. andreicfsteaua

    andreicfsteaua

    Joined:
    Nov 18, 2019
    Posts:
    36
    I am in the same spot as you, desperate for Animations in Pure ECS but so far I've seen just 2D animations in Hybrid ECS and the sample is too hard for me to understand yet. Maybe just learn basic animations and then learn the new ones from the sample or wait for the final iteration of the Animation Package
     
  3. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    SergeyRomanko and awesomedata like this.
  4. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    I'm also facing same issue. Sample is really hard to understand. I'm messing with DOTS Sample and FPS Sample for many days. But I couldn't figure out how animations are working.
    I'm also developing Third Person Shooter game with DOTS I couldn't understand how to run proper rigged animation.

    I also watched this https://github.com/Unity-Technologies/Unity.Animation.Samples new animation package. But I couldn't understand how to implement it in DOTS or documentation is not clear for intermediate developers.
     
  5. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    I've been playing around with the
    unity.animation
    package for a while ( https://github.com/Unity-Technologies/Unity.Animation.Samples/issues/1#issuecomment-576544306 ) and got it to work with URP (officially only HDRP is supported right now). Drop
    0.3.0-preview.7
    made things a little more performant and the guys/gals are working hard for official URP compatibility for GDC in about a month.

    To get started I recommend checking out this example:
    https://github.com/Unity-Technologi...s/Assets/Scenes/Examples/MyFirstAnimationClip
    Drop in a model of your own and compare it to the prefab/rig/etc... that's used by that example. Follow the scene dependencies, check out the shader graph, inspect the prefab (it has some components,
    RigComponent
    (iirc) in it).

    Disclaimer, it's not yet a drop in replacement to the old animations! There is some ground work to do rn, i.e. use a specific shader, add a component to your prefab, add all bones from the rig to the model. It's doable if you really need it, but I'd rather wait until the integration is simplified. I'm very confident that they'll come up with more "convenience classes" that make this a breeze. So far I'm treating it a performance proof of concept for my game until it's more "final" :)

    FYI: Performance wise I can get 400 models (≈1M tris total, unlit, no shadows) to animate on Android. 40 FPS on a Pixel XL (3.5year old flagship phone) and >90 FPS on a Pixel 4 XL (current flagship phone):
    74304866-11688000-4d13-11ea-9d7b-a45ad68154bc.png 74304870-12011680-4d13-11ea-8345-273f62dd4e65.png
     
  6. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    I downloaded a character and an animation from mixamo, follow example scene's instructions carefully. But my character is not running animation. BoneRendererComponent shows character's bones are in animation's starting state (but animation is not playing) and actually character is in T Pose. As you can see in following image.
    animation rig.PNG
    There is no error in console log, although there are some warnings. animation logs.PNG

    I didn't found SceneIDMap game object in scene and also in character.
     
  7. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Hm, there should be 2 components on your prefab where you reference all bone transforms. Looks like you might have done that for only one of them?
     
  8. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Are you using a shader graph that has the Linear Blend Skinning node in it (or an equivalent handmade shader that uses the _SkinMatrices buffer)?
     
  9. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    I'm using a very simple Shader Graph modeled after the HDRP one from the github project.

    73720230-53bc0c80-46d6-11ea-8bf9-6c77b91557d5.png

    (Sidenote: Is "PBR Master" the default "lit" shader master node in URP? (I'm pretty new to shaders and was wondering what the most efficient master node would be or if the compiler strips away all the unused stuff automatically :rolleyes:?)
     
    florianhanke likes this.
  10. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    I already added both RigComponent and BoneRenderComponenet on character prefab and passes all bones' transforms to it.
    animation rig highlighted.PNG
    And on skin of character I also already added SkinnedMesh.
    animation skin.PNG
    But animation is not running. Instead in play mode bones are in animation's starting pose and character is in T-Pose (As you can see in the reference image which I posted in previous reply.)
     
  11. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Is the
    Beta_Joints_MAT
    using the shader graph I posted above?
     
  12. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    No, I'm not using any shader graph. It is unity's default HDRP converted shader
    HDRP/Lit
     
  13. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    That's your issue, you material uses a specific shader that takes "bones" into account via the LinearBlendSkinning node :)
     
  14. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    Thank you very much. Now animation is running fine.

    I have few more questions about new animation pack.
    1. Animation on character runs when character is generic (In FBX settings), Animation is not running when character is Humanoid. Is animation only run when character is generic or I'm missing something more?
    2. When we can able to use unity's old animator component in dots? Or Unity is planing to change it?
     
  15. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
  16. ProceduralCatMaker

    ProceduralCatMaker

    Joined:
    Mar 9, 2020
    Posts:
    108
    Thanks, this was useful to get a tecture mapped character. Actually instead of a PBR master I used a LitMaster, as they also do in DOTSSample where you can see a texture Mapped Terraformer using Animation Package, but with a much more complex shadergraph.
    I take the Bone Index and Texture2D as inputs, Runs fine on my characters with their textures. upload_2020-4-24_15-30-20.png
    If someone wants more complex effects, reference DOTSsample shadergraph and get ready for an amusing experience.
    For samples like these it would be useful a KISS /Keep It Simple Stupid) approach. ECS and DOTS are quite a change, and the complexity of DOTSsample is overwhelming for most people without a masochistic hacking attitude like some of us here.
     
    Last edited: Apr 26, 2020
  17. patSilva

    patSilva

    Joined:
    Mar 25, 2019
    Posts:
    27
    No Idea what I am doing wrong here, I cannot get my mesh to match the bone renderer and the bone renderer is not running the animation. I followed what I thought was everything I should do to get it running but below is a screen shot of the result. For a little more Context before explaining the image; The Goblin is a model from the Unity Asset Store and works in a non-ECS environment.

    Image Details:
    Game View (Top left) is a snapshot of the left animation running. The Graph view (Bottom left) is the shader graph that all skinned meshes are using. The Hierarchy window just has four objects selected that are being displayed in the four Inspector windows beside it. The Rig Component's bones and bone renderer bones are identical to show where they should be. The model has three skinned mesh renderers; one for the goblin itself, and two for the props on him. Each of these are displayed in the remaining three inspector windows.

    Editor Screen Shot.jpg

    Anyone have any ideas where I went wrong?
     
  18. ValiantTechStudios

    ValiantTechStudios

    Joined:
    May 10, 2020
    Posts:
    7
    Hi nicolasgramlich,
    Any chance you could tell us how this performance compares to the same scenario using your "standard" animation mechanism, I assume either UnityEngine.Animator or UnityEngine.Animation?
    Thanks
     
  19. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    In my early prototypes I gave up very quickly trying to use built in animations. You'll never get there. There are some asset packs that allow for gpu skinning

    And for comparison: 882 individually animated units at 120 FPS in the editor on my laptop (thermal throttling to 2GHz...thanks Apple) with all the jobs/burst debug bells and whistles enabled:

    Adding more units scales absolutely phenomenally <3 :cool:

    upload_2020-11-21_23-48-26.png
     
  20. Sobirux

    Sobirux

    Joined:
    Apr 2, 2019
    Posts:
    6
    I am facing an issue with the dots animation package. I have followed the unity animation sample and imported the character in my own project. The editor is showing the animation fine, but when I make a build (Windows x86_64) and run the game, no animation is shown and it just displays the character in T-pose. Has anybody experienced this? Any idea what might be different in the build version?
     
    Last edited: Jan 20, 2021
  21. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    need to use subscenes with animation if you arent already. animation conversion doesnt work in builds yet.
     
    Sobirux likes this.
  22. Sobirux

    Sobirux

    Joined:
    Apr 2, 2019
    Posts:
    6
    Aah, that was the part I was missing. Thank you very much.