AMFP Enhanced
C++ reference: the code this unofficial fork added
Loading...
Searching...
No Matches
LuxComfort.h File Reference

the comfort pass (PLAN.md "Comfort pass"). More...

#include <cmath>

Go to the source code of this file.

Classes

struct  cLuxComfortValues
 Multipliers: 1 = vanilla, 0 = none. More...

Enumerations

enum  eLuxComfortProfile {
  eLuxComfort_Original , eLuxComfort_Reduced , eLuxComfort_Comfort , eLuxComfort_Custom ,
  eLuxComfort_LastEnum
}

Functions

cLuxComfortValues LuxComfortProfile (int alProfile)
float LuxComfortClamp01 (float x)
cLuxComfortValues LuxComfortSanitize (cLuxComfortValues v)
 Values read from a config: multipliers 0..1, FOV within the slider range.
bool LuxComfortSame (const cLuxComfortValues &a, const cLuxComfortValues &b)
int LuxComfortDetect (const cLuxComfortValues &v)
 Which profile the values are, or Custom.
int LuxComfortFromOld (int alScriptedMotion, bool abReduceHeadBob)
 Profiles saved before the comfort tab: "Scripted camera effects" and "Reduce head bob".
float LuxComfortAmount (float afVanilla, float afMul)
 Effects whose neutral value is 0 (shake, blur size, trail amount, roll angle, bob).
float LuxComfortMul (float afVanilla, float afMul)
 Effects whose neutral value is 1 (FOV and aspect multipliers).
float LuxComfortBlurStart (float afVanillaStart, float afBlur)
 Radial blur start distance (0 = from the centre, 1 = edges only): lower blur keeps more of the centre sharp (Comfort 0.2 -> at least 0.7).
float LuxComfortSpinSpeed (float afVanillaSpeed, float afHeadSpin)
 Head spin start speed: the spin slows at a fixed rate, so its angle grows with speed squared; the square root makes mfHeadSpin scale the angle (Comfort 0.15 -> about 7 degrees).
float LuxComfortTurnCapDeg (float afTurnSpeed)
 Forced turn cap in degrees per second, or 0 for no cap (vanilla).
float LuxComfortLimitStep (float afStepRad, float afTimeStep, float afCapDeg)
 Limit one frame's angle step (radians) to the cap; 0 cap = untouched.
int LuxComfortArmSamples (int alVanilla, float afArmLag)
 Arm lag: number of camera samples averaged (vanilla 13); at least 1 (no lag).
float LuxComfortRemoved (float afVanilla, float afApplied, float afFullScale)
 How much of a distortion was removed, 0..1, relative to a full-strength amount.
float LuxComfortEaseCue (float afCurrent, float afGoal, float afTimeStep)
 Ease the edge darkening toward its goal (0..1) over about kLuxEdgeCueFadeTime.

Variables

static const float kLuxVanillaFov = 70.0f
static const float kLuxFovMin = 60.0f
static const float kLuxFovMax = 90.0f
static const float kLuxVanillaHeadSpinDeg = 46.0f
static const float kLuxEdgeCueMaxAlpha = 0.35f
static const float kLuxEdgeCueFadeTime = 0.3f

Detailed Description

the comfort pass (PLAN.md "Comfort pass").

Separates what makes the body sick (roll, smearing, shake, zoom pulses, fast forced turns, view lag) from what tells the story (sound, the fever): the effects keep their vanilla values and these multipliers are applied where each one reaches the camera or the screen ("scale on output"), so effects the game code starts itself are covered too, saves keep vanilla values, and changing the option applies at once.

Profiles: Original (exactly vanilla, built in), Reduced, Comfort (default under Modern); any change on the Comfort tab makes it Custom. Pure, unit tested in tests/cpp/test_comfort.cpp.

Definition in file LuxComfort.h.

Enumeration Type Documentation

◆ eLuxComfortProfile

Enumerator
eLuxComfort_Original 
eLuxComfort_Reduced 
eLuxComfort_Comfort 
eLuxComfort_Custom 
eLuxComfort_LastEnum 

Definition at line 16 of file LuxComfort.h.

Function Documentation

◆ LuxComfortProfile()

cLuxComfortValues LuxComfortProfile ( int alProfile)
inline

Definition at line 48 of file LuxComfort.h.

◆ LuxComfortClamp01()

float LuxComfortClamp01 ( float x)
inline

Definition at line 72 of file LuxComfort.h.

◆ LuxComfortSanitize()

cLuxComfortValues LuxComfortSanitize ( cLuxComfortValues v)
inline

Values read from a config: multipliers 0..1, FOV within the slider range.

Definition at line 75 of file LuxComfort.h.

◆ LuxComfortSame()

bool LuxComfortSame ( const cLuxComfortValues & a,
const cLuxComfortValues & b )
inline

Definition at line 85 of file LuxComfort.h.

◆ LuxComfortDetect()

int LuxComfortDetect ( const cLuxComfortValues & v)
inline

Which profile the values are, or Custom.

Definition at line 97 of file LuxComfort.h.

◆ LuxComfortFromOld()

int LuxComfortFromOld ( int alScriptedMotion,
bool abReduceHeadBob )
inline

Profiles saved before the comfort tab: "Scripted camera effects" and "Reduce head bob".

The old default (Reduced) moves to the new default, Comfort; only a deliberate stock setup stays Original.

Definition at line 106 of file LuxComfort.h.

◆ LuxComfortAmount()

float LuxComfortAmount ( float afVanilla,
float afMul )
inline

Effects whose neutral value is 0 (shake, blur size, trail amount, roll angle, bob).

Definition at line 116 of file LuxComfort.h.

◆ LuxComfortMul()

float LuxComfortMul ( float afVanilla,
float afMul )
inline

Effects whose neutral value is 1 (FOV and aspect multipliers).

Definition at line 119 of file LuxComfort.h.

◆ LuxComfortBlurStart()

float LuxComfortBlurStart ( float afVanillaStart,
float afBlur )
inline

Radial blur start distance (0 = from the centre, 1 = edges only): lower blur keeps more of the centre sharp (Comfort 0.2 -> at least 0.7).

Vanilla blur leaves it untouched.

Definition at line 123 of file LuxComfort.h.

◆ LuxComfortSpinSpeed()

float LuxComfortSpinSpeed ( float afVanillaSpeed,
float afHeadSpin )
inline

Head spin start speed: the spin slows at a fixed rate, so its angle grows with speed squared; the square root makes mfHeadSpin scale the angle (Comfort 0.15 -> about 7 degrees).

Definition at line 132 of file LuxComfort.h.

◆ LuxComfortTurnCapDeg()

float LuxComfortTurnCapDeg ( float afTurnSpeed)
inline

Forced turn cap in degrees per second, or 0 for no cap (vanilla).

Comfort 0.15 -> 52.5.

Definition at line 138 of file LuxComfort.h.

◆ LuxComfortLimitStep()

float LuxComfortLimitStep ( float afStepRad,
float afTimeStep,
float afCapDeg )
inline

Limit one frame's angle step (radians) to the cap; 0 cap = untouched.

Definition at line 145 of file LuxComfort.h.

◆ LuxComfortArmSamples()

int LuxComfortArmSamples ( int alVanilla,
float afArmLag )
inline

Arm lag: number of camera samples averaged (vanilla 13); at least 1 (no lag).

Definition at line 155 of file LuxComfort.h.

◆ LuxComfortRemoved()

float LuxComfortRemoved ( float afVanilla,
float afApplied,
float afFullScale )
inline

How much of a distortion was removed, 0..1, relative to a full-strength amount.

Drives the edge darkening that stands in for it.

Definition at line 163 of file LuxComfort.h.

◆ LuxComfortEaseCue()

float LuxComfortEaseCue ( float afCurrent,
float afGoal,
float afTimeStep )
inline

Ease the edge darkening toward its goal (0..1) over about kLuxEdgeCueFadeTime.

Definition at line 173 of file LuxComfort.h.

Variable Documentation

◆ kLuxVanillaFov

const float kLuxVanillaFov = 70.0f
static

Definition at line 43 of file LuxComfort.h.

◆ kLuxFovMin

const float kLuxFovMin = 60.0f
static

Definition at line 44 of file LuxComfort.h.

◆ kLuxFovMax

const float kLuxFovMax = 90.0f
static

Definition at line 45 of file LuxComfort.h.

◆ kLuxVanillaHeadSpinDeg

const float kLuxVanillaHeadSpinDeg = 46.0f
static

Definition at line 46 of file LuxComfort.h.

◆ kLuxEdgeCueMaxAlpha

const float kLuxEdgeCueMaxAlpha = 0.35f
static

Definition at line 169 of file LuxComfort.h.

◆ kLuxEdgeCueFadeTime

const float kLuxEdgeCueFadeTime = 0.3f
static

Definition at line 170 of file LuxComfort.h.