Overview
The ColorGrading object provides comprehensive control over the appearance of rendered images through a series of color transformations applied in a specific order. These transformations range from basic exposure adjustments to advanced controls like ASC CDL color grading.Creation and Usage
A ColorGrading object is created using theColorGrading::Builder and destroyed by calling Engine::destroy(const ColorGrading*). A ColorGrading object is meant to be set on a View.
Transform Order
The various transforms held by ColorGrading are applied in the following order:- Exposure
- Night adaptation
- White balance
- Channel mixer
- Shadows/mid-tones/highlights
- Slope/offset/power (CDL)
- Contrast
- Vibrance
- Saturation
- Curves
- Tone mapping
- Luminance scaling
- Gamut mapping
Quality Levels
QualityLevel
When color grading is implemented using a 3D LUT, the quality level impacts the resolution and bit depth:LOW- 16x16x16 10-bit LUTMEDIUM- 32x32x32 10-bit LUT (default)HIGH- 32x32x32 16-bit LUTULTRA- 64x64x64 16-bit LUT
LutFormat
INTEGER- 10 bits per component (default)FLOAT- 16 bits per component (10 bits mantissa precision)
Builder Methods
Quality and Format
quality()
format() and dimensions().
format()
quality().
dimensions()
Tone Mapping
toneMapper()
ACESLegacyToneMapper.
luminanceScaling()
gamutMapping()
Basic Adjustments
exposure()
exposure- Value in EV stops. Can be negative, 0, or positive.
nightAdaptation()
adaptation- Amount of adaptation, between 0 (no adaptation) and 1 (full adaptation).
whiteBalance()
temperature- Modification on the blue/yellow axis. Range: -1.0 to +1.0 (where -1.0 = 50,000K, +1.0 = 2,000K)tint- Modification on the green/magenta axis. Range: -1.0 (green) to +1.0 (magenta)
Advanced Color Controls
channelMixer()
outRed- Mix of source RGB for output red channel (range: -2.0 to +2.0)outGreen- Mix of source RGB for output green channel (range: -2.0 to +2.0)outBlue- Mix of source RGB for output blue channel (range: -2.0 to +2.0)
shadowsMidtonesHighlights()
shadows- Linear RGB color (.rgb) and weight (.w) for shadowsmidtones- Linear RGB color (.rgb) and weight (.w) for mid-toneshighlights- Linear RGB color (.rgb) and weight (.w) for highlightsranges- Defines zone transitions (.xy = shadows to mid-tones, .zw = mid-tones to highlights)
slopeOffsetPower()
slope- Multiplier of input color (must be > 0, equivalent to gain)offset- Added to input color (can be negative or positive, equivalent to lift)power- Power exponent of input color (must be > 0, equivalent to gamma)
contrast()
contrast- Range: 0.0 to 2.0. A value of 1.0 has no effect.
vibrance()
vibrance- Range: 0.0 to 2.0. A value of 1.0 has no effect.
saturation()
saturation- Range: 0.0 to 2.0. A value of 1.0 has no effect.
curves()
shadowGamma- Power value for shadows (must be > 0)midPoint- Where shadows stop and highlights start (must be > 0)highlightScale- Scale factor for highlights (any value)
outputColorSpace()
- Rec709-sRGB-D65
- Rec709-Linear-D65
Default Values
- Exposure: 0.0
- Night adaptation: 0.0
- White balance: temperature 0, tint 0
- Channel mixer: red , green , blue
- Shadows/mid-tones/highlights: shadows , mid-tones , highlights , ranges
- Slope/offset/power: slope 1.0, offset 0.0, power 1.0
- Contrast: 1.0
- Vibrance: 1.0
- Saturation: 1.0
- Curves: gamma , midPoint , scale
- Tone mapping: ACESLegacyToneMapper
- Luminance scaling: false
- Gamut mapping: false
- Output color space: Rec709-sRGB-D65
Performance Considerations
Creating a new ColorGrading object may be more expensive than other Filament objects as a LUT may need to be generated. The generation of this LUT, if necessary, may happen on the CPU.See Also
- ToneMapper - Tone mapping operators
- View - Apply color grading to a view