Skip to content

Kuesa::Qt3D::BloomEffect

Module: Kuesa Qt 3D API

Post-processing effect for blurring the bright parts of a scene. More...

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

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

Public Slots

Name
void setThreshold(float threshold)
void setBlurPassCount(int blurPassCount)

Public Signals

Name
void thresholdChanged(float threshold)
void blurPassCountChanged(int blurPassCount)

Public Functions

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

Public Properties

Name
float threshold
the brightness level determining which pixels the effect are applied to
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::BloomEffect;

Post-processing effect for blurring the bright parts of a scene.

Since: Kuesa 2.0

BloomEffect is a post-processing effect that applies a blur to the brightest parts of scene to simulate a fuzzy glow.

The effect can be configured to change the threshold defining the bright parts of the scene and the amount of blurring to apply.

The BloomEffect is a combination of the ThresholdEffect and the GaussianBlurEffect.

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

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

bloomEffect->setThreshold(0.5f);
bloomEffect->setBlurPassCount(2);

frameGraph->addPostProcessingEffect(bloomEffect);

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

...

Public Slots Documentation

slot setThreshold

1
2
3
void setThreshold(
    float threshold
)

See: BloomEffect::threshold

Sets the threshold value to threshold.

slot setBlurPassCount

1
2
3
void setBlurPassCount(
    int blurPassCount
)

See: BloomEffect::blurPassCount

Sets the number of blur passes to apply to blurPassCount.

Public Signals Documentation

signal thresholdChanged

1
2
3
void thresholdChanged(
    float threshold
)

signal blurPassCountChanged

1
2
3
void blurPassCountChanged(
    int blurPassCount
)

Public Functions Documentation

function BloomEffect

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

function ~BloomEffect

1
~BloomEffect() override

function frameGraphSubTree

1
virtual FrameGraphNodePtr frameGraphSubTree() const override

See: Kuesa::Qt3D::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 setWindowSize

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

See: Kuesa::Qt3D::AbstractPostProcessingEffect::setSceneSize

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

Sets the size of the rendered scene in pixels to size.

function setInputTexture

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

See: Kuesa::Qt3D::AbstractPostProcessingEffect::setInputTexture

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

Sets the input texture for the effect to texture.

function threshold

1
float threshold() const

See: BloomEffect::setThreshold

Returns the threshold value.

function blurPassCount

1
int blurPassCount() const

See: BloomEffect::setBlurPassCount

Returns the number of blur passes to apply.

Public Property Documentation

property threshold

1
float threshold;

the brightness level determining which pixels the effect are applied to

See: ThresholdEffect::threshold

This value determines how bright something has to be for the bloom effect to be applied to it. Any pixels below the threshold are ignored.

property blurPassCount

1
int blurPassCount;

the number of blur passes

See: GaussianBlurEffect::blurPassCount

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


Updated on 2022-10-18 at 11:12:51 +0200