Files
XCSDD/docs/api/resources/material/updateconstantbuffer.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- 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
2026-03-19 12:44:08 +08:00

540 B
Raw Blame History

Material::UpdateConstantBuffer

void UpdateConstantBuffer()

更新材质常量缓冲区。将所有属性值打包到常量缓冲区的二进制数据中,供 GPU 着色器使用。

参数:

返回:

复杂度: O(n)n 为属性数量

示例:

mat->SetFloat("roughness", 0.5f);
mat->SetFloat3("albedo", Math::Vector3(1.0f, 0.8f, 0.6f));
mat->UpdateConstantBuffer();
auto cbData = mat->GetConstantBufferData();

相关文档