Kuesa Runtime

BloomEffect Class

class Kuesa::BloomEffect

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

Header: #include <Kuesa/BloomEffect>
Since: Kuesa 1.0
Inherits: Kuesa::AbstractPostProcessingEffect

This class was introduced in Kuesa 1.0.

Properties

Public Functions

int blurPassCount() const
float threshold() const

Reimplemented Public Functions

virtual Kuesa::AbstractPostProcessingEffect::FrameGraphNodePtr frameGraphSubTree() const override
virtual void setInputTexture(Qt3DRender::QAbstractTexture *texture) override
virtual void setWindowSize(const QSize &size) override

Public Slots

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

Signals

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

Detailed Description

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.

 #include <Qt3DExtras/Qt3DWindow>
 #include <ForwardRenderer>
 #include <SceneEntity>
 #include <BloomEffect>

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

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

 frameGraph->addPostProcessingEffect(bloomEffect);

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

 ...

Property Documentation

blurPassCount : int

This property holds the number of blur passes

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.

Access functions:

int blurPassCount() const
void setBlurPassCount(int blurPassCount)

Notifier signal:

void blurPassCountChanged(int blurPassCount)

See also GaussianBlurEffect::blurPassCount.

threshold : float

This property holds the brightness level determining which pixels the effect are applied to

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.

Access functions:

float threshold() const
void setThreshold(float threshold)

Notifier signal:

void thresholdChanged(float threshold)

See also ThresholdEffect::threshold.

Member Function Documentation

[slot] void BloomEffect::setBlurPassCount(int blurPassCount)

Sets the number of blur passes to apply to blurPassCount.

Note: Setter function for property blurPassCount.

See also BloomEffect::blurPassCount.

[slot] void BloomEffect::setThreshold(float threshold)

Sets the threshold value to threshold.

Note: Setter function for property threshold.

See also BloomEffect::threshold.

int BloomEffect::blurPassCount() const

Returns the number of blur passes to apply.

Note: Getter function for property blurPassCount.

See also BloomEffect::setBlurPassCount.

[override virtual] Kuesa::AbstractPostProcessingEffect::FrameGraphNodePtr BloomEffect::frameGraphSubTree() const

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

See also Kuesa::AbstractPostProcessingEffect::frameGraphSubTree.

[override virtual] void BloomEffect::setInputTexture(Qt3DRender::QAbstractTexture *texture)

Sets the input texture for the effect to texture.

See also Kuesa::AbstractPostProcessingEffect::setInputTexture.

[override virtual] void BloomEffect::setWindowSize(const QSize &size)

Reimplements: AbstractPostProcessingEffect::setWindowSize(const QSize &sceneSize).

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

See also Kuesa::AbstractPostProcessingEffect::setSceneSize.

float BloomEffect::threshold() const

Returns the threshold value.

Note: Getter function for property threshold.

See also BloomEffect::setThreshold.