Adding simple rectangular or circular shadows is very easy with this asset! The shadow volume geometry can be moved, rotated, and scaled. Just drop the material onto a cube or sphere mesh, place it in the world, and adjust the color, sharpness, and intensity as needed. For dynamic objects, you can position it with a simple script or constraint. The shadows can be useful even in situations when full shadows are enabled but a little bit of cheap extra occlusion is desired. The material can be GPU instanced, but static and dynamic batching do not work, because batching removes transformation information necessary for the shader to function.使用这个资产,添加简单的矩形或圆形阴影是非常容易的。阴影体的几何形状可以被移动、旋转和缩放。只要把材质放到一个立方体或球体的网格上,把它放在世界中,然后根据需要调整颜色、锐度和强度
The primary advantage this asset has over the standard Unity projector is that the projector will re-render all of the objects it affects, which can potentially increase the number of draw calls and overall cost of a scene dramatically, especially if there are multiple objects casting shadows on multiple environment objects, or the objects receiving the shadows are large or complex. The FVBS shader doesn't suffer from this issue, and will have the same cost regardless of the complexity of the scene being shadowed.对于动态物体,你可以用一个简单的脚本或约束来定位它。阴影甚至在启用全阴影但需要一点廉价的额外遮挡的情况下也是有用的
Note: For the shader to work, there must be a depth texture enabled on the camera, either in the pipeline asset for the URP, or with an included script for Builtin.