QRenderPass¶
Encapsulates a Render Pass. More…
Synopsis¶
Functions¶
def
addFilterKey
(filterKey)def
addParameter
(p)def
addRenderState
(state)def
filterKeys
()def
parameters
()def
removeFilterKey
(filterKey)def
removeParameter
(p)def
removeRenderState
(state)def
renderStates
()def
shaderProgram
()
Slots¶
def
setShaderProgram
(shaderProgram)
Signals¶
def
shaderProgramChanged
(shaderProgram)
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
- class PySide2.Qt3DRender.Qt3DRender.QRenderPass([parent=None])¶
- param parent:
Constructs a new
QRenderPass
with the specifiedparent
.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.addFilterKey(filterKey)¶
- Parameters:
filterKey –
PySide2.Qt3DRender.Qt3DRender.QFilterKey
Adds
filterKey
to theQRenderPass
local filter keys.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.addParameter(p)¶
- Parameters:
Add
parameter
to the render pass’ parameters.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.addRenderState(state)¶
- Parameters:
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.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.filterKeys()¶
- Return type:
Returns the list of
QFilterKey
key objects making up the filter keys of theQRenderPass
.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.parameters()¶
- Return type:
Returns a vector of the render pass’ current parameters
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.removeFilterKey(filterKey)¶
- Parameters:
filterKey –
PySide2.Qt3DRender.Qt3DRender.QFilterKey
Removes
filterKey
from theQRenderPass
local filter keys.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.removeParameter(p)¶
- Parameters:
Remove
parameter
from the render pass’ parameters.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.removeRenderState(state)¶
- Parameters:
Removes
state
from theQRenderPass
local render state.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.renderStates()¶
- Return type:
Returns the list of
QRenderState
state objects making up the render state of theQRenderPass
.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.setShaderProgram(shaderProgram)¶
- Parameters:
shaderProgram –
PySide2.Qt3DRender.Qt3DRender.QShaderProgram
Specifies the shader program to be used for this render pass.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.shaderProgram()¶
- Return type:
Specifies the shader program to be used for this render pass.
- PySide2.Qt3DRender.Qt3DRender.QRenderPass.shaderProgramChanged(shaderProgram)¶
- Parameters:
shaderProgram –
PySide2.Qt3DRender.Qt3DRender.QShaderProgram
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.