Qt3DRender.QEffect

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

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QEffect

Synopsis

Functions

Detailed Description

The QEffect class combines a set of techniques and parameters used by those techniques to produce a rendering effect for a material.

An QEffect instance should be shared among several QMaterial instances when possible.

Note

QEffect node 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 QParameter defined on an Effect is overridden by a QParameter (of the same name) defined in a QMaterial , QTechniqueFilter , QRenderPassFilter .

See also

QMaterial QTechnique QParameter

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

parentQNode

PySide2.Qt3DRender.Qt3DRender.QEffect.addParameter(parameter)
Parameters

parameterQParameter

Adds parameter to the effect. It sends an update to the backend. The parameter will be used to set a corresponding uniform value in the shader used by this effect.

PySide2.Qt3DRender.Qt3DRender.QEffect.addTechnique(t)
Parameters

tQTechnique

Adds a new technique t to 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

parameterQParameter

Removes a parameter parameter from the effect.

PySide2.Qt3DRender.Qt3DRender.QEffect.removeTechnique(t)
Parameters

tQTechnique

Removes a technique t from the effect.

PySide2.Qt3DRender.Qt3DRender.QEffect.techniques()
Return type

Returns the list of techniques used by the effect.