QSSGRenderHelpers Class

Class containing helper functions for setting up and render QtQuick3D renderables. 更多...

头: #include <QSSGRenderHelpers>
Since: Qt 6.7

公共类型

enum class CreateFlag { None, Recurse, Steal }
flags CreateFlags

静态公共成员

QSSGPrepResultId commit (const QSSGFrameData & frameData , QSSGPrepContextId prepId , QSSGRenderablesId renderablesId , float lodThreshold = 1.0f)
QSSGRenderablesId createRenderables (const QSSGFrameData & frameData , QSSGPrepContextId prepId , const QSSGRenderHelpers::NodeList & nodes , QSSGRenderHelpers::CreateFlags flags = CreateFlag::None)
QSSGPrepContextId prepareForRender (const QSSGFrameData & frameData , const QSSGRenderExtension & ext , QSSGCameraId cameraId , quint32 slot = 0)
void prepareRenderables (const QSSGFrameData & frameData , QSSGPrepResultId prepId , QRhiRenderPassDescriptor * renderPassDescriptor , QSSGRhiGraphicsPipelineState & ps , QSSGRenderablesFilters filter = QSSGRenderablesFilter::All)
void renderRenderables (const QSSGFrameData & frameData , QSSGPrepResultId prepId )

详细描述

成员类型文档编制

enum class QSSGRenderHelpers:: CreateFlag
flags QSSGRenderHelpers:: CreateFlags

常量 描述
QSSGRenderHelpers::CreateFlag::None 0 The default value. Renderables are created only for the nodes specified.
QSSGRenderHelpers::CreateFlag::Recurse 0x1 Renderables are created for each node and their children.
QSSGRenderHelpers::CreateFlag::Steal 0x2 Renderables are taken from the engine and won't be rendered by QtQuick3D .

注意: 调用 QSSGRenderHelpers::createRenderables () without the {QSSGRenderHelpers::CreateFlag::Steal}{Steal} flag set means nodes are duplicated and QtQuick3D will render its copy of the nodes as normal.

The CreateFlags type is a typedef for QFlags <CreateFlag>. It stores an OR combination of CreateFlag values.

成员函数文档编制

[static] QSSGPrepResultId QSSGRenderHelpers:: commit (const QSSGFrameData & frameData , QSSGPrepContextId prepId , QSSGRenderablesId renderablesId , float lodThreshold = 1.0f)

Once the required changes have been done to the renderables, the data can marked as ready for the renderer.

Returns an id to the preparation result.

frameData , prepId , renderablesId , lodThreshold

另请参阅 prepareRenderables () 和 renderRenderables ().

[static] QSSGRenderablesId QSSGRenderHelpers:: createRenderables (const QSSGFrameData & frameData , QSSGPrepContextId prepId , const QSSGRenderHelpers::NodeList & nodes , QSSGRenderHelpers::CreateFlags flags = CreateFlag::None)

Takes a list of node ids and create renderables that can be further processed by the renderer. If there are no nodes, or no renderable nodes in the list, the returned id will be invalid.

By default the function does not recurse down and included children of the nodes in the list. Enabling recursion can be achieved by passing in the Recurse flag in the flags 自变量。

Returns an id to the created renderables.

frameData , prepId

另请参阅 CreateFlags and prepareForRender ().

[static] QSSGPrepContextId QSSGRenderHelpers:: prepareForRender (const QSSGFrameData & frameData , const QSSGRenderExtension & ext , QSSGCameraId cameraId , quint32 slot = 0)

prepareForRender() creates a context for collecting and storing information about the render-data associated with this render extension.

If the same nodes are to be rendered more then once but with different properties, for example a different material or camera, then a new context will be needed. To create several contexts for one extension the slot argument can be used. The default context is created in slot 0 .

Returns an id to the prep context.

frameData , ext , cameraId

另请参阅 commit ().

[static] void QSSGRenderHelpers:: prepareRenderables (const QSSGFrameData & frameData , QSSGPrepResultId prepId , QRhiRenderPassDescriptor * renderPassDescriptor , QSSGRhiGraphicsPipelineState & ps , QSSGRenderablesFilters filter = QSSGRenderablesFilter::All)

Prepare the draw call data needed for the renderables before calling renderRenderables .

Returns an id to the preparation result.

frameData , renderPassDescriptor , ps , prepId , filter

另请参阅 renderRenderables ().

[static] void QSSGRenderHelpers:: renderRenderables (const QSSGFrameData & frameData , QSSGPrepResultId prepId )

Render the renderables.

frameData , prepId

另请参阅 prepareRenderables ().