Generic

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

This operator can be used to control the aesthetics of the final image. It also allows control over the dynamic range of the scene-referred values.

The tone mapping curve is defined by 5 parameters:

  • contrast: controls the contrast of the curve

  • midGrayIn: sets the input middle gray

  • midGrayOut: sets the output middle gray

  • hdrMax: defines the maximum input value that will be mapped to output white

The default values approximate an ACES tone mapping curve with a maximum input value of 10.0.

Parameters

contrast

Controls the contrast of the curve. Must be > 0.0, values in the range 0.5..2.0 are recommended. Default is 1.55.

midGrayIn

Sets the input middle gray, between 0.0 and 1.0. Default is 0.18.

midGrayOut

Sets the output middle gray, between 0.0 and 1.0. Default is 0.215.

hdrMax

Defines the maximum input value that will be mapped to output white. Must be >= 1.0. Default is 10.0.

Constructors

Link copied to clipboard
constructor(contrast: Float = 1.55f, midGrayIn: Float = 0.18f, midGrayOut: Float = 0.215f, hdrMax: Float = 10.0f)

Properties

Link copied to clipboard

Controls the contrast of the curve. Must be > 0.0, values in 0.5..2.0 recommended.

Link copied to clipboard

Defines the maximum input value that maps to output white. Must be >= 1.0.

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.

Link copied to clipboard

Sets the input middle gray, between 0.0 and 1.0.

Link copied to clipboard

Sets the output middle gray, between 0.0 and 1.0.

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").