class QRenderPass#

Encapsulates a Render Pass. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QRenderPass

Synopsis#

Properties#

Methods#

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

Note

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

property shaderProgramᅟ: QShaderProgram#

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

Access functions:
__init__([parent=None])#
Parameters:

parentQNode

Constructs a new QRenderPass with the specified parent.

addFilterKey(filterKey)#
Parameters:

filterKeyQFilterKey

Adds filterKey to the QRenderPass local filter keys.

addParameter(p)#
Parameters:

pQParameter

Add parameter to the render pass’ parameters.

addRenderState(state)#
Parameters:

stateQRenderState

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.

filterKeys()#
Return type:

.list of Qt3DRender.QFilterKey

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

parameters()#
Return type:

.list of Qt3DRender.QParameter

Returns a vector of the render pass’ current parameters

removeFilterKey(filterKey)#
Parameters:

filterKeyQFilterKey

Removes filterKey from the QRenderPass local filter keys.

removeParameter(p)#
Parameters:

pQParameter

Remove parameter from the render pass’ parameters.

removeRenderState(state)#
Parameters:

stateQRenderState

Removes state from the QRenderPass local render state.

renderStates()#
Return type:

.list of Qt3DRender.QRenderState

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

setShaderProgram(shaderProgram)#
Parameters:

shaderProgramQShaderProgram

See also

shaderProgram()

Setter of property shaderProgramᅟ .

shaderProgram()#
Return type:

QShaderProgram

See also

setShaderProgram()

Getter of property shaderProgramᅟ .

shaderProgramChanged(shaderProgram)#
Parameters:

shaderProgramQShaderProgram

Notification signal of property shaderProgramᅟ .