PySide6.Qt3DRender.Qt3DRender.QEffect¶
- class QEffect¶
The base class for effects in a Qt 3D scene. More…
Synopsis¶
Methods¶
def
__init__()def
addParameter()def
addTechnique()def
parameters()def
techniques()
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¶
The
QEffectclass combines a set of techniques and parameters used by those techniques to produce a rendering effect for a material.An
QEffectinstance should be shared among severalQMaterialinstances when possible.Note
QEffectnode can not be disabled.QEffect *effect = new QEffect(); // Create technique, render pass and shader QTechnique *gl3Technique = new QTechnique(); QRenderPass *gl3Pass = new QRenderPass(); QShaderProgram *glShader = new QShaderProgram(); // Set the shader on the render pass gl3Pass->setShaderProgram(glShader); // Add the pass to the technique gl3Technique->addRenderPass(gl3Pass); // 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); // Add the technique to the effect effect->addTechnique(gl3Technique);
A
QParameterdefined on aQEffectoverrides parameter (of the same name) defined inQTechniqueandQRenderPass, but are overridden by parameter inQRenderPassFilter,QTechniqueFilterandQMaterial.See also
QMaterialQTechniqueQParameter- __init__([parent=None])¶
- Parameters:
parent –
QNode
- addParameter(parameter)¶
- Parameters:
parameter –
QParameter
Adds
parameterto the effect. It sends an update to the backend. Theparameterwill be used to set a corresponding uniform value in the shader used by this effect.- addTechnique(t)¶
- Parameters:
t –
QTechnique
Adds a new technique
tto the effect. It sends an update to the backend.- parameters()¶
- Return type:
.list of Qt3DRender.QParameter
Returns the list of parameters used by the effect.
- removeParameter(parameter)¶
- Parameters:
parameter –
QParameter
Removes a parameter
parameterfrom the effect.- removeTechnique(t)¶
- Parameters:
t –
QTechnique
Removes a technique
tfrom the effect.- techniques()¶
- Return type:
.list of Qt3DRender.QTechnique
Returns the list of techniques used by the effect.