mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-28 18:41:14 +00:00
filters/color-grading: Replace log10 command for GLSL (#510)
Fixes #510
This commit is contained in:
parent
2a48036e7d
commit
fd3d514a20
2 changed files with 10 additions and 2 deletions
|
@ -86,13 +86,13 @@ float3 grade_tint(float3 v) {
|
|||
|
||||
if (pTintMode == TINT_MODE_LINEAR) { // Linear
|
||||
} else if (pTintMode == TINT_MODE_EXP) { // Exp
|
||||
value = 1.0 - exp2(value * pTintExponent * -C_log2_e);
|
||||
value = 1.0 - exp2(value * pTintExponent * -C_log2_e);
|
||||
} else if (pTintMode == TINT_MODE_EXP2) { // Exp2
|
||||
value = 1.0 - exp2(value * value * pTintExponent * pTintExponent * -C_log2_e);
|
||||
} else if (pTintMode == TINT_MODE_LOG) { // Log
|
||||
value = (log2(value) + 2.) / 2.333333;
|
||||
} else if (pTintMode == TINT_MODE_LOG10) { // Log10
|
||||
value = (log10(value) + 1.) / 2.;
|
||||
value = (m_log10(value) + 1.) / 2.;
|
||||
}
|
||||
|
||||
float3 tint = float3(0,0,0);
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// HLSL/GLSL Support
|
||||
//------------------------------------------------------------------------------
|
||||
// OBS Studio does not correctly translate all HLSL functionality to GLSL.
|
||||
|
||||
// log10(x) is HLSL-exclusive and not translated by OBS Shader Parser.
|
||||
#define m_log10(x) (log(x) / log(10))
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Uniforms
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue