Skip to content

Commit 1574926

Browse files
Added color scaling by average log lum for neutral and commerce tone mappings
1 parent 187baae commit 1574926

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Shaders/PostProcess/ToneMapping/public/ToneMapping.fxh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ float3 ToneMap(in float3 f3Color, ToneMappingAttribs Attribs, float fAveLogLum)
172172
}
173173
#elif TONE_MAPPING_MODE == TONE_MAPPING_MODE_PBR_NEUTRAL
174174
{
175+
f3Color *= 0.3 / fAveLogLum;
176+
175177
// https://www.khronos.org/news/press/khronos-pbr-neutral-tone-mapper-released-for-true-to-life-color-rendering-of-3d-products
176178
// https://github.com/KhronosGroup/ToneMapping/blob/main/PBR_Neutral/pbrNeutral.glsl
177179
float StartCompression = 0.8 - 0.04;
@@ -195,6 +197,8 @@ float3 ToneMap(in float3 f3Color, ToneMappingAttribs Attribs, float fAveLogLum)
195197
}
196198
#elif TONE_MAPPING_MODE == TONE_MAPPING_MODE_COMMERCE
197199
{
200+
f3Color *= 0.3 / fAveLogLum;
201+
198202
// https://github.com/google/model-viewer/pull/4495
199203
float StartCompression = 0.8;
200204
float Desaturation = 0.5;

0 commit comments

Comments
 (0)