Shadows rendering incorrectly (displaced) with Instanced Static Meshes

Hi all,

I’m using a Blueprint class to generate a random maze. It has two instanced static mesh components, Floor and Walls, that each build a tiled-based maze depending on a given input size. However, as you can hopefully see from the pictures, the shadows are not correct - looking almost as if they’re displaced slightly, with the shadows from one wall peeking through under the next. Any thoughts?

Both instanced static components are set to Moveable, as they do not render at all if set to Static.

That looks like a bias issue. This is an inherent issue with shadow maps, although there are various methods you can use to reduce the effect such as:

  • Lower the max shadow distance
  • Raise the number of shadow cascades
  • Raise the shadow map resolution
  • Make the walls thicker
  • Adjust the shadow bias value

Or you could consider switching to either static lighting or raytraced shadows, depending on whether you need the lighting to stay dynamic.