QTechnique

Encapsulates a Technique. More

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QTechnique

Synopsis

Functions

Detailed Description

A QTechnique specifies a set of QRenderPass objects, QFilterKey objects, QParameter objects and a QGraphicsApiFilter , which together define a rendering technique the given graphics API can render. The filter keys are used by QTechniqueFilter to select specific techniques at specific parts of the FrameGraph. A QParameter defined on a QTechnique overrides parameter (of the same name) defined in QRenderPass , but are overridden by parameter in QRenderPassFilter , QTechniqueFilter , QMaterial and QEffect .

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

Note

When using OpenGL as the graphics API for rendering, Qt3D relies on the QSurfaceFormat returned by 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 setDefaultFormat() . Setting the QSurfaceFormat on the view will likely have no effect on Qt3D related rendering.

Note

QTechnique node can not be disabled.

QTechnique *gl3Technique = new QTechnique();

// Create the render passes
QRenderPass *firstPass = new QRenderPass();
QRenderPass *secondPass = new QRenderPass();

// Add the passes to the technique
gl3Technique->addRenderPass(firstPass);
gl3Technique->addRenderPass(secondPass);

// Set the targeted GL version for the technique
gl3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL);
gl3Technique->graphicsApiFilter()->setMajorVersion(3);
gl3Technique->graphicsApiFilter()->setMinorVersion(1);
gl3Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::CoreProfile);

// Create a FilterKey
QFilterKey *filterKey = new QFilterKey();
filterKey->setName(QStringLiteral("name"));
fitlerKey->setValue(QStringLiteral("zFillPass"));

// Add the FilterKey to the Technique
gl3Technique->addFilterKey(filterKey);

// Create a QParameter
QParameter *colorParameter = new QParameter(QStringLiteral("color"), QColor::fromRgbF(0.0f, 0.0f, 1.0f, 1.0f));

// Add parameter to technique
gl3Technique->addParameter(colorParameter);

See also

QEffect QRenderPass QTechniqueFilter

class PySide2.Qt3DRender.Qt3DRender.QTechnique([parent=None])
Parameters:

parentPySide2.Qt3DCore.Qt3DCore.QNode

PySide2.Qt3DRender.Qt3DRender.QTechnique.addFilterKey(filterKey)
Parameters:

filterKeyPySide2.Qt3DRender.Qt3DRender.QFilterKey

Add filterKey to the QTechnique local filter keys.

PySide2.Qt3DRender.Qt3DRender.QTechnique.addParameter(p)
Parameters:

pPySide2.Qt3DRender.Qt3DRender.QParameter

Add parameter to the technique’s parameters.

PySide2.Qt3DRender.Qt3DRender.QTechnique.addRenderPass(pass)
Parameters:

passPySide2.Qt3DRender.Qt3DRender.QRenderPass

Appends a pass to the technique.

PySide2.Qt3DRender.Qt3DRender.QTechnique.filterKeys()
Return type:

Returns the list of Qt3DCore::QFilterKey key objects making up the filter keys of the QTechnique .

PySide2.Qt3DRender.Qt3DRender.QTechnique.graphicsApiFilter()
Return type:

PySide2.Qt3DRender.Qt3DRender.QGraphicsApiFilter

Specifies the graphics API filter being used

PySide2.Qt3DRender.Qt3DRender.QTechnique.parameters()
Return type:

Returns a vector of the techniques current parameters

PySide2.Qt3DRender.Qt3DRender.QTechnique.removeFilterKey(filterKey)
Parameters:

filterKeyPySide2.Qt3DRender.Qt3DRender.QFilterKey

Removes filterKey from the QTechnique local filter keys.

PySide2.Qt3DRender.Qt3DRender.QTechnique.removeParameter(p)
Parameters:

pPySide2.Qt3DRender.Qt3DRender.QParameter

Remove parameter from the technique’s parameters.

PySide2.Qt3DRender.Qt3DRender.QTechnique.removeRenderPass(pass)
Parameters:

passPySide2.Qt3DRender.Qt3DRender.QRenderPass

Removes a pass from the technique.

PySide2.Qt3DRender.Qt3DRender.QTechnique.renderPasses()
Return type:

Returns the list of render passes contained in the technique.