Skip to content

Kuesa::Qt3D::ThresholdEffect

Module: Kuesa Qt 3D API

Post-processing effect showing only pixels brighter than a specified value. More...

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

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

Public Slots

Name
void setThreshold(float threshold)

Public Signals

Name
void thresholdChanged(float threshold)

Public Functions

Name
ThresholdEffect(Qt3DCore::QNode * parent =nullptr)
virtual FrameGraphNodePtr frameGraphSubTree() const override
virtual QVector< Qt3DRender::QLayer * > layers() const override
virtual void setInputTexture(Qt3DRender::QAbstractTexture * texture) override
float threshold() const

Public Properties

Name
float threshold
the brightness value used as a cut-off

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)
virtual void setWindowSize(const QSize & sceneSize)

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::ThresholdEffect;

Post-processing effect showing only pixels brighter than a specified value.

Since: Kuesa 2.0

ThresholdEffect is a post-processing effect that passes through any pixel above a certain brightness value and sets all others to black.

 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 <ThresholdEffect>

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

thresholdEffect->setThreshold(0.5f);

frameGraph->addPostProcessingEffect(thresholdEffect);

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

...

Public Slots Documentation

slot setThreshold

1
2
3
void setThreshold(
    float threshold
)

See: ThresholdEffect::threshold

Sets the threshold value to threshold.

Public Signals Documentation

signal thresholdChanged

1
2
3
void thresholdChanged(
    float threshold
)

Public Functions Documentation

function ThresholdEffect

1
2
3
ThresholdEffect(
    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 threshold

1
float threshold() const

See: ThresholdEffect::setThreshold

Returns the current threshold.

Public Property Documentation

property threshold

1
float threshold;

the brightness value used as a cut-off

This value is used to determine how bright a pixel needs to be to pass the threshold.

Threshold 0.12 Threshold 0.35
t12.pngt12.pngt12.pngt12.png t35.pngt35.pngt35.pngt35.png

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