Struct TonemapSettings ​
Namespace: ValveResourceFormat.Renderer.SceneEnvironment
Assembly: Renderer.dll
Filmic tonemapping curve parameters for HDR-to-LDR conversion.
public readonly struct TonemapSettingsConstructors ​
TonemapSettings() ​
Initializes a new TonemapSettings with default filmic curve values.
public TonemapSettings()TonemapSettings(KVObject) ​
Initializes a new TonemapSettings by reading values from a KV object.
public TonemapSettings(KVObject tonemapParams)Parameters ​
tonemapParams KVObject
The KV object containing tonemapping parameters.
Fields ​
PreTonemapScale ​
The scale the shader applies to the exposed scene before the curve.
public const float PreTonemapScale = 2.8Field Value ​
float
Properties ​
EffectiveWhitePoint ​
Gets the white point the curve clamps to and is normalized against: two to the power of TonemapSettings.WhitePoint.
public float EffectiveWhitePoint { get; }Property Value ​
float
ExposureBias ​
Gets the exposure bias in log2 stops; converted to linear via exp2 before GPU upload.
public float ExposureBias { get; init; }Property Value ​
float
LinearAngle ​
Gets the linear section angle of the tonemapping curve.
public float LinearAngle { get; init; }Property Value ​
float
LinearStrength ​
Gets the linear section strength of the tonemapping curve.
public float LinearStrength { get; init; }Property Value ​
float
ShoulderStrength ​
Gets the shoulder strength of the Uncharted 2 tonemapping curve.
public float ShoulderStrength { get; init; }Property Value ​
float
ToeDenom ​
Gets the toe denominator of the tonemapping curve.
public float ToeDenom { get; init; }Property Value ​
float
ToeNum ​
Gets the toe numerator of the tonemapping curve.
public float ToeNum { get; init; }Property Value ​
float
ToeStrength ​
Gets the toe strength of the tonemapping curve.
public float ToeStrength { get; init; }Property Value ​
float
WhitePoint ​
Gets the white point in stops, the scene value that displays as white being two to its power.
public float WhitePoint { get; init; }Property Value ​
float
Methods ​
ApplyTonemapping(float) ​
Applies the Uncharted 2 filmic tonemapping curve to a single input value.
public float ApplyTonemapping(float inputValue)Parameters ​
inputValue float
The linear HDR value to tonemap.
Returns ​
float
The tonemapped LDR output value.
BlendTonemapSettings(float, TonemapSettings, TonemapSettings) ​
Linearly interpolates between two TonemapSettings by a given weight.
public static TonemapSettings BlendTonemapSettings(float weight, TonemapSettings TonemapSettings1, TonemapSettings TonemapSettings2)Parameters ​
weight float
Blend factor in the range [0, 1]; 0 returns TonemapSettings1, 1 returns TonemapSettings2.
TonemapSettings1 TonemapSettings
The first (start) tonemapping settings.
TonemapSettings2 TonemapSettings
The second (end) tonemapping settings.
Returns ​
A new TonemapSettings whose fields are component-wise lerped between the two inputs.
Display(float) ​
Runs the full tonemap the shader performs: the pre-curve scale and clamp, the curve, and the white point normalization.
public float Display(float sceneValue)Parameters ​
sceneValue float
The exposed linear scene value.
Returns ​
float
The displayed value, in the 0-1 range before the sRGB encode.
InvertTonemapping(float) ​
Inverts TonemapSettings.Display(float): the exposed scene value that displays as displayValue.
public float InvertTonemapping(float displayValue)Parameters ​
displayValue float
The desired displayed value, in the 0-1 range the shader outputs.
Returns ​
float
The exposed linear scene value, or float.NaN if this curve cannot be inverted.
Linear() ​
The nearly linear curve the game uses where no post processing gives one, when its game sets it to.
public static TonemapSettings Linear()
