Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
4 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
1
Question by hsnzkg · May 07 at 08:28 AM · shaderrenderingoptimizationcullingskinnedmeshrenderer

Unity Skinned Mesh Renderer & Rendering Optimization

I have been researching for a long time about how to run min 100-200 characters (skinned mesh) on mobile in an optimized way.

Ways i tried:


  • Animation Instancing

  • LOD

  • Decimating Meshes (3000-6000 tris max I got)

  • Culling

  • Instanced blob shadows (just quads)

  • Simple Shaders (Just texture no extra things like mobile shaders)

  • Mipmaps


I don't have a problem with the code (2-3 ms max) 200-300 NPCs going around are just structs and a different mono behavior manipulates them.


But while trying all these, all the usability of the game almost disappeared thanks to the animation instance. I can't use Animator the way I want, animations have become pure torture.


And also in the SRP batcher, I guess it doesn't cover skinned mesh.

I'm very curious what you can suggest.


Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Pangamini · May 07 at 01:58 PM

You could try Vertex Animation Textures to allow instancing of animated characters, however I've been researching a similar problem recently (I even had a target of 200 characters), testes various techniques, evaluating their pros and cons... and ended up doing skinned meshes with animator. The triangle count was a bottleneck and instancing, SRP batches, dynamic batching, or any draw call reduction technique had basically no effect on the final FPS. Animator ended up being more performant than VAT, although not by much.


I convinced the art team to produce 500 triangle characters for the lower end devices, and it works.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hsnzkg · May 07 at 02:56 PM 0
Share

Actually, you're right, if I had an art team, iteration could be provided and intervened in this way, but it is very difficult on my own.

At the moment, I take ready-made asset packages and try to decimate them with some plugins and create my own lod's in Unity because they do not have lod's.

But this process becomes unbearable.

So today, for the last time, I'm going to combine and test the performance of the skinned meshes, combining and testing wave after wave of drops (for example, wave 1 combined with 100 characters)

I'm considering using Mesh Baker here, but the pros and cons of events in this method are still annoying.

I hope unity will soon release a method that will allow us to use these skinned meshes in a cheaper way, without destroying the usability of other methods like animator.

Also the package that I target with 200-300 character is this https://assetstore.unity.com/packages/3d/environments/fantasy/human-orcs-undead-elves-rts-mega-pack-170078

avatar image Pangamini hsnzkg · May 07 at 04:35 PM 0
Share

Baking or "cheaper way of using skinned mesh" won't hep you if your bottleneck is the same as mine, and that is triangle count. The only thing you can do is to reduce it, by reducing the number of characters or by decimating the meshes. Or, by incrementing your target hardware requirements, of course. Unfortunately, there are some situations where you can't have everything and have it for free.

One option, if viable for your game, would be to generate sprite sheets, do it the old fashioned way. The only reason why I didn't use sprite sheets for the project is that there's a lot of customizations and dynamic content and the sprite sheets would be either impossible to store on the device, huge to download, or take a very long time to generate at runtime. But if you can generate spritesheets offline, you could have many more characters on the screen while using the fraction of phone's power.

avatar image Pangamini hsnzkg · May 08 at 09:01 AM 0
Share

I suggest that you decimate the meshes regardless of the output quality, just to see the effect on performance in your case. Just use some quick method, be it ugly af. Find your bottleneck.

avatar image hsnzkg Pangamini · May 10 at 12:10 PM 0
Share

I found a solution this is the best on mobile
https://assetstore.unity.com/packages/tools/animation/mesh-animator-animate-massive-crowds-26009


More than 500 character limit to polygon tris count up to 1M it works 60 FPS. Also, I configured the pack shader a little bit for my own purposes and optimization.

Other solutions on animation instance theory might be a little bit buggy (texture creators, their own vertex shaders, etc.)

Also, I take a little bit trick on these repo's shader https://github.com/chenjd/Render-Crowd-Of-Animated-Characters

Lastly don't use real-time shadow just create an instanced shadow with quads and cull them

I hope it helps the others

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

228 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can the Cull option in shader improve perfomances ? 2 Answers

Eliminate CPU spike from shader load? 1 Answer

How to render one object on top of another in URP? 0 Answers

Make material always culled. 1 Answer

What are the best shaders for mobile platforms ? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges