The parameter of the Graphics.DrawMeshInstanced "receiveShadows" is invalid in URP.

Unity 2019.3.5
Latest URP
When calling Graphics.DrawMeshInstanced in URP, objects always receive shadows regardless of whether “receiveShadows” is set to true or false.
But receiveShadows works well in Built-in Render Pipeline.
Is there any way to make receiveShadows work normally in URP?

When using URP, the “Receive Shadows” option is not available on renderers, and must instead be set via the Material.

Could it be this option is now completely useless on the mesh renderer component with SRP. Both URP and HDRP are not using this property. I think this highly confuses people.

Yep, that is correct. We’ve removed it from the UI when using URP and HDRP, but we cannot remove it from the scripting API as it might be used by code for the built-in render pipeline.

I’ve been unable to get “ReceiveShadows” to work using DrawMeshInstanced. I can use the exact same material and draw (Graphics.DrawMesh) in parallel to my DrawMeshInstanced but the instanced version does not receive a shadow in HDRP. Just using the default lit shader doesn’t seem to receive a shadow. Is there something else I need to do or is this a bug with HDRP and calling DrawMeshInstanced?

1 Like