Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QSSGRenderExtension Class Referenceabstract

#include <qssgrenderextensions_p.h>

+ Inheritance diagram for QSSGRenderExtension:
+ Collaboration diagram for QSSGRenderExtension:

Public Types

enum class  Type { Standalone , Main }
 Specifies the render extension type. More...
 
enum class  RenderMode { Underlay , Overlay }
 
- Public Types inherited from QSSGRenderGraphObject
enum  BaseType : quint16 {
  Node = 0x10 , Light = 0x20 , Camera = 0x40 , Renderable = 0x80 ,
  Resource = 0x100 , Material = 0x200 , Texture = 0x400 , Extension = 0x800
}
 
enum class  Type : quint16 {
  Unknown = 0 , Node = BaseType::Node , Layer , Joint ,
  Skeleton , ImportScene , ReflectionProbe , DirectionalLight = BaseType::Light | BaseType::Node ,
  PointLight , SpotLight , OrthographicCamera = BaseType::Camera | BaseType::Node , PerspectiveCamera ,
  CustomFrustumCamera , CustomCamera , Model = BaseType::Renderable | BaseType::Node , Item2D ,
  Particles , SceneEnvironment = BaseType::Resource , Effect , Geometry ,
  TextureData , MorphTarget , ModelInstance , ModelBlendParticle ,
  ResourceLoader , DefaultMaterial = BaseType::Material | BaseType::Resource , PrincipledMaterial , CustomMaterial ,
  SpecularGlossyMaterial , Skin , Image2D = BaseType::Texture | BaseType::Resource , ImageCube ,
  RenderExtension = BaseType::Extension
}
 

Public Member Functions

 QSSGRenderExtension ()
 
virtual ~QSSGRenderExtension ()
 
virtual bool prepareData (QSSGFrameData &data)=0
 Called after scene data is collected, but before any render data or rendering in the current frame has been done.
 
virtual void prepareRender (const QSSGRenderer &renderer, QSSGFrameData &data)=0
 Prepare data for rendering.
 
virtual void render (const QSSGRenderer &renderer)=0
 renderer handle to the QtQuick3D's render object.
 
virtual void release ()=0
 Called each time a new frame starts.
 
virtual Type type () const =0
 
virtual RenderMode mode () const =0
 
- Public Member Functions inherited from QSSGRenderGraphObject
Q_QUICK3D_PROFILE_ID QSSGRenderGraphObject (QSSGRenderGraphObject::Type inType)
 
virtual ~QSSGRenderGraphObject ()
 

Additional Inherited Members

- Static Public Member Functions inherited from QSSGRenderGraphObject
static Q_REQUIRED_RESULT constexpr bool isNodeType (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isLight (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isCamera (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isMaterial (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isTexture (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isRenderable (Type type) Q_DECL_NOTHROW
 
static Q_REQUIRED_RESULT constexpr bool isResource (Type type) Q_DECL_NOTHROW
 
static constexpr bool isExtension (Type type) noexcept
 
static Q_REQUIRED_RESULT constexpr bool hasGraphicsResources (Type type) Q_DECL_NOTHROW
 
static const char * asString (QSSGRenderGraphObject::Type type)
 
static QDebug debugPrintImpl (QDebug stream, QSSGRenderGraphObject::Type type)
 
- Public Attributes inherited from QSSGRenderGraphObject
Type type
 

Detailed Description

Definition at line 63 of file qssgrenderextensions_p.h.

Member Enumeration Documentation

◆ RenderMode

Enumerator
Underlay 
Overlay 

Definition at line 72 of file qssgrenderextensions_p.h.

◆ Type

enum class QSSGRenderExtension::Type
strong

Specifies the render extension type.

\value Standalone The 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 type is used the \l prepareRender() and \l render() functions are both called during the frame's prepare phase.

\value Main The rendering code is recorded within the main render pass. In this mode the \l prepareRender() is called in the frame's prepare phase while \l render() is called the frame's render phase.

Enumerator
Standalone 
Main 

Definition at line 66 of file qssgrenderextensions_p.h.

Constructor & Destructor Documentation

◆ QSSGRenderExtension()

QSSGRenderExtension::QSSGRenderExtension ( )

Definition at line 109 of file qssgrenderextensions.cpp.

◆ ~QSSGRenderExtension()

QSSGRenderExtension::~QSSGRenderExtension ( )
virtual

Definition at line 115 of file qssgrenderextensions.cpp.

Member Function Documentation

◆ mode()

QSSGRenderExtension::RenderMode QSSGRenderExtension::mode ( ) const
pure virtual
Returns
The mode that should used for this render extension.
See also
QSSGRenderExtension::RenderMode

Definition at line 225 of file qssgrenderextensions.cpp.

References Overlay.

◆ prepareData()

bool QSSGRenderExtension::prepareData ( QSSGFrameData data)
pure virtual

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

Definition at line 159 of file qssgrenderextensions.cpp.

References Q_UNUSED.

◆ prepareRender()

void QSSGRenderExtension::prepareRender ( const QSSGRenderer renderer,
QSSGFrameData data 
)
pure virtual

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 type \l Type::Standalon 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, QSSGRenderer

Definition at line 177 of file qssgrenderextensions.cpp.

References Q_UNUSED, and renderer.

◆ release()

void QSSGRenderExtension::release ( )
pure virtual

Called each time a new frame starts.

Any data from the previous frame should be cleared at this point.

Definition at line 203 of file qssgrenderextensions.cpp.

◆ render()

void QSSGRenderExtension::render ( const QSSGRenderer renderer)
pure virtual

renderer handle to the QtQuick3D's render object.

Record the render pass. Depending on the extensions \l {Type}{type} this function will be called during the frame's prepare or render phase.

See also
QSSGRenderExtension::Type, QSSGRenderer

Definition at line 192 of file qssgrenderextensions.cpp.

References Q_UNUSED, and renderer.

◆ type()

QSSGRenderExtension::Type QSSGRenderExtension::type ( ) const
pure virtual
Returns
The render extension type.
See also
QSSGRenderExtension::Type

Definition at line 214 of file qssgrenderextensions.cpp.


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