- Home /
How to reduce draw call when use skinned mesh, one material but has multiply copy?
I know combine mesh to 1 material can reduce draw call. Now I have one skinned mesh ,is a man model and his bones.It has only 1 material and only 1 draw call.I copy it to 10 instance,and now display 10 draw calls. Is there idea to reduce to 1 draw call,when i copy it 10 times?
$$anonymous$$y mode has only 600 tris and 523 verts,only one diffuse shader. But Dynamic batching not work to it.I don't know why.
Answer by rutter · Feb 21, 2014 at 02:22 AM
From the manual: Draw Call Batching
Only objects sharing the same material can be batched together.
...
If you need to access shared material properties from the scripts, then it is important to note that modifying Renderer.material will create a copy of the material. Instead, you should use Renderer.sharedMaterial to keep material shared.
...
Currently, only Mesh Renderers and Particle Systems are batched. This means that skinned meshes, cloth, trail renderers and other types of rendering components are not batched.
I know that's what the doc says but I was sure it got added in 4.1. Can't find the reference however.
That said it will only batch 180 verts if the model has normals etc.
as rutter said: Currently, only $$anonymous$$esh Renderers and Particle Systems are batched. This means that skinned meshes, cloth, trail renderers and other types of rendering components are not batched.
$$anonymous$$y mesh is skinned meshes,and only diffuse material,so is there any way to reduce draw call? $$anonymous$$y game have 100 man in model,how can I do?
Answer by Kiloblargh · Feb 21, 2014 at 06:03 AM
Do a 2-camera LOD setup where the near camera renders from foreground to [whatever] units and the far camera renders from [whatever] to background. Put a skinned mesh renderer on a layer that the close camera renders and separate jointed body parts on a layer that the far camera renders. This will reserve the draw calls for where they're needed most.
You can also do something with SkinnedMeshRenderer.Bakemesh
; which the docs are no help at all in explaining, so I don't know what to do with it either.
Answer by whydoidoit · Feb 21, 2014 at 06:29 AM
You can make all of those SkinnedMeshes a single draw call but it is difficult.
Basically you can combine all of the meshes together yourself and apply the bone weights then merge the bones from the models into the new SMR and delete the renderers on the individual objects. In this way all of the animations and movements will work - however, adding and removing things from this big mesh is going to be cumbersome. I use this approach for crowd scenes where I know the people are close together and they don't need to be destroyed.
Answer by vfxjex · Aug 06, 2020 at 08:56 PM
have you tried this option for batching a skinned mesh instancing? https://blogs.unity3d.com/2018/04/16/animation-instancing-instancing-for-skinnedmeshrenderer/
Your answer
