A tone mapping effect meant to map linear values to display device colors. More...
Static Public Member Functions | |
static nkMemory::UniquePtr< ToneMappingEffect > | create (System *system=nullptr) |
A tone mapping effect meant to map linear values to display device colors.
This effect offers different algorithms to tone map a given texture to colors that can map on a display device. It is a very important piece to generate realistic looking images, but it can also be tuned to give fancier results.
|
noexcept |
Default constructor. Alternatively, see ToneMappingEffect::create(), or EffectManager::createOrRetrieve().
|
virtual |
Default destructor. Also see EffectManager::erase().
|
overridevirtual |
nkGraphics::Texture* nkAstraeus::ToneMappingEffect::getSourceTexture | ( | ) | const |
bool nkAstraeus::ToneMappingEffect::getReinhardUsed | ( | ) | const |
const nkMaths::Vector& nkAstraeus::ToneMappingEffect::getReinhardMaxWhite | ( | ) | const |
bool nkAstraeus::ToneMappingEffect::getHablesUsed | ( | ) | const |
const ToneMappingHablesCurveDescriptor& nkAstraeus::ToneMappingEffect::getHablesDescriptor | ( | ) | const |
bool nkAstraeus::ToneMappingEffect::getAcesUsed | ( | ) | const |
const nkMaths::Matrix& nkAstraeus::ToneMappingEffect::getAcesLookTransform | ( | ) | const |
void nkAstraeus::ToneMappingEffect::setSourceTexture | ( | nkGraphics::Texture * | value | ) |
Sets the texture to use as a source. Linear values are expected in this texture, encoding the light intensities.
value | The texture to tone map as a source. |
void nkAstraeus::ToneMappingEffect::setAsReinhard | ( | const nkMaths::Vector & | maxWhite = nkMaths::Vector(2.f, 2.f, 2.f) | ) |
Prepare the effect to use the Reinhard technique to tone map the source texture.
maxWhite | The max white point to use as a reference to map the image. |
void nkAstraeus::ToneMappingEffect::setAsHables | ( | const ToneMappingHablesCurveDescriptor & | descriptor = ToneMappingHablesCurveDescriptor() | ) |
Prepare the effect to use the Hables curve technique to tone map the source texture.
descriptor | The description of the curve to use. |
void nkAstraeus::ToneMappingEffect::setAsAces | ( | const nkMaths::Matrix & | lookTransform = nkMaths::Matrix(1.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f) | ) |
Prepare the effect to use the ACES tone mapping standard.
lookTransform | A 3x3 transformation matrix that gets applied to the raw ACES values after conversion from the linear reference of the texture. This matrix can be used to tweak the exposure of values, each row encoding a color channel (from the top, red, green, and then blue) output as it gets applied as : lookTransform * acesValues |
void nkAstraeus::ToneMappingEffect::setUseLuminance | ( | bool | value | ) |
Sets whether the effect should act on the luminance values as a whole, or if it will act per color channel.
value | Whether the luminance of a pixel should be used (true) or not (false). |
|
overridevirtual |
Loads the effect and make it ready for rendering.
Implements nkAstraeus::Effect.
|
overridevirtual |
Unloads the effect and its internal memory. After that, the effect is unusable for rendering.
Implements nkAstraeus::Effect.
|
static |
Creates an instance of the class, and returns ownership over it.
system | The system the resource should live in. If left to nullptr, will seek the singleton instance of the system. |