problem with graphics.drawmesh casting shadows.

Hello,

I’m using the drawmesh call to render meshes. Works as I expect. The problem I am having is that I want the meshes to receive shadows but not cast them, by default they do appear to do both. I can’t work out how to change this. The manual says the following about drawmesh(): “The mesh will be affected by the lights, can cast and receive shadows and be affected by Projectors”, but it doesn’t say how to change the settings. Usually the shadow settings for the mesh are set up in the Mesh Renderer file:///C:/Program%20Files%20%28x86%29/Unity/Editor/Data/Documentation/Documentation/ScriptReference/Renderer-castShadows.html?from=MeshRenderer but drawmesh isn’t connected to a meshrender object (unless I am being dumb). Anyone know how to do this?

Anyone? Presumably there is a way to control this? So to recap how to do I chage hte shadow settings for meshes rendered using the drawmesh() function?

Found it! Turns out there are a couple of bools you can tag on the end of the function to control shadows. These are not mentioned in the manual anywhere. Would be good if they where :slight_smile:

Graphics.DrawMesh (scaledMesh,meshPosition,meshRotation,meshMaterial,meshLayer,thisCamera,submeshIndex,meshMaterialPropertyBlock,castShadows,receiveShadows);

1 Like