Files
XCEngine/docs/api/XCEngine/Rendering/Execution/CameraRenderer/SetShadowCasterPass.md

37 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CameraRenderer::SetShadowCasterPass
**命名空间**: `XCEngine::Rendering`
**类型**: `method`
**头文件**: `XCEngine/Rendering/Execution/CameraRenderer.h`
## 签名
```cpp
void SetShadowCasterPass(std::unique_ptr<RenderPass> shadowCasterPass);
```
## 作用
替换当前用于消费 `request.shadowCaster` 的独立 scene pass。
## 当前实现行为
1. 如果旧 `m_shadowCasterPass` 非空,先调用它的 `Shutdown()`
2. 接管新的 `shadowCasterPass`
3. 如果新指针为空,则自动回退到 [Passes::BuiltinShadowCasterPass](../../Passes/BuiltinShadowCasterPass/BuiltinShadowCasterPass.md)。
## 关键语义
- 这里替换的是一个普通 `RenderPass`,并不要求必须是 builtin shadow-caster 实现。
- `CameraRenderer::Render()` 只在 `request.shadowCaster.IsRequested()` 时才会执行这里持有的 pass。
- 当前执行顺序里shadow-caster pass 位于 depth-only 与主主管线之前。
## 相关文档
- [GetShadowCasterPass](GetShadowCasterPass.md)
- [Render](Render.md)
- [BuiltinShadowCasterPass](../../Passes/BuiltinShadowCasterPass/BuiltinShadowCasterPass.md)