unity staticShadowCaster
时间: 2023-10-10 15:13:37 浏览: 173
Unity's StaticShadowCaster component is used to mark GameObjects as static shadow casters. This component is used in combination with Unity's baked global illumination (GI) system to create static shadows that are baked into lightmaps.
When a GameObject is marked as a static shadow caster, Unity will precompute the shadow information for that object during the baking process. This precomputed data is then stored in lightmaps and can be used to render shadows on other objects in the scene.
StaticShadowCaster can be added to any GameObject that has a MeshRenderer or SkinnedMeshRenderer component. Once added, the GameObject will be included in the baking process and its shadows will be baked into the lightmaps.
It's important to note that StaticShadowCaster only works for static objects. If a GameObject is marked as a static shadow caster and then moved or animated during runtime, its shadow will not update. In these cases, dynamic shadow casting techniques such as real-time shadow mapping or shadow volumes should be used instead.
阅读全文