- class QRenderPass#
Encapsulates a Render Pass. More…
Synopsis#
Properties#
Methods#
def
__init__()
def
addFilterKey()
def
addParameter()
def
addRenderState()
def
filterKeys()
def
parameters()
def
renderStates()
def
shaderProgram()
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 byQTechnique
. Render pass consists of aQShaderProgram
and a list ofQFilterKey
objects, a list ofQRenderState
objects and a list ofQParameter
objects.QRenderPass
executes theQShaderProgram
using the givenQRenderState
andQParameter
nodes when at least one ofQFilterKey
nodes being referenced matches any of theQFilterKey
nodes inQRenderPassFilter
or when noQFilterKey
nodes are specified and noQRenderPassFilter
is present in the FrameGraph.If the
QRenderPass
defines aQParameter
, it will be overridden by aQParameter
with the same name if it exists in any of theQTechnique
,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. EachQRenderPass
can overload this base render state by specifying its ownQRenderState
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:
parent –
QNode
Constructs a new
QRenderPass
with the specifiedparent
.- addFilterKey(filterKey)#
- Parameters:
filterKey –
QFilterKey
Adds
filterKey
to theQRenderPass
local filter keys.- addParameter(p)#
- Parameters:
p –
QParameter
Add
parameter
to the render pass’ parameters.- addRenderState(state)#
- Parameters:
state –
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 theQRenderPass
.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 theQRenderPass
.- parameters()#
- Return type:
.list of Qt3DRender.QParameter
Returns a vector of the render pass’ current parameters
- removeFilterKey(filterKey)#
- Parameters:
filterKey –
QFilterKey
Removes
filterKey
from theQRenderPass
local filter keys.- removeParameter(p)#
- Parameters:
p –
QParameter
Remove
parameter
from the render pass’ parameters.- removeRenderState(state)#
- Parameters:
state –
QRenderState
Removes
state
from theQRenderPass
local render state.- renderStates()#
- Return type:
.list of Qt3DRender.QRenderState
Returns the list of
QRenderState
state objects making up the render state of theQRenderPass
.- setShaderProgram(shaderProgram)#
- Parameters:
shaderProgram –
QShaderProgram
See also
shaderProgram()
Setter of property
shaderProgramᅟ
.- shaderProgram()#
- Return type:
QShaderProgram
See also
setShaderProgram()
Getter of property
shaderProgramᅟ
.- shaderProgramChanged(shaderProgram)#
- Parameters:
shaderProgram –
QShaderProgram
Notification signal of property
shaderProgramᅟ
.