The issue you're experiencing with the 2D light on your Spine objects in Unity using the Universal Rendering Pipeline/2D/Sprite-lit-default shader is likely due to the vertex-lit nature of the shader. This can cause certain parts of the object to receive less light than expected, especially when dealing with large attachment images or specific lighting conditions.
To mitigate this effect, you can try the following solutions:
Switch to a Pixel-Lit Shader: Use a pixel-lit shader such as Spine/Sprite/Pixel Lit
or any of the URP shaders specifically designed for Spine. This can provide more consistent lighting across the entire object.
Adjust Lighting Settings: Modify the lighting setup in your scene. Ensure that the light source is positioned and configured to provide even illumination across the entire object.
Increase Attachment Geometry: Add more vertices to the attachment geometry. This can be done by converting the RegionAttachment
to a MeshAttachment
, which allows for more detailed lighting calculations.
Check Normals and Tangents: Ensure that the normals and tangents are correctly set up for your Spine objects. This can affect how light interacts with the surfaces.
Here is an example of how to switch to a pixel-lit shader:
// Assign the pixel-lit shader to your material
Material material = new Material(Shader.Find("Spine/Sprite/Pixel Lit"));
yourSpineRenderer.material = material;
Additionally, you can refer to the Spine URP Shaders UPM package documentation