Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need a Universal Render Pipeline Version Animation Sample!!!Thank you !!! #1

Closed
cdm456852 opened this issue Dec 11, 2019 · 30 comments

Comments

@cdm456852
Copy link

I need a Universal Render Pipeline Version Animation Sample!!!Thank you !!!

@nicolasgramlich
Copy link

nicolasgramlich commented Jan 21, 2020

I managed to port it over to the Universal Render Pipeline with limited success after eventually finding a package combination that works and several (voluntary and involuntary) Unity restarts, to convince the compiler that the scripts are correct! 🕺

Unity Version: 2109.3.0f5
Packages:

{
  "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.ads": "2.0.8",
    "com.unity.analytics": "3.3.4",
    "com.unity.animation": "0.2.16-preview.5",
    "com.unity.burst": "1.2.0",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.ide.rider": "1.1.4",
    "com.unity.ide.vscode": "1.1.3",
    "com.unity.jobs": "0.2.3-preview.9",
    "com.unity.render-pipelines.universal": "7.1.7",
    "com.unity.rendering.hybrid": "0.3.2-preview.17",
    "com.unity.test-framework": "1.1.9",
    "com.unity.test-framework.performance": "2.0.6-preview",
    "com.unity.textmeshpro": "2.0.1",
    "com.unity.timeline": "1.2.9",
    "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"
  }
}

Limitations:

  • Currently unlit only (I've never used Shader Graph before, so I converted the Basic_Vertex_Skinning.shadergraph to an unlit version)
  • All meshes seem to animate "in sync" and can't figure out for my life why that is :'(
    • I was able to get them to animate "out of sync" when "dropping in" my assets to the HDRP TwoClipsAndMixer example, but not in my own project.
  • Still no texturing (See A textured examples would be useful #2)
  • Big problems getting things to render properly (or at all) outside of the Unity itself (Mac/Android)

The frustration is steadily growing, mostly due to the slow turnaround time and Unity crashes bugs with the beta 2109.3.0f5 and the preview packages. So I'll probably give up for now until things mature a little more :)

Big thanks for creating these examples in the first place btw! @oldio

image
image

@oldio
Copy link
Contributor

oldio commented Jan 24, 2020

Hi and thanks for the comments/feedback.

A URP pipeline is in the works but as specified in the README the current version only works with HDRP. There's a bit of work to do on our side to support instanced skin matrices for GPU skinning in URP.
Otherwise duly noted, we can definitely provide an example with texturing next time around. This is actually something you can already do in the shading graph by passing in a proper color coming from a texture. There's a few tutorials related to the shader graph you can follow for help:
https://www.youtube.com/watch?v=V5XFrIhLpGQ
You just need to make sure that the vertex data (positions/normals/tangents) are coming from the linear blend skinning node.

Again, this is an early preview of Dots.Animation, we know the API is still a bit rough but our goal is to make things a lot more simple to do in the near term.

@cdm456852
Copy link
Author

Hi and thanks for the comments/feedback.

A URP pipeline is in the works but as specified in the README the current version only works with HDRP. There's a bit of work to do on our side to support instanced skin matrices for GPU skinning in URP.
Otherwise duly noted, we can definitely provide an example with texturing next time around. This is actually something you can already do in the shading graph by passing in a proper color coming from a texture. There's a few tutorials related to the shader graph you can follow for help:
https://www.youtube.com/watch?v=V5XFrIhLpGQ
You just need to make sure that the vertex data (positions/normals/tangents) are coming from the linear blend skinning node.

Again, this is an early preview of Dots.Animation, we know the API is still a bit rough but our goal is to make things a lot more simple to do in the near term.

Can you tell us the exact release time of this urp animation? Like One week later or one month later.

@nicolasgramlich
Copy link

nicolasgramlich commented Feb 4, 2020

After dipping my toes into Shader Graph the other week, I was able to get a textured example in URP to work (literally just had to hook in that texture).

image

On my Macbook I can get ≈2500 Units to animate (simple lit, physics bodies (cylinders), no shadows, 1M triangles, SRP Batcher disabled, Dynamic Batching enabled (but doesn't seem to work)) at 30FPS in the Editor (probably some more when building the actual app)
Screen Shot 2020-02-03 at 10 38 07 PM

(Closeup with shadows enabled)
Screen Shot 2020-02-03 at 10 39 04 PM

Poking around in the Entity Debugger it looks like every single rig is animated separately, they just happen to be "in sync" because they start at exactly the same time.
Screen Shot 2020-02-03 at 10 38 14 PM

My machine:
image

Android

Pixel XL (2016 flagship phone)

30 FPS with 400 units, simple lit, physics bodies (cylinders), no shadows
Screenshot_20200203-234938

Pixel 4 XL (2019 flagship phone)

Going to test on this one tomorrow, but pretty sure I can get 90 FPS :)

Overall I'm happy with the performance :)

@cdm456852
Copy link
Author

After dipping my toes into Shader Graph the other week, I was able to get a textured example in URP to work (literally just had to hook in that texture).

image

On my Macbook I can get ≈2500 Units to animate (simple lit, physics bodies (cylinders), no shadows, 1M triangles, SRP Batcher disabled, Dynamic Batching enabled (but doesn't seem to work)) at 30FPS in the Editor (probably some more when building the actual app)
Screen Shot 2020-02-03 at 10 38 07 PM

(Closeup with shadows enabled)
Screen Shot 2020-02-03 at 10 39 04 PM

Poking around in the Entity Debugger it looks like every single rig is animated separately, they just happen to be "in sync" because they start at exactly the same time.
Screen Shot 2020-02-03 at 10 38 14 PM

My machine:
image

Android

Pixel XL (2016 flagship phone)

30 FPS with 400 units, simple lit, physics bodies (cylinders), no shadows
Screenshot_20200203-234938

Pixel 4 XL (2019 flagship phone)

Going to test on this one tomorrow, but pretty sure I can get 90 FPS :)

Overall I'm happy with the performance :)

I just did it all over again with what you described,But it did not work,Can you describe the whole process more specifically?

@nicolasgramlich
Copy link

I just did it all over again with what you described,But it did not work,Can you describe the whole process more specifically?

Hm, what's not working? How I got it to work initially is basically opening my project and this one next to each other and comparing every single component and values side-by-side until the errors were gone.

Do you have a screenshot of what's not working for you rn? I'll try to respond in a timely manner :)

@oldio
Copy link
Contributor

oldio commented Feb 11, 2020

After dipping my toes into Shader Graph the other week, I was able to get a textured example in URP to work (literally just had to hook in that texture).

image

On my Macbook I can get ≈2500 Units to animate (simple lit, physics bodies (cylinders), no shadows, 1M triangles, SRP Batcher disabled, Dynamic Batching enabled (but doesn't seem to work)) at 30FPS in the Editor (probably some more when building the actual app)
Screen Shot 2020-02-03 at 10 38 07 PM

(Closeup with shadows enabled)
Screen Shot 2020-02-03 at 10 39 04 PM

Poking around in the Entity Debugger it looks like every single rig is animated separately, they just happen to be "in sync" because they start at exactly the same time.
Screen Shot 2020-02-03 at 10 38 14 PM

My machine:
image

Android

Pixel XL (2016 flagship phone)

30 FPS with 400 units, simple lit, physics bodies (cylinders), no shadows
Screenshot_20200203-234938

Pixel 4 XL (2019 flagship phone)

Going to test on this one tomorrow, but pretty sure I can get 90 FPS :)

Overall I'm happy with the performance :)

Great work @nicolasgramlich ! Although I think you might be taking a performance hit because you may not go through the GPU instancing pipeline. To answer your question, we are planning on making a URP experimental skinning pipeline available around GDC. Hopefully you can put your hands on it then.

Note that we also just pushed another update (0.3.0-preview.7), this has quite a few improvements namely better dots component integration with our animation graph evaluator and a data layout that is more SIMD friendly. This should translate better performances overall.

@nicolasgramlich
Copy link

Great work @nicolasgramlich ! Although I think you might be taking a performance hit because you may not go through the GPU instancing pipeline. To answer your question, we are planning on making a URP experimental skinning pipeline available around GDC. Hopefully you can put your hands on it then.

Awesome, that's barely a month away. I can't wait! :)

Note that we also just pushed another update (0.3.0-preview.7), this has quite a few improvements namely better dots component integration with our animation graph evaluator and a data layout that is more SIMD friendly. This should translate better performances overall.

I'll check it out later and see if performance changed!

@nicolasgramlich
Copy link

nicolasgramlich commented Feb 12, 2020

@oldio I just checked out the repo. Great work on restructuring the examples, that'll help a lot of people! 👏 (@cdm456852 check out the MyFirstAnimationClip example! )

For my project it was basically a drop in replacement, which was nice :)

Regarding performance (in the editor, I'll check on Android later): It seems about roughly the same.
I'll also try to make a direct comparison, with only animations (no physics, no custom systems enabled) :)

@nicolasgramlich
Copy link

@oldio how would I figure out the GPU instancing issue you raised?

Also here the new performance benchmark on 0.3.0-preview.7:

Pixel XL (≈40FPS)

Screenshot_20200211-210223

Pixel 4 XL (>90FPS)

Screenshot_20200211-210244

@cdm456852
Copy link
Author

@oldio I just checked out the repo. Great work on restructuring the examples, that'll help a lot of people! 👏 (@cdm456852 check out the MyFirstAnimationClip example! )

For my project it was basically a drop in replacement, which was nice :)

Regarding performance (in the editor, I'll check on Android later): It seems about roughly the same.
I'll also try to make a direct comparison, with only animations (no physics, no custom systems enabled) :)

Thank you so much,But what I wanted to say is that I need a Universal render pipeline version of Animation system Not a HDRP version,Can you help me?

@nicolasgramlich
Copy link

The only thing you really need to add for "URP support" is the URP compatible shader from above :)

To make it work in your own project, copy these files to your project: https://github.com/Unity-Technologies/Unity.Animation.Samples/tree/14ece9d3c953cc32c2c0f2ae196140a4ae80455c/UnityAnimationHDRPExamples/Assets/Scripts/Common (you don't need all of them, but copy all of them for simplicity).

In order to help you need to be more specific on what's not working.

To originally get it working in my project took me more time than I'm willing to admit :)

For cross reference there is also a thread developing here: https://forum.unity.com/threads/animation-documentation.818892/#post-5472981

If I have the time, I'll fork this project and make a crude, working and highly unofficial URP example 🙈

@cdm456852
Copy link
Author

The only thing you really need to add for "URP support" is the URP compatible shader from above :)

To make it work in your own project, copy these files to your project: https://github.com/Unity-Technologies/Unity.Animation.Samples/tree/14ece9d3c953cc32c2c0f2ae196140a4ae80455c/UnityAnimationHDRPExamples/Assets/Scripts/Common (you don't need all of them, but copy all of them for simplicity).

In order to help you need to be more specific on what's not working.

To originally get it working in my project took me more time than I'm willing to admit :)

For cross reference there is also a thread developing here: https://forum.unity.com/threads/animation-documentation.818892/#post-5472981

If I have the time, I'll fork this project and make a crude, working and highly unofficial URP example 🙈

Thank you so much,I will try it later!!

@JCBuck
Copy link

JCBuck commented Feb 20, 2020

I presume this is still an issue with instancing with skinned mesh rendering in URP. I read somewhere that URP support is coming soon.

I've ported over the simple HDRP shadergraph to URP with PBR instead and it results in these deformities.
image

funny enough even the material preview is being shifted around as the animation is running in the editor

image

@ulti-killer
Copy link

Great work @nicolasgramlich ! Although I think you might be taking a performance hit because you may not go through the GPU instancing pipeline. To answer your question, we are planning on making a URP experimental skinning pipeline available around GDC. Hopefully you can put your hands on it then.

Note that we also just pushed another update (0.3.0-preview.7), this has quite a few improvements namely better dots component integration with our animation graph evaluator and a data layout that is more SIMD friendly. This should translate better performances overall.

Hi @oldio. Does URP experimental skinning pipeline optimized for mobile platform?

@segant08
Copy link

segant08 commented Mar 14, 2020

Hi i could managed to do with urp too. Gpu instancing works with it. But when bone count is too high. I takes lots of time to start. I think gdc is near. If it'll work with srp without problem i will use it for spectators. And is there a custom lod system for this? And how can i offset animation with PerformanceTestGraph? If i want offset for every single entity, is it possible or should i need different scenes for some offset groups? I will just use it for spectators. On some devices i get this error "The number of vertex shader storage blocks (1) is greater than the maximum number allowed (0)." Is there any chance with mali gpu? As i read in arm forum may be this helps to you. If you offset every vertex with vertex index in shader than i have done it with mali gpu. here video but just used float3 array for positions.

I found this line in unity linear blend skinning node
sb.AppendLine("uniform StructuredBuffer _SkinMatrices;");
i think old gpus are capable of differents float arrays. we know that vertex id in shader. So in shader if we can set all normals tangents offsets positions as differents arrays we can support old gpus and mali gpus. But this may be slower but there should be an option to enable it.

https://www.youtube.com/watch?v=uEqtzW2zs_c
https://community.arm.com/developer/tools-software/graphics/f/discussions/13645/can-a-mali-g71-use-a-ssbo-in-a-vertex-shader

@cdm456852
Copy link
Author

The only thing you really need to add for "URP support" is the URP compatible shader from above :)

To make it work in your own project, copy these files to your project: https://github.com/Unity-Technologies/Unity.Animation.Samples/tree/14ece9d3c953cc32c2c0f2ae196140a4ae80455c/UnityAnimationHDRPExamples/Assets/Scripts/Common (you don't need all of them, but copy all of them for simplicity).

In order to help you need to be more specific on what's not working.

To originally get it working in my project took me more time than I'm willing to admit :)

For cross reference there is also a thread developing here: https://forum.unity.com/threads/animation-documentation.818892/#post-5472981

If I have the time, I'll fork this project and make a crude, working and highly unofficial URP example 🙈

So there is still no timeline for the dots animation support of the universal render pipeline.
I am very sad because it's been a very long time since the last time that they said they will support the urp render pipeline very soon.

@nicolasgramlich
Copy link

So I finally took a stab at this again. After almost giving up trying to find out why all the meshes were "in sync" despite having individually animating bones. It would look something like this:
Screen Shot 2020-05-10 at 10 13 13 PM

Turns out all you have to do to fix it is turn on Enable GPU Instancing wherever you use that material:
Screen Shot 2020-05-10 at 10 09 49 PM

And as you can see the problem has been solved and the meshes are now in sync with their individual bones :)

Turns out @oldio pushed that change after me cloning the repo dd68f2c 🙈 🙃 😱

Note: This is all HDRP and I'll give it a shot on URP 🙏

@nicolasgramlich
Copy link

nicolasgramlich commented May 11, 2020

Sidenote: 2000 animated meshes ("In Sync", due to lack of GPU instancing for URP) on an iPhone XR @ 60 FPS . So all i want for Christmas is URP GPU Instancing 🙏 😄

D8A73A6D-6013-4D97-99CA-3AC6197D6CF0

@nicolasgramlich
Copy link

No luck with URP 😭

@oldio I'm kindly asking if there any news? 🙏 (good or bad news, we can handle it)

Oh and if you could make a recommendation if we should switch to 2020.x to use this package with URP, let us know 😄

@cdm456852
Copy link
Author

After dipping my toes into Shader Graph the other week, I was able to get a textured example in URP to work (literally just had to hook in that texture).
image
On my Macbook I can get ≈2500 Units to animate (simple lit, physics bodies (cylinders), no shadows, 1M triangles, SRP Batcher disabled, Dynamic Batching enabled (but doesn't seem to work)) at 30FPS in the Editor (probably some more when building the actual app)
Screen Shot 2020-02-03 at 10 38 07 PM
(Closeup with shadows enabled)
Screen Shot 2020-02-03 at 10 39 04 PM
Poking around in the Entity Debugger it looks like every single rig is animated separately, they just happen to be "in sync" because they start at exactly the same time.
Screen Shot 2020-02-03 at 10 38 14 PM
My machine:
image

Android

Pixel XL (2016 flagship phone)

30 FPS with 400 units, simple lit, physics bodies (cylinders), no shadows
Screenshot_20200203-234938

Pixel 4 XL (2019 flagship phone)

Going to test on this one tomorrow, but pretty sure I can get 90 FPS :)
Overall I'm happy with the performance :)

Great work @nicolasgramlich ! Although I think you might be taking a performance hit because you may not go through the GPU instancing pipeline. To answer your question, we are planning on making a URP experimental skinning pipeline available around GDC. Hopefully you can put your hands on it then.

Note that we also just pushed another update (0.3.0-preview.7), this has quite a few improvements namely better dots component integration with our animation graph evaluator and a data layout that is more SIMD friendly. This should translate better performances overall.

Hi, Can you share your project to me, I tried multiple times with URP, But all of them failed,I am very interested in your example with URP and texture.

@nicolasgramlich
Copy link

@oldio any news for us 🙏 :)

@Snow-Okami
Copy link

Yes, also wondering on news of URP as it has been several months now.

@cdm456852
Copy link
Author

Yes, also wondering on news of URP as it has been several months now.

But it seemed the author of this example did not want to care about our question Because they never reply us, And this example has not been updated for 7 months,I am very disappointed about the author of this example.

@oldio
Copy link
Contributor

oldio commented Sep 15, 2020

It's not because we do not care - that couldn't further from the truth.

The main reason for delaying updates has been mostly motivated by how unstable the code base has been these past few months and we did not want to expose our users to such churn. One point to note is that rendering aspects are not dictated by one sole team but a coordination of multiple packages working together. Fortunately we are now able create a workable URP project and one of our goals this sprint is to update these samples to add a URP project to the mix. It will at most contain only a small set of samples but the difference in setup between URP/HDRP is minimal (i.e. materials need to be recreated in the appropriate format). Unfortunately I can't promise an ETA right now but this repo should be updated soon to reflect all the work that has been done in the past few months.

@cdm456852
Copy link
Author

It's not because we do not care - that couldn't further from the truth.

The main reason for delaying updates has been mostly motivated by how unstable the code base has been these past few months and we did not want to expose our users to such churn. One point to note is that rendering aspects are not dictated by one sole team but a coordination of multiple packages working together. Fortunately we are now able create a workable URP project and one of our goals this sprint is to update these samples to add a URP project to the mix. It will at most contain only a small set of samples but the difference in setup between URP/HDRP is minimal (i.e. materials need to be recreated in the appropriate format). Unfortunately I can't promise an ETA right now but this repo should be updated soon to reflect all the work that has been done in the past few months.

Hi! Thanks for your reply, I am so glad to hear the news about the next release, Especially for the URP support, You said that this example will be updated soon, So Can I assume the next update will come before the end of this month?

@nicolasgramlich
Copy link

@cdm456852 he specifically said there is no ETA right now, so let's be patient hopefully just a little longer 🙏

@oldio The community really appreciates the response. What we were "upset" about is not really the lack of "code updates" but simply updates on the general state of the package. There are delays and things always take longer (we're all just as guilty of that), but the difference is being left in the dark and an update just like the one you did "Things are taking longer. There is no ETA right now." is all we've been asking for :)

That being said, we're all very excited about the URP support, even if it's just minimal :)

@oldio
Copy link
Contributor

oldio commented Nov 1, 2020

URP project is now provided in the last sample update.

@oldio oldio closed this as completed Nov 1, 2020
@jackylong
Copy link

niu b

@ajc-software-ltd
Copy link

ajc-software-ltd commented Jul 8, 2022

com.unity.animation 0.9.0 will work with com.unity.rendering.hybrid upto 0.11.0.preview.44 and only work upto 2021.1.28f1 , I have tested 2021.2.0 it failed with a graph foundation error.
I hope this helps people trying builds to get the animation system working.
image

image

advised you add ENABLE_COMPUTE_DEFORMATIONS into your project settings under player
then Go to the Unity Project's directory, open Library, and delete the ShaderCache directory
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants