PySide6.Qt3DRender.Qt3DRender.QTechnique¶
- class QTechnique¶
- Encapsulates a Technique. More… - Synopsis¶- Properties¶- Methods¶- def - __init__()
- def - addFilterKey()
- def - addParameter()
- def - addRenderPass()
- def - filterKeys()
- def - parameters()
- def - renderPasses()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- A - QTechniquespecifies a set of- QRenderPassobjects,- QFilterKeyobjects,- QParameterobjects and a- QGraphicsApiFilter, which together define a rendering technique the given graphics API can render. The filter keys are used by- QTechniqueFilterto select specific techniques at specific parts of the FrameGraph. A- QParameterdefined on a- QTechniqueoverrides parameter (of the same name) defined in- QRenderPass, but are overridden by parameter in- QRenderPassFilter,- QTechniqueFilter,- QMaterialand- QEffect.- When creating an - QEffectthat targets several versions of a graphics API, it is useful to create several- QTechniquenodes each with a- graphicsApiFilterset to match one of the targeted GL versions. At runtime, the Qt3D renderer will select the most appropriate- QTechniquebased on which graphics API versions are supported and (if specified) the- QFilterKeynodes that satisfy a given- QTechniqueFilterin 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. - Note - QTechniquenode 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- Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property graphicsApiFilterᅟ: QGraphicsApiFilter¶
 - Specifies the graphics API filter being used - Access functions:
 - __init__([parent=None])¶
- Parameters:
- parent – - QNode
 
 - addFilterKey(filterKey)¶
- Parameters:
- filterKey – - QFilterKey
 
 - Add - filterKeyto the- QTechniquelocal filter keys.- addParameter(p)¶
- Parameters:
- p – - QParameter
 
 - Add - parameterto the technique’s parameters.- addRenderPass(pass)¶
- Parameters:
- pass – - QRenderPass
 
 - Appends a - passto the technique.- filterKeys()¶
- Return type:
- .list of Qt3DRender.QFilterKey 
 
 - Returns the list of Qt3DCore::QFilterKey key objects making up the filter keys of the - QTechnique.- graphicsApiFilter()¶
- Return type:
- QGraphicsApiFilter
 
 - Getter of property - graphicsApiFilterᅟ.- parameters()¶
- Return type:
- .list of Qt3DRender.QParameter 
 
 - Returns a vector of the techniques current parameters - removeFilterKey(filterKey)¶
- Parameters:
- filterKey – - QFilterKey
 
 - Removes - filterKeyfrom the- QTechniquelocal filter keys.- removeParameter(p)¶
- Parameters:
- p – - QParameter
 
 - Remove - parameterfrom the technique’s parameters.- removeRenderPass(pass)¶
- Parameters:
- pass – - QRenderPass
 
 - Removes a - passfrom the technique.- renderPasses()¶
- Return type:
- .list of Qt3DRender.QRenderPass 
 
 - Returns the list of render passes contained in the technique.