From a8fda9b4d079b8bc17f49b9a328cedfd099e7b7e Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 19 Mar 2024 11:11:44 -0700 Subject: [PATCH] Make PBR Neutral invertible (#7677) Based on model-viewer's change at https://github.com/google/model-viewer/pull/4716 --- filament/src/ToneMapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filament/src/ToneMapper.cpp b/filament/src/ToneMapper.cpp index 2afa58f4be3..9c5a191210c 100644 --- a/filament/src/ToneMapper.cpp +++ b/filament/src/ToneMapper.cpp @@ -253,7 +253,7 @@ float3 PBRNeutralToneMapper::operator()(math::float3 color) const noexcept { color *= newPeak / peak; float g = 1.0f - 1.0f / (desaturation * (peak - newPeak) + 1.0f); - return mix(color, float3(1.0f), g); + return mix(color, float3(newPeak), g); } //------------------------------------------------------------------------------