So i'm doing some experiments in muscle simulation and one feature i'd like to have included (mainly for debugging) would be to see how much displacement is occurring based on vertex color
and example would be:
flex bicep, the peak of the bicep at its most flexed position would be bright yellow, and falloff to a dark red
something like this:
http://vimeo.com/19604678
I'm thinking something shader based, but perhaps there's a more programmatic approach if anyone has any ideas on where to start here.
Replies
How is your rig set up? And does it work in Unity already?
You can easily calculate the length of displacement from original to morphed position and pass that in to the vertex colour of the mesh (at the same time you're putting your morphs in).
rig is functional in unity, its a mix of joints and blend shapes.
two animations control the deformation, one for bending at the elbow, and another to control morphing. Both animations are synced to run on a simple gui slider that samples them.
Not quite sure how i'd go about transferring the displacement information into vertex coulor though