本页内容

Effect QML Type

Qt 3D 场景中效果的基类。更多内容...

Import Statement: import Qt3D.Render 2.12
In C++: QEffect
Inherits:

Node

Status: Deprecated

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

属性

详细说明

“效果”类型整合了一组技术及其相关参数,用于为材质生成渲染效果。

在可能的情况下,一个“效果”(Effect)实例应被多个“材质”(Material)实例共享。

在效果上定义的参数会覆盖在“Technique”和“RenderPass ”中定义的(同名)参数,但会被“RenderPassFilter ”、“TechniqueFilter ”和“Material”中的参数覆盖。

注意:效果 节点无法被禁用。

Effect {
    id: effect

    techniques: [
        Technique {
            id: gl3Technique
            graphicsApiFilter {
                api: GraphicsApiFilter.OpenGL
                profile: GraphicsApiFilter.CoreProfile
                majorVersion: 3
                minorVersion: 1
            }
            renderPasses: [
                RenderPass {
                    id: gl3Pass
                    shaderProgram: ShaderProgram {
                        ...
                    }
                }
            ]
        }
    ]
}

另请参阅 Material 、Technique 和Parameter 。

属性文档

parameters : list<Parameter>

存储此效果所使用的参数列表。每个参数用于在此效果所使用的着色器中设置相应的均匀值。

techniques : list<Technique>

保存了此效果所使用的技巧列表。

© 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.