Files
XCEngine/docs/api/rhi/command-list/set-stencil-ref.md
2026-03-20 02:35:45 +08:00

29 lines
586 B
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.
# RHICommandList::SetStencilRef
```cpp
virtual void SetStencilRef(uint8_t ref) = 0;
```
设置模板测试的参考值。模板测试将每个像素的模板值与此参考值进行比较,决定像素是否被写入。
**参数:**
- `ref` - 模板参考值(范围 0-255
**返回:** `void`
**异常:**
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
cmdList->SetStencilRef(0xFF);
```
## 相关文档
- [RHICommandList 总览](command-list.md) - 返回类总览
- [SetDepthStencilState](set-depth-stencil-state.md) - 设置深度模板状态