Technique QML Type

Encapsulates a Technique. More...

Import Statement: import Qt3D.Render 2.12
Since: Qt 5.7
Instantiates: QTechnique

Properties

Detailed Description

A Technique specifies a set of RenderPass objects, FilterKey objects, Parameter objects and a GraphicsApiFilter, which together define a rendering technique the given graphics API can render. The filter keys are used by TechniqueFilter to select specific techniques at specific parts of the FrameGraph. If two Parameter instances with the same name are specified in a Technique and a RenderPass, the one in Technique overrides the one used in the RenderPass.

When creating an Effect that targets several versions of a graphics API, it is useful to create several Technique nodes each with a graphicsApiFilter set to match one of the targeted versions. At runtime, the Qt3D renderer will select the most appropriate Technique based on which graphics API versions are supported and (if specified) the FilterKey nodes that satisfy a given TechniqueFilter in the FrameGraph.

Note: When using OpenGL as the graphics API for rendering, Qt3D relies on the QSurfaceFormat returned by QSurfaceFormat::defaultFormat() at runtime to decide what is the most appropriate GL version available. If you need to customize the QSurfaceFormat, do not forget to apply it with QSurfaceFormat::setDefaultFormat(). Setting the QSurfaceFormat on the view will likely have no effect on Qt3D related rendering.

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 {
                // ...
            }
        }
    ]
}

See also Effect, RenderPass, and TechniqueFilter.

Property Documentation

filterKeys : list<FilterKey>

Specifies the list of filter keys enabling this technique

graphicsApiFilter : GraphicsApiFilter

Specifies the graphics API filter being used

parameters : list<Parameter>

Specifies the parameters used by the technique

renderPasses : list<RenderPass>

Specifies the render passes used by the tehcnique

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.12/qml-qt3d-render-technique.html