Hi. I have a problem with phong tessellation and SkinnedMesh. When the scale of a bone is increased (in this case the head) the mesh gets distortion. To fix it you have to activate GPU Skinning, but unfortunately it is not working in version 5.5.0 Could someone give me information on why this problem or some way to solve it. Thank you very much. 5.4 Gpu Skining 5.5 Gpu Skinning
Was GPU skinning disabled for Unity 5.5 PC Platform? It no longer corrects this issue as described above.
you can fix this on the cpu side by using BakeMesh function, cloning the original mesh and then loop through the normals: clonedNormlas=originalNormals / bakedNormals.magnitude; where i is the index. and then set the cloned mesh as shared mesh of the skinRenderer and set this clonned mesh normals as "clonedNormlas". more info: https://feedback.unity3d.com/sugges...lization?_ga=1.100289181.248724783.1477350678
Hi tavovallejo, do you have a code snippet of this? Have worked very little with the BakeMesh function. Thanks.
Code (CSharp): public class SimpleNormalsMagnitudeFixer : MonoBehaviour { public SkinnedMeshRenderer m_renderer; Mesh m_baked; Mesh m_working; Mesh m_original; Vector3[] m_originalNormals; List<Vector3> m_DrawingNormals; void Awake() { m_original = m_renderer.sharedMesh; m_working = UnityEngine.Object.Instantiate<Mesh>(m_original); m_working.MarkDynamic(); //do not know if this is necessary m_baked = UnityEngine.Object.Instantiate<Mesh>(m_original); m_baked.MarkDynamic(); m_renderer.sharedMesh = m_working; m_originalNormals = m_original.normals; m_DrawingNormals = new List<Vector3>(m_originalNormals); } void LateUpdate() { //on every frame gona be slow //we need to bake the original m_renderer.sharedMesh = m_original; m_renderer.BakeMesh(m_baked); m_renderer.sharedMesh = m_working; //chage this to GetNormals on 5.6 var bakedNormals = m_baked.normals; for(int i = 0; i < m_originalNormals.Length; i++) { m_DrawingNormals[i] = m_originalNormals[i] / bakedNormals[i].magnitude; } m_working.SetNormals(m_DrawingNormals); } void OnDestroy() { m_renderer.sharedMesh = m_original; Destroy(m_baked); Destroy(m_working); } } you can see here http://answers.unity3d.com/questions/1197217/can-a-mesh-collider-work-with-an-animated-skinned.html, for guidance on a custom solution, that update only the changed bones instead of updating the entire mesh. to me its was very hard and time consuming to archive, but thats what i needed, becouse my bones gonna keep changing scale at runtime
Thanks tavovallejo, that did it. I hope they make normal normalization optional for GPU Skinning. I don't understand why this was removed in the first place
I am having this issue in 2019.2.10f. Has anyone found a solution that does not involve rebaking meshes at runtime (as the solution posted above does)? It feels like this shouldn't be happening in the first place.
Actually, I just figured it out. My FBX files were exporting from Blender with the scale wrong in such a way that every SkinnedMeshRenderer's Transform would have a default scale of (100,100,100). This seems to cause problems with any shader that uses GPU tessellation. I resolved it by exporting from Blender with "Apply Scalings" set to "FBX All", which caused everything to have a (1,1,1) scale in the FBX when I brought it into Unity.