Search Unity

Code Generated Skinned Mesh With Bones Lighting Not Updating.

Discussion in 'General Graphics' started by GallopingGames, Jun 23, 2022.

  1. GallopingGames

    GallopingGames

    Joined:
    Mar 13, 2013
    Posts:
    26
    Hi there Experts.

    I'm creating a skinned mesh from a C# script adapted from the script Example in the Unity Docs. I am moving a bone around which moves two points on a quad. The angle of the quad mesh is altered correctly BUT the lighting does not update to reflect the changes made to the mesh by the bone.

    I have tried mesh.RecalculateNormals() and mesh.RecalculateTangents per update / lateUpdate, but the quad remains lit as per the original mesh before the bone was translated.

    Rotating the whole root gameObject changes the lighting on the quad, but moving the mesh quad vertices via the bone does not change the lighting.

    Same problem in Standard 3D shader and URP Lit Shader pipelines.

    Any suggestions?

    Many thanks!