Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSSGRenderHelpers Class Reference

\inmodule QtQuick3D More...

#include <qssgrenderhelpers.h>

Collaboration diagram for QSSGRenderHelpers:

Public Types

enum class  CreateFlag : quint32 { None , Recurse = 0x1 , Steal = 0x2 }
 \value None The default value. More...

Static Public Member Functions

static QSSGRenderablesId createRenderables (const QSSGFrameData &frameData, QSSGPrepContextId prepId, const QSSGNodeIdList &nodes, CreateFlags flags=CreateFlag::None)
 Takes a list of node ids and create renderables that can be further processed by the renderer.
static QSSGPrepContextId 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.
static QSSGPrepResultId 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.
static void 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 \l {renderRenderables}.
static void renderRenderables (const QSSGFrameData &frameData, QSSGPrepResultId prepId)
 Render the renderables.

Detailed Description

\inmodule QtQuick3D

Since
6.7

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

Definition at line 103 of file qssgrenderhelpers.h.

Member Enumeration Documentation

◆ CreateFlag

\value None The default value.

Renderables are created only for the nodes specified. \value Recurse Renderables are created for each node and their children. \value Steal Renderables are taken from the engine and won't be rendered by QtQuick3D.

Note
Calling \l 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.
Enumerator
None 
Recurse 
Steal 

Definition at line 106 of file qssgrenderhelpers.h.

Member Function Documentation

◆ commit()

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

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

See also
prepareRenderables(), renderRenderables()

Definition at line 137 of file qssgrenderhelpers.cpp.

◆ createRenderables()

QSSGRenderablesId QSSGRenderHelpers::createRenderables ( const QSSGFrameData & frameData,
QSSGPrepContextId prepId,
const QSSGNodeIdList & nodes,
CreateFlags flags = CreateFlag::None )
staticnodiscard

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 \l{CreateFlag::}{Recurse} flag in the flags argument.

Returns
an id to the created renderables.

frameData, prepId

See also
CreateFlags, prepareForRender()

Definition at line 83 of file qssgrenderhelpers.cpp.

◆ prepareForRender()

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

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

See also
commit()

Definition at line 114 of file qssgrenderhelpers.cpp.

◆ prepareRenderables()

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

Prepare the draw call data needed for the renderables before calling \l {renderRenderables}.

Returns
an id to the preparation result.

frameData, renderPassDescriptor, ps, prepId, filter

See also
renderRenderables()

Definition at line 157 of file qssgrenderhelpers.cpp.

◆ renderRenderables()

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

Render the renderables.

frameData, prepId

See also
prepareRenderables()

Definition at line 176 of file qssgrenderhelpers.cpp.


The documentation for this class was generated from the following files: