1. 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)
    InspectorUncheckReceiveShadow
  2. Repeat steps from 3 to 11 for each shadow caster objects.
  3. Create an empty game object and attach “LightProjector” component. You can find the script file in “FastShadowReceiver/Scripts/Projectors” folder.
  4. Assign the main light object to “Light” property of LightProjector component created at step 3.
    InspectorSetLight
  5. Assign the caster object to “Target” property of the light projector object.
  6. Specify “Target Bounds” of the LightProjector object so that the bounding box can enclose the caster object.
  7. 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.
  8. Assign the LightProjector object created at step 3 to “Projector” property of the shadow receiver object created at step 7.
    InspectorSetLightProjector
  9. Assign “MultiplyShadowMap” or “BlendShadowMap” material in “FastShadowReceiver/Materials” folder to MeshRenderer component of the game object created at step 7.
    InspectorSetShadowMaterial
  10. 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.

  11. 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.
    createmeshtreebutton
    This button will open Create Mesh Tree Wizard. For more details, see Create a Mesh Tree section.
    createmeshtreewizard

Links

Leave a Reply

Your email address will not be published. Required fields are marked *

Anti Spam Code *