The QRenderStateSet FrameGraph node offers a way of specifying a set of QRenderState objects to be applied during the execution of a framegraph branch. 更多...
头: | #include <QRenderStateSet> |
qmake: | QT += 3drender |
Since: | Qt 5.5 |
实例化: | RenderStateSet |
继承: | Qt3DRender::QFrameGraphNode |
QRenderStateSet (Qt3DCore::QNode * parent = nullptr) | |
void | addRenderState (Qt3DRender::QRenderState * state ) |
void | removeRenderState (Qt3DRender::QRenderState * state ) |
QVector<Qt3DRender::QRenderState *> | renderStates () const |
const QMetaObject | staticMetaObject |
QRenderStateSet (Qt3DRender::QRenderStateSetPrivate & dd , Qt3DCore::QNode * parent = nullptr) |
The QRenderStateSet FrameGraph node offers a way of specifying a set of QRenderState objects to be applied during the execution of a framegraph branch.
States set on a QRenderStateSet are set globally, contrary to the per-material states that can be set on a QRenderPass . By default, an empty QRenderStateSet will result in all render states being disabled when executed. Adding a QRenderState state explicitly enables that render state at runtime.
The RenderStateSet is enabled when added to the active frame graph:
// using namespace Qt3DRender; Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity(); QRenderSettings *renderSettings = new QRenderSettings(); QViewport *viewport = new QViewport(); QCameraSelector *cameraSelector = new QCameraSelector(viewport); QClearBuffers *clearBuffers = new QClearBuffers(cameraSelector); clearBuffers->setBuffers(QClearBuffers::ColorDepthBuffer); QRenderStateSet *renderStateSet = new QRenderStateSet(cameraSelector); QCullFace *cullFace = new QCullFace(renderStateSet); cullFace->setMode(QCullFace::Front); renderStateSet->addRenderState(cullFace); renderSettings->setActiveFrameGraph(viewport); rootEntity->addComponent(renderSettings);
另请参阅 QRenderState and QRenderPass .
Default constructs an instance of QRenderStateSet.
[protected]
QRenderStateSet::
QRenderStateSet
(
Qt3DRender::QRenderStateSetPrivate
&
dd
,
Qt3DCore::QNode
*
parent
= nullptr)
Default constructs an instance of QRenderStateSet.
Adds a new QRenderState state 到 QRenderStateSet 实例。
注意: Not setting any QRenderState state on a QRenderStateSet instance implies all the render states will be disabled at render time.
移除 QRenderState state 从 QRenderStateSet 实例。
Returns the list of QRenderState objects that compose the QRenderStateSet 实例。