Encapsulates a Render Pass. 更多...
头: | #include <QRenderPass> |
CMake: |
find_package(Qt6 COMPONENTS 3drender REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
Since: | Qt 5.7 |
实例化: | RenderPass |
继承: | Qt3DCore::QNode |
QRenderPass (Qt3DCore::QNode * parent = nullptr) | |
void | addFilterKey (Qt3DRender::QFilterKey * filterKey ) |
void | addParameter (Qt3DRender::QParameter * 参数 ) |
void | addRenderState (Qt3DRender::QRenderState * state ) |
QList<Qt3DRender::QFilterKey *> | filterKeys () const |
QList<Qt3DRender::QParameter *> | 参数 () const |
void | removeFilterKey (Qt3DRender::QFilterKey * filterKey ) |
void | removeParameter (Qt3DRender::QParameter * 参数 ) |
void | removeRenderState (Qt3DRender::QRenderState * state ) |
QList<Qt3DRender::QRenderState *> | renderStates () const |
Qt3DRender::QShaderProgram * | shaderProgram () const |
void | setShaderProgram (Qt3DRender::QShaderProgram * shaderProgram ) |
void | shaderProgramChanged (Qt3DRender::QShaderProgram * shaderProgram ) |
ParameterList |
A Qt3DRender::QRenderPass specifies a single rendering pass - an instance of shader program execution - used by Qt3DRender::QTechnique . Render pass consists of a Qt3DRender::QShaderProgram and a list of Qt3DRender::QFilterKey objects, a list of Qt3DRender::QRenderState objects and a list of Qt3DRender::QParameter 对象。
QRenderPass executes the QShaderProgram 使用给定 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);
另请参阅 QRenderPassFilter , QFilterKey , QParameter , QRenderState , QEffect ,和 QTechnique .
Specifies the shader program to be used for this render pass.
访问函数:
Qt3DRender::QShaderProgram * | shaderProgram () const |
void | setShaderProgram (Qt3DRender::QShaderProgram * shaderProgram ) |
通知程序信号:
void | shaderProgramChanged (Qt3DRender::QShaderProgram * shaderProgram ) |
Constructs a new QRenderPass with the specified parent .
添加 filterKey 到 Qt3DRender::QRenderPass local filter keys.
Add 参数 to the render pass' 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 the Qt3DRender::QRenderPass .
注意: not defining any Qt3DRender::QRenderState in a pass will result in the pass using the globally set render state for a given FrameGraph branch execution path.
Returns the list of Qt3DRender::QFilterKey key objects making up the filter keys of the Qt3DRender::QRenderPass .
Returns a vector of the render pass' current parameters
移除 filterKey 从 Qt3DRender::QRenderPass local filter keys.
移除 参数 from the render pass' parameters.
移除 state 从 Qt3DRender::QRenderPass local render state.
Returns the list of Qt3DRender::QRenderState state objects making up the render state of the Qt3DRender::QRenderPass .
[alias]
ParameterList
A list of Qt3DRender::QParameter 参数。