Skip to content

Kuesa::Qt3D::GaussianBlurEffect

Module: Kuesa Qt 3D API

Post-processing effect for blurring the scene. More...

#include <Kuesa/Qt3D/api/fx/gaussianblureffect.h>

Inherits from Kuesa::Qt3D::AbstractPostProcessingEffect, Qt3DCore::QNode

Public Slots

Name
void setBlurPassCount(int blurPassCount)

Public Signals

Name
void blurPassCountChanged(int blurPassCount)

Public Functions

Name
GaussianBlurEffect(Qt3DCore::QNode * parent =nullptr)
virtual FrameGraphNodePtr frameGraphSubTree() const override
virtual QVector< Qt3DRender::QLayer * > layers() const override
virtual void setInputTexture(Qt3DRender::QAbstractTexture * texture) override
virtual void setWindowSize(const QSize & size) override
int blurPassCount() const

Public Properties

Name
int blurPassCount
the number of blur passes

Additional inherited members

Public Types inherited from Kuesa::Qt3D::AbstractPostProcessingEffect

Name
enum Type { Custom}
using QSharedPointer< Qt3DRender::QFrameGraphNode > FrameGraphNodePtr

Public Functions inherited from Kuesa::Qt3D::AbstractPostProcessingEffect

Name
~AbstractPostProcessingEffect()
Type type() const
virtual void setDepthTexture(Qt3DRender::QAbstractTexture * texture)
virtual void setCamera(Qt3DCore::QEntity * camera)

Protected Functions inherited from Kuesa::Qt3D::AbstractPostProcessingEffect

Name
AbstractPostProcessingEffect(Qt3DCore::QNode * parent =nullptr, Type type =Custom)

Protected Attributes inherited from Kuesa::Qt3D::AbstractPostProcessingEffect

Name
const Type m_type

Detailed Description

1
class Kuesa::Qt3D::GaussianBlurEffect;

Post-processing effect for blurring the scene.

Since: Kuesa 2.0

GaussianBlurEffect is a post-processing effect that applies a Gaussian blur to the scene. The amount of blurring can be adjusted using the blurPassCount property.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#include <Qt3DExtras/Qt3DWindow>
#include <ForwardRenderer>
#include <SceneEntity>
#include <GaussianBlurEffect>

Qt3DExtras::Qt3DWindow win;
Kuesa::Qt3D::SceneEntity *root = new Kuesa::Qt3D::SceneEntity();
Kuesa::Qt3D::ForwardRenderer *frameGraph = new Kuesa::Qt3D::ForwardRenderer();
Kuesa::Qt3D::GaussianBlurEffect *blurEffect = new Kuesa::Qt3D::GaussianBlurEffect();

blurEffect->setBlurPassCount(2);

frameGraph->addPostProcessingEffect(blurEffect);

win->setRootEntity(root);
win->setActiveFrameGraph(forwardRenderer);

...

Example

blur.pngBlur effect applied on a Kuesa scene.

Increasing the number of passes too high may adversely impact rendering performance, especially on lower-end GPUs.

Public Slots Documentation

slot setBlurPassCount

1
2
3
void setBlurPassCount(
    int blurPassCount
)

See: GaussianBlurEffect::blurPassCount

Sets the number of blur passes to blurPassCount.

Public Signals Documentation

signal blurPassCountChanged

1
2
3
void blurPassCountChanged(
    int blurPassCount
)

Public Functions Documentation

function GaussianBlurEffect

1
2
3
GaussianBlurEffect(
    Qt3DCore::QNode * parent =nullptr
)

function frameGraphSubTree

1
virtual FrameGraphNodePtr frameGraphSubTree() const override

See: AbstractPostProcessingEffect::frameGraphSubTree

Reimplements: Kuesa::Qt3D::AbstractPostProcessingEffect::frameGraphSubTree

Returns the frame graph subtree corresponding to the effect's implementation.

function layers

1
virtual QVector< Qt3DRender::QLayer * > layers() const override

Reimplements: Kuesa::Qt3D::AbstractPostProcessingEffect::layers

Return the layers provided by this effect. This will generally be the layer of a

function setInputTexture

1
2
3
virtual void setInputTexture(
    Qt3DRender::QAbstractTexture * texture
) override

See: AbstractPostProcessingEffect::setInputTexture

Reimplements: Kuesa::Qt3D::AbstractPostProcessingEffect::setInputTexture

Sets the input texture for the effect to texture.

function setWindowSize

1
2
3
virtual void setWindowSize(
    const QSize & size
) override

See: AbstractPostProcessingEffect::setSceneSize

Reimplements: Kuesa::Qt3D::AbstractPostProcessingEffect::setWindowSize

Sets the size of the rendered scene in pixels to size. This is required to keep a consistent amount of blurring when the scene is resized.

function blurPassCount

1
int blurPassCount() const

See: GaussianBlurEffect::setBlurPassCount

Returns the number of blur passes.

Public Property Documentation

property blurPassCount

1
int blurPassCount;

the number of blur passes

This is the number of times to apply the blur filter. More passes result in stronger blurring effect but take longer to render.


Updated on 2023-07-03 at 11:02:12 +0000