QForwardRenderer Class

class Qt3DExtras ::QForwardRenderer

The QForwardRenderer provides a default FrameGraph implementation of a forward renderer. 更多...

头: #include <QForwardRenderer>
CMake: find_package(Qt6 COMPONENTS 3dextras REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
Since: Qt 5.7
实例化: ForwardRenderer
继承: Qt3DRender::QTechniqueFilter

特性

公共函数

Qt3DRender::QClearBuffers::BufferType buffersToClear () const
Qt3DCore::QEntity * camera () const
QColor clearColor () const
QSize externalRenderTargetSize () const
float gamma () const
bool isFrustumCullingEnabled () const
bool showDebugOverlay () const
QObject * surface () const
QRectF viewportRect () const

公共槽

void setBuffersToClear (Qt3DRender::QClearBuffers::BufferType)
void setCamera (Qt3DCore::QEntity * camera )
void setClearColor (const QColor & clearColor )
void setExternalRenderTargetSize (const QSize & size )
void setFrustumCullingEnabled (bool enabled )
void setGamma (float gamma )
void setShowDebugOverlay (bool showDebugOverlay )
void setSurface (QObject * surface )
void setViewportRect (const QRectF & viewportRect )

信号

void buffersToClearChanged (Qt3DRender::QClearBuffers::BufferType)
void cameraChanged (Qt3DCore::QEntity * camera )
void clearColorChanged (const QColor & clearColor )
void externalRenderTargetSizeChanged (const QSize & size )
void frustumCullingEnabledChanged (bool enabled )
void gammaChanged (float gamma )
void showDebugOverlayChanged (bool showDebugOverlay )
void surfaceChanged (QObject * surface )
void viewportRectChanged (const QRectF & viewportRect )

详细描述

Forward rendering is what OpenGL traditionally uses. It renders directly to the backbuffer one object at a time shading each one as it goes.

QForwardRenderer is a single leaf FrameGraph tree which contains a Qt3DRender::QViewport Qt3DRender::QCameraSelector ,和 Qt3DRender::QClearBuffers . The QForwardRenderer has a default requirement filter key whose name is "renderingStyle" and value "forward". If you need to filter out your techniques, you should do so based on that filter key.

By default the viewport occupies the whole screen and the clear color is white. Frustum culling is also enabled.

特性文档编制

[since 5.14] buffersToClear : Qt3DRender::QClearBuffers::BufferType

Holds the current buffers to be cleared. Default value is ColorDepthBuffer

该特性在 Qt 5.14 引入。

访问函数:

Qt3DRender::QClearBuffers::BufferType buffersToClear () const
void setBuffersToClear (Qt3DRender::QClearBuffers::BufferType)

通知程序信号:

void buffersToClearChanged (Qt3DRender::QClearBuffers::BufferType)

camera : Qt3DCore::QEntity *

Holds the current camera entity used to render the scene.

注意: A camera is a QEntity that has a QCameraLens as one of its components.

访问函数:

Qt3DCore::QEntity * camera () const
void setCamera (Qt3DCore::QEntity * camera )

通知程序信号:

void cameraChanged (Qt3DCore::QEntity * camera )

clearColor : QColor

Holds the current clear color of the scene. The frame buffer is initialized to the clear color before rendering.

访问函数:

QColor clearColor () const
void setClearColor (const QColor & clearColor )

通知程序信号:

void clearColorChanged (const QColor & clearColor )

externalRenderTargetSize : QSize

Contains the size of the external render target. External render targets are relevant when rendering does not target a window surface (as set in surface ).

访问函数:

QSize externalRenderTargetSize () const
void setExternalRenderTargetSize (const QSize & size )

通知程序信号:

void externalRenderTargetSizeChanged (const QSize & size )

frustumCulling : bool

Indicates if the renderer applies frustum culling to the scene.

访问函数:

bool isFrustumCullingEnabled () const
void setFrustumCullingEnabled (bool enabled )

通知程序信号:

void frustumCullingEnabledChanged (bool enabled )

gamma : float

Holds the gamma value the renderer applies to the scene.

访问函数:

float gamma () const
void setGamma (float gamma )

通知程序信号:

void gammaChanged (float gamma )

[since 5.15] showDebugOverlay : bool

If true, a debug overlay will be rendered over the scene. It will show detailed information about the runtime rendering state, let the user turn logging on and off, etc.

该特性在 Qt 5.15 引入。

访问函数:

bool showDebugOverlay () const
void setShowDebugOverlay (bool showDebugOverlay )

通知程序信号:

void showDebugOverlayChanged (bool showDebugOverlay )

surface : QObject *

Holds the current render surface.

访问函数:

QObject * surface () const
void setSurface (QObject * surface )

通知程序信号:

void surfaceChanged (QObject * surface )

viewportRect : QRectF

Holds the current normalized viewport rectangle.

访问函数:

QRectF viewportRect () const
void setViewportRect (const QRectF & viewportRect )

通知程序信号:

void viewportRectChanged (const QRectF & viewportRect )