Kuesa::Qt3D::View
Module: Kuesa Qt 3D API
View allows to specify the rendering description for a rendered view of the scene. They are to be used along with the QForwardRenderer FrameGraph. More...
#include <view.h>
Inherits from Qt3DRender::QFrameGraphNode
Inherited by Kuesa::Qt3D::ForwardRenderer
Protected Types
|
Name |
enum |
Feature { BackToFrontSorting = (1 << 0), Skinning = (1 << 1), FrustumCulling = (1 << 2), ZFilling = (1 << 3), Particles = (1 << 4)} |
Public Slots
Public Signals
Public Functions
Protected Functions
Public Properties
Friends
Detailed Description
View allows to specify the rendering description for a rendered view of the scene. They are to be used along with the QForwardRenderer FrameGraph.
Since: Kuesa 2.0
View allows to specify the description of a rendered view of the scene. They are to be used along with the QForwardRenderer FrameGraph.
This is especially useful to render on the same window multiple views of different subset of content coming from a glTF file and scene from different view points.
Views are rendered in the order in which they were added to the ForwardRenderer.
1
2
3
4
5
6
7
8
9
10
11
12
13 | Kuesa::Qt3D::ForwardRenderer *frameGraph = new Kuesa::Qt3D::ForwardRenderer();
Kuesa::Qt3D::View *view1 = new Kuesa::Qt3D::View();
view1->setCamera(sceneCamera1);
view1->setViewportRect(QRectF(0, 0, 0.5, 1);
Kuesa::Qt3D::View *view2 = new Kuesa::Qt3D::View();
view2->setCamera(sceneCamera2);
view2->setViewportRect(QRectF(0.5, 0, 0.5, 1);
view2->addLayer(groundLayer);
frameGraph->addView(view1);
frameGraph->addView(view2);
|
Protected Types Documentation
enum Feature
Enumerator |
Value |
Description |
BackToFrontSorting |
(1 << 0) |
|
Skinning |
(1 << 1) |
|
FrustumCulling |
(1 << 2) |
|
ZFilling |
(1 << 3) |
|
Particles |
(1 << 4) |
|
Public Slots Documentation
slot setViewportRect
| void setViewportRect(
const QRectF & viewportRect
)
|
slot setCamera
| void setCamera(
Qt3DCore::QEntity * camera
)
|
slot setFrustumCulling
| void setFrustumCulling(
bool frustumCulling
)
|
slot setSkinning
| void setSkinning(
bool frustumCulling
)
|
slot setBackToFrontSorting
| void setBackToFrontSorting(
bool backToFrontSorting
)
|
slot setZFilling
| void setZFilling(
bool zfilling
)
|
slot setParticlesEnabled
| void setParticlesEnabled(
bool enabled
)
|
slot setReflectionTextureSize
| void setReflectionTextureSize(
const QSize & reflectionTextureSize
)
|
slot setClearColor
| void setClearColor(
const QColor & clearColor
)
|
Sets the clearColor used to clear the screen at the start of each frame. The color is expected to be in sRGB color space.
slot setGamma
| void setGamma(
float gamma
)
|
Sets the gamma value to use for gamma correction that brings linear colors to sRGB colors. \default 2.2
slot setExposure
| void setExposure(
float exposure
)
|
Sets the exposure value to use for exposure correction \default 0
slot setToneMappingAlgorithm
| void setToneMappingAlgorithm(
ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm
)
|
Since: Kuesa 2.0
Sets the tone mapping algorithm to toneMappingAlgorithm.
slot setUsesStencilMask
| void setUsesStencilMask(
bool usesStencilMask
)
|
Since: Kuesa 2.0
Allows to use stencil buffer during the render phase depending on the value of usesStencilMask. The resulting stencil buffer is then accessible from the post processing effects. This allows to apply post process effects only to part of the scene.
slot addPostProcessingEffect
| void addPostProcessingEffect(
AbstractPostProcessingEffect * effect
)
|
Registers a new post processing effect effect with the View. In essence this will complete the FrameGraph tree with a dedicated subtree provided by the effect.
Lifetime of the subtree will be entirely managed by the View.
Be aware that registering several effects of the same type might have unexpected behavior. It is advised against unless explicitly documented in the effect.
The FrameGraph tree is reconfigured upon insertion of a new effect.
Effects added to a view, contrary to effects added to the ForwardRenderer, only affect the view.
slot removePostProcessingEffect
| void removePostProcessingEffect(
AbstractPostProcessingEffect * effect
)
|
Unregisters effect from the current View. This will destroy the FrameGraph subtree associated with the effect.
The FrameGraph tree is reconfigured upon removal of an effect.
slot addLayer
| void addLayer(
Qt3DRender::QLayer * layer
)
|
slot removeLayer
| void removeLayer(
Qt3DRender::QLayer * layer
)
|
slot addReflectionPlane
| void addReflectionPlane(
ReflectionPlane * plane
)
|
slot removeReflectionPlane
| void removeReflectionPlane(
ReflectionPlane * plane
)
|
slot setShadowMaps
| void setShadowMaps(
const QVector< ShadowMapPtr > & activeShadowMaps
)
|
slot dump
Dumps the FrameGraph tree to the console. Can be really convenient for debug or troubleshooting purposes.
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 backToFrontSortingChanged
| void backToFrontSortingChanged(
bool backToFrontSorting
)
|
signal zFillingChanged
| void zFillingChanged(
bool zFilling
)
|
signal particlesEnabledChanged
| void particlesEnabledChanged(
bool enabled
)
|
signal reflectionTextureChanged
| void reflectionTextureChanged(
Qt3DRender::QAbstractTexture * reflectionTexture
)
|
signal reflectionTextureSizeChanged
| void reflectionTextureSizeChanged(
const QSize & reflectionTextureSize
)
|
signal clearColorChanged
| void clearColorChanged(
const QColor & clearColor
)
|
signal gammaChanged
| void gammaChanged(
float gamma
)
|
signal shadowMapsChanged
| void shadowMapsChanged(
const QVector< ShadowMapPtr > & shadowMaps
)
|
signal exposureChanged
| void exposureChanged(
float exposure
)
|
signal toneMappingAlgorithmChanged
| void toneMappingAlgorithmChanged(
ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm
)
|
signal usesStencilMaskChanged
| void usesStencilMaskChanged(
bool usesStencilMask
)
|
| void frameGraphTreeReconfigured()
|
Public Functions Documentation
function View
| explicit View(
Qt3DCore::QNode * parent =nullptr
)
|
function ~View
function viewportRect
| QRectF viewportRect() const
|
function camera
| Qt3DCore::QEntity * camera() const
|
function frustumCulling
| bool frustumCulling() const
|
function skinning
function backToFrontSorting
| bool backToFrontSorting() const
|
function zFilling
function particlesEnabled
| bool particlesEnabled() const
|
function reflectionTexture
| Qt3DRender::QAbstractTexture * reflectionTexture() const
|
function reflectionTextureSize
| QSize reflectionTextureSize() const
|
function clearColor
| QColor clearColor() const
|
Returns the color used to clear the screen at the start of each frame. The color is returned in sRGB color space.
function exposure
Exposure correction factor used before the linear to sRGB conversion.
\default 0.0
function gamma
Since: Kuesa 2.0
Gamma correction value used for the linear to sRGB conversion. \default 2.2
function toneMappingAlgorithm
| ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm() const
|
Since: Kuesa 2.0
Returns the tone mapping algorithm used by the shader. \default ToneMappingAndGammaCorrectionEffect::None
function usesStencilMask
| bool usesStencilMask() const
|
function postProcessingEffects
| const std::vector< AbstractPostProcessingEffect * > & postProcessingEffects() const
|
function layers
| const std::vector< Qt3DRender::QLayer * > & layers() const
|
Returns all layers used by the view.
function reflectionPlanes
| const std::vector< ReflectionPlane * > & reflectionPlanes() const
|
function shadowMaps
| QVector< ShadowMapPtr > shadowMaps() const
|
Protected Functions Documentation
function scheduleFGTreeRebuild
| void scheduleFGTreeRebuild()
|
function rebuildFGTree
| virtual void reconfigureStages()
|
| virtual void reconfigureFrameGraph()
|
Reimplemented by: Kuesa::Qt3D::ForwardRenderer::reconfigureFrameGraph
function rootView
function frameGraphSubtreeForPostProcessingEffect
| AbstractPostProcessingEffect::FrameGraphNodePtr frameGraphSubtreeForPostProcessingEffect(
AbstractPostProcessingEffect * effect
) 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 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 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.
property zFilling
Holds whether multi-pass zFilling support is enabled. Disabled by default.
property particlesEnabled
Holds whether particles support is enabled. Disabled by default.
property reflectionTexture
| Qt3DRender::QAbstractTexture * reflectionTexture;
|
Returns a 2D texture containing the reflections obtained from the reflection planes set for the View.
property reflectionTextureSize
| QSize reflectionTextureSize;
|
The size of the reflectionTexture. Defaults to 512x512. Increasing the size will lead to better reflections at the expense of more memory consumption.
property toneMappingAlgorithm
| ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm;
|
Since: Kuesa 2.0 \default ToneMappingAndGammaCorrectionEffect::None
Tone mapping specifies how we perform color conversion from HDR (high dynamic range) content to LDR (low dynamic range) content which our monitor displays.
property usesStencilMask
Since: Kuesa 2.0 \default False
Enables/disables stencil buffers. If true, stencil operations be used during the render phase to modify the stencil buffer. The resulting stencil buffer can later be used to apply post process effect to only part of the scene
property exposure
Since: Kuesa 2.0
Exposure correction factor used before the linear to sRGB conversion. \default 0
property gamma
Since: Kuesa 2.0
Holds the gamma value to use for gamma correction that brings linear colors to sRGB colors. \default 2.2
property clearColor
Holds the color used to clear the screen at the start of each frame.
Friends
friend ForwardRenderer
| friend class ForwardRenderer(
ForwardRenderer
);
|
friend ViewResolver
| friend class ViewResolver(
ViewResolver
);
|
Updated on 2023-07-03 at 11:02:10 +0000