ToneMapper

open class ToneMapper(nativeHandle: NativePointer) : AutoCloseable

Interface for tone mapping operators.

A tone mapping operator, or tone mapper, is responsible for compressing the dynamic range of the rendered scene to a dynamic range suitable for display.

In Filament, tone mapping is a color grading step. ToneMapper instances are created and passed to the ColorGrading.Builder to produce a 3D LUT that will be used during post-processing to prepare the final color buffer for display.

Filament provides several default tone mapping operators that fall into three categories:

  • Configurable tone mapping operators

  • Generic

  • Agx

  • Fixed-aesthetic tone mapping operators

  • ACES

  • ACESLegacy

  • Filmic

  • PBRNeutralToneMapper

  • GT7ToneMapper

  • Debug/validation tone mapping operators

  • Linear

  • DisplayRange

Custom tone mapping operators can be created by subclassing ToneMapper.

Inheritors

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard

ACES tone mapping operator.

Link copied to clipboard

ACES tone mapping operator, modified for legacy compatibility.

Link copied to clipboard
class Agx : ToneMapper

AgX tone mapping operator.

Link copied to clipboard

A tone mapper that converts the input HDR RGB color into one of 16 debug colors that represent the pixel's exposure.

Link copied to clipboard

"Filmic" tone mapping operator.

Link copied to clipboard

Generic tone mapping operator that gives control over the tone mapping curve.

Link copied to clipboard

Gran Turismo 7 tone mapping operator.

Link copied to clipboard

Linear tone mapping operator that returns the input color clamped to the 0..1 range. This operator is mostly useful for debugging.

Link copied to clipboard

Khronos PBR Neutral tone mapping operator.

Properties

Link copied to clipboard

True if this tone mapper produces LDR output, i.e. never outputs values above 1.0.

Link copied to clipboard

If true, then this function holds that f(x) = vec3(f(x.r), f(x.g), f(x.b)), which lets Filament build its LUT faster.

Functions

Link copied to clipboard
open override fun close()

Destroys the native tone mapper. ColorGrading.Builder only uses it during build(), so it can be closed afterwards.

Link copied to clipboard
operator fun invoke(color: FloatArray, out: FloatArray? = null): FloatArray

Maps an open domain (or "scene referred") color value to a display domain (or "display referred") color value. Both are in the Rec.2020 color space, with no transfer function applied ("linear Rec.2020").