QRenderPass

Encapsulates a Render Pass. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QRenderPass

Synopsis

Functions

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.

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()

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

PySide6.Qt3DRender.Qt3DRender.QShaderProgram

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

shaderProgramPySide6.Qt3DRender.Qt3DRender.QShaderProgram