Mesh from MagicaVoxel cast a strange holed shadow

I have a problem with any mesh I import from MagicaVoxel into Unity. As you can see from the screenshot below, the mesh on the left cast a shadow that has holes in it. That’s a basic 7-voxel mesh exported as OBJ and dragged into Unity. The light is the standard directional light Unity automatically creates in an empty scene. The glitch occurs in scene editor, preview and exported builds, I tried on multiple PCs as well.

alt text

The mesh on the right is a cube extruded on all faces created in Blender and exported as 3DS. As you can see from the wireframe, it is basically the same mesh, but its shadow looks good. Note that if I import the MagicaVoxel’s OBJ in Blender first, and then I export in 3DS and into Unity, the shadow stays holed, so it’s not a problem with the mesh format, but with something in the mesh itself.

What can it be? Can I solve it somehow or try some others approaches? Thank you.

I’m pretty sure it’s because the vertices aren’t shared on the left hand model, on the right the normals look to be smoothed which would indicate they are.

There’s no absolute fix but fiddling with the bias on the light should help reduce the gaps.

As a (less than ideal) workaround you can also change the shadow casting mode to two sided, which generally means the back face will cover up any seams - it’s not perfect but it makes it much more rare.

turn your light’s normal bias to 0