Skip to content

Kuesa::Qt3D::ToneMappingAndGammaCorrectionEffect

Module: Kuesa Qt 3D API

Perform conversion from linear color space to sRGB space. This effects performs exposure correction, tone mapping and gamma correction in this order. More...

#include <tonemappingandgammacorrectioneffect.h>

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

Public Types

Name
enum ToneMapping { None = 0, Reinhard, Filmic, Uncharted}

Public Slots

Name
void setExposure(float exposure)
void setGamma(float gamma)
void setToneMappingAlgorithm(Kuesa::Qt3D::ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm)

Public Signals

Name
void exposureChanged(float exposure)
void gammaChanged(float gamma)
void toneMappingAlgorithmChanged(Kuesa::Qt3D::ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm)

Public Functions

Name
ToneMappingAndGammaCorrectionEffect(Qt3DCore::QNode * parent =nullptr)
~ToneMappingAndGammaCorrectionEffect()
float exposure() const
float gamma() const
ToneMapping toneMappingAlgorithm() const
virtual FrameGraphNodePtr frameGraphSubTree() const override
virtual void setInputTexture(Qt3DRender::QAbstractTexture * texture) override
virtual QVector< Qt3DRender::QLayer * > layers() const override

Public Properties

Name
float exposure
float gamma
Kuesa::Qt3D::ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm

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

Perform conversion from linear color space to sRGB space. This effects performs exposure correction, tone mapping and gamma correction in this order.

Since: Kuesa 2.0

Note: If using the ForwardRenderer FrameGraph, this effect is automatically added as the last step of the pipeline, after any user defined post processing effect. Therefore, you shouldn't need to instantiate this effect yourself if using that FrameGraph.

It uses a gamma of 2.2 to perform the correction, but this can be overridden if required.

If you care about Tone Mapping implementation details, the algorithms in use are detailly explained

Public Types Documentation

enum ToneMapping

Enumerator Value Description
None 0
Reinhard
Filmic
Uncharted

This enum lists the various Tone Mapping Algorithms

  • None - No Tone Mapping (default)
  • Reinhard - Reinhard Tone Mapping
  • Filmic - Filmic Tone Mapping
  • Uncharted - Hable John's Uncharted Tone Mapping

Public Slots Documentation

slot setExposure

1
2
3
void setExposure(
    float exposure
)

slot setGamma

1
2
3
void setGamma(
    float gamma
)

slot setToneMappingAlgorithm

1
2
3
void setToneMappingAlgorithm(
    Kuesa::Qt3D::ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm
)

Since: Kuesa 2.0

Sets the tone mapping algorithm to algorithm,

Public Signals Documentation

signal exposureChanged

1
2
3
void exposureChanged(
    float exposure
)

signal gammaChanged

1
2
3
void gammaChanged(
    float gamma
)

signal toneMappingAlgorithmChanged

1
2
3
void toneMappingAlgorithmChanged(
    Kuesa::Qt3D::ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm
)

Public Functions Documentation

function ToneMappingAndGammaCorrectionEffect

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

function ~ToneMappingAndGammaCorrectionEffect

1
~ToneMappingAndGammaCorrectionEffect()

function exposure

1
float exposure() const

function gamma

1
float gamma() const

function toneMappingAlgorithm

1
ToneMapping toneMappingAlgorithm() const

Since: Kuesa 2.0

Returns the tone mapping algorithm used by the shader. \default ToneMappingAndGammaCorrectionEffect::None

function frameGraphSubTree

1
virtual FrameGraphNodePtr frameGraphSubTree() const override

Note: The lifetime of the returned subtree is assumed to be managed by the shared pointer. Any caller reparenting the subtree to add to a

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

Returns a FrameGraph subtree corresponding to the effect's implementation.

function setInputTexture

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

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

Sets the input texture to texture for this effect. The texture contain the rendered scene that the effect will be applied to. This is set automatically by the ForwardRenderer when the effect is added.

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

Public Property Documentation

property exposure

1
float exposure;

Exposure correction factor used before the linear to sRGB conversion. \default 0

property gamma

1
float gamma;

Holds the gamma value to use for gamma correction conversion that brings linear colors to sRGB colors. \default 2.2

property toneMappingAlgorithm

1
Kuesa::Qt3D::ToneMappingAndGammaCorrectionEffect::ToneMapping toneMappingAlgorithm;

Tone mapping specifies how we perform color conversion from HDR (high dynamic range) content to LDR (low dynamic range) content which our monitor displays.

\default ToneMappingAndGammaCorrectionEffect::None


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