Files
XCEngine/docs/api/rhi/command-list/set-stencil-ref.md

29 lines
586 B
Markdown
Raw Normal View History

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