Fast Shadow Receiver provides three types of shadow receiver, InfinitePlaneShadowReceiver, MeshShadowReceiver and RaycastPlaneShadowReceiver.

InfinitePlaneShadowReceiver

If your scene consists of one big flat plane and small objects (I mean, not so big, for example: buildings, trees and so on), you can use InfinitePlaneShadowReceiver. You can still cast shadows on the small objects, because rendering shadows on small objects will not take so much time. The following image shows an example of InfinitePlaneShadowReceiver. In this case, the plane floor object is the large environment object, and InfinitePlaneShadowReceiver creates a rectangle mesh on the floor. The cylinder object is not counted as the large environment object and it is also receiving the shadow from the projector.

ScreenshotInfinitPlane

MeshShadowReceiver or RaycastPlaneShadowReceiver

If the large environment object in your scene has non flat surface, these two receivers are suitable to be used.

MeshShadowReceiver will pick up polygons from the mesh of the large environment object. It can cover not only a single MeshRenderer object but also multiple MeshRenderer objects and Unity Terrain object. This method will take some CPU time.

On the other hand, RaycastPlaneShadowReceiver will generate a quadrangle mesh at the place where a raycast hits, which is much faster than MeshShadowReceiver method. However, the quadrangle mesh will not fit the actual environment surface if it has large curvature.

Images below are examples of both methods. In these examples, the environment object is a terrain. The left image is using MeshShadowReceiver, and the right image is using RaycastPlaneShadowReceiver. As you can see, MeshShadowReceiver can make a mesh which perfectly fits the terrain surface. On the other hand, the mesh created by RaycastPlaneShadowReceiver does not fit the surface, since it is just a rectangle polygon. If the surface was concave, the rectangle polygon would intersect with the terrain surface.

ScreenshotTerrainMesh        ScreenshotTerrainPlane

MeshShadowReceiver vs InfinitePlaneShadowReceiver

The following image shows an example of MeshShadowReceiver compared to InfinitePlaneShadowReceiver in the pervious example. The cylinder object is counted as the large environment object, and the mesh created by the MeshShadowReceiver contains a part of the cylinder surface. This is just an example to show how MeshShadowReceiver works. In this situation, using InfinitePlaneShadowReceiver is recommended.

ScreenshotMeshShadowReceiver

Links

Leave a Reply

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

Anti Spam Code *