I was finally able to resolve this problem, though the solution wasn’t as straightforward as I’d hoped it’d be. My idea was to copy skinned mesh vertex data from a non-simulating skeletal mesh with morphs to a simulating cloth asset:
Using a deformer graph I was able to read the verts and morph offset data from the (hidden) skinned mesh, and apply them to the simulated cloth asset. However initially this resulted in hard edges at the boundary of the skinned mesh region and the simulated region:
So I painted a smooth gradient on the skinned mesh with vertex color:
And in deformer graph read the influence/weight value of the red channel and used it to lerp between the skinned position and cloth position. Here’s the full HLSL:
bool AreEqual(float3 a, float3 b) {
return (a.x == b.x) && (a.y == b.y) && (a.z == b.z);
}
KERNEL
{
if (Index >= ReadNumThreads().x) return;
float3 LocalPosition = ReadPosition(Index);
float3 MorphDelta = SkeletalMesh::ReadDeltaPosition(Index);
float3 MorphedPosition = LocalPosition + MorphDelta;
float3x4 BoneMatrix = SkeletalMesh::ReadWeightedBoneMatrix(Index);
float3 SkinnedPosition = mul(BoneMatrix, float4(MorphedPosition, 1));
float3 ClothWeight = ReadClothWeight(Index) * SkeletalMesh::ReadInfluence(Index);
float3 ClothPosition = ReadClothPosition(Index) + MorphDelta;
float3 LocalClothPosition = mul(float4(ClothPosition, 1), ReadClothToLocal()).xyz;
float3 FinalPosition = lerp(SkinnedPosition, LocalClothPosition.xyz, ClothWeight);
if (!AreEqual(ReadPosition(Index), ReadClothPosition(Index)))
WriteOutPosition(Index, FinalPosition));
}
This gave a clean result when applying the morph data.
However there’s still the problem of collisions. The first issue is that cloth simulation collides with physics capsules, and morph targets do not update the position or scale of physics capsules. Translating/scaling bones however DOES update the collider associated with that bone. So the key is to use a combination of pose assets AND morph targets simultaneously, so you can get the detail from the morph target while also updating the bone positions to match the new shape. This will in turn ensure the colliders are in the correct position when the morph+pose is applied and therefore prevent clipping with the cloth asset.
But there’s another problem, and that is that capsule colliders alone don’t provide a satisfactory result in terms of both visual and preventing clipping with the cloth asset, at least they didn’t on my character.
So for a better collision result I added a kinematic collider to the cloth asset using a low-poly proxy mesh of my character. This video explains how. The neat thing is, since we are projecting the skinning weights from the character mesh to the low poly proxy mesh, the proxy mesh will also update its position and shape in accordance with morphs, since we are now also using pose assets to change the positions of bones when a morph is applied. This leads to an even better collision result since we’re using BOTH physics capsules that update with morphs AND a kinematic mesh that updates with morphs.
Suffice to say I will be marking this problem as resolved since the answer is clearly yes, deformer graphs can be used for the purposes of achieving cloth sim with morphs, it’s just a huge pain in the ■■■. But it does work!