Unity-Technologies / Unity.Animation.Samples

Repository of projects that showcase the new DOTS animation package (com.unity.animation).
Other
418 stars 77 forks source link

Shader for built in rendering #4

Open gamemachine opened 4 years ago

gamemachine commented 4 years ago

I'm sure someone else besides us would like to make this work in built in. It's simple enough. This is a shader that works:

https://gist.github.com/gamemachine/2fe6e1f919f6fa6cf5b20eb942ddc0da

You will have to use Graphics.DrawMeshInstanced yourself though, Hybrid Renderer uses the new BatchRenderGroup which isn't passing instanced data to builtin correctly.

BoneIndexOffset has the offset you need for the instanced shader prop. If you just disable the SkinnedMeshRenderer component that prevents the hybrid renderer from picking it up. Fairly straight forward.