QEffect¶
The base class for effects in a Qt 3D scene. More…

Synopsis¶
Functions¶
def
addParameter(parameter)def
addTechnique(t)def
parameters()def
removeParameter(parameter)def
removeTechnique(t)def
techniques()
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
- class PySide2.Qt3DRender.Qt3DRender.QEffect([parent=None])¶
- Parameters:
parent –
PySide2.Qt3DCore.Qt3DCore.QNode
- PySide2.Qt3DRender.Qt3DRender.QEffect.addParameter(parameter)¶
- Parameters:
parameter –
PySide2.Qt3DRender.Qt3DRender.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.
- PySide2.Qt3DRender.Qt3DRender.QEffect.addTechnique(t)¶
- Parameters:
Adds a new technique
tto the effect. It sends an update to the backend.
- PySide2.Qt3DRender.Qt3DRender.QEffect.parameters()¶
- Return type:
Returns the list of parameters used by the effect.
- PySide2.Qt3DRender.Qt3DRender.QEffect.removeParameter(parameter)¶
- Parameters:
parameter –
PySide2.Qt3DRender.Qt3DRender.QParameter
Removes a parameter
parameterfrom the effect.
- PySide2.Qt3DRender.Qt3DRender.QEffect.removeTechnique(t)¶
- Parameters:
Removes a technique
tfrom the effect.
- PySide2.Qt3DRender.Qt3DRender.QEffect.techniques()¶
- Return type:
Returns the list of techniques used by the effect.
© 2022 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.