|
AMFP Enhanced
C++ reference: the code this unofficial fork added
|
gamma (Options > Gamma) when the display cannot do it. More...
#include <cmath>Go to the source code of this file.
Functions | |
| float | SoftwareGammaExponent (float afGamma) |
| The exponent applied to each colour channel (SDL_CalculateGammaRamp: 1 / gamma). | |
| bool | SoftwareGammaNeeded (bool abHardwareGammaWorks, float afGamma) |
| Draw the pass this frame: hardware gamma failed and gamma is not (about) 1. | |
| float | SoftwareGammaApply (float afValue, float afGamma) |
| One channel through the curve, 0..1 (what the shader does; for tests and references). | |
Variables | |
| static const char *const | kSoftwareGammaVS |
| static const char *const | kSoftwareGammaFS |
gamma (Options > Gamma) when the display cannot do it.
The game sets gamma with SDL_SetWindowBrightness, a hardware gamma ramp. SDL3 (under sdl2-compat on macOS, and on Wayland) has no gamma ramps, so the call fails and the slider did nothing. Then the last thing drawn each frame is a full-screen pass with the same curve SDL's ramp used: out = in ^ (1 / gamma). Gamma 1 costs nothing. Pure, unit tested in tests/cpp/test_software_gamma.cpp.
Definition in file SoftwareGamma.h.
|
inline |
The exponent applied to each colour channel (SDL_CalculateGammaRamp: 1 / gamma).
Definition at line 14 of file SoftwareGamma.h.
|
inline |
Draw the pass this frame: hardware gamma failed and gamma is not (about) 1.
Definition at line 22 of file SoftwareGamma.h.
|
inline |
One channel through the curve, 0..1 (what the shader does; for tests and references).
Definition at line 28 of file SoftwareGamma.h.
|
static |
Definition at line 37 of file SoftwareGamma.h.
|
static |
Definition at line 39 of file SoftwareGamma.h.