Fast Volumetric Blob Shadows

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. If the depth texture is not already enabled in your project you will see an increase in draw calls due to Unity needing to render the depth pass. If draw calls are the primary bottleneck this asset is likely not the right solution.