Hi,
Apology for my bad grammar.I am not native English speaker.
I make a character with customize equipment (mix&match). Everything work fine.
And when i combine with outline shader. Using RenderExistingMesh.cs cause the outline mesh to not align correctly with the base mesh.(it magically flipped)
This is the code i use after customize skin.
private void RepackSkin()
{
var repackedSkin = new Skin("repacked skin");
repackedSkin.AddAttachments(skeleton.Data.FindSkin("01_basicSkin"));
repackedSkin.AddAttachments(customSkin);
if (runtimeMaterial != null)
Destroy(runtimeMaterial);
if (runtimeAtlas != null)
Destroy(runtimeAtlas);
repackedSkin = repackedSkin.GetRepackedSkin(repackedSkin.Name, sourceMaterial, out runtimeMaterial, out runtimeAtlas);
skeleton.SetSkin(repackedSkin);
var outlineMaterial = renderExistingMesh.replacementMaterials[0].replacementMaterial;
outlineMaterial.mainTexture = runtimeAtlas;
outlineMaterial.SetInt("_OutlineReferenceTexWidth", runtimeAtlas.width);
outlineMaterial.SetFloat("_OutlineWidth", runtimeAtlas.width / 256f);
}
Default outline.
After call RepackSkin.
Repack with custom skin.
I forgot to point out that i need help. I have no idea what I am doing is wrong.
If you need more clarity please ask for. I will try my best to explain.