Nanite mesh with WPO has shadow artifacts from Directional light

When a nanite mesh has a WPO material, it will have incorrect shadowing. When the mesh is changed to be non nanite it will have correct shadowing.

Steps to Reproduce
Open the map DisplaceTest and notice that the mesh is incorrectly shadowed in the dents. I suspect the shadow is calculated from the non WPO displaced mesh.

Can’t see the attachment I made - uploading again just to be sure

NaniteWPOShadow.zip(146 KB)

Hello,

Thank you for reaching out.

I’ve been assigned this issue, and we will be looking into these shadow artifacts for you.

Hello,

Nanite computes detail required based on the current view and as a result the streamed in geometry for the main pass and the shadow pass can differ. This can lead to errors if used with WPO and Heightmaps since there is an assumption of required detail with these approaches.

This mismatch can potentially result in shadows looking different depending on what the LOD error computation results in for the view.

A technique is to use the Shadow Pass Switch on the WPO, to specify a different WPO for the shadow pass that will not cause self-shadowing issues for nearby geometry. In your case, fixed {0,0,0} would solve the issue, as your Material always pulls the vertices up, which is closer to the light.

Please let us know if this helps.