Kuesa::Qt3D::ForwardRendererLight
Module: Kuesa Qt 3D API
Implements a simple forward rendering FrameGraph. More...
#include <forwardrendererlight.h>
Inherits from Qt3DRender::QRenderSurfaceSelector
Public Slots
Public Signals
Public Functions
Public Properties
Detailed Description
| class Kuesa::Qt3D::ForwardRendererLight;
|
Implements a simple forward rendering FrameGraph.
Since: Kuesa 2.0
This FrameGraph will select all Qt3D Entities that reference a Material with Techniques having a FilterKey with the name "renderingStyle" set to the string value "forward".
The rendering will be made on a main viewport whose dimensions can be set with normalized coordinates by calling ForwardRendererLight::setViewportRect.
The screen will be cleared with the color set by calling ForwardRendererLight::setClearColor. By default the clear color is black.
The scene will be rendered from the camera set with ForwardRendererLight::setCamera on the window.
Frustum culling of Entities will be performed by default to only render entities that are visible within the camera's frustum. This can be disabled by calling ForwardRendererLight::setFrustumCulling.
Please note that this FrameGraph does not support skinned meshes.
By default the rendering is performed so that:
Opaque object are rendered first: Entities having a Material with a compatible RenderPass that has a FilterKey KuesaDrawStage with a value set to Opaque will be rendered.
Transparent objects are rendered second: select all Entities having a Material with a compatible RenderPass that has a FilterKey KuesaDrawStage with a value set to Transparent will be rendered.
Scenes containing materials with transparency need to be drawn from back-to-front in relation to the Camera for the blending to work correctly. This sorting can be expensive but is disabled by default. It can be disabled by calling ForwardRendererLight::setBackToFrontSorting.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | #include <Qt3DExtras/Qt3DWindow>
#include <Qt3DRender/QCamera>
#include <ForwardRenderer>
#include <SceneEntity>
#include <BloomEffect>
Qt3DExtras::Qt3DWindow win;
Kuesa::Qt3D::SceneEntity *root = new Kuesa::Qt3D::SceneEntity();
Kuesa::Qt3D::ForwardRendererLight *frameGraph = new Kuesa::Qt3D::ForwardRendererLight();
Qt3DRender::QCamera *camera = new Qt3DRender::QCamera();
frameGraph->setCamera(camera);
frameGraph->setClearColor(QColor(Qt::red));
win->setRootEntity(root);
win->setActiveFrameGraph(frameGraph);
...
|
Public Slots Documentation
slot setViewportRect
| void setViewportRect(
const QRectF & viewportRect
)
|
slot setCamera
| void setCamera(
Qt3DCore::QEntity * camera
)
|
slot setClearColor
| void setClearColor(
const QColor & clearColor
)
|
slot setFrustumCulling
| void setFrustumCulling(
bool frustumCulling
)
|
slot setSkinning
| void setSkinning(
bool skinning
)
|
slot setShowDebugOverlay
| void setShowDebugOverlay(
bool showDebugOverlay
)
|
slot setBackToFrontSorting
| void setBackToFrontSorting(
bool backToFrontSorting
)
|
Public Signals Documentation
signal viewportRectChanged
| void viewportRectChanged(
const QRectF & viewportRect
)
|
signal cameraChanged
| void cameraChanged(
Qt3DCore::QEntity * camera
)
|
signal frustumCullingChanged
| void frustumCullingChanged(
bool frustumCulling
)
|
signal skinningChanged
| void skinningChanged(
bool skinning
)
|
signal clearColorChanged
| void clearColorChanged(
const QColor & clearColor
)
|
signal showDebugOverlayChanged
| void showDebugOverlayChanged(
bool showDebugOverlay
)
|
signal backToFrontSortingChanged
| void backToFrontSortingChanged(
bool backToFrontSorting
)
|
Public Functions Documentation
function ForwardRendererLight
| explicit ForwardRendererLight(
Qt3DCore::QNode * parent =nullptr
)
|
function ~ForwardRendererLight
function viewportRect
| QRectF viewportRect() const
|
function camera
| Qt3DCore::QEntity * camera() const
|
function clearColor
| QColor clearColor() const
|
function frustumCulling
| bool frustumCulling() const
|
function skinning
function showDebugOverlay
| bool showDebugOverlay() const
|
function backToFrontSorting
| bool backToFrontSorting() const
|
Public Property Documentation
property viewportRect
Holds the viewport rectangle from within which the rendering will occur. Rectangle is in normalized coordinates.
property camera
| Qt3DCore::QEntity * camera;
|
Holds the camera used to view the scene.
property clearColor
Holds the color used to clear the screen at the start of each frame.
property frustumCulling
Holds whether frustum culling is enabled or not. Enabled by default.
property skinning
Holds whether skinned mesh support is required. Disabled by default.
property showDebugOverlay
Shows the Qt 3D debug overlay when true. False by default;
property backToFrontSorting
Holds whether back to front sorting to render objects in back-to-front order is enabled. This is required for proper alpha blending rendering. Enabled by default.
Updated on 2023-07-03 at 11:02:09 +0000