- Select the large environment object(s) and uncheck “Receive Shadows” in MeshRenderer component. (Unity Terrain object doesn’t have “Receive Shadows” property, so you cannot use Unity Terrain object with shadow-map)
- Repeat steps from 3 to 11 for each shadow caster object.
- Create an empty game object and attach “LightProjector” component. You can find the script file in “FastShadowReceiver/Scripts/Projectors” folder.
- Assign the main light object to “Light” property of LightProjector component created at step 3.
- Assign the caster object to “Target” property of the light projector object.
- Specify “Target Bounds” of the LightProjector object so that the bounding box can enclose the caster object.
- Create an empty game object and attach one of the shadow receiver components. The scripts of shadow receiver components are located in “FastShadowReceiver/Scripts/Receivers” folder.
- Assign the LightProjector object created at step 3 to “Projector” property of the shadow receiver object created at step 7.
- Assign “MultiplyShadowMap” or “BlendShadowMap” material in “FastShadowReceiver/Materials” folder to MeshRenderer component of the game object created at step 7 (If you are using Universal RP, these materials are not available. Please use MultiplyShadowMapShader for URP instead.).
- Assign the large environment object to the shadow receiver:
- as “target” property , if you created InfinitePlaneShadowReceiver at step 7
- as “MeshTransform” property, if you created MeshShadowReceiver at step 7.
- set “Raycast Mask” to “Environment” layer (same layer as the environment object), if you created RaycastPlaneShadowReceiver at step 7.
For more details, see Setup Shadow Receiver section.
- If you created MeshShadowReceiver at step 7, you need to create a Mesh Tree, and set it to “Mesh Tree” property of MeshShadowReceiver component.
If no “Mesh Tree” has been set, and “Mesh Transform” property is set as described in step 10, you can find “Create a new MeshTree” button.
This button will open Create Mesh Tree Wizard. For more details, see Create a Mesh Tree section.