本页内容

ShaderProgramBuilder QML Type

根据加载的图生成着色器程序内容。更多...

Import Statement: import Qt3D.Render 2.12
In C++: QShaderProgramBuilder
Status: Deprecated

此类型已弃用。我们强烈建议不要在新代码中使用它。

属性

详细说明

着色器程序生成器由多个不同的着色器图组成,用于生成着色器代码。

系统会维护一个生成的着色器代码缓存。生成的着色器默认保存在QStandardPaths::writableLocation (QStandardPaths::TempLocation )中。可以通过将环境变量 QT3D_WRITABLE_CACHE_PATH 设置为有效的可写路径来覆盖此路径。

可以通过将环境变量 QT3D_DISABLE_SHADER_CACHE 设置为相应值来禁用缓存功能。

在大多数情况下,Qt 3D 会检测到对图形所做的更改,并生成新的缓存条目。 唯一不会发生这种情况的情况是,当图中包含的代码片段发生更改时。要解决此问题,可以清空缓存目录或设置环境变量 QT3D_REBUILD_SHADER_CACHE,以强制重新生成着色器代码。

属性文档

computeShaderCode : string [read-only]

保存生成的计算着色器代码

enabledLayers : stringlist

保存了该构建器在代码生成过程中将在着色器图上激活的图层列表。

fragmentShaderCode : string [read-only]

保存生成的片段着色器代码

geometryShaderCode : string [read-only]

保存生成的几何着色器代码

shaderProgram : string

保存此构建器用于生成代码的着色器程序。

tessellationControlShaderCode : string [read-only]

包含生成的镶嵌控制着色器代码

tessellationEvaluationShaderCode : string [read-only]

包含生成的曲面细分评估着色器代码

vertexShaderCode : string [read-only]

包含生成的顶点着色器代码

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.