Qt3DRender.QTechnique¶
Encapsulates a Technique. More…

Synopsis¶
Functions¶
def
addFilterKey(filterKey)def
addParameter(p)def
addRenderPass(pass)def
filterKeys()def
graphicsApiFilter()def
parameters()def
removeFilterKey(filterKey)def
removeParameter(p)def
removeRenderPass(pass)def
renderPasses()
Detailed Description¶
A
QTechniquespecifies a set ofQRenderPassobjects,QFilterKeyobjects,QParameterobjects and aQGraphicsApiFilter, which together define a rendering technique the given graphics API can render. The filter keys are used byQTechniqueFilterto select specific techniques at specific parts of the FrameGraph. If twoQParameterinstances with the same name are specified in aQTechniqueand aQRenderPass, the one in Technique overrides the one used in theQRenderPass.When creating an
QEffectthat targets several versions of a graphics API, it is useful to create severalQTechniquenodes each with agraphicsApiFilterset to match one of the targeted GL versions. At runtime, the Qt3D renderer will select the most appropriateQTechniquebased on which graphics API versions are supported and (if specified) theQFilterKeynodes that satisfy a givenQTechniqueFilterin the FrameGraph.Note
When using OpenGL as the graphics API for rendering, Qt3D relies on the
QSurfaceFormatreturned bydefaultFormat()at runtime to decide what is the most appropriate GL version available. If you need to customize theQSurfaceFormat, do not forget to apply it withsetDefaultFormat(). Setting theQSurfaceFormaton the view will likely have no effect on Qt3D related rendering.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
QEffectQRenderPassQTechniqueFilter
-
class
PySide2.Qt3DRender.Qt3DRender.QTechnique([parent=None])¶ - Parameters
parent –
QNode
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.addFilterKey(filterKey)¶ - Parameters
filterKey –
QFilterKey
Add
filterKeyto theQTechniquelocal filter keys.
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.addParameter(p)¶ - Parameters
p –
QParameter
Add
parameterto the technique’s parameters.
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.addRenderPass(pass)¶ - Parameters
pass –
QRenderPass
Appends a
passto 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
QGraphicsApiFilter
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.parameters()¶ - Return type
Returns a vector of the techniques current parameters
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.removeFilterKey(filterKey)¶ - Parameters
filterKey –
QFilterKey
Removes
filterKeyfrom theQTechniquelocal filter keys.
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.removeParameter(p)¶ - Parameters
p –
QParameter
Remove
parameterfrom the technique’s parameters.
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.removeRenderPass(pass)¶ - Parameters
pass –
QRenderPass
Removes a
passfrom the technique.
-
PySide2.Qt3DRender.Qt3DRender.QTechnique.renderPasses()¶ - Return type
Returns the list of render passes contained in the technique.
© 2018 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.