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 with default filmic curve values.
public TonemapSettings()TonemapSettings(KVObject) ​
Initializes a new 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 ​
Properties ​
EffectiveWhitePoint ​
Gets the white point the curve is actually normalized against: scaled by .
public float EffectiveWhitePoint { get; }Property Value ​
ExposureBias ​
Gets the exposure bias in log2 stops; converted to linear via exp2 before GPU upload.
public float ExposureBias { get; init; }Property Value ​
LinearAngle ​
Gets the linear section angle of the tonemapping curve.
public float LinearAngle { get; init; }Property Value ​
LinearStrength ​
Gets the linear section strength of the tonemapping curve.
public float LinearStrength { get; init; }Property Value ​
ShoulderStrength ​
Gets the shoulder strength of the Uncharted 2 tonemapping curve.
public float ShoulderStrength { get; init; }Property Value ​
ToeDenom ​
Gets the toe denominator of the tonemapping curve.
public float ToeDenom { get; init; }Property Value ​
ToeNum ​
Gets the toe numerator of the tonemapping curve.
public float ToeNum { get; init; }Property Value ​
ToeStrength ​
Gets the toe strength of the tonemapping curve.
public float ToeStrength { get; init; }Property Value ​
WhitePoint ​
Gets the white point value; passed through the tonemapper before GPU upload.
public float WhitePoint { get; init; }Property Value ​
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 ​
The tonemapped LDR output value.
BlendTonemapSettings(float, TonemapSettings, TonemapSettings) ​
Linearly interpolates between two 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 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 ​
The displayed value, in the 0-1 range before the sRGB encode.
InvertTonemapping(float) ​
Inverts : 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 ​
The exposed linear scene value that displays as displayValue, or if this curve cannot be inverted.
Linear() ​
Returns a intended for linear (non-filmic) tonemapping. Note: returns a constant 0 with these values, so they are not a true passthrough curve.
public static TonemapSettings Linear()Returns ​
See Also ​
https://s2v.app/SchemaExplorer/cs2/materialsystem2/PostProcessingTonemapParameters_t

