UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

graphics

[Lighting] Resolving Shadow Acne and Dark Lines on Meshes

Solution

lightingrenderingfbxvisuals

Unity 2021.3.x - Unity 6.3.x

Published Tue, Mar 24

Issue

 When importing 3D models into Unity from external modeling software such as Blender, dark lines may appear along the edges of the mesh, often coinciding with quad boundaries.

Initial attempts to correct this by applying smoothing groups in the source software or modifying normal generation settings in your FBX import settings typically do not resolve the issue.

Quick-Fix

Dark lines appearing on imported 3D models are typically resolved by adjusting the Depth Bias and Normal Bias properties of the Light component to eliminate shadow acne.

Expand Analysis

The occurrence of dark lines on imported 3D models is frequently linked to inaccuracies in how shadows are cast and rendered. This visual anomaly is mitigated by fine-tuning the Depth Bias settings on the primary light source to prevent self-shadowing artifacts.

To resolve this issue:

  1. Select the Directional Light GameObject in the hierarchy.
  2. Locate the Light component in the Inspector panel.
  3. Under the shadow settings section, locate the Depth Bias and Normal Bias properties.
  4. Incrementally increase the Depth Bias value while observing the scene view to find the minimum value that clears the artifacts.
  5. Adjust the Normal Bias property to resolve artifacts on curved surfaces or sloped geometry without causing shadow disconnects.

Additional Tips

  • Excessive Depth Bias can cause “peter-panning,” where shadows appear to float away from the base of your mesh.
  • If using the Universal Render Pipeline, ensure the shadow resolution in your pipeline asset is sufficient to support fine-tuned bias settings.
  • Shadow acne is often more prominent on meshes with large, flat surfaces and low polygon counts; increasing geometry density can sometimes reduce the required bias.

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.