A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'General Graphics' started by lucaskargreen, Sep 20, 2020.
The Voxel character is solid, standard lighting settings pretty much
This is an artifact of a mesh with hard edges and Unity’s “normal bias”. There are three options I can think of to solve the issue:
1. Set your light’s Normal Bias to 0.0. You may have to increase the light’s non-normal Bias to compensate. Means worse peter panning (gaps between the shadow caster and the shadow) or more shadow acne (striped or boxy artifacts) or both. But it doesn’t require any more work.
2. Use two meshes, one for rendering what you see which is what you already have, and one that has smoothed normals that is for shadows only. Kind of a pain because now ever mesh needs a duplicate mesh, and you have to keep them in sync, but should solve the issue.
3. Use one smoothed normal mesh for both the rendering and shadow, but use a shader to do the flat shading instead of the vertex normals. May even render slightly faster as it can reduce the vertex count quite a bit. But doesn’t work on OpenGLES 2.0 devices if for some reason you were still planning on supporting those.
I found that going into the object's Mesh Renderer and setting "cast shadows" from 'On' to 'Two Sided' fixes the issue.
This can fix it, but isn't guaranteed, and will depend on the model. The gaps are still there, and will show up in some lighting angles, they're just hidden where the gaps in the front and back faces don't line up.