QForwardRenderer Class | Qt 3D 5.6

Qt 5.6 | Qt 3D | C++ Classes | QForwardRenderer

Qt 5.6.2 Reference Documentation

# QForwardRenderer Class

(Qt3DRender::QForwardRenderer)

The Qt3DRender::QForwardRenderer provides a default FrameGraph implementation of a forward renderer. More...

Header: | #include <QForwardRenderer>
qmake: | QT += 3drender
Since: | Qt 5.5
Inherits: | QTechniqueFilter

- List of all members, including inherited members

## Properties

- camera : Qt3DCore::QEntity *
- clearColor : QColor
- viewportRect : QRectF

- 1 property inherited from Qt3DRender::QFrameGraphNode
- 2 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject

## Public Functions

| QForwardRenderer(Qt3DCore::QNode *parent = Q_NULLPTR)
| ~QForwardRenderer()
Qt3DCore::QEntity * | camera() const
QColor | clearColor() const
QRectF | viewportRect() const

- 6 public functions inherited from Qt3DRender::QTechniqueFilter
- 2 public functions inherited from Qt3DRender::QFrameGraphNode
- 6 public functions inherited from Qt3DCore::QNode
- 31 public functions inherited from QObject

## Public Slots

void | setCamera(Qt3DCore::QEntity *camera)
void | setClearColor(const QColor &clearColor)
void | setViewportRect(const QRectF &viewportRect)

- 1 public slot inherited from Qt3DRender::QFrameGraphNode
- 2 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject

## Signals

void | cameraChanged(Qt3DCore::QEntity *camera)
void | clearColorChanged(const QColor &clearColor)
void | viewportRectChanged(const QRectF &viewportRect)

- 1 signal inherited from Qt3DRender::QFrameGraphNode
- 2 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject

### Additional Inherited Members

- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 1 protected function inherited from Qt3DRender::QTechniqueFilter
- 3 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject
- 2 protected variables inherited from QObject
- 1 static protected member inherited from Qt3DCore::QNode

## Detailed Description

The Qt3DRender::QForwardRenderer provides a default FrameGraph implementation of a forward renderer.

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

Internally the Qt3DRender::QForwardRenderer is a subclass of Qt3DRender::QTechniqueFilter. This a is a single leaf Framegraph tree which contains a Qt3DRender::QViewport, a Qt3DRender::QCameraSelector and a Qt3DRender::QClearBuffer. The Qt3DRender::QForwardRenderer has a default requirement annotation whose name is "renderingStyle" and value "forward". If you need to filter out your techniques, you should do so based on that annotation.

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

## Property Documentation

### camera : Qt3DCore::QEntity *

Holds the current QEntity camera used to render the scene.

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

Access functions:

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

Notifier signal:

void | cameraChanged(Qt3DCore::QEntity *camera)

### clearColor : QColor

Holds the current clearColor.

Access functions:

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

Notifier signal:

void | clearColorChanged(const QColor &clearColor)

### viewportRect : QRectF

Holds the current viewport rect.

Access functions:

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

Notifier signal:

void | viewportRectChanged(const QRectF &viewportRect)

## Member Function Documentation

### QForwardRenderer::QForwardRenderer(Qt3DCore::QNode *parent = Q_NULLPTR)

Default constructs an instance of QForwardRenderer.

### QForwardRenderer::~QForwardRenderer()

Destroys the QForwardRenderer instance.

### `[slot]` void QForwardRenderer::setCamera(Qt3DCore::QEntity *camera)

Sets the camera which should be used to render the scene to camera.

Note: A camera is a QEntity having a QCameraLens as one of its components.

Note: Setter function for property camera.

See also camera().