- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
27 lines
540 B
Markdown
27 lines
540 B
Markdown
# Material::UpdateConstantBuffer
|
||
|
||
```cpp
|
||
void UpdateConstantBuffer()
|
||
```
|
||
|
||
更新材质常量缓冲区。将所有属性值打包到常量缓冲区的二进制数据中,供 GPU 着色器使用。
|
||
|
||
**参数:** 无
|
||
|
||
**返回:** 无
|
||
|
||
**复杂度:** O(n),n 为属性数量
|
||
|
||
**示例:**
|
||
|
||
```cpp
|
||
mat->SetFloat("roughness", 0.5f);
|
||
mat->SetFloat3("albedo", Math::Vector3(1.0f, 0.8f, 0.6f));
|
||
mat->UpdateConstantBuffer();
|
||
auto cbData = mat->GetConstantBufferData();
|
||
```
|
||
|
||
## 相关文档
|
||
|
||
- [Material 总览](material.md) - 返回类总览
|