Unity-Technologies / Animation-Instancing

This technique is designed to instance Characters(SkinnedMeshRender).
Other
1.65k stars 300 forks source link

useInstancing conflicts with packaging #33

Open gamemachine opened 6 years ago

gamemachine commented 6 years ago

If useInstancing is false, the system still packages data as if instancing should be used. Which results in not all meshes being rendered. If you have a mix of same and not same meshes, with useInstancing it's going to call DrawMeshInstanced for all of them. Not sure how much extra overhead that is.

On PC the simple fix is in Render instead of if (useInstance) do if (package.instancingCount > 1). But packaging needs to be aware of useInstancing to make it just work for all cases.

CloudJin commented 6 years ago

The flag useInstancing is used for OpenGL es 2.0. On OpenGL es 2 we can't use instancing, so I try to draw the characters on by one. But I didn't finish it because of some reasons, for instance I can't use RGBAHalf texture on OpenGL es 2.