QSSGRenderExtension Class

Base class for extension backend node implementations. More...

Header: #include <QSSGRenderExtension>
Since: Qt 6.7

Public Types

enum class RenderMode { Standalone, Main }
enum class RenderStage { PreColor, PostColor }

Public Functions

virtual QSSGRenderExtension::RenderMode mode() const = 0
virtual bool prepareData(QSSGFrameData &data) = 0
virtual void prepareRender(QSSGFrameData &data) = 0
virtual void render(QSSGFrameData &data) = 0
virtual void resetForFrame() = 0
virtual QSSGRenderExtension::RenderStage stage() const = 0

Detailed Description

See also QQuick3DRenderExtension.

Member Type Documentation

enum class QSSGRenderExtension::RenderMode

Specifies the render extension mode.

ConstantValueDescription
QSSGRenderExtension::RenderMode::Standalone0The rendering code is recorded in full during the render prepare phase. This will usually imply that there are some output crated for a preceding render extension(s). When this mode is used the prepareRender() and render() functions are both called during the frame's prepare phase.
QSSGRenderExtension::RenderMode::Main1The rendering code is recorded within the main render pass. In this mode the prepareRender() is called in the frame's prepare phase while render() is called the frame's render phase.

enum class QSSGRenderExtension::RenderStage

Specifies the order the extension will be called.

ConstantValueDescription
QSSGRenderExtension::RenderStage::PreColor0The rendering code is recorded and executed before the main (color) pass.
QSSGRenderExtension::RenderStage::PostColor1The rendering code is recorded and executed after the main (color) pass.

Member Function Documentation

[pure virtual] QSSGRenderExtension::RenderMode QSSGRenderExtension::mode() const

Returns The render mode used for this extension.

[pure virtual] bool QSSGRenderExtension::prepareData(QSSGFrameData &data)

Called after scene data is collected, but before any render data or rendering in the current frame has been done.

Returns Dirty state. Return true if the there are dirty data that needs to be rendered.

Note: Much of the data created/collected from the engine during the prepare and render phases is per-frame and should be released or assumed released at the start of the next frame

See also QSSGFrameData.

[pure virtual] void QSSGRenderExtension::prepareRender(QSSGFrameData &data)

Prepare data for rendering. Build and collect data needed for rendering. Any render extension scheduled before this one has been processed. In addition; any render extension of mode RenderMode::Standalone will, if successful, have been completed in full.

Note: Much of the data created/collected from the engine during the prepare and render phases is per-frame and should be released or assumed released at the start of the next frame

See also QSSGFrameData.

[pure virtual] void QSSGRenderExtension::render(QSSGFrameData &data)

Record the render pass. Depending on the extensions mode this function will be called during the frame's prepare or render phase.

Use data to gain access to the render context from which the active QRhi object can be queried.

See also QSSGRenderExtension::RenderMode.

[pure virtual] void QSSGRenderExtension::resetForFrame()

Called each time a new frame starts. Any data from the previous frame should be cleared at this point.

[pure virtual] QSSGRenderExtension::RenderStage QSSGRenderExtension::stage() const

Returns The stage in which this render extension will be used.

© 2024 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.