QRenderPass#

Encapsulates a Render Pass. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QRenderPass

Synopsis#

Properties#

Functions#

Slots#

Signals#

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 QRenderPass specifies a single rendering pass - an instance of shader program execution - used by QTechnique . Render pass consists of a QShaderProgram and a list of QFilterKey objects, a list of QRenderState objects and a list of QParameter objects.

QRenderPass executes the QShaderProgram using the given QRenderState and QParameter nodes when at least one of QFilterKey nodes being referenced matches any of the QFilterKey nodes in QRenderPassFilter or when no QFilterKey nodes are specified and no QRenderPassFilter is present in the FrameGraph.

If the QRenderPass defines a QParameter , it will be overridden by a QParameter with the same name if it exists in any of the QTechnique , QEffect , QMaterial , QTechniqueFilter , QRenderPassFilter associated with the pass at runtime. This still can be useful to define sane default values.

At render time, for each leaf node of the FrameGraph a base render state is recorded by accumulating states defined by all QRenderStateSet nodes in the FrameGraph branch. Each QRenderPass can overload this base render state by specifying its own QRenderState nodes.

// Create the render passes
QRenderPass *pass = new QRenderPass();

// Create shader program
QShaderProgram *glShader = new QShaderProgram();

// Set the shader on the render pass
pass->setShaderProgram(glShader);

// Create a FilterKey
QFilterKey *filterKey = new QFilterKey();
filterKey->setName(QStringLiteral("name"));
fitlerKey->setValue(QStringLiteral("zFillPass"));

// Add the FilterKey to the pass
pass->addFilterKey(filterKey);

// Create a QParameter
QParameter *colorParameter = new QParameter(QStringLiteral("color"), QColor::fromRgbF(0.0f, 0.0f, 1.0f, 1.0f));

// Add parameter to pass
pass->addParameter(colorParameter);

// Create a QRenderState
QDepthTest *depthTest = new QDepthTest();

// Add the render state to the pass
pass->addRenderState(depthTest);

See also

QRenderPassFilter QFilterKey QParameter QRenderState QEffect QTechnique

class PySide6.Qt3DRender.Qt3DRender.QRenderPass([parent=None])#
Parameters:

parentPySide6.Qt3DCore.Qt3DCore.QNode

Constructs a new QRenderPass with the specified parent.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.Qt3DRender.Qt3DRender.QRenderPass.shaderProgram: PySide6.Qt3DRender.Qt3DRender.QShaderProgram#

Specifies the shader program to be used for this render pass.

Access functions:
PySide6.Qt3DRender.Qt3DRender.QRenderPass.addFilterKey(filterKey)#
Parameters:

filterKeyPySide6.Qt3DRender.Qt3DRender.QFilterKey

Adds filterKey to the QRenderPass local filter keys.

PySide6.Qt3DRender.Qt3DRender.QRenderPass.addParameter(p)#
Parameters:

pPySide6.Qt3DRender.Qt3DRender.QParameter

Add parameter to the render pass’ parameters.

PySide6.Qt3DRender.Qt3DRender.QRenderPass.addRenderState(state)#
Parameters:

statePySide6.Qt3DRender.Qt3DRender.QRenderState

Adds a render state to the rendering pass. That implies that when the pass is executed at render time, the globally set render state will be modified by the states defined locally by the QRenderPass .

Note

not defining any QRenderState in a pass will result in the pass using the globally set render state for a given FrameGraph branch execution path.

PySide6.Qt3DRender.Qt3DRender.QRenderPass.filterKeys()#
Return type:

Returns the list of QFilterKey key objects making up the filter keys of the QRenderPass .

PySide6.Qt3DRender.Qt3DRender.QRenderPass.parameters()#
Return type:

Returns a vector of the render pass’ current parameters

PySide6.Qt3DRender.Qt3DRender.QRenderPass.removeFilterKey(filterKey)#
Parameters:

filterKeyPySide6.Qt3DRender.Qt3DRender.QFilterKey

Removes filterKey from the QRenderPass local filter keys.

PySide6.Qt3DRender.Qt3DRender.QRenderPass.removeParameter(p)#
Parameters:

pPySide6.Qt3DRender.Qt3DRender.QParameter

Remove parameter from the render pass’ parameters.

PySide6.Qt3DRender.Qt3DRender.QRenderPass.removeRenderState(state)#
Parameters:

statePySide6.Qt3DRender.Qt3DRender.QRenderState

Removes state from the QRenderPass local render state.

PySide6.Qt3DRender.Qt3DRender.QRenderPass.renderStates()#
Return type:

Returns the list of QRenderState state objects making up the render state of the QRenderPass .

PySide6.Qt3DRender.Qt3DRender.QRenderPass.setShaderProgram(shaderProgram)#
Parameters:

shaderProgramPySide6.Qt3DRender.Qt3DRender.QShaderProgram

See also

shaderProgram()

Setter of property shaderProgram .

PySide6.Qt3DRender.Qt3DRender.QRenderPass.shaderProgram()#
Return type:

PySide6.Qt3DRender.Qt3DRender.QShaderProgram

Getter of property shaderProgram .

PySide6.Qt3DRender.Qt3DRender.QRenderPass.shaderProgramChanged(shaderProgram)#
Parameters:

shaderProgramPySide6.Qt3DRender.Qt3DRender.QShaderProgram

Notification signal of property shaderProgram .