From 3a1d4bd7ad6638cd66c66e97c639616455d23b2f Mon Sep 17 00:00:00 2001 From: "Raoul v. R." Date: Fri, 6 Sep 2024 16:13:13 +0200 Subject: [PATCH] Add CINEON tone mapping mode --- src/effects/ToneMappingEffect.js | 4 ++++ src/enums/ToneMappingMode.js | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/effects/ToneMappingEffect.js b/src/effects/ToneMappingEffect.js index 285216747..344cd24f0 100644 --- a/src/effects/ToneMappingEffect.js +++ b/src/effects/ToneMappingEffect.js @@ -136,6 +136,10 @@ export class ToneMappingEffect extends Effect { this.defines.set("toneMapping(texel)", "ReinhardToneMapping(texel)"); break; + case ToneMappingMode.CINEON: + this.defines.set("toneMapping(texel)", "CineonToneMapping(texel)"); + break; + case ToneMappingMode.OPTIMIZED_CINEON: this.defines.set("toneMapping(texel)", "OptimizedCineonToneMapping(texel)"); break; diff --git a/src/enums/ToneMappingMode.js b/src/enums/ToneMappingMode.js index 31a6cbcb5..ccbf6ff1d 100644 --- a/src/enums/ToneMappingMode.js +++ b/src/enums/ToneMappingMode.js @@ -7,7 +7,8 @@ * @property {Number} REINHARD2 - Modified Reinhard tone mapping. * @property {Number} REINHARD2_ADAPTIVE - Simulates the optic nerve responding to the amount of light it is receiving. * @property {Number} UNCHARTED2 - Uncharted 2 tone mapping. http://filmicworlds.com/blog/filmic-tonemapping-operators. - * @property {Number} OPTIMIZED_CINEON - Optimized filmic operator by Jim Hejl and Richard Burgess-Dawson. + * @property {Number} OPTIMIZED_CINEON - Deprecated. Use `CINEON` instead. + * @property {Number} CINEON - Optimized filmic operator by Jim Hejl and Richard Burgess-Dawson. Requires three r168 or higher. * @property {Number} ACES_FILMIC - ACES tone mapping with a scale of 1.0/0.6. * @property {Number} AGX - Filmic tone mapping. Requires three r160 or higher. https://github.com/EaryChow/AgX. * @property {Number} NEUTRAL - Neutral tone mapping by Khronos. Requires three r162 or higher. https://modelviewer.dev/examples/tone-mapping. @@ -20,7 +21,8 @@ export const ToneMappingMode = { REINHARD2_ADAPTIVE: 3, UNCHARTED2: 4, OPTIMIZED_CINEON: 5, - ACES_FILMIC: 6, - AGX: 7, - NEUTRAL: 8 + CINEON: 6, + ACES_FILMIC: 7, + AGX: 8, + NEUTRAL: 9 };