Many of you might be used to using the old Klak/MidiJack libraries for midi input into Unity, however they're getting a little long in the tooth now & Unity has changed up its input system to supposedly be more flexible & modern. The new midi input library is called Minis, I'm pretty sure it's short for Midi New Input System.. but that doesn't really matter :D There isn't a whole lot of easy-to-understand documentation on how to use it in scripts, so I thought I'd share what I'd figured out through digging around Keijiro's example files. I'm kind of assuming you know how to use the Input Action menu - as it would seem you don't even need it, for the method I'm about to show you... In any case if you do setup some midi inputs there (or indeed any other kinds of inputs - and it seems like you can only setup simple single note button presses there? - you would use code resembling this (following) to trigger things functions as you would ...
This is v. similar to the previous flocking post, only now we use a skinned & animated mesh & it's attached Animator component. Something to note, one instance of the prefab has to be in the scene, or it doesn't work (move it off camera or something). Also - the material that uses the surface shader , must have the GPU instancing enabled! That's what those if-checks are for! The gist of this is - we need to store the vertex animation into another buffer. The compute shader doesn't deal with this data at all - it is only concerned with the position/direction of each instance. It is the surface/vert-frag shader that will deal with it. The only bit the compute shader does increment is the "frame" of animation, which is determined by the speed at which the boid is moving. C# SCRIPT using System.Collections; using System.Collections.Generic; using UnityEngine; public class SkinnedFlocking : MonoBehaviour { public struct Boid { ...
EDIT - I think.. it is best to have a standard FK hierarchy and multiple Rig Builders, which each exist one bone above the root of each 2 joint IK chain. Eg. the clavicle would have the rig builder and the L_HAND in my example below would sit underneath it. |- CLAVICLE | | -SHOULDER | | | -ELBOW | | | | -HAND | |-runtime rig, containing the 2 bone IK & rig components This hierarchy allows the clavicle to rotate and behave as it should in "standard" rigs. ------------------------------------------------------------------------------------------------------------------ At time of writing, Trump just got beaten by Biden! Good times.... and Unity 2020 has an "in preview" rigging package, which lets us implement simple IK setups. Now there are some third party commercial plugins we could look at - Final IK is probably the top...
Comments
Post a Comment