From 4846ccd86d1fdb6de136903dca0e331a3adb4bd1 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 30 Sep 2021 14:44:46 -0700 Subject: [PATCH] Use the more common EOTF/OETF acronyms (#4691) Nothing wrong with EOCF/OECF but the "T" version is more common and readers will therefore be more likely to be more familiar with it. --- filament/src/Color.cpp | 4 ++-- filament/src/ColorGrading.cpp | 4 ++-- filament/src/ColorSpace.h | 8 ++++---- shaders/src/dithering.fs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/filament/src/Color.cpp b/filament/src/Color.cpp index 7711a3f24e..6a7eff52ca 100644 --- a/filament/src/Color.cpp +++ b/filament/src/Color.cpp @@ -26,11 +26,11 @@ namespace filament { using namespace math; float3 Color::sRGBToLinear(float3 color) noexcept { - return EOCF_sRGB(color); + return EOTF_sRGB(color); } float3 Color::linearToSRGB(float3 color) noexcept { - return OECF_sRGB(color); + return OETF_sRGB(color); } LinearColor Color::cct(float K) { diff --git a/filament/src/ColorGrading.cpp b/filament/src/ColorGrading.cpp index 7cac2fb05f..67ae43a274 100644 --- a/filament/src/ColorGrading.cpp +++ b/filament/src/ColorGrading.cpp @@ -746,8 +746,8 @@ FColorGrading::FColorGrading(FEngine& engine, const Builder& builder) { // We need to clamp for the output transfer function v = saturate(v); - // Apply OECF - v = OECF_sRGB(v); + // Apply OETF + v = OETF_sRGB(v); *p++ = half4{v, 0.0f}; } diff --git a/filament/src/ColorSpace.h b/filament/src/ColorSpace.h index 9622ef337b..2e73f3e461 100644 --- a/filament/src/ColorSpace.h +++ b/filament/src/ColorSpace.h @@ -272,7 +272,7 @@ inline float3 linearAP1_to_ACEScct(float3 x) noexcept { return x; } -inline float3 OECF_sRGB(float3 x) noexcept { +inline float3 OETF_sRGB(float3 x) noexcept { constexpr float a = 0.055f; constexpr float a1 = 1.055f; constexpr float b = 12.92f; @@ -283,7 +283,7 @@ inline float3 OECF_sRGB(float3 x) noexcept { return x; } -inline float3 EOCF_sRGB(float3 x) noexcept { +inline float3 EOTF_sRGB(float3 x) noexcept { constexpr float a = 0.055f; constexpr float a1 = 1.055f; constexpr float b = 1.0f / 12.92f; @@ -294,7 +294,7 @@ inline float3 EOCF_sRGB(float3 x) noexcept { return x; } -inline float3 OECF_PQ(float3 x, float maxPqValue) { +inline float3 OETF_PQ(float3 x, float maxPqValue) { constexpr float PQ_constant_N = 2610.0f / 4096.0f / 4.0f; constexpr float PQ_constant_M = 2523.0f / 4096.0f * 128.0f; constexpr float PQ_constant_C1 = 3424.0f / 4096.0f; @@ -309,7 +309,7 @@ inline float3 OECF_PQ(float3 x, float maxPqValue) { return pow(numerator / denominator, PQ_constant_M); } -inline float3 EOCF_PQ(float3 x, float maxPqValue) { +inline float3 EOTF_PQ(float3 x, float maxPqValue) { constexpr float PQ_constant_N = 2610.0f / 4096.0f / 4.0f; constexpr float PQ_constant_M = 2523.0f / 4096.0f * 128.0f; constexpr float PQ_constant_C1 = 3424.0f / 4096.0f; diff --git a/shaders/src/dithering.fs b/shaders/src/dithering.fs index f0383ae133..bbec2211c7 100644 --- a/shaders/src/dithering.fs +++ b/shaders/src/dithering.fs @@ -93,7 +93,7 @@ vec4 Dither_TriangleNoiseRGB(vec4 rgba, const highp float temporalNoise01) { /** * Dithers the specified RGBA color based on the current time and fragment - * coordinates the input must be in the final color space (including OECF). + * coordinates the input must be in the final color space (including OETF). * This dithering function assumes we are dithering to an 8-bit target. * This function dithers the alpha channel assuming premultiplied output */