Technique QML Type
封装了一种技术。更多...
| Import Statement: | import Qt3D.Render 2.12 |
| In C++: | QTechnique |
| Inherits: | |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- filterKeys : list<FilterKey>
- graphicsApiFilter : GraphicsApiFilter
- parameters : list<Parameter>
- renderPasses : list<RenderPass>
详细说明
一种渲染技术(Technique)指定了一组渲染技术参数(RenderPass )对象、渲染技术参数(FilterKey )对象、参数(Parameter)对象以及一个渲染技术(GraphicsApiFilter ),它们共同定义了给定图形API能够渲染的渲染技术。TechniqueFilter 使用过滤器键在FrameGraph的特定部分选择特定的技术。在技术上定义的参数会覆盖在RenderPass 中定义的(同名)参数,但会被RenderPassFilter 、TechniqueFilter 、Material和Effect中的参数覆盖。
在创建针对多个图形 API 版本的 Effect 时,建议创建多个 Technique 节点,并将每个节点的 `graphicsApiFilter ` 设置为与目标版本之一匹配。 在运行时,Qt3D 渲染器将根据支持的图形 API 版本以及(如果指定了)在 FrameGraph 中满足给定TechniqueFilter 的FilterKey 节点,选择最合适的 Technique。
注意:当使用 OpenGL 作为渲染的图形 API时, Qt3D 依赖于运行时由 `QSurfaceFormat::defaultFormat()` 返回的 `QSurfaceFormat ` 来决定可用的最合适 GL 版本。如果您需要自定义 `QSurfaceFormat`,请不要忘记通过 `QSurfaceFormat::setDefaultFormat()` 将其应用。在视图上设置 `QSurfaceFormat ` 通常不会对 Qt3D 相关的渲染产生影响。
注意: 无法禁用“技术 ”节点。
Technique {
id: gl3Technique
parameters: [
Parameter { name: "color"; value: "orange" }
]
filterKeys: [
FilterKey { name: "renderingStyle"; value: "forward" }
]
graphicsApiFilter: {
api: GraphicsApiFilter.OpenGL
profile: GraphicsApiFilter.CoreProfile
majorVersion: 3
minorVersion: 1
}
renderPasses: [
RenderPass {
id: firstPass
shaderProgram: ShaderProgram {
// ...
}
},
RenderPass {
id: secondPass
shaderProgram: ShaderProgram {
// ...
}
}
]
}另请参阅 Effect 、RenderPass 以及TechniqueFilter 。
属性文档
filterKeys : list<FilterKey>
指定启用此技术所需的过滤键列表
graphicsApiFilter : GraphicsApiFilter [read-only]
指定正在使用的图形 API 滤波器
parameters : list<Parameter>
指定该技术所使用的参数
renderPasses : list<RenderPass>
指定该技术所使用的渲染阶段
© 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.